/* ═══════════════════════════════════════════
   ADIL ISLAM — adilislam.com
   Mnemos-inspired design system.
   Cream on dark. Neutral monochrome.
   The signal moves.
   ═══════════════════════════════════════════ */

:root {
  /* surfaces */
  --bg: #0e0e11;
  --bg-deep: #121215;
  --bg-surface: #151518;
  --bg-raised: #1a1a1e;
  --bg-gallery: #222224;
  --bg-overlay: rgba(14,14,17,.86);
  --neutral-rgb: 220,219,216;

  /* ink · warm-to-cool cascade (brightened 2026-06-05 for readability) */
  --fg: #F4F3F0;
  --fg-92: rgba(244,243,240,.95);
  --fg-78: rgba(232,230,226,.86);
  --fg-62: rgba(220,218,214,.78);
  --fg-46: rgba(200,198,194,.62);
  --fg-32: rgba(180,178,174,.50);
  --fg-20: rgba(160,158,154,.36);
  --fg-12: rgba(150,148,144,.24);
  --fg-06: rgba(140,138,134,.14);

  /* hairlines */
  --rule: rgba(220,219,216,.06);
  --rule-mid: rgba(220,219,216,.10);
  --rule-strong: rgba(220,219,216,.18);
  --highlight-top: rgba(220,219,216,.045);

  /* accent · cream = the accent */
  --accent: rgba(244,243,240,.93);
  --accent-bright: #F4F3F0;
  --accent-dim: rgba(220,219,216,.32);
  --accent-glow: rgba(220,219,216,.18);
  --accent-bg: rgba(220,219,216,.06);

  /* type */
  --sans: "Inter Tight","Inter",-apple-system,sans-serif;
  --body: "Inter",-apple-system,sans-serif;
  --mono: "JetBrains Mono","SF Mono",monospace;
  --display: "Fraunces","Iowan Old Style","Georgia",serif;

  /* radius */
  --r-sm: 4px;
  --r: 6px;
  --r-lg: 10px;

  /* elevation */
  --shadow-xs: 0 1px 0 rgba(0,0,0,.22);
  --shadow-sm: 0 1px 2px rgba(0,0,0,.32), 0 2px 6px rgba(0,0,0,.18);
  --shadow-md: 0 2px 4px rgba(0,0,0,.34), 0 8px 18px rgba(0,0,0,.22);
  --shadow-lg: 0 4px 8px rgba(0,0,0,.36), 0 12px 30px rgba(0,0,0,.26), 0 24px 60px rgba(0,0,0,.16);

  /* interactive states */
  --state-hover-bg: rgba(220,219,216,.04);
  --state-hover-border: rgba(220,219,216,.18);
  --state-focus-ring: rgba(244,243,240,.55);
  --state-focus-shadow: 0 0 0 1px rgba(14,14,17,1), 0 0 0 3px rgba(244,243,240,.40);
  --state-active-bg: rgba(220,219,216,.08);
  --state-active-scale: .985;

  /* motion */
  --ease: cubic-bezier(.16,1,.3,1);
  --ease-io: cubic-bezier(.4,0,.2,1);
  --ease-premium: cubic-bezier(.22,1,.36,1);
  --dur-fast: 180ms;
  --dur-base: 240ms;
  --dur-slow: 480ms;

  /* atmosphere */
  --pad-x: 56px;
  --paper-dot: rgba(220,219,216,.020);
}

@media (max-width:1000px){ :root{ --pad-x:32px; } }
@media (max-width:620px){ :root{ --pad-x:22px; } }

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  overflow-x: clip;
  scroll-padding-top: 54px;
  background: var(--bg);
}

::selection { background: var(--accent); color: var(--bg); }

body {
  background: var(--bg);
  color: var(--fg-78);
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.65;
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01", "tnum" 0;
}

/* ── atmosphere · dot-grid paper ── */
.paper {
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background-color: var(--bg);
  background-image: radial-gradient(circle at 1px 1px, var(--paper-dot) 1px, transparent 1.2px);
  background-size: 14px 14px;
}

a { color: inherit; text-decoration: none; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 var(--pad-x); }

/* ═══════════════════════════════════════════
   CHROME (topbar)
   ═══════════════════════════════════════════ */
.chrome {
  position: sticky; top: 0; z-index: 50;
  background: var(--bg-overlay);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  backdrop-filter: blur(18px) saturate(140%);
  border-bottom: 1px solid var(--rule);
}

.chrome-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; padding: 14px var(--pad-x);
}

.brand {
  display: flex; align-items: center; gap: 13px;
  color: var(--fg-92); text-decoration: none;
  font-family: var(--mono); font-size: 10.5px;
  letter-spacing: .14em; text-transform: uppercase; font-weight: 500;
}

.seal {
  width: 25px; height: 25px; border-radius: 50%;
  border: 1px solid var(--fg-32);
  display: grid; place-items:center;
  font-family: var(--sans); font-weight: 500;
  font-size: 12px; color: var(--fg-92);
  transition: border-color var(--dur-base) var(--ease), color var(--dur-base) var(--ease);
}

.brand:hover .seal { border-color: var(--accent-dim); color: var(--accent-bright); }
.brand b { font-weight: 500; }

.nav {
  display: flex; gap: 2rem;
  font-family: var(--mono); font-size: 10.5px;
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--fg-46);
}

