/* ==========================================================================
   THE MORAL COMPASS — stylesheet
   A student-led ethics publication, Harvard-Westlake School.

   Organised top-to-bottom as:
     1. Theme tokens (semantic colours that swap for light / dark) + scale
     2. Base / reset
     3. Layout primitives (container, section, eyebrow, page header)
     4. Navigation + theme toggle
     5. Buttons
     6. Home / hero
     7. Article grid & cards
     8. Issues page
     9. Team page
    10. About page
    11. From the Editors
    12. Article reading page (+ progress bar, reading time)
    13. Subscribe page + forms
    14. Footer
    15. Routing transitions & scroll reveal
    16. Responsive (mobile-first refinements)
    17. Print

   THEMING NOTE: components reference *semantic* tokens (--bg, --surface,
   --text, --panel, …) — never raw colours. Dark mode just re-points those
   tokens in the [data-theme="dark"] block, so everything follows along.
   ========================================================================== */

/* ============================== 1. TOKENS ============================== */
:root {
  /* ---- Raw palette (fixed reference values) ---- */
  --c-parchment:   #f5f0e8;
  --c-parchment-2: #efe8da;
  --c-parchment-3: #e7dec9;
  --c-ink:         #1a1612;
  --c-ink-2:       #2b2620;
  --c-ink-soft:    #6b5f55;
  --c-gold:        #b8922a;
  --c-gold-light:  #c9a84c;
  --c-gold-deep:   #866610;   /* AA-compliant (4.7:1) as small text on parchment */
  --c-crimson:     #8b1a1a;

  /* ---- Semantic tokens — LIGHT theme (default) ---- */
  --bg:            var(--c-parchment);
  --bg-band:       var(--c-parchment-2);
  --surface:       var(--c-parchment);
  --surface-2:     var(--c-parchment-2);
  --paper:         #fcf8f0;   /* the article "sheet" — a touch brighter than the page */
  --text:          var(--c-ink-2);
  --text-strong:   var(--c-ink);
  --text-soft:     var(--c-ink-soft);
  --hairline:      rgba(184, 146, 42, 0.28);
  --hairline-soft: rgba(184, 146, 42, 0.16);
  --hairline-strong: rgba(148, 113, 24, 0.55);

  /* Intentionally dark panels (nav, page headers, founder & issue cards, footer) */
  --panel:         var(--c-ink);
  --panel-2:       #221d17;
  --panel-text:    #ffffff;
  --panel-text-soft: rgba(255, 255, 255, 0.6);
  --panel-hairline: rgba(184, 146, 42, 0.18);
  --nav-bg:        rgba(20, 17, 13, 0.96);

  /* Accents */
  --accent:        var(--c-gold);
  --accent-light:  var(--c-gold-light);
  --accent-deep:   var(--c-gold-deep);
  --accent-soft:   rgba(184, 146, 42, 0.05);
  --crimson:       var(--c-crimson);
  --crimson-bright:#a02b2b;

  /* Elevation */
  --shadow-sm: 0 1px 2px rgba(40, 30, 12, 0.06);
  --shadow-md: 0 6px 22px rgba(60, 44, 16, 0.10);
  --shadow-lg: 0 18px 48px rgba(60, 44, 16, 0.16);
  /* The medallion's raised look comes from a soft shadow drawn as a radial
     gradient behind it (--logo-cast), NOT a filter. A blurred drop-shadow
     filter on the floating logo re-rasterised every animation frame and was
     the main source of home-page lag; a gradient paints once and is free to
     animate. */
  --logo-cast: rgba(60, 44, 16, 0.40);

  /* Type families */
  --font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-body:    'Crimson Pro', Georgia, serif;
  --font-ui:      'DM Sans', system-ui, sans-serif;

  /* Fluid type scale */
  --fs-eyebrow: 0.66rem;
  --fs-ui:      0.72rem;
  --fs-body:    clamp(1.06rem, 0.98rem + 0.4vw, 1.22rem);
  --fs-lead:    clamp(1.18rem, 1.05rem + 0.6vw, 1.4rem);
  --fs-h3:      clamp(1.3rem, 1.15rem + 0.7vw, 1.6rem);
  --fs-h2:      clamp(1.7rem, 1.4rem + 1.4vw, 2.3rem);
  --fs-h1:      clamp(2.1rem, 1.6rem + 2.4vw, 3.1rem);
  --fs-hero:    clamp(2.6rem, 1.9rem + 3.4vw, 4.2rem);

  /* Rhythm */
  --container: 1080px;
  --measure:   38rem;
  --gutter:    clamp(1.25rem, 0.6rem + 3vw, 3rem);
  --section-y: clamp(3rem, 2rem + 4vw, 5.5rem);

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  color-scheme: light;
}

/* ---- Semantic tokens — DARK theme ---- */
[data-theme="dark"] {
  --bg:            #14110d;
  --bg-band:       #1a1712;
  --surface:       #1c1813;
  --surface-2:     #241f18;
  --paper:         #201b14;   /* the article "sheet" — raised slightly from the page */
  --text:          #e3d9c6;
  --text-strong:   #f4eddd;
  --text-soft:     #a99c86;
  --hairline:      rgba(184, 146, 42, 0.26);
  --hairline-soft: rgba(184, 146, 42, 0.14);
  --hairline-strong: rgba(201, 168, 76, 0.5);

  --panel:         #211c15;     /* slightly raised from --bg so panels read */
  --panel-2:       #2a241c;
  --panel-text:    #f4eddd;
  --panel-text-soft: rgba(244, 237, 221, 0.62);
  --panel-hairline: rgba(184, 146, 42, 0.22);
  --nav-bg:        rgba(20, 17, 13, 0.96);

  --accent:        #c9a84c;
  --accent-light:  #ddc16d;
  --accent-deep:   #d2b257;
  --accent-soft:   rgba(201, 168, 76, 0.08);
  --crimson:       #d98975;     /* warm rose — legible on dark surfaces */
  --crimson-bright:#e29a86;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.55);
  --logo-cast: rgba(0, 0, 0, 0.55);
  color-scheme: dark;
}

