/* PolicySight blog — static pages, hand-written CSS. No Tailwind here. */

:root {
  --ground: #0a0e17;
  --panel: #0f1420;
  --raise: #141b2d;
  --line: rgba(250, 249, 247, 0.09);
  --line-soft: rgba(250, 249, 247, 0.055);
  --cream: #faf9f7;
  --text: rgba(250, 249, 247, 0.74);
  --muted: rgba(250, 249, 247, 0.5);
  --faint: rgba(250, 249, 247, 0.34);
  --ember: #e07b39;
  --ember-soft: rgba(224, 123, 57, 0.5);
  --sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --display: 'Fraunces', Georgia, serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;
  --measure: 70ch;
  --gutter: clamp(1.25rem, 5vw, 3rem);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
::selection { background: var(--ember); color: #fff; }

a { color: inherit; }

a:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--ember);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--ember);
  color: #fff;
  padding: 0.75rem 1.25rem;
  font-weight: 600;
  font-size: 0.9rem;
}
.skip:focus { left: 0; }

.wrap {
  width: 100%;
  max-width: 76rem;
  margin: 0 auto;
  padding-inline: var(--gutter);
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0 0 1.5rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--faint);
}
.eyebrow a { text-decoration: none; transition: color 0.25s; }
.eyebrow a:hover { color: var(--cream); }
.eyebrow__dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--ember);
  box-shadow: 0 0 12px 1px var(--ember-soft);
  flex: none;
}

/* --- Navigation ---------------------------------------------------------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 14, 23, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-soft);
}

.nav__inner {
  max-width: 80rem;
  margin: 0 auto;
  padding: 1rem var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.nav__brand, .foot__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
}
.mark { width: 2.25rem; height: 2.25rem; flex: none; }
.nav__word { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.01em; }
.nav__word-a { color: var(--ember); }
.nav__word-b { color: var(--cream); }

.nav__links { display: none; align-items: center; gap: 2rem; }

.nav__link {
  position: relative;
  font-size: 1rem;
  color: rgba(250, 249, 247, 0.78);
  text-decoration: none;
  padding-bottom: 2px;
  transition: color 0.3s;
  white-space: nowrap;
}
.nav__link::after {
  content: '';
  position: absolute;
  left: 0; bottom: -2px;
  height: 1px; width: 100%;
  background: var(--ember);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease-out;
}
.nav__link:hover { color: var(--cream); }
.nav__link:hover::after { transform: scaleX(1); }
.nav__link.is-current { color: var(--ember); font-weight: 600; }
.nav__link.is-current::after { transform: scaleX(1); }
.nav__link--quiet { color: var(--faint); margin-left: 2rem; }

/* Mobile menu: a <details> element, so it works with JavaScript off. */
.nav__mobile { position: relative; }
.nav__mobile > summary {
  list-style: none;
  cursor: pointer;
  padding: 0.5rem;
  display: block;
}
.nav__mobile > summary::-webkit-details-marker { display: none; }
.nav__burger { display: block; width: 22px; }
.nav__burger i {
  display: block;
  height: 1.5px;
  background: var(--cream);
  margin: 5px 0;
  transition: transform 0.3s, opacity 0.2s;
}
.nav__mobile[open] .nav__burger i:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav__mobile[open] .nav__burger i:nth-child(2) { opacity: 0; }
.nav__mobile[open] .nav__burger i:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

.nav__drawer {
  position: absolute;
  right: 0;
  top: calc(100% + 0.9rem);
  min-width: 14rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.75rem;
  background: var(--raise);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.8);
}
.nav__drawer-link {
  padding: 0.6rem 0.75rem;
  font-size: 0.95rem;
  color: rgba(250, 249, 247, 0.82);
  text-decoration: none;
  border-radius: 8px;
}
.nav__drawer-link:hover { background: rgba(255, 255, 255, 0.05); color: var(--cream); }
.nav__drawer-link.is-current { color: var(--ember); font-weight: 600; }

@media (min-width: 768px) {
  .nav__links { display: flex; }
  .nav__mobile { display: none; }
}