.nav a {
  color: var(--fg-46); transition: color var(--dur-fast) var(--ease);
}
.nav a:hover, .nav a.active { color: var(--fg-92); }

@media (max-width:620px){
  .nav { gap: 1rem; font-size: 9.5px; }
}

/* ═══════════════════════════════════════════
   OPENING (hero)
   ═══════════════════════════════════════════ */
.open {
  position: relative; isolation: isolate;
  min-height: calc(100vh - 54px);
  display: flex; flex-direction: column;
  padding: clamp(28px,4vh,48px) 0;
}

.open > .wrap { flex: 1; display: flex; flex-direction: column; }

/* aura · soft radial glow */
.aura {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(ellipse 56% 60% at 34% 44%, rgba(220,219,216,.075) 0%, transparent 58%),
    radial-gradient(ellipse 100% 58% at 50% -6%, rgba(220,219,216,.026) 0%, transparent 70%);
  animation: aura 16s var(--ease-io) infinite;
}
@keyframes aura { 0%,100%{ opacity:.55 } 50%{ opacity:1 } }

/* canvas particle field */
.hero-field {
  position: absolute; inset: 0; width: 100%; height: 100%;
  z-index: -1; pointer-events: none;
  -webkit-mask: linear-gradient(95deg, transparent 0%, rgba(0,0,0,.18) 28%, #000 60%, #000 100%);
  mask: linear-gradient(95deg, transparent 0%, rgba(0,0,0,.18) 28%, #000 60%, #000 100%);
}

/* open rule */
.open-rule {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding-bottom: 15px; border-bottom: 1px solid var(--rule);
  font-family: var(--mono); font-size: 10px;
  letter-spacing: .2em; text-transform: uppercase;
  color: var(--fg-32); margin-bottom: clamp(28px,4vh,44px);
}
.open-rule b { color: var(--fg-62); font-weight: 400; }

/* reactor wrap */
.reactor-wrap {
  margin: auto 0;
  display: flex; flex-direction: column;
  align-items: flex-start;
  gap: clamp(20px,3vh,34px);
  perspective: 800px;
}

/* reactor · SVG text mask with scrolling content */
.reactor {
  position: relative;
  width: min(86vw,1040px);
  aspect-ratio: 1200/240;
  overflow: hidden;
  -webkit-mask-size: contain; mask-size: contain;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-position: center; mask-position: center;
  transform-origin: center center;
}

.reactor::before {
  content: ""; position: absolute; inset: 0; z-index: 0;
  background: rgba(220,219,216,.06);
}

.reactor__scroll {
  position: absolute; left: 0; right: 0; top: 0;
  z-index: 1; will-change: transform;
}

.reactor__scroll .rw {
  font-family: var(--sans); white-space: nowrap; text-align: center;
  font-size: clamp(10px,0.95vw,14px); line-height: 1.5;
  color: var(--fg); letter-spacing: .02em;
}

.reactor__scroll .rw .d { color: var(--fg-32); }

/* The scroll fill only reads correctly inside the SVG text mask. Until JS
   confirms mask support and applies one, hide the reactor and show a plain
   headline instead — otherwise the fill renders as scattered words. */
.reactor:not(.is-masked) { display: none; }
.reactor.is-masked ~ .reactor-fallback { display: none; }
.reactor-fallback {
  font-family: var(--sans); font-weight: 800;
  font-size: clamp(56px,11vw,168px); letter-spacing: .04em;
  line-height: 1; margin: 0; color: var(--fg);
}

/* hero foot */
.hero-foot {
  display: flex; flex-direction: column;
  gap: 14px; align-items: flex-start;
}

.epi {
  display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap;
}

.epi__title {
  font-family: var(--sans); font-weight: 300;
  font-size: clamp(15px,1.4vw,20px);
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--fg-92);
}

.epi__gloss {
  font-family: var(--mono); font-size: 10px;
  letter-spacing: .04em; color: var(--fg-46);
}

.lead {
  font-family: var(--sans); font-weight: 300;
  font-size: clamp(20px,2.2vw,26px);
  line-height: 1.45; color: var(--fg-92);
  max-width: 24ch; letter-spacing: -.012em;
}

.hint {
  position: absolute; left: 0; bottom: clamp(24px,5vh,52px);
  font-family: var(--mono); font-size: 9.5px;
  letter-spacing: .2em; text-transform: uppercase;
  color: var(--fg-32);
  display: inline-flex; align-items: center; gap: 9px;
}

.hint .updown { animation: updown 2.6s var(--ease-io) infinite; }
@keyframes updown { 0%,100%{transform:translateY(-2px);opacity:.5} 50%{transform:translateY(2px);opacity:1} }

@media (max-width:680px){
  .hint { display: none; }
  .reactor { width: min(92vw,1040px); }
}

/* text-shadow warmth on big statements */
.lead { text-shadow: 0 0 40px rgba(220,219,216,.05); }

/* ═══════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 12px 22px; border-radius: var(--r-lg);
  font-family: var(--mono); font-weight: 500;
  font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase;
  cursor: pointer; text-decoration: none;
  border: 1px solid transparent;
  transition: all var(--dur-base) var(--ease);
  white-space: nowrap;
}

.btn::after {
  content: "→"; transition: transform var(--dur-base) var(--ease);
  font-size: .85em;
}

.btn:hover::after { transform: translateX(3px); }

.btn-primary {
  background: var(--accent); color: var(--bg);
}

.btn-primary:hover {
  background: var(--accent-bright);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px -12px rgba(220,219,216,.22);
}

.btn-ghost {
  border-color: var(--rule-strong);
  color: var(--fg-62); background: transparent;
}

.btn-ghost:hover {
  border-color: var(--fg-32);
  color: var(--fg-92);
  transform: translateY(-1px);
}

.cta-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 0.5rem; }

/* ═══════════════════════════════════════════
   SECTIONS
   ═══════════════════════════════════════════ */
.section {
  padding: clamp(44px,6vh,72px) 0;
  position: relative;
  border-bottom: 1px solid var(--rule);
}

.section::before {
  content: ""; position: absolute; top: 0; left: 50%;
  transform: translateX(-50%);
  width: min(440px,60vw); height: 1px;
  background: radial-gradient(ellipse, rgba(220,219,216,.10) 0%, transparent 70%);
  pointer-events: none;
}

.section-eyebrow {
  font-family: var(--mono); font-size: 12px;
  letter-spacing: .22em; text-transform: uppercase;
  color: var(--fg-62); margin-bottom: clamp(14px,2vh,22px);
  display: flex; align-items: center; gap: 14px;
}

.section-eyebrow::before {
  content: ""; width: 28px; height: 1px;
  background: var(--accent-dim);
}

/* ═══════════════════════════════════════════
   CARDS (bento-style surfaces)
   ═══════════════════════════════════════════ */
.card-grid {
  display: grid; gap: clamp(12px,1.1vw,18px);
  grid-template-columns: 1.5fr 1fr;
  grid-template-areas:
    "about signal"
    "about writing"
    "projects teaching";
}

.card {
  position: relative; overflow: hidden; cursor: pointer;
  background: var(--bg-surface);
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  padding: clamp(18px,1.8vw,28px);
  display: flex; flex-direction: column;
  justify-content: center; gap: 9px;
  text-decoration: none;
  transition: border-color var(--dur-base) var(--ease),
              transform var(--dur-base) var(--ease),
              background var(--dur-base) var(--ease),
              box-shadow var(--dur-base) var(--ease);
}

.card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--highlight-top), transparent);
}