/* ============================== 2. BASE ============================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  /* Column layout with a growing <main> keeps the footer at the bottom of the
     viewport on short pages, so no page background shows beneath it. */
  display: flex; flex-direction: column; min-height: 100vh;
  background: var(--bg);
  color: var(--text-strong);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  background-image:
    radial-gradient(rgba(184, 146, 42, 0.05) 1px, transparent 1px),
    radial-gradient(rgba(120, 90, 30, 0.04) 1px, transparent 1px);
  background-size: 64px 64px, 33px 33px;
  background-position: 0 0, 14px 22px;
  transition: background-color 0.4s var(--ease), color 0.4s var(--ease);
}

/* Tactile paper-fibre texture over the parchment — a fixed, very faint
   fractal-noise overlay that sits behind the content. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='p'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.62' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23p)'/%3E%3C/svg%3E");
  background-size: 200px 200px;
  opacity: 0.07;
}
[data-theme="dark"] body::before { opacity: 0.09; }

img { display: block; max-width: 100%; }
a { color: var(--crimson); text-decoration-thickness: 1px; text-underline-offset: 2px; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
.page h1:focus { outline: none; }   /* programmatic focus target, not a tab stop */

/* Selecting text gilds it — the palette carries into the smallest interaction. */
::selection { background: var(--accent); color: var(--bg); }

/* View Transitions (Chromium, Safari): route changes cross-fade at the site's
   pace. Browsers without support simply swap instantly, as they always did. */
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.3s; }

html {
  /* Scrollbar in the house palette (Firefox, and Chromium 121+) */
  scrollbar-color: var(--accent-deep) transparent;
  /* Anchor/focus jumps clear the sticky nav instead of hiding under it */
  scroll-padding-top: 72px;
  /* No grey flash on mobile taps — the UI provides its own affordances */
  -webkit-tap-highlight-color: transparent;
}

.skip-link {
  position: absolute; left: 1rem; top: -3rem; z-index: 400;
  background: var(--panel); color: var(--accent-light);
  font-family: var(--font-ui); font-size: 0.8rem; letter-spacing: 0.06em;
  padding: 0.6rem 1rem; text-decoration: none; transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 0.75rem; }

/* <picture> shouldn't create a box — let the inner <img> use the existing
   .portrait img / .hero__logo img rules as if it were a direct child. */
picture { display: contents; }

/* Screen-reader-only (visually hidden but announced) */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ---- Typography refinements ---- */
body { font-kerning: normal; font-optical-sizing: auto; hanging-punctuation: first allow-end last; }
/* Old-style (text) figures in running serif copy — numerals sit with lowercase */
.reader__body, .prose, .editors__note, .hero__mission,
.pullquote p {
  font-variant-numeric: oldstyle-nums proportional-nums;
}
/* Balance headlines across lines; tidy paragraph ragging and avoid widows */
h1, h2, .section-title, .hero h1, .reader h1, .page-header h1,
.issue-plate__title, .article-card__title, .writer__name, .founder__name { text-wrap: balance; }
.reader__body > p, .prose p, .editors__note p, .hero__mission { text-wrap: pretty; }
/* Small-caps utility for acronyms inside essays, e.g. <span class="sc">AI</span> */
.sc { font-variant-caps: all-small-caps; letter-spacing: 0.03em; }

/* ============================== 3. LAYOUT PRIMITIVES ============================== */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }

.section { padding-block: var(--section-y); }
.section--band  { background: var(--bg-band); border-block: 1px solid var(--hairline-soft); }

.eyebrow {
  font-family: var(--font-ui); font-size: var(--fs-eyebrow); font-weight: 500;
  letter-spacing: 0.26em; text-transform: uppercase; color: var(--accent-deep);
  display: inline-flex; align-items: center; gap: 0.75rem; margin-bottom: 0.85rem;
}
.eyebrow::after { content: ""; width: 38px; height: 1px; background: var(--accent); opacity: 0.5; transform-origin: left; transition: transform 0.7s var(--ease) 0.15s; }
.eyebrow--center { justify-content: center; }
.eyebrow--center::before { content: ""; width: 38px; height: 1px; background: var(--accent); opacity: 0.5; transform-origin: right; transition: transform 0.7s var(--ease) 0.15s; }
/* The little gold rule draws outward when its reveal block scrolls into view */
[data-reveal]:not(.is-visible) .eyebrow::after,
[data-reveal]:not(.is-visible).eyebrow::after,
[data-reveal]:not(.is-visible) .eyebrow--center::before,
[data-reveal]:not(.is-visible).eyebrow--center::before { transform: scaleX(0); }

.section-title {
  font-family: var(--font-display); font-size: var(--fs-h2); font-weight: 600;
  line-height: 1.15; color: var(--text-strong); letter-spacing: -0.01em;
}

.rule { border: none; border-top: 1px solid var(--hairline); }

.page-header {
  background: var(--panel); color: var(--panel-text); text-align: center;
  padding-block: clamp(2.75rem, 2rem + 3vw, 4rem);
  border-bottom: 1px solid var(--panel-hairline); position: relative;
}
.page-header::after {
  content: ""; position: absolute; left: 50%; bottom: -1px;
  width: 64px; height: 2px; background: var(--accent); transform: translateX(-50%);
}
.page-header .eyebrow { color: var(--accent-light); justify-content: center; }
.page-header h1 { font-family: var(--font-display); font-size: var(--fs-h1); font-weight: 700; letter-spacing: -0.01em; }