/* --- Landing hero -------------------------------------------------------- */

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: clamp(4.5rem, 13vw, 9.5rem) var(--gutter) clamp(3.5rem, 9vw, 6.5rem);
}
.hero__img {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: 50% 42%;
  z-index: -3;
}
.hero__scrim {
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(180deg, rgba(10, 14, 23, 0.72) 0%, rgba(10, 14, 23, 0.8) 45%, var(--ground) 100%),
    radial-gradient(120% 90% at 15% 110%, rgba(224, 123, 57, 0.16), transparent 58%);
}
.hero__grain {
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.05;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 250 250' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.7' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.hero__inner { max-width: 76rem; margin: 0 auto; }

.hero__title {
  margin: 0;
  font-family: var(--display);
  font-weight: 300;
  font-variation-settings: 'opsz' 144, 'SOFT' 0, 'WONK' 0;
  font-size: clamp(2.6rem, 7.4vw, 5.1rem);
  line-height: 1.02;
  letter-spacing: -0.028em;
  color: var(--cream);
  max-width: 16ch;
}

.hero__intro {
  margin-top: clamp(1.75rem, 4vw, 2.5rem);
  max-width: 60ch;
  display: grid;
  gap: 1rem;
}
.hero__intro p {
  margin: 0;
  font-size: clamp(1rem, 1.6vw, 1.1rem);
  color: rgba(250, 249, 247, 0.82);
  line-height: 1.72;
}

/* Quiet staggered rise on load, held back for reduced-motion users. */
.hero .eyebrow, .hero__title, .hero__intro {
  animation: rise 0.9s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.hero__title { animation-delay: 0.08s; }
.hero__intro { animation-delay: 0.18s; }

@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}

/* --- Archive ------------------------------------------------------------- */

.archive { padding-top: clamp(3rem, 7vw, 5rem); padding-bottom: clamp(4rem, 10vw, 7rem); }

.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  padding-bottom: 1.5rem;
  margin-bottom: clamp(2rem, 5vw, 3.5rem);
  border-bottom: 1px solid var(--line-soft);
}
.filters__label {
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--faint);
}
.filters__row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.filters__btn {
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.35rem 0.95rem;
  cursor: pointer;
  transition: color 0.25s, border-color 0.25s, background-color 0.25s;
}
.filters__btn:hover { color: var(--cream); border-color: rgba(250, 249, 247, 0.28); }
.filters__btn.is-active {
  color: var(--ground);
  background: var(--ember);
  border-color: var(--ember);
  font-weight: 600;
}

.group { display: grid; gap: 1.75rem; margin-bottom: clamp(2.5rem, 6vw, 4rem); }

.group__label h2 {
  margin: 0;
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--faint);
  padding-top: 0.35rem;
  border-top: 1px solid var(--line);
}

.group__items { display: grid; gap: 0; }

.entry {
  position: relative;
  display: grid;
  gap: 1.25rem;
  padding: 1.75rem 0;
  border-bottom: 1px solid var(--line-soft);
}
.entry::after {
  content: '';
  position: absolute;
  left: 0; bottom: -1px;
  height: 1px; width: 100%;
  background: linear-gradient(to right, var(--ember), rgba(224, 123, 57, 0));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}
.entry:hover::after, .entry:focus-within::after { transform: scaleX(1); }

.entry__thumb {
  overflow: hidden;
  border-radius: 10px;
  border: 1px solid var(--line-soft);
  background: var(--panel);
  aspect-ratio: 16 / 9;
}
.entry__thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: saturate(0.9) brightness(0.88);
  transform: scale(1.005);
  transition: filter 0.5s, transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.entry:hover .entry__thumb img { filter: none; transform: scale(1.035); }
.entry__thumb--none { background: linear-gradient(140deg, var(--panel), var(--raise)); }

.entry__date {
  margin: 0 0 0.6rem;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
}