.card:hover {
  border-color: var(--rule-mid);
  transform: translateY(-2px);
  background: var(--bg-raised);
  box-shadow: var(--shadow-md);
}

.card__head {
  display: flex; align-items: baseline;
  justify-content: space-between; gap: 12px;
}

.card__name {
  font-family: var(--sans); font-weight: 300;
  font-size: clamp(21px,1.7vw,28px);
  letter-spacing: -0.018em; color: var(--fg);
  transition: color var(--dur-fast) var(--ease);
}

.card:hover .card__name { color: var(--accent-bright); }

.card__kind {
  font-family: var(--mono); font-size: 9px;
  letter-spacing: .2em; text-transform: uppercase;
  color: var(--fg-32); white-space: nowrap;
}

.card__desc {
  font-size: 13px; line-height: 1.55;
  color: var(--fg-62); font-weight: 300;
}

.card__desc strong { color: var(--fg-78); font-weight: 400; }

.card__meta {
  padding-top: 12px; display: flex;
  align-items: baseline; gap: 12px;
  font-family: var(--mono); font-size: 9px;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--fg-32);
}

.card__meta b { color: var(--fg-78); font-weight: 400; }

.card__meta .go {
  margin-left: auto; color: var(--fg-46);
  white-space: nowrap;
  transition: color var(--dur-fast) var(--ease);
}

.card:hover .card__meta .go { color: var(--accent-bright); }

/* primary card (about) */
.card--primary {
  padding: clamp(26px,2.6vw,44px); gap: 12px;
  justify-content: flex-start; grid-area: about;
}

.card--primary .card__head {
  flex-direction: column; align-items: flex-start; gap: 12px;
}

.card--primary .card__name {
  font-size: clamp(32px,3vw,48px);
  font-weight: 200; letter-spacing: -0.028em;
}

.card--primary .card__desc {
  font-size: 14.5px; line-height: 1.6;
  color: var(--fg-78); max-width: 38ch; margin-top: 6px;
}

.card--primary .card__meta {
  margin-top: auto; font-size: 9.5px; flex-wrap: wrap;
}

.card--primary .card__meta .go { color: var(--accent); }

/* grid areas */
.card--primary { grid-area: about; }
.card:nth-child(2) { grid-area: signal; }
.card:nth-child(3) { grid-area: writing; }
.card:nth-child(4) { grid-area: projects; }
.card:nth-child(5) { grid-area: teaching; }

/* soon card */
.card--soon { opacity: .7; }
.card--soon .card__name { color: var(--fg-62); }
.card--soon .card__desc { color: var(--fg-46); }

/* animated border glow on primary card */
@property --g1{syntax:'<number>';initial-value:.05;inherits:false}
@property --g2{syntax:'<number>';initial-value:.30;inherits:false}
@property --g3{syntax:'<number>';initial-value:.05;inherits:false}
@property --g4{syntax:'<number>';initial-value:.28;inherits:false}
@property --g5{syntax:'<number>';initial-value:.05;inherits:false}
@property --g6{syntax:'<number>';initial-value:.26;inherits:false}
@property --g7{syntax:'<number>';initial-value:.05;inherits:false}
@property --g8{syntax:'<number>';initial-value:.24;inherits:false}