/* ============================== 4. NAVIGATION ============================== */
.nav {
  position: sticky; top: 0; z-index: 200;
  /* No backdrop-filter: at 96% opacity the frosted-glass blur is invisible,
     but it forces the GPU to re-blur the page behind the bar whenever anything
     under it moves — a real cost on Windows machines. */
  background: var(--nav-bg);
  border-bottom: 1px solid var(--panel-hairline);
}
.nav__inner {
  max-width: var(--container); margin-inline: auto; padding: 0 var(--gutter);
  height: 60px; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.nav__brand { display: inline-flex; align-items: center; gap: 0.6rem; text-decoration: none; }
.nav__brand img { width: 30px; height: 30px; object-fit: contain; filter: drop-shadow(0 1px 2px rgba(0,0,0,0.4)); transition: transform 0.5s var(--ease); }
.nav__brand:hover img { transform: rotate(20deg); }   /* the mark is a compass — let it turn */
.nav__brand span { font-family: var(--font-display); font-size: 1rem; font-weight: 600; letter-spacing: 0.01em; color: #f2ead8; }
.nav__brand span em { font-style: italic; color: var(--accent-light); }

.nav__right { display: flex; align-items: center; gap: clamp(1rem, 0.4rem + 1.6vw, 2rem); }
.nav__links { display: flex; align-items: center; gap: clamp(1rem, 0.4rem + 1.6vw, 2.2rem); list-style: none; }
/* .nav__apply lives outside the list (to the right of the theme toggle) but
   dresses exactly like the other nav links. */
.nav__links a, .nav__apply {
  font-family: var(--font-ui); font-size: var(--fs-ui); font-weight: 400;
  letter-spacing: 0.13em; text-transform: uppercase; color: rgba(255, 255, 255, 0.6);
  text-decoration: none; padding: 0.4rem 0; position: relative; transition: color 0.2s var(--ease);
}
.nav__links a::after, .nav__apply::after {
  content: ""; position: absolute; left: 0; bottom: -2px; width: 100%; height: 1.5px;
  background: var(--accent-light); transform: scaleX(0); transform-origin: left;
  transition: transform 0.25s var(--ease);
}
.nav__links a:hover, .nav__apply:hover { color: #fff; }
.nav__links a[aria-current="page"], .nav__apply[aria-current="page"] { color: var(--accent-light); }
.nav__links a[aria-current="page"]::after, .nav__links a:hover::after,
.nav__apply[aria-current="page"]::after, .nav__apply:hover::after { transform: scaleX(1); }

/* Subscribe as a small gold CTA within the nav */
.nav__cta {
  font-family: var(--font-ui); font-size: var(--fs-ui); font-weight: 500;
  letter-spacing: 0.13em; text-transform: uppercase; text-decoration: none;
  color: var(--accent-light); border: 1px solid rgba(184, 146, 42, 0.5);
  border-radius: 100px; padding: 0.4rem 1rem; transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
.nav__cta:hover, .nav__cta[aria-current="page"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.nav__cta::after { display: none; }

/* Theme toggle */
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 50%; cursor: pointer;
  background: transparent; border: 1px solid var(--panel-hairline); color: var(--accent-light);
  transition: background 0.2s var(--ease), transform 0.3s var(--ease);
}
.theme-toggle:hover { background: rgba(184, 146, 42, 0.12); }
.theme-toggle svg { width: 16px; height: 16px; }
.theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-moon { display: block; }

/* Mobile menu toggle */
.nav__toggle {
  display: none; background: none; border: 1px solid var(--panel-hairline); border-radius: 4px;
  width: 40px; height: 36px; cursor: pointer; padding: 0; align-items: center; justify-content: center;
}
.nav__toggle span, .nav__toggle span::before, .nav__toggle span::after {
  content: ""; display: block; width: 18px; height: 1.5px; background: var(--accent-light);
  transition: transform 0.25s var(--ease), opacity 0.2s;
}
.nav__toggle span { position: relative; }
.nav__toggle span::before { position: absolute; top: -6px; }
.nav__toggle span::after  { position: absolute; top: 6px; }
.nav[data-open="true"] .nav__toggle span { background: transparent; }
.nav[data-open="true"] .nav__toggle span::before { transform: translateY(6px) rotate(45deg); }
.nav[data-open="true"] .nav__toggle span::after  { transform: translateY(-6px) rotate(-45deg); }

/* Reading progress bar — only visible on the article route */
.progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 100%;
  transform: scaleX(var(--progress, 0)); transform-origin: left;
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
  z-index: 250; opacity: 0; transition: opacity 0.3s var(--ease);
}
body[data-route="article"] .progress { opacity: 1; }

/* ============================== 5. BUTTONS ============================== */
.btn {
  position: relative; overflow: hidden; z-index: 0;
  display: inline-flex; align-items: center; gap: 0.5rem; font-family: var(--font-ui);
  font-size: 0.74rem; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase;
  padding: 0.85rem 1.9rem; border: 1px solid var(--accent); color: var(--accent-deep);
  background: transparent; text-decoration: none; cursor: pointer;
  transition: color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
/* Gold fills in from the left on hover, rather than a flat colour swap */
.btn::before {
  content: ""; position: absolute; inset: 0; z-index: -1; background: var(--accent);
  transform: scaleX(0); transform-origin: left; transition: transform 0.35s var(--ease);
}
.btn:hover { color: #fff; box-shadow: var(--shadow-md); }
.btn:hover::before { transform: scaleX(1); }
.btn:hover .btn__arrow { transform: translateX(3px); }
.btn__arrow { transition: transform 0.25s var(--ease); }
.btn--solid { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn--solid::before { background: var(--accent-deep); }   /* deepens on hover */

/* ============================== 6. HERO ============================== */
.hero {
  position: relative; overflow: hidden; text-align: center;
  /* A firmer rule under the hero — the fold between "title page" and the issue */
  padding-block: clamp(3.5rem, 2.5rem + 5vw, 6.5rem); border-bottom: 1px solid var(--hairline-strong);
}
.hero__lines {
  position: absolute; inset: 0; pointer-events: none;
  animation: hero-lines-in 1.4s var(--ease) both;
  transition: transform 0.4s var(--ease);   /* smooths the cursor parallax */
}
.hero__lines svg { width: 100%; height: 100%; }
/* Solid map lines "draw" themselves in on load (pathLength=1 normalises length) */
.hero__lines .draw { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw-line 2s var(--ease) 0.2s forwards; }
@keyframes hero-lines-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes draw-line { to { stroke-dashoffset: 0; } }

.hero__logo {
  position: relative;
  width: clamp(150px, 38vw, 200px); margin: 0 auto 2rem;
  animation: floaty 11s ease-in-out infinite;
  will-change: transform;
}
/* Soft raised shadow, drawn as a circular gradient behind the medallion and
   offset downward. No blur filter, so it's free to animate with the float. */
.hero__logo::after {
  content: ""; position: absolute; z-index: -1; inset: 0;
  border-radius: 50%;
  transform: translateY(9%) scale(0.98);
  background: radial-gradient(circle at 50% 52%, var(--logo-cast) 38%, transparent 72%);
  pointer-events: none;
}

/* When the hero is scrolled out of view, freeze its continuous animations so
   the GPU/compositor isn't doing work the visitor can't see. Toggled in JS. */
.hero.is-rest .hero__logo,
.hero.is-rest .hero__orbit,
.hero.is-rest h1 { animation-play-state: paused; }

/* Orbiting compass pointer (decorative). The pointer + tick-ring sit just
   outside the medallion and rotate together, slowly. The rotation is applied
   to the <svg> element itself, not a group inside it: browsers can only run
   transform animations on the compositor for HTML-level elements, so animating
   an inner <g> would repaint the ring on the main thread every frame. */
.hero__orbit {
  position: absolute; left: 50%; top: 50%;
  width: 114%; height: 114%; transform: translate(-50%, -50%);
  overflow: visible; pointer-events: none;
  animation: orbit 38s linear infinite; will-change: transform;
}
.hero__orbit-ring { fill: none; stroke: var(--accent); stroke-width: 0.3; opacity: 0.16; stroke-dasharray: 0.5 3.4; }
.hero__orbit-needle { fill: var(--accent); opacity: 0.9; }    /* north — gold */
.hero__orbit-needle-s { fill: var(--accent); opacity: 0.9; }  /* south — gold */
@keyframes orbit {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to   { transform: translate(-50%, -50%) rotate(360deg); }
}
.hero__logo img { width: 100%; height: auto; }
/* A gentle, continuous drift — the compass traces a slow loop so it feels alive. */
@keyframes floaty {
  0%   { transform: translate(0px, 0px); }
  20%  { transform: translate(9px, -7px); }
  40%  { transform: translate(5px, -15px); }
  60%  { transform: translate(-6px, -12px); }
  80%  { transform: translate(-9px, -5px); }
  100% { transform: translate(0px, 0px); }
}

.hero h1 {
  font-family: var(--font-display); font-size: var(--fs-hero); font-weight: 700;
  line-height: 1.04; letter-spacing: -0.015em; margin-bottom: 1rem;
  color: var(--accent-deep);   /* fallback if background-clip:text is unsupported */
}
.hero h1 em { font-style: italic; }

/* Gilded wordmark: a gold-leaf gradient clipped to the text, with a slow
   specular sheen sweeping across like light catching gilt. */
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .hero h1 {
    /* Flat gold ends with a single bright band in the centre. At rest the band
       is off-screen, so the wordmark is solid gilt; the sheen sweeps across only
       occasionally. The flat ends make the loop seamless (no visible jump). */
    background-image: linear-gradient(100deg,
      #b8922a 0%, #b8922a 33%,
      #d9b450 42%, #f6e4ad 48%, #fff6db 50%, #f6e4ad 52%, #d9b450 58%,
      #b8922a 67%, #b8922a 100%);
    background-size: 300% 100%;
    background-position: 0% 0;
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent; color: transparent;
    /* No filter here: a drop-shadow would force the headline to re-rasterize
       through the filter on every frame of the sheen sweep. */
    animation: gild 15s ease-in-out infinite;
  }
}
@keyframes gild {
  0%, 60%   { background-position: 0% 0; }     /* long idle on solid gold */
  90%, 100% { background-position: 100% 0; }   /* one slow sheen, then rest */
}
.hero__sub {
  font-family: var(--font-ui); font-size: var(--fs-eyebrow); letter-spacing: 0.3em;
  text-transform: uppercase; color: var(--accent-deep); margin-bottom: 1.75rem;
}
.hero__mission {
  font-family: var(--font-display); font-style: italic; font-size: var(--fs-lead);
  line-height: 1.6; color: var(--text); max-width: 34rem; margin: 0 auto 2.25rem;
}

/* ============================== SPIN-THE-COMPASS ============================== */
.compass-explore { border-top: 1px solid var(--hairline-soft); }
.compass-explore__lead { max-width: 34rem; margin: 0 auto 2.5rem; color: var(--text); font-size: var(--fs-lead); font-style: italic; font-family: var(--font-display); }
.compass { display: flex; flex-direction: column; align-items: center; gap: 1.75rem; }

.compass__dial {
  background: none; border: none; padding: 0; cursor: pointer; border-radius: 50%;
  width: clamp(240px, 58vw, 330px);
  /* box-shadow, not filter: drop-shadow — the dial is a circle so they look the
     same, but a filter would re-rasterize the whole dial every frame while the
     needle spins or the hover scale plays. */
  box-shadow: 0 10px 26px rgba(60, 44, 16, 0.16);
  transition: transform 0.3s var(--ease);
}
.compass__dial:hover { transform: scale(1.02); }
.compass__svg { width: 100%; height: auto; display: block; }

.compass__ring { fill: var(--surface); stroke: var(--accent); stroke-width: 1; opacity: 1; }
.compass__ring-inner { fill: none; stroke: var(--hairline); stroke-width: 0.7; }
.compass__rose polygon { fill: var(--accent); opacity: 0.12; }
.compass__card { font-family: var(--font-display); font-size: 11px; font-weight: 600; fill: var(--text-soft); }
.compass__marker { fill: var(--hairline); transition: fill 0.3s var(--ease), r 0.3s var(--ease); }
.compass__marker.is-active { fill: var(--accent); }

.compass__needle { transform-box: view-box; transform-origin: 100px 100px; transition: transform 2.6s cubic-bezier(0.18, 0.9, 0.22, 1); }
.compass__needle-n { fill: var(--accent); }
.compass__needle-s { fill: var(--crimson); }
.compass__hub { fill: var(--accent); stroke: var(--surface); stroke-width: 1.5; }

.compass__readout { min-height: 5rem; max-width: 36rem; display: flex; flex-direction: column; justify-content: center; }
.compass__hint { color: var(--text-soft); font-style: italic; }
.compass__topic { font-family: var(--font-ui); font-size: 0.66rem; font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase; color: var(--crimson); margin-bottom: 0.5rem; }
.compass__q { font-family: var(--font-display); font-size: var(--fs-h3); font-weight: 600; line-height: 1.25; color: var(--text-strong); animation: page-in 0.5s var(--ease) both; }
.compass__actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 1rem 1.5rem; }
.compass__link { font-family: var(--font-ui); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent-deep); text-decoration: none; }
.compass__link:hover { color: var(--accent); }

@media (prefers-reduced-motion: reduce) {
  .compass__needle { transition: none; }
}

/* ============================== 7. ARTICLE GRID & CARDS ============================== */
/* Flex-wrap rather than a fixed grid: cards on the final row stretch to fill
   the width, so any number of essays (7, 8, 11…) closes out cleanly with no
   empty cells — at every breakpoint. */
.card-grid {
  display: flex; flex-wrap: wrap; align-items: stretch;
  gap: 1px; background: var(--hairline-soft); border: 1px solid var(--hairline-soft);
}
.article-card {
  /* 220px basis puts four cards per row on a desktop container, so seven
     essays land in two rows rather than three and stay in view. */
  flex: 1 1 220px;
  background: var(--surface); padding: 1.6rem 1.5rem; text-decoration: none; color: inherit;
  display: flex; flex-direction: column; gap: 0.5rem; position: relative; min-width: 0;
  transition: background 0.2s var(--ease), transform 0.2s var(--ease);
}
.article-card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--accent); transform: scaleY(0); transform-origin: top; transition: transform 0.25s var(--ease);
}
.article-card:hover { background: var(--surface-2); }
.article-card:hover::before { transform: scaleY(1); }
.article-card__topic { font-family: var(--font-ui); font-size: 0.62rem; font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase; color: var(--crimson); }
.article-card__title { font-family: var(--font-display); font-size: 1.1rem; font-weight: 600; line-height: 1.32; color: var(--text-strong); }
/* Byline under each card title (populated from ARTICLES in initIssueBylines) */
.article-card__byline { margin-top: 0.2rem; font-family: var(--font-ui); font-size: 0.66rem; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent-deep); }
.article-card__byline--pending { text-transform: none; letter-spacing: 0.01em; font-size: 0.9rem; font-style: italic; color: var(--text-soft); }
/* The topic/search filter toggles [hidden] on cards; .article-card sets
   display:flex, which would otherwise defeat it — so force hidden cards out. */
.article-card[hidden] { display: none; }

/* ============================== 8. ISSUES ============================== */
/* Issue plate — a gilded dark band that deliberately breaks from the parchment
   pages around it, and is compact enough that the essays sit in view on arrival. */
.issue-plate {
  display: flex; align-items: center; gap: clamp(1.1rem, 0.6rem + 2vw, 2.2rem);
  padding: clamp(1.25rem, 0.8rem + 1.6vw, 2rem) clamp(1.4rem, 0.8rem + 2vw, 2.6rem);
  background:
    radial-gradient(120% 180% at 12% 50%, rgba(201, 168, 76, 0.18) 0%, transparent 60%),
    linear-gradient(135deg, #17130e 0%, #221c14 55%, #14110d 100%);
  border: 1px solid rgba(201, 168, 76, 0.42);
  /* Square bottom edge: the essay grid attaches directly beneath it. */
  border-radius: 4px 4px 0 0;
  box-shadow: var(--shadow-md);
  position: relative; overflow: hidden;
}
/* Gold flowing across the plate. Animates ONLY transform, so the compositor
   handles it on the GPU — no layout, no repaint, no measurable cost. */
.issue-plate::before {
  content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 45%;
  background: linear-gradient(100deg,
    transparent 0%, rgba(201, 168, 76, 0.10) 35%, rgba(245, 226, 160, 0.30) 50%,
    rgba(201, 168, 76, 0.10) 65%, transparent 100%);
  transform: translate3d(-120%, 0, 0);
  animation: plate-sheen 7s linear infinite;
  will-change: transform; pointer-events: none;
}
@keyframes plate-sheen {
  to { transform: translate3d(340%, 0, 0); }
}
/* A gilt rule along the bottom edge, fading out like foil stamping */
.issue-plate::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: linear-gradient(90deg, var(--accent), rgba(201, 168, 76, 0.12));
}
.issue-plate__mark {
  width: clamp(58px, 5.5vw, 84px); height: auto; flex-shrink: 0;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.45));
  position: relative; z-index: 1;
}
.issue-plate__text { min-width: 0; position: relative; z-index: 1; }
.issue-plate__eyebrow {
  font-family: var(--font-ui); font-size: 0.66rem; letter-spacing: 0.26em;
  text-transform: uppercase; color: var(--accent-light); margin: 0 0 0.5rem;
}
.issue-plate__title {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(1.5rem, 1rem + 2.4vw, 2.5rem); line-height: 1.1;
  letter-spacing: -0.015em; color: #f4eddd; margin: 0; text-wrap: balance;
}
.issue-plate__title em { font-style: italic; color: var(--accent-light); }
@media (max-width: 560px) {
  .issue-plate { flex-direction: column; text-align: center; gap: 0.9rem; }
}