.entry__title {
  margin: 0 0 0.7rem;
  font-family: var(--display);
  font-weight: 400;
  font-variation-settings: 'opsz' 72, 'SOFT' 0, 'WONK' 0;
  font-size: clamp(1.45rem, 2.6vw, 2rem);
  line-height: 1.18;
  letter-spacing: -0.018em;
  color: var(--cream);
}
.entry__title a {
  text-decoration: none;
  transition: color 0.25s;
}
/* Stretched link: the whole row is clickable, one link in the a11y tree. */
.entry__title a::after {
  content: '';
  position: absolute;
  inset: 0;
}
.entry:hover .entry__title a { color: #fff; }

.entry__summary {
  margin: 0;
  max-width: 62ch;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.68;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
}
.tags li {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.28rem 0.7rem;
}
.tags--meta { margin-top: 0; }

@media (min-width: 640px) {
  .entry { grid-template-columns: 13rem minmax(0, 1fr); gap: 1.75rem; align-items: start; }
}
@media (min-width: 900px) {
  .group { grid-template-columns: 11rem minmax(0, 1fr); gap: 3rem; }
  .group__label { position: sticky; top: 6.5rem; align-self: start; }
  .entry { grid-template-columns: 15rem minmax(0, 1fr); gap: 2.25rem; padding: 2.25rem 0; }
}

.empty {
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: linear-gradient(150deg, var(--panel), rgba(20, 27, 45, 0.35));
  padding: clamp(2.5rem, 6vw, 4rem);
  text-align: center;
}
.empty h1,
.empty h2 {
  margin: 0 0 0.85rem;
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(1.5rem, 3.4vw, 2.1rem);
  letter-spacing: -0.02em;
  color: var(--cream);
}
.empty .eyebrow { justify-content: center; }
.empty p { margin: 0 auto; max-width: 46ch; color: var(--muted); }
.empty a { color: var(--cream); text-decoration-color: var(--ember-soft); text-underline-offset: 3px; }
.empty a:hover { color: var(--ember); }

/* --- Post ---------------------------------------------------------------- */

.post { padding-bottom: clamp(3.5rem, 8vw, 6rem); }

.post__hero {
  position: relative;
  margin: 0;
  height: clamp(15rem, 42vw, 27rem);
  overflow: hidden;
}
.post__hero img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 45%; }
.post__hero-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10, 14, 23, 0.5) 0%, rgba(10, 14, 23, 0.25) 30%, rgba(10, 14, 23, 0.92) 82%, var(--ground) 100%);
}

/* The title block rides up over the foot of the hero image. */
.post__head {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 76rem;
  margin: clamp(-5rem, -8vw, -3rem) auto 0;
  padding-inline: var(--gutter);
}
.post--nohero .post__head { margin-top: clamp(3rem, 8vw, 5rem); }

.post__head h1 {
  margin: 0;
  font-family: var(--display);
  font-weight: 300;
  font-variation-settings: 'opsz' 144, 'SOFT' 0, 'WONK' 0;
  font-size: clamp(2.1rem, 5.6vw, 3.7rem);
  line-height: 1.06;
  letter-spacing: -0.026em;
  color: var(--cream);
  max-width: 20ch;
}

.post__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line-soft);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
}

/* The body shares the header's left edge: one strong margin down the page,
   with the reading measure applied to the children rather than the column. */
.prose {
  width: 100%;
  max-width: 76rem;
  margin: clamp(2.5rem, 6vw, 3.75rem) auto 0;
  padding-inline: var(--gutter);
  font-size: 1.06rem;
  line-height: 1.78;
}
.prose > * { max-width: var(--measure); }
.prose > *:first-child { margin-top: 0; }
.prose p { margin: 0 0 1.4em; }
.prose strong { color: var(--cream); font-weight: 600; }

.prose h2, .prose h3 {
  font-family: var(--display);
  color: var(--cream);
  letter-spacing: -0.015em;
  line-height: 1.2;
}
.prose h2 {
  margin: 2.6em 0 0.7em;
  font-weight: 400;
  font-size: clamp(1.5rem, 3.2vw, 1.95rem);
}
.prose h2::before {
  content: '';
  display: block;
  width: 2.25rem;
  height: 2px;
  background: var(--ember);
  margin-bottom: 0.85rem;
  border-radius: 2px;
}
.prose h3 {
  margin: 2.1em 0 0.6em;
  font-weight: 500;
  font-size: clamp(1.2rem, 2.4vw, 1.4rem);
}

.prose a {
  color: var(--cream);
  text-decoration: underline;
  text-decoration-color: var(--ember-soft);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 0.2s, text-decoration-color 0.2s;
}
.prose a:hover { color: var(--ember); text-decoration-color: var(--ember); }

.prose ul, .prose ol { margin: 0 0 1.4em; padding-left: 1.35em; }
.prose li { margin-bottom: 0.55em; }
.prose li::marker { color: var(--ember-soft); }

.prose blockquote {
  margin: 2em 0;
  padding: 0.2em 0 0.2em 1.6em;
  border-left: 2px solid var(--ember);
  font-family: var(--display);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(1.15rem, 2.4vw, 1.4rem);
  line-height: 1.5;
  letter-spacing: -0.01em;
  color: rgba(250, 249, 247, 0.88);
}
.prose blockquote p:last-child { margin-bottom: 0; }

.prose code {
  font-family: var(--mono);
  font-size: 0.87em;
  background: rgba(250, 249, 247, 0.07);
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  padding: 0.12em 0.38em;
  color: var(--cream);
}
.prose pre {
  margin: 1.9em 0;
  padding: 1.15rem 1.25rem;
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-left: 2px solid var(--ember-soft);
  border-radius: 10px;
  overflow-x: auto;
  font-size: 0.86rem;
  line-height: 1.65;
}
.prose pre code {
  background: none;
  border: 0;
  padding: 0;
  font-size: inherit;
  color: rgba(250, 249, 247, 0.86);
}