@keyframes gp1{0%,100%{--g1:.05}50%{--g1:.34}}
@keyframes gp2{0%,100%{--g2:.30}50%{--g2:.05}}
@keyframes gp3{0%,100%{--g3:.05}50%{--g3:.32}}
@keyframes gp4{0%,100%{--g4:.28}50%{--g4:.05}}
@keyframes gp5{0%,100%{--g5:.05}50%{--g5:.30}}
@keyframes gp6{0%,100%{--g6:.26}50%{--g6:.04}}
@keyframes gp7{0%,100%{--g7:.05}50%{--g7:.28}}
@keyframes gp8{0%,100%{--g8:.24}50%{--g8:.04}}

.card--primary { background: var(--bg-deep); }
.card--primary:hover { background: var(--bg-surface); }

.card--primary::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  padding: 1px; border-radius: inherit;
  background:
    radial-gradient(ellipse 45% 180% at 6% 0%, rgba(220,219,216,var(--g1)) 0%, transparent 64%),
    radial-gradient(ellipse 40% 180% at 30% 0%, rgba(220,219,216,var(--g2)) 0%, transparent 64%),
    radial-gradient(ellipse 45% 180% at 56% 0%, rgba(220,219,216,var(--g3)) 0%, transparent 64%),
    radial-gradient(ellipse 40% 180% at 82% 0%, rgba(220,219,216,var(--g4)) 0%, transparent 64%),
    radial-gradient(ellipse 45% 180% at 95% 100%, rgba(220,219,216,var(--g5)) 0%, transparent 64%),
    radial-gradient(ellipse 40% 180% at 68% 100%, rgba(220,219,216,var(--g6)) 0%, transparent 64%),
    radial-gradient(ellipse 45% 180% at 40% 100%, rgba(220,219,216,var(--g7)) 0%, transparent 64%),
    radial-gradient(ellipse 40% 180% at 14% 100%, rgba(220,219,216,var(--g8)) 0%, transparent 64%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  animation:
    gp1 5s ease-in-out infinite, gp2 7s ease-in-out infinite,
    gp3 9s ease-in-out infinite, gp4 11s ease-in-out infinite,
    gp5 13s ease-in-out infinite, gp6 8s ease-in-out infinite,
    gp7 6s ease-in-out infinite, gp8 10s ease-in-out infinite;
}

@media (max-width:768px){
  .card-grid {
    grid-template-columns: 1fr;
    grid-template-areas: "about" "signal" "writing" "projects" "teaching";
  }
  .card--primary { min-height: auto; }
}

/* ═══════════════════════════════════════════
   LATEST ITEMS
   ═══════════════════════════════════════════ */
.latest-list { display: flex; flex-direction: column; }

.latest-item {
  display: flex; align-items: baseline; gap: 1.25rem;
  padding: 1rem 0; border-bottom: 1px solid var(--rule);
  text-decoration: none; color: var(--fg-92);
  transition: color var(--dur-fast) var(--ease);
}

.latest-item:first-child { border-top: 1px solid var(--rule); }
.latest-item:hover { color: var(--accent-bright); }

.latest-item .date-col {
  font-family: var(--mono); font-size: .75rem;
  color: var(--fg-32); min-width: 80px; letter-spacing: .02em;
}

.latest-item .title-col {
  flex: 1; font-weight: 400; font-size: .9375rem;
  font-family: var(--body); line-height: 1.4;
}

.latest-item .badge-col {
  font-family: var(--mono); font-size: .625rem;
  padding: 2px 8px; border-radius: 3px;
  background: var(--accent-bg); color: var(--fg-46);
  text-transform: uppercase; letter-spacing: .06em;
  white-space: nowrap;
}

/* ═══════════════════════════════════════════
   LINKS
   ═══════════════════════════════════════════ */
.link-accent {
  color: var(--fg-62); font-weight: 500;
  font-family: var(--mono); font-size: 10.5px;
  letter-spacing: .12em; text-transform: uppercase;
  transition: color var(--dur-fast) var(--ease);
}
.link-accent:hover { color: var(--accent-bright); }

/* ═══════════════════════════════════════════
   CLOSING
   ═══════════════════════════════════════════ */
.closing {
  padding: clamp(44px,6vh,76px) 0;
  position: relative;
}

.closing::before {
  content: ""; position: absolute; top: 0; left: 50%;
  transform: translateX(-50%);
  width: min(440px,60vw); height: 1px;
  background: radial-gradient(ellipse, rgba(220,219,216,.10) 0%, transparent 70%);
  pointer-events: none;
}

.closing p {
  font-family: var(--sans); font-weight: 200;
  font-size: clamp(23px,2.7vw,33px);
  line-height: 1.42; letter-spacing: -0.02em;
  color: var(--fg-92); max-width: 18em;
  text-shadow: 0 0 40px rgba(220,219,216,.05);
}

.closing p.q { color: var(--fg); margin-top: 26px; }

.closing .note {
  font-family: var(--mono); font-size: 9.5px;
  color: var(--fg-32); letter-spacing: .16em;
  text-transform: uppercase; margin-top: 1rem;
  font-weight: 400; text-shadow: none;
}

/* ═══════════════════════════════════════════
   COLOPHON (footer)
   ═══════════════════════════════════════════ */