/* The Issues page exists to show the essays, so its banner, section padding and
   search field are tighter than elsewhere — the grid should be in view on arrival. */
#page-issues .page-header { padding-block: clamp(1.5rem, 1rem + 1.6vw, 2.25rem); }
#page-issues .section { padding-block: clamp(1.5rem, 1rem + 1.6vw, 2.25rem); }
#page-issues .archive-search input { padding-block: 0.55rem; font-size: 1rem; }

/* The essay grid butts straight onto the plate, so the issue reads as one
   object; the search and filters follow underneath the essays. */
.issue-body { margin-top: 0; }
.card-grid--attached { border-top: none; }
#page-issues .archive-tools { margin: 1.5rem 0 0; }
#page-issues .archive-search { margin-bottom: 0.75rem; }
#page-issues .archive-count { margin-top: 0.75rem; }

.subhead {
  font-family: var(--font-ui); font-size: 0.68rem; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--text-soft); padding-bottom: 0.7rem; margin-bottom: 1.25rem; border-bottom: 1px solid var(--hairline);
}

/* ---- Archive tools (search + topic filter) ---- */
.archive-tools { margin-bottom: 1.5rem; }
.archive-search { position: relative; margin-bottom: 1rem; }
.archive-search__icon {
  position: absolute; left: 0.95rem; top: 50%; transform: translateY(-50%);
  width: 17px; height: 17px; color: var(--text-soft); pointer-events: none;
}
.archive-search input {
  width: 100%; font-family: var(--font-body); font-size: 1.05rem; color: var(--text-strong);
  background: var(--surface); border: 1px solid var(--hairline); border-radius: 100px;
  padding: 0.7rem 1rem 0.7rem 2.6rem;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.archive-search input::placeholder { color: var(--text-soft); opacity: 0.7; }
.archive-search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip {
  font-family: var(--font-ui); font-size: 0.66rem; font-weight: 500; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--text-soft);
  background: transparent; border: 1px solid var(--hairline); border-radius: 100px;
  padding: 0.42rem 0.9rem; cursor: pointer;
  transition: background 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.chip:hover { border-color: var(--accent); color: var(--text-strong); }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }

.archive-count { margin-top: 0.9rem; font-family: var(--font-ui); font-size: 0.7rem; letter-spacing: 0.04em; color: var(--text-soft); }

.archive-empty {
  margin-top: 1.5rem; padding: 2rem; text-align: center; font-style: italic; color: var(--text-soft);
  background: var(--bg-band); border: 1px dashed var(--hairline);
}
.archive-reset {
  font-family: var(--font-ui); font-style: normal; font-size: 0.68rem; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--accent-deep); background: none; border: none;
  border-bottom: 1px solid var(--hairline); cursor: pointer; padding: 0 0 1px;
}
.archive-reset:hover { color: var(--accent); }

/* ============================== 9. TEAM ============================== */
.founders { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.25rem; margin-bottom: clamp(1.4rem, 0.9rem + 1.6vw, 2.25rem); }
.founder {
  background: var(--panel); color: var(--panel-text); border-bottom: 2px solid var(--accent);
  padding: clamp(1.8rem, 1.2rem + 2vw, 2.6rem); display: flex; align-items: center; gap: 1.6rem;
  min-width: 0; box-shadow: var(--shadow-sm); transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.founder:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.founder__name { font-family: var(--font-display); font-size: 1.6rem; font-weight: 600; margin-bottom: 0.3rem; }
.founder__role { font-family: var(--font-ui); font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent-light); }