.prose img { margin: 2em 0; border-radius: 10px; height: auto; }

/* A pull-quote set over its image, scrimmed for legibility. */
.prose .quote-overlay {
  position: relative;
  margin: 2em 0;
  border-radius: 10px;
  overflow: hidden;
  isolation: isolate;
}
.prose .quote-overlay img { margin: 0; width: 100%; border-radius: 0; }
.prose .quote-overlay blockquote {
  position: absolute;
  top: 0; right: 0;
  margin: 0;
  padding: clamp(1.1rem, 3.5vw, 2.25rem) clamp(1.1rem, 3.5vw, 2.5rem);
  border-left: 0;
  text-align: right;
  font-family: var(--display);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(1rem, 2.3vw, 1.45rem);
  line-height: 1.45;
  letter-spacing: -0.01em;
  color: var(--cream);
  text-shadow: 0 1px 4px rgba(10, 14, 23, 0.8), 0 2px 22px rgba(10, 14, 23, 0.7);
}
.prose .quote-overlay blockquote::before {
  content: '';
  display: block;
  width: 2.25rem;
  height: 2px;
  background: var(--ember);
  border-radius: 2px;
  margin: 0 0 0.85rem auto;
}
.prose .quote-overlay blockquote p { margin: 0 0 0 auto; max-width: 40ch; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.75em 0; }
.prose table { display: block; width: 100%; overflow-x: auto; border-collapse: collapse; margin: 2em 0; }
.prose th, .prose td { border: 1px solid var(--line); padding: 0.6rem 0.85rem; text-align: left; }
.prose th { color: var(--cream); font-weight: 600; }

.post__back {
  width: 100%;
  max-width: 76rem;
  margin: clamp(3rem, 7vw, 4.5rem) auto 0;
  padding-inline: var(--gutter);
}
.post__back::before {
  content: '';
  display: block;
  max-width: var(--measure);
  border-top: 1px solid var(--line-soft);
  margin-bottom: 1.75rem;
}
.post__back a {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.25s, gap 0.25s;
}
.post__back a:hover { color: var(--ember); gap: 0.85rem; }

/* --- Footer -------------------------------------------------------------- */

.foot {
  position: relative;
  background: linear-gradient(180deg, #171e30 0%, var(--panel) 100%);
  padding: clamp(3rem, 7vw, 4.5rem) 0 2rem;
  overflow: hidden;
}
.foot__rule {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--ember-soft), transparent);
}
.foot__inner { max-width: 76rem; margin: 0 auto; padding-inline: var(--gutter); }

.foot__grid {
  display: grid;
  gap: 2.5rem;
  margin-bottom: 1.5rem;
}
@media (min-width: 640px) { .foot__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .foot__grid { grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 3rem; } }

.foot__brand { margin-bottom: 1rem; }
.foot__brand .mark { width: 1.9rem; height: 1.9rem; }
.foot__brand .nav__word { font-size: 1.2rem; }

.foot__blurb {
  margin: 0 0 1.25rem;
  font-size: 0.88rem;
  line-height: 1.7;
  color: rgba(197, 202, 217, 0.85);
  max-width: 34ch;
}

.foot__head {
  margin: 0 0 1.1rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cream);
}
.foot__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.7rem; }
.foot__link {
  font-size: 0.88rem;
  color: rgba(197, 202, 217, 0.85);
  text-decoration: none;
  transition: color 0.25s;
}
.foot__link:hover { color: var(--ember); }
.foot__link--quiet { color: var(--faint); }
.foot__head--stacked { margin-top: 2rem; }

.foot__wordmark {
  margin: 0;
  font-family: var(--display);
  font-weight: 300;
  font-size: 15.5vw;
  line-height: 1.2;
  letter-spacing: -0.02em;
  white-space: nowrap;
  color: rgba(255, 255, 255, 0.045);
  user-select: none;
  pointer-events: none;
  overflow-x: clip;
}
@media (min-width: 1024px) { .foot__wordmark { font-size: 11.5vw; } }

.foot__strip {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
  text-align: center;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.72rem;
  color: rgba(154, 163, 192, 0.85);
}
.foot__strip p { margin: 0 0 0.25rem; }
.foot__legal { display: flex; flex-wrap: wrap; justify-content: center; gap: 1.25rem; }
.foot__legal .foot__link { font-size: 0.72rem; }

@media (min-width: 768px) {
  .foot__strip { flex-direction: row; justify-content: space-between; text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