.colophon { border-top: 1px solid var(--rule); }

.colophon-inner {
  display: flex; align-items: center;
  justify-content: space-between; gap: 20px;
  flex-wrap: wrap; padding: 30px var(--pad-x);
  font-family: var(--mono); font-size: 10px;
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--fg-32);
}

.colophon-links { display: flex; gap: 1.5rem; }

.colophon-links a {
  color: var(--fg-46); transition: color var(--dur-fast) var(--ease);
}
.colophon-links a:hover { color: var(--accent-bright); }

/* ═══════════════════════════════════════════
   FOCUS + REDUCED MOTION
   ═══════════════════════════════════════════ */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px; border-radius: 2px;
}

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

/* ═══════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════ */
@media (max-width: 768px) {
  .card-grid {
    grid-template-columns: 1fr;
    grid-template-areas: "about" "signal" "writing" "projects" "teaching";
  }
  .card--primary { min-height: auto; }
  .latest-item { flex-wrap: wrap; gap: .5rem; }
  .latest-item .date-col { min-width: unset; }
  .cta-row { flex-direction: column; }
  .cta-row .btn { width: 100%; justify-content: center; }
}

@media (max-width: 480px) {
  .nav { gap: .75rem; font-size: 9px; }
  .wrap { padding: 0 22px; }
  .colophon-inner { flex-direction: column; align-items: flex-start; }
}

/* ═══════════════════════════════════════════
   CONTACT PAGE
   ═══════════════════════════════════════════ */
.contact-hero { padding-top: clamp(72px, 9vh, 120px); padding-bottom: clamp(32px, 4vh, 56px); border-bottom: 1px solid var(--rule); }

.contact-title {
  font-family: var(--display); font-weight: 400;
  font-size: clamp(48px, 7.4vw, 96px);
  line-height: 0.98; letter-spacing: -0.028em;
  color: var(--fg); margin: 14px 0 22px;
  font-variation-settings: "opsz" 144, "SOFT" 30, "WONK" 1;
}

.contact-lead {
  font-family: var(--display); font-weight: 300;
  font-size: clamp(18px, 1.9vw, 24px);
  color: var(--fg-78); max-width: 60ch;
  line-height: 1.45; font-style: italic;
  font-variation-settings: "opsz" 36, "SOFT" 60;
}

.contact-grid {
  display: grid; gap: clamp(36px, 4.5vw, 72px);
  grid-template-columns: 1fr 1.5fr;
  align-items: start;
}

@media (max-width: 860px) {
  .contact-grid { grid-template-columns: 1fr; gap: 36px; }
}

.contact-direct .section-eyebrow { margin-bottom: 18px; }

.contact-text {
  color: var(--fg-78); font-size: 15px;
  margin-bottom: 18px; font-weight: 300; line-height: 1.55;
}

.contact-email {
  font-family: var(--mono); font-size: 15px;
  letter-spacing: -0.005em; color: var(--fg);
  display: inline-block; padding: 12px 0;
  border-bottom: 1px solid var(--fg-32);
  transition: color var(--dur-base) var(--ease), border-color var(--dur-base) var(--ease);
}
.contact-email:hover { color: var(--accent-bright); border-color: var(--fg); }

.contact-note {
  color: var(--fg-46); font-size: 13px; line-height: 1.6;
  margin-top: 22px; max-width: 44ch; font-weight: 300;
}

.contact-form {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; gap: 18px;
  padding: clamp(20px, 2vw, 32px);
  background: var(--bg-surface);
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
}

.contact-form::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--highlight-top), transparent);
}

.contact-form .section-eyebrow { margin-bottom: 6px; }

.contact-form .field { display: flex; flex-direction: column; gap: 8px; }

.contact-form .field label {
  font-family: var(--mono); font-size: 10px;
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--fg-46);
}

.contact-form .field input,
.contact-form .field textarea {
  width: 100%;
  font-family: var(--body); font-size: 14.5px; line-height: 1.55;
  color: var(--fg); background: var(--bg-deep);
  border: 1px solid var(--rule-mid);
  border-radius: var(--r);
  padding: 12px 14px;
  outline: none;
  resize: vertical;
  transition: border-color var(--dur-fast) var(--ease),
              background var(--dur-fast) var(--ease),
              box-shadow var(--dur-fast) var(--ease);
}

.contact-form .field input::placeholder,
.contact-form .field textarea::placeholder { color: var(--fg-32); }

.contact-form .field input:focus,
.contact-form .field textarea:focus {
  border-color: var(--accent-dim);
  background: var(--bg-raised);
  box-shadow: 0 0 0 3px rgba(244, 243, 240, 0.06);
}

.contact-form .field textarea { min-height: 132px; }

.contact-form-actions {
  display: flex; align-items: center; gap: 18px;
  flex-wrap: wrap; margin-top: 6px;
}

.contact-form-meta {
  font-family: var(--mono); font-size: 10.5px;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--fg-32);
}