/* Rounded-rectangle photo frames — the full square photo shows (head to
   shoulders, nothing clipped), and all portraits read uniformly. */
.portrait {
  border-radius: 12px; overflow: hidden; flex-shrink: 0; background: rgba(184, 146, 42, 0.12);
  box-shadow: 0 0 0 1px rgba(184, 146, 42, 0.45), var(--shadow-sm);
}
.portrait img {
  width: 100%; height: 100%; object-fit: cover; object-position: center top;
  filter: saturate(0.9) sepia(0.08) contrast(1.02);
  transition: filter 0.3s var(--ease), transform 0.4s var(--ease);
}
/* Founders sit above the masthead, so their portraits read noticeably larger
   than the writers' (152px vs 116px). */
.founder .portrait { width: 152px; height: 152px; }

/* Flex-wrap (like .card-grid) so the final row stretches to fill: any number
   of writers closes out cleanly, at every breakpoint. */
.writers-grid { display: flex; flex-wrap: wrap; align-items: stretch; gap: 1px; background: var(--hairline-soft); border: 1px solid var(--hairline-soft); }
/* Basis tuned so the ten writers fall into two even rows of five on desktop;
   flex still fills the last row cleanly if that count ever changes. */
.writer { flex: 1 1 186px; background: var(--surface); text-align: center; padding: 2.1rem 1rem 1.85rem; min-width: 0; transition: background 0.2s var(--ease), transform 0.2s var(--ease); }
.writer:hover { background: var(--surface-2); transform: translateY(-2px); }
.writer .portrait { width: 128px; height: 128px; margin: 0 auto 1.15rem; }
.writer:hover .portrait img { filter: saturate(1) sepia(0) contrast(1.03); transform: scale(1.04); }
.writer__name { font-family: var(--font-display); font-size: 1.02rem; font-weight: 600; color: var(--text-strong); margin-bottom: 0.25rem; overflow-wrap: break-word; }
.writer__role { font-family: var(--font-ui); font-size: 0.64rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-soft); }

/* ============================== 10. ABOUT ============================== */
.prose { max-width: 44rem; }
.prose p { margin-bottom: 1.3rem; color: var(--text); }
.prose p:last-child { margin-bottom: 0; }
.prose strong { color: var(--text-strong); font-weight: 600; }
.prose h3 { font-family: var(--font-display); font-size: var(--fs-h3); font-weight: 600; color: var(--text-strong); margin-bottom: 0.9rem; }

.contact-list { display: flex; flex-direction: column; gap: 0.35rem; }
.contact-list a { color: var(--accent-deep); text-decoration: none; border-bottom: 1px solid var(--hairline); }
.contact-list a:hover { color: var(--accent); }

.pullquote { border-left: 3px solid var(--accent); background: var(--accent-soft); padding: 1.3rem 1.75rem; margin: 0 0 2.25rem; }
.pullquote p { font-family: var(--font-display); font-style: italic; font-size: var(--fs-lead); line-height: 1.6; color: var(--text); margin: 0; }

/* ============================== 11. FROM THE EDITORS ============================== */
.editors { max-width: var(--measure); }
.editors__note p { margin-bottom: 1.3rem; color: var(--text); }
.editors__note em { font-style: italic; }
.editors__note p:first-of-type::first-letter {
  font-family: var(--font-display); float: left; font-size: 3.6em; line-height: 0.78;
  padding: 0.05em 0.12em 0 0; color: var(--crimson); font-weight: 600;
}
.editors__closing { font-style: italic; color: var(--text); margin-bottom: 2rem !important; }
.editors__sig { font-family: var(--font-display); font-style: italic; font-size: 1.15rem; color: var(--text-strong); margin-bottom: 0.25rem; }
.editors__sig-role { font-family: var(--font-ui); font-size: 0.66rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-soft); }

/* ============================== 12. ARTICLE READING PAGE ============================== */
/* The essay sits on a tactile "sheet of paper": a slightly brighter panel with
   a faint paper-fibre grain, a soft shadow, and a hairline edge. Wider than the
   old measure so the text no longer feels cramped on desktop. */
.reader {
  max-width: 50rem;
  position: relative;
  isolation: isolate;                 /* contains the texture layer below the text */
  background: var(--paper);
  border: 1px solid var(--hairline-soft);
  border-radius: 4px;
  box-shadow: var(--shadow-md);
  padding: clamp(2rem, 1.3rem + 3.4vw, 3.75rem) clamp(1.4rem, 0.8rem + 3vw, 3.25rem);
  margin-block: clamp(2rem, 1.4rem + 2.4vw, 3.5rem);
}
/* Paper grain — a static fractal-noise overlay, a little stronger than the
   page texture so the sheet feels rough/tactile. No filter, so it's cheap. */
.reader::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  border-radius: inherit;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='r'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.6' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23r)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
  opacity: 0.06;
}
[data-theme="dark"] .reader::before { opacity: 0.05; }
.reader__back {
  display: inline-flex; align-items: center; gap: 0.45rem; font-family: var(--font-ui);
  font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent-deep);
  text-decoration: none; margin-bottom: 2.25rem; transition: gap 0.2s var(--ease), color 0.2s;
}
.reader__back:hover { gap: 0.7rem; color: var(--accent); }
.reader__topic { font-family: var(--font-ui); font-size: 0.72rem; font-weight: 500; letter-spacing: 0.2em; text-transform: uppercase; color: var(--crimson); margin-bottom: 1rem; }
.reader h1 { font-family: var(--font-display); font-size: var(--fs-h1); font-weight: 700; line-height: 1.14; letter-spacing: -0.015em; color: var(--text-strong); margin-bottom: 1.1rem; }
.reader__byline {
  font-family: var(--font-ui); font-size: 0.78rem; letter-spacing: 0.04em; color: var(--text-soft);
  padding-bottom: 1.75rem; margin-bottom: 2.25rem; border-bottom: 1px solid var(--hairline);
}

.reader__body { font-size: var(--fs-body); line-height: 1.85; color: var(--text); }
.reader__body > p { margin-bottom: 1.4rem; }
/* Standfirst / dek — the framing question that sits beneath the headline,
   set larger and italic. It is excluded from the drop-cap below. */
.reader__dek {
  font-family: var(--font-display); font-style: italic; font-size: var(--fs-lead);
  line-height: 1.55; color: var(--text); margin-bottom: 1.9rem;
}
/* Drop cap on the first real paragraph — whether or not a dek precedes it. */
.reader__body > p:first-of-type:not(.reader__pending):not(.reader__dek)::first-letter,
.reader__body > .reader__dek + p::first-letter {
  font-family: var(--font-display); float: left; font-size: 3.8em; line-height: 0.76;
  padding: 0.04em 0.14em 0 0; color: var(--crimson); font-weight: 600;
}
.reader__body h2 { font-family: var(--font-display); font-size: var(--fs-h3); font-weight: 600; color: var(--text-strong); margin: 2.4rem 0 0.9rem; line-height: 1.25; }
.reader__body h3 { font-family: var(--font-display); font-size: 1.2rem; font-weight: 600; color: var(--text-strong); margin: 1.9rem 0 0.7rem; }
.reader__body blockquote {
  border-left: 3px solid var(--accent); background: var(--accent-soft); padding: 1.1rem 1.6rem;
  margin: 1.8rem 0; font-family: var(--font-display); font-style: italic; font-size: var(--fs-lead); color: var(--text);
}
.reader__body blockquote p { margin: 0; }
/* Second-person "scenarios": an inset block of lines pulled in from both
   margins — like the indented passages in the manuscript — rather than a
   bordered pull-quote. Each sentence keeps its own line, set tightly together. */
.reader__body .reader__scene { margin: 2.2rem 0; padding-inline: clamp(1.5rem, 7vw, 3.5rem); }
.reader__body .reader__scene p { margin: 0 0 0.4rem; line-height: 1.7; }
.reader__body .reader__scene p:last-child { margin-bottom: 0; }
.reader__body a { color: var(--crimson); text-decoration: underline; }
.reader__body a:hover { color: var(--crimson-bright); }
.reader__body em { font-style: italic; }
.reader__body strong { font-weight: 600; color: var(--text-strong); }
.reader__body ul, .reader__body ol { margin: 0 0 1.4rem 1.4rem; }
.reader__body li { margin-bottom: 0.5rem; }

.reader__pending { font-style: italic; color: var(--text-soft); background: var(--bg-band); border: 1px dashed var(--hairline); padding: 2rem; text-align: center; }
.reader__endmark { text-align: center; color: var(--accent); margin-top: 2.5rem; font-size: 1.2rem; letter-spacing: 0.5rem; }

.reader__nav { display: flex; justify-content: space-between; gap: 1rem; margin-top: 2.5rem; padding-top: 1.75rem; border-top: 1px solid var(--hairline); }
.reader__nav a { text-decoration: none; color: inherit; flex: 1 1 0; max-width: 48%; transition: transform 0.2s var(--ease); }
.reader__nav a:hover { transform: translateY(-2px); }
.reader__nav a.is-next { text-align: right; margin-left: auto; }
.reader__nav-label { font-family: var(--font-ui); font-size: 0.62rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent-deep); display: block; margin-bottom: 0.3rem; }
.reader__nav-title { font-family: var(--font-display); font-size: 0.98rem; font-weight: 600; color: var(--text-strong); line-height: 1.3; }

/* Author link on the byline */
.reader__byline a { color: var(--accent-deep); text-decoration: none; border-bottom: 1px solid var(--hairline); }
.reader__byline a:hover { color: var(--accent); }

/* ============================== 13. SUBSCRIBE + FORMS ============================== */
.subscribe { max-width: 34rem; }
.subscribe__lead { font-size: var(--fs-lead); line-height: 1.6; color: var(--text); margin-bottom: 2rem; }
.subscribe__lead em { font-style: italic; }

.form-field { margin-bottom: 1.25rem; }
.form-field label {
  display: block; font-family: var(--font-ui); font-size: 0.68rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--text-soft); margin-bottom: 0.5rem;
}
.form-field label .opt { text-transform: none; letter-spacing: 0; color: var(--text-soft); opacity: 0.7; }
.form-field input, .form-field textarea, .form-field select {
  width: 100%; font-family: var(--font-body); font-size: 1.05rem; color: var(--text-strong);
  background: var(--surface); border: 1px solid var(--hairline); border-radius: 3px;
  padding: 0.75rem 0.9rem; transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.form-field textarea { resize: vertical; min-height: 5rem; line-height: 1.5; }
.form-field select { cursor: pointer; }
.form-field input::placeholder, .form-field textarea::placeholder { color: var(--text-soft); opacity: 0.55; }
.form-field input:focus, .form-field textarea:focus, .form-field select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 540px) { .form-row { grid-template-columns: 1fr; } }