.contact-form-status {
  font-family: var(--mono); font-size: 11px;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--fg-32);
  min-height: 1.2em;
}
.contact-form-status.is-sending { color: var(--fg-62); }
.contact-form-status.is-ok      { color: var(--fg-92); }
.contact-form-status.is-err     { color: #e3725a; text-transform: none; letter-spacing: 0; font-family: var(--body); font-size: 13px; }

/* ═══════════════════════════════════════════
   LEGACY SHIM
   Maps old class names (.topbar/.container/.lede/
   .section-header/.card-link/.footer-*/etc.) to
   the new Mnemos tokens so the ~165 inner pages
   render until they're migrated to .chrome/.wrap.
   Safe to delete page-by-page as each is converted.
   ═══════════════════════════════════════════ */

/* Legacy design tokens → Mnemos tokens. Hundreds of article inline styles
   reference these names; without the aliases they silently resolve to
   nothing and article styling collapses. */
:root {
  --text: var(--fg);
  --text-1: var(--fg);
  --text-2: var(--fg-78);
  --text-3: var(--fg-62);
  --text-4: var(--fg-46);
  --muted: var(--fg-46);
  --border: var(--rule-mid);
  --border-subtle: var(--rule);
  --line: var(--rule-mid);
  --bg-elevated: var(--bg-raised);
  --bg-subtle: var(--bg-deep);
  --surface-2: var(--bg-surface);
  --radius: var(--r);
  --radius-sm: var(--r-sm);
  --radius-md: var(--r-lg);
  --font-mono: var(--mono);
  --danger: #e3725a;
}

/* topbar → chrome */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: var(--bg-overlay);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  backdrop-filter: blur(18px) saturate(140%);
  border-bottom: 1px solid var(--rule);
}
.topbar-inner {
  max-width: 1080px; margin: 0 auto;
  padding: 14px var(--pad-x);
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; min-height: 56px;
}
.topbar .brand {
  font-family: var(--display); font-size: 1.1rem; font-weight: 500;
  letter-spacing: -0.02em; color: var(--fg);
  text-transform: none;
}
.topbar .nav {
  font-family: var(--sans); font-size: 13px;
  letter-spacing: 0.02em; text-transform: none;
  gap: 1.75rem;
}
.topbar .nav a { color: var(--fg-46); }
.topbar .nav a:hover, .topbar .nav a.active { color: var(--fg); }

/* container → wrap */
.container { max-width: 1080px; margin: 0 auto; padding: 0 var(--pad-x); }
.topbar-inner.container { padding: 14px var(--pad-x); }

/* eyebrow (legacy variant — accent line prefix) */
.eyebrow {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-62);
  margin-bottom: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.eyebrow::before {
  content: ""; width: 18px; height: 1px;
  background: var(--accent-dim); display: inline-block;
}

/* lede */
.lede {
  font-family: var(--display); font-weight: 300;
  font-size: clamp(17px, 1.6vw, 22px);
  color: var(--fg-78); max-width: 60ch;
  line-height: 1.5; font-style: italic;
  font-variation-settings: "opsz" 36, "SOFT" 40;
}
.lede strong { color: var(--fg); font-weight: 500; font-style: normal; }

/* section-header */
.section-header { margin-bottom: clamp(24px, 3.5vh, 40px); }
.section-header .eyebrow { margin-bottom: 0.75rem; }
.section-header h2 {
  font-family: var(--display); font-weight: 400;
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1.05; letter-spacing: -0.02em;
  color: var(--fg); margin-bottom: 0.75rem;
  font-variation-settings: "opsz" 144, "SOFT" 30;
}
.section-header h2 em {
  font-style: italic; color: var(--fg);
  font-variation-settings: "opsz" 144, "SOFT" 80, "WONK" 1;
}
.section-header p { color: var(--fg-78); }

/* Inner-page hero (NOT the homepage .open) */
.topbar + main > .hero,
main > section.hero {
  padding: clamp(72px, 9vh, 120px) 0 clamp(40px, 5vh, 80px);
  position: relative;
}
.topbar + main > .hero h1,
main > section.hero h1 {
  font-family: var(--display); font-weight: 400;
  font-size: clamp(40px, 6vw, 72px);
  line-height: 1.02; letter-spacing: -0.025em;
  color: var(--fg); margin-bottom: 1rem;
  font-variation-settings: "opsz" 144, "SOFT" 30, "WONK" 1;
}
.topbar + main > .hero h1 em,
main > section.hero h1 em {
  font-style: italic;
  font-variation-settings: "opsz" 144, "SOFT" 80;
}

/* Legacy card-grid (old markup with .card > h3 + p + .card-link) */
.section .container > .card-grid,
.container > .card-grid {
  background: var(--rule);
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  overflow: hidden;
  grid-template-areas: none;
  gap: 1px;
}

/* Legacy card body (no .card__head BEM children) */
.card > h3 {
  font-family: var(--display); font-size: 1.25rem;
  font-weight: 400; letter-spacing: -0.015em;
  margin-bottom: 0.6rem; color: var(--fg);
  font-variation-settings: "opsz" 60;
}
.card > p, .card > p strong {
  color: var(--fg-62); font-size: 14.5px;
  line-height: 1.6; flex: 1;
}
.card > p strong { color: var(--fg-78); font-weight: 500; }
.card > .card-link {
  margin-top: 1.25rem;
  font-family: var(--mono); font-size: 10.5px;
  color: var(--fg-46); letter-spacing: 0.14em;
  text-transform: uppercase;
}
.card:hover > .card-link { color: var(--fg); }