.form-actions { margin-top: 1.75rem; }
.form-note { margin-top: 1rem; font-size: 0.92rem; color: var(--text-soft); font-style: italic; }
/* While a submission is in flight the button holds steady and can't double-fire */
.btn:disabled { opacity: 0.55; cursor: default; pointer-events: none; }

.form-status { margin-top: 1.25rem; font-family: var(--font-ui); font-size: 0.85rem; padding: 0.9rem 1.1rem; border-radius: 3px; display: none; }
.form-status.is-ok    { display: block; background: var(--accent-soft); border: 1px solid var(--hairline); color: var(--text-strong); }
.form-status.is-error { display: block; background: rgba(139, 26, 26, 0.07); border: 1px solid rgba(139, 26, 26, 0.3); color: var(--crimson-bright); }

/* ============================== 14. FOOTER ============================== */
main { flex: 1 0 auto; }
.footer {
  flex-shrink: 0;
  background: var(--panel); color: var(--panel-text); text-align: center;
  padding-block: clamp(2.5rem, 1.8rem + 2vw, 3.5rem); border-top: 1px solid var(--panel-hairline);
}
.footer__name { font-family: var(--font-display); font-style: italic; font-size: 1.4rem; font-weight: 600; color: var(--accent-light); margin-bottom: 0.5rem; }
.footer__sub { font-family: var(--font-ui); font-size: 0.66rem; letter-spacing: 0.16em; text-transform: uppercase; color: rgba(255, 255, 255, 0.55); }
.footer__social {
  display: inline-flex; align-items: center; gap: 0.5rem; margin-top: 1.4rem;
  font-family: var(--font-ui); font-size: 0.72rem; letter-spacing: 0.08em; color: rgba(255, 255, 255, 0.5);
  text-decoration: none; border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 100px; padding: 0.5rem 1.15rem;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.footer__social:hover { color: var(--accent-light); border-color: rgba(184, 146, 42, 0.5); }
.footer__contact { margin-top: 1.4rem; font-family: var(--font-ui); font-size: 0.74rem; letter-spacing: 0.04em; color: rgba(255, 255, 255, 0.55); }
.footer__contact a { color: var(--accent-light); text-decoration: none; }
.footer__contact a:hover { text-decoration: underline; }
.footer__legal { margin-top: 0.75rem; font-family: var(--font-ui); font-size: 0.68rem; letter-spacing: 0.08em; }
.footer__legal a { color: rgba(255, 255, 255, 0.45); text-decoration: none; }
.footer__legal a:hover { color: var(--accent-light); }

/* ============================== 15. ROUTING & SCROLL REVEAL ============================== */
.page { display: none; }
.page.is-active { display: block; animation: page-in 0.5s var(--ease) both; }
@keyframes page-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

[data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
[data-reveal].is-visible { opacity: 1; transform: translateY(0); }

/* Staggered reveal: a container's children cascade in (per-child delay set in JS) */
[data-stagger] > * { opacity: 0; transform: translateY(16px); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); }
[data-stagger].is-visible > * { opacity: 1; transform: none; }

/* Smooth palette crossfade — applied by JS only during a manual theme toggle */
html.theme-anim, html.theme-anim *, html.theme-anim *::before, html.theme-anim *::after {
  transition: background-color 0.45s var(--ease), color 0.45s var(--ease),
              border-color 0.45s var(--ease), fill 0.45s var(--ease), box-shadow 0.45s var(--ease) !important;
}

/* ============================== 16. RESPONSIVE ============================== */
/* The writers grid is flex-wrap; steer the column count via the flex basis. */
@media (max-width: 860px) { .writer { flex-basis: 170px; } }

@media (max-width: 760px) {
  .nav__toggle { display: inline-flex; order: 3; }
  .nav__right {
    position: absolute; top: 60px; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0;
    background: var(--panel); border-bottom: 1px solid var(--panel-hairline); padding: 0.5rem var(--gutter) 1rem;
    transform: translateY(-12px); opacity: 0; pointer-events: none; transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
  }
  .nav[data-open="true"] .nav__right { transform: translateY(0); opacity: 1; pointer-events: auto; }
  .nav__links { flex-direction: column; align-items: stretch; gap: 0; }
  .nav__links a, .nav__apply { padding: 0.85rem 0; border-bottom: 1px solid rgba(255,255,255,0.06); }
  .nav__links a::after, .nav__apply::after { display: none; }
  .nav__cta { text-align: center; margin-top: 0.75rem; padding: 0.7rem 1rem; }
  .theme-toggle { margin-top: 0.75rem; align-self: flex-start; }

  .founders { grid-template-columns: 1fr; }
}

@media (max-width: 540px) {
  .writer { flex-basis: 130px; padding: 1.5rem 0.75rem 1.35rem; }
  .writer .portrait { width: 92px; height: 92px; }
  .founder .portrait { width: 112px; height: 112px; }
  .reader__nav { flex-direction: column; }
  .reader__nav a, .reader__nav a.is-next { max-width: 100%; text-align: left; }
  .reader__nav a.is-next { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
  .hero__logo { animation: none; }
  [data-reveal] { opacity: 1; transform: none; }
  [data-stagger] > * { opacity: 1 !important; transform: none !important; }
  .hero__lines .draw { stroke-dashoffset: 0 !important; animation: none !important; }
  .eyebrow::after, .eyebrow--center::before { transform: none !important; }
  /* Keep the gilded wordmark, but hold the sheen still */
  .hero h1 { animation: none !important; background-position: 0% 0 !important; }
}

/* ============================== 17. PRINT ============================== */
@media print {
  .nav, .footer, .progress, .hero__lines, .reader__back, .reader__nav, .skip-link, .theme-toggle { display: none !important; }
  body { background: #fff; color: #000; font-size: 12pt; }
  .page { display: none !important; }
  .page.is-active { display: block !important; }
  .page-header { background: #fff; color: #000; border: none; }
  .page-header::after { display: none; }
  .reader, .container { max-width: 100%; }
  [data-reveal] { opacity: 1 !important; transform: none !important; }
  .reader__body { color: #000; }
  .reader__body a { color: #000; }
  /* Expose link targets for printed essays */
  .reader__body a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 0.85em; color: #555; }
  .reader h1 { color: #000; }
}