/* Footer (legacy) */
.footer {
  padding: 3rem 0;
  border-top: 1px solid var(--rule);
  background: var(--bg-deep);
  margin-top: clamp(48px, 6vh, 96px);
}
.footer-inner {
  max-width: 1080px; margin: 0 auto;
  padding: 0 var(--pad-x);
  display: flex; justify-content: space-between;
  align-items: center; flex-wrap: wrap; gap: 1rem;
}
.footer-copy {
  color: var(--fg-32);
  font-family: var(--mono); font-size: 11px;
  letter-spacing: 0.12em; text-transform: uppercase;
}
.footer-links {
  display: flex; gap: 1.5rem;
  font-family: var(--mono); font-size: 10.5px;
  letter-spacing: 0.16em; text-transform: uppercase;
}
.footer-links a {
  color: var(--fg-46);
  transition: color var(--dur-fast) var(--ease);
}
.footer-links a:hover { color: var(--fg); }

/* Stats row */
.stats-row {
  display: flex; margin: 3rem 0;
  border: 1px solid var(--rule);
  border-radius: var(--r); overflow: hidden;
}
.stat-cell {
  flex: 1; text-align: center;
  padding: 1.25rem 1rem;
  border-right: 1px solid var(--rule);
}
.stat-cell:last-child { border-right: none; }
.stat-number {
  font-family: var(--display); font-size: 2rem;
  font-weight: 400; color: var(--fg); line-height: 1;
  margin-bottom: 0.35rem;
}
.stat-label {
  font-family: var(--mono); font-size: 10px;
  color: var(--fg-46); text-transform: uppercase;
  letter-spacing: 0.16em;
}

/* Timeline */
.timeline { margin-top: 2rem; }
.timeline-item {
  display: flex; gap: 1.5rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--rule);
}
.timeline-item:last-child { border-bottom: none; }
.timeline-year {
  font-family: var(--mono); font-size: 11px;
  color: var(--fg-46); min-width: 80px;
  letter-spacing: 0.08em;
}
.timeline-content h3 {
  font-size: 0.95rem; font-weight: 500;
  color: var(--fg); margin-bottom: 0.1rem;
}
.timeline-content p {
  color: var(--fg-62); font-size: 14px; line-height: 1.55;
}

/* Archive list (index pages) */
.archive-list { display: flex; flex-direction: column; }
.archive-item {
  display: flex; align-items: baseline; gap: 1.25rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--rule);
  color: var(--fg); text-decoration: none;
  transition: color var(--dur-fast) var(--ease);
}
.archive-item:first-child { border-top: 1px solid var(--rule); }
.archive-item:hover { color: var(--accent-bright); }
.archive-item .date {
  font-family: var(--mono); font-size: 11px;
  color: var(--fg-46); min-width: 100px;
  letter-spacing: 0.08em;
}
.archive-item .title { flex: 1; font-size: 14.5px; }
.archive-item .type-badge {
  font-family: var(--mono); font-size: 9.5px;
  padding: 2px 8px; border-radius: 3px;
  background: rgba(244,243,240,.06);
  color: var(--fg-78);
  text-transform: uppercase; letter-spacing: 0.14em;
}

/* Signup block (legacy) */
.signup-block {
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  padding: 2.5rem; text-align: center;
  background: var(--bg-surface);
  position: relative; overflow: hidden;
}
.signup-block::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--highlight-top), transparent);
}
.signup-block h3 {
  font-family: var(--display); font-size: 1.5rem;
  font-weight: 400; margin-bottom: 0.5rem; color: var(--fg);
}
.signup-block p {
  color: var(--fg-78); max-width: 480px;
  margin: 0 auto 1.25rem;
  font-size: 14.5px; line-height: 1.6;
}
.signup-block .note {
  color: var(--fg-32);
  font-family: var(--mono); font-size: 10px;
  margin-top: 1rem;
  letter-spacing: 0.14em; text-transform: uppercase;
}

/* Quote block (article body) */
.quote-block {
  border-left: 2px solid var(--accent-dim);
  padding: 0.5rem 0 0.5rem 1.5rem;
  margin: 2rem 0;
}
.quote-block p {
  color: var(--fg-78);
  font-family: var(--display); font-size: 1.1rem;
  font-style: italic; line-height: 1.5;
}
.quote-block cite {
  display: block; margin-top: 0.5rem;
  font-family: var(--mono); font-size: 10px;
  font-style: normal; color: var(--fg-46);
  letter-spacing: 0.14em; text-transform: uppercase;
}

/* Project grid (kidstuff and similar) */
.project-grid {
  display: grid; gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.project-grid.two-col { grid-template-columns: repeat(2, 1fr); }
.project-card {
  background: var(--bg-surface); padding: 1.75rem;
  display: flex; flex-direction: column; gap: 0.65rem;
  color: var(--fg); text-decoration: none;
  transition: background var(--dur-base) var(--ease);
}
.project-card:hover { background: var(--bg-raised); }
.project-card .project-eyebrow {
  font-family: var(--mono); font-size: 10px;
  color: var(--fg-46); letter-spacing: 0.16em; text-transform: uppercase;
}
.project-card h3 {
  font-family: var(--display); font-size: 1.15rem;
  font-weight: 400; letter-spacing: -0.015em; color: var(--fg);
}
.project-card p {
  color: var(--fg-62); font-size: 14px;
  line-height: 1.6; flex: 1;
}
.project-card .project-link {
  font-family: var(--mono); font-size: 10.5px;
  color: var(--fg-46);
  letter-spacing: 0.14em; text-transform: uppercase;
}
.project-card:hover .project-link { color: var(--fg); }

/* Article page (legacy markup, before chapbook.css migration) */
.article-page > .container {
  padding-top: clamp(60px, 8vh, 100px);
  padding-bottom: clamp(60px, 8vh, 100px);
  max-width: 720px;
}
.article-page .article-header { margin-bottom: 3rem; padding-bottom: 0; border-bottom: none; }
.article-page .article-eyebrow {
  font-family: var(--mono); font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.16em;
  color: var(--fg-46); margin-bottom: 1rem;
}
.article-page .article-title {
  font-family: var(--display); font-weight: 400;
  font-size: clamp(36px, 4.5vw, 56px);
  line-height: 1.05; letter-spacing: -0.025em;
  color: var(--fg); margin-bottom: 1.25rem;
  font-variation-settings: "opsz" 144, "SOFT" 40, "WONK" 1;
}
.article-page .article-meta-row {
  display: flex; gap: 1.5rem;
  font-family: var(--mono); font-size: 11px;
  color: var(--fg-46);
  text-transform: uppercase; letter-spacing: 0.14em;
}
.article-content {
  font-family: var(--display); font-size: 18px;
  line-height: 1.6; color: var(--fg);
  font-variation-settings: "opsz" 36;
}
.article-content p { margin: 0 0 1.2em; }
.article-content h2 {
  font-family: var(--display); font-weight: 400;
  font-style: italic; font-size: 1.5rem;
  margin: 2.5em 0 0.5em; color: var(--fg);
  font-variation-settings: "opsz" 36, "SOFT" 60;
}
.article-content h3 {
  font-family: var(--display); font-weight: 500;
  font-size: 1.15rem; margin: 2em 0 0.5em; color: var(--fg);
}
.article-content ul,
.article-content ol { margin: 1em 0 1.4em 1.4em; padding: 0; }
.article-content li { margin-bottom: 0.5em; }
.article-content a {
  color: var(--fg);
  text-decoration: underline;
  text-decoration-color: var(--accent-dim);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}
.article-content a:hover { color: var(--accent-bright); }
.article-page .lead {
  font-size: 1.2rem; line-height: 1.55;
  color: var(--fg); margin-bottom: 1.5em;
  font-variation-settings: "opsz" 36, "SOFT" 30;
}
.article-content strong,
.article-content b { color: var(--fg); font-weight: 500; }
.article-content em,
.article-content i {
  font-style: italic;
  font-variation-settings: "opsz" 36, "SOFT" 70;
}
.article-content code {
  font-family: var(--mono); font-size: 0.88em;
  background: rgba(244,243,240,.05);
  padding: 0.08em 0.32em; border-radius: 3px;
}
.article-content pre {
  font-family: var(--mono); font-size: 0.82rem;
  background: var(--bg-deep);
  border: 1px solid var(--rule);
  border-radius: var(--r-sm);
  padding: 1.25em 1.4em;
  overflow-x: auto; margin: 1.5em 0;
}
.article-page .article-cta {
  margin-top: 3rem; padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  color: var(--fg-62); font-size: 14px;
}

/* Unwrapped article markup (no .article-page / .container ancestor) —
   used by Signal bulletins and most feature articles. */
.article-content {
  max-width: 720px; margin: 0 auto;
  padding-left: var(--pad-x); padding-right: var(--pad-x);
}
.article-content h1 {
  font-family: var(--display); font-weight: 400;
  font-size: clamp(32px, 4vw, 48px);
  line-height: 1.08; letter-spacing: -0.02em;
  color: var(--fg); margin: 0 0 1rem;
  font-variation-settings: "opsz" 144, "SOFT" 40, "WONK" 1;
}
.article-head { margin-bottom: 2.5rem; }
.article-head .article-meta {
  display: flex; gap: 1.25rem; margin-bottom: 1.25rem;
  font-family: var(--mono); font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.14em;
}
.article-tag { color: var(--fg-62); }
.article-date { color: var(--fg-46); }
.article-content .lead {
  font-size: 1.2rem; line-height: 1.55;
  color: var(--fg-78); max-width: none;
}

/* Story cards + labels for pages without their own inline styles */
.story-card {
  background: var(--bg-raised);
  border: 1px solid var(--rule);
  padding: 1.5rem; border-radius: var(--r-lg);
  margin: 1.5rem 0;
}
.story-card h3 { margin-top: 0; }
.trending { color: var(--accent-bright); font-weight: 600; }
.editorial-label {
  background: var(--accent-bg); color: var(--accent-bright);
  padding: 4px 10px; border-radius: 4px;
  font-size: 11px; font-weight: 600; font-family: var(--mono);
  display: inline-block;
}

/* Responsive (legacy) */
@media (max-width: 600px) {
  .topbar-inner { padding: 12px var(--pad-x); min-height: 48px; }
  .topbar .nav { gap: 1rem; }
  .stats-row { flex-direction: column; }
  .stat-cell { border-right: none; border-bottom: 1px solid var(--rule); }
  .stat-cell:last-child { border-bottom: none; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
  .archive-item { flex-wrap: wrap; }
  .archive-item .date { min-width: 0; }
  .project-grid.two-col { grid-template-columns: 1fr; }
}
