/* ==========================================================================
   Lithastra — design system
   Brand: clean & technical blueprint. IBM Plex Sans + IBM Plex Mono.

   Layers:
   1. Tokens        — color, type, space, radius, elevation, motion
   2. Base          — reset, typography, focus
   3. Components    — buttons, cards, tags, nav, code, tables, callouts
   4. Page sections — hero, sections, article, footer
   5. Motion        — reveals, reduced-motion overrides
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. TOKENS
   -------------------------------------------------------------------------- */

:root {
  /* Color — brand */
  --ink: #0E2A4E;            /* ink navy (headings, strong text) */
  --blue: #2563EB;           /* primary action */
  --blue-hover: #1D4FC4;
  --blue-soft: #5B8DEF;
  --blue-line: #AFC8EE;
  --star: #FFC24B;           /* warm accent — the "astra" */
  --star-hover: #FFCF6E;
  --star-soft: #FFE3A8;
  --paper: #F3F7FC;          /* blueprint paper surface */
  --paper-line: #D9E6F6;
  --navy-deep: #0A1E3A;      /* dark surface */
  --navy-deep-2: #14365F;

  /* Color — semantic */
  --text: #1F2D40;
  --text-muted: #51627B;     /* 4.9:1 on white */
  --text-on-dark: #C7D8F0;
  --text-on-dark-muted: #93ABCC;  /* 4.6:1 on navy-deep */
  --text-on-dark-strong: #FFFFFF; /* headings/strong text on dark surfaces */
  --code-text: #DCE8FA;           /* code/pre text on navy-deep */
  --surface: #FFFFFF;
  --focus: var(--blue);

  /* Type scale (fluid) */
  --fs-display: clamp(2.2rem, 5vw, 3.4rem);
  --fs-h1: clamp(1.8rem, 3.6vw, 2.4rem);
  --fs-h2: clamp(1.55rem, 3vw, 2.05rem);
  --fs-h3: 1.3rem;
  --fs-h4: 1.12rem;
  --fs-body: 1.0625rem;      /* 17px */
  --fs-small: 0.95rem;
  --fs-caption: 0.85rem;
  --fs-micro: 0.78rem;
  --lh-tight: 1.15;
  --lh-heading: 1.3;
  --lh-body: 1.65;

  /* Space scale */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.5rem;
  --sp-6: 2rem;
  --sp-7: 3rem;
  --sp-8: 4.5rem;
  --sp-9: 6rem;

  /* Radius */
  --r-sm: 6px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-pill: 999px;

  /* Elevation */
  --shadow-1: 0 1px 3px rgba(14, 42, 78, 0.07);
  --shadow-2: 0 6px 20px rgba(14, 42, 78, 0.10);
  --shadow-3: 0 16px 44px rgba(14, 42, 78, 0.14);
  --glow-star: 0 6px 22px rgba(255, 194, 75, 0.40);
  --glow-blue: 0 6px 20px rgba(37, 99, 235, 0.32);

  /* Motion */
  --dur-1: 140ms;
  --dur-2: 260ms;
  --dur-3: 520ms;
  --ease: cubic-bezier(0.2, 0.7, 0.3, 1);

  /* Layout */
  --maxw: 1080px;
  --header-h: 64px;

  /* Families */
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

/* --------------------------------------------------------------------------
   2. BASE
   -------------------------------------------------------------------------- */

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 1rem); }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--text);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { max-width: 100%; height: auto; }

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

::selection { background: var(--star-soft); color: var(--ink); }

/* Single, consistent focus treatment everywhere */
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}
.on-dark, .hero, .support, .site-footer { --focus: var(--star); }

code, pre, kbd { font-family: var(--mono); font-size: 0.88em; }

code {
  background: var(--paper);
  border: 1px solid var(--paper-line);
  border-radius: 4px;
  padding: 0.12em 0.38em;
  color: var(--ink);
  overflow-wrap: anywhere;
}

pre {
  position: relative;
  background: var(--navy-deep);
  color: var(--code-text);
  border: 1px solid rgba(175, 200, 238, 0.18);
  border-radius: var(--r-md);
  padding: 1.1rem 1.3rem;
  padding-top: 1.7rem;
  overflow-x: auto;
  line-height: 1.55;
  box-shadow: var(--shadow-1);
}

/* terminal dots — quiet affordance that this is a shell block */
pre::before {
  content: "";
  position: absolute;
  top: 0.7rem;
  left: 1.1rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--star);
  box-shadow: 14px 0 0 var(--blue-soft), 28px 0 0 rgba(175, 200, 238, 0.55);
  opacity: 0.85;
}

pre code { background: none; border: none; padding: 0; color: inherit; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--sp-5); }

.skip-link {
  position: absolute;
  left: -9999px;
  background: var(--ink);
  color: var(--text-on-dark-strong);
  padding: 0.6rem 1rem;
  z-index: 100;
  border-radius: var(--r-sm);
}
.skip-link:focus { left: var(--sp-2); top: var(--sp-2); }

/* Utility text colors (replaces inline styles) */
.t-ink { color: var(--ink); }
.t-blue { color: var(--blue); }

/* --------------------------------------------------------------------------
   3. COMPONENTS
   -------------------------------------------------------------------------- */

/* ---- Buttons -------------------------------------------------------------
   Variants: primary / ghost / ghost-dark / star.
   States: default, hover (lift), active (press), focus-visible (ring).     */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  border-radius: 10px;
  padding: 0.6rem 1.15rem;
  font-weight: 600;
  font-size: var(--fs-small);
  line-height: 1.3;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition:
    transform var(--dur-1) var(--ease),
    box-shadow var(--dur-2) var(--ease),
    background-color var(--dur-1) var(--ease),
    border-color var(--dur-1) var(--ease);
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(0.98); box-shadow: none; }

.btn-primary { background: var(--blue); color: var(--text-on-dark-strong); }
.btn-primary:hover { background: var(--blue-hover); box-shadow: var(--glow-blue); }

.btn-ghost { border-color: var(--paper-line); color: var(--ink); background: var(--surface); }
.btn-ghost:hover { border-color: var(--blue-line); background: var(--paper); }

.btn-ghost-dark { border-color: rgba(175, 200, 238, 0.45); color: var(--text-on-dark); background: transparent; }
.btn-ghost-dark:hover { border-color: var(--star); color: var(--star-soft); }

.btn-star { background: var(--star); color: var(--navy-deep); }
.btn-star:hover { background: var(--star-hover); box-shadow: var(--glow-star); }

/* ---- Tags ---------------------------------------------------------------- */

.tag {
  display: inline-block;
  background: var(--paper);
  border: 1px solid var(--paper-line);
  color: var(--ink);
  border-radius: var(--r-pill);
  font-family: var(--mono);
  font-size: 0.72rem;
  padding: 0.18rem 0.68rem;
  margin: 0 0.25rem 0.3rem 0;
  transition: border-color var(--dur-1) var(--ease), background-color var(--dur-1) var(--ease);
}
.tag:hover { border-color: var(--blue-line); background: var(--surface); }

/* ---- Kicker / eyebrow ----------------------------------------------------- */

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  font-family: var(--mono);
  font-size: var(--fs-micro);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--blue);
  margin: 0 0 var(--sp-2);
}
.kicker::before {
  content: "";
  width: 1.6em;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--star), var(--blue));
}

/* ---- Header / nav ---------------------------------------------------------
   Sticky, blurred. Collapses to a toggle drawer below 820px (JS-enhanced;
   without JS the nav simply wraps — no content is lost).                   */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--paper-line);
  transition: box-shadow var(--dur-2) var(--ease);
}
.site-header.scrolled { box-shadow: var(--shadow-2); }

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header-h);
  gap: var(--sp-4);
  flex-wrap: wrap;
  padding-top: var(--sp-2);
  padding-bottom: var(--sp-2);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 600;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
}
.brand:hover { text-decoration: none; }
.brand img { width: 30px; height: 34px; transition: transform var(--dur-2) var(--ease); }
.brand:hover img { transform: rotate(-6deg) scale(1.06); }
.brand .lith { color: var(--ink); }
.brand .astra { color: var(--blue); }

.site-nav { display: flex; align-items: center; gap: var(--sp-5); flex-wrap: wrap; }

.site-nav > a:not(.btn) {
  position: relative;
  color: var(--ink);
  font-size: var(--fs-small);
  font-weight: 500;
  padding: 0.35rem 0;
}
.site-nav > a:not(.btn):hover { color: var(--blue); text-decoration: none; }
.site-nav > a:not(.btn)::after {
  content: "";
  position: absolute;
  left: 0; right: 100%; bottom: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--blue);
  transition: right var(--dur-2) var(--ease);
}
.site-nav > a:not(.btn):hover::after { right: 0; }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 10px;
  background: none;
  border: 1.5px solid var(--paper-line);
  border-radius: var(--r-sm);
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  height: 2px;
  border-radius: 2px;
  background: var(--ink);
  transition: transform var(--dur-2) var(--ease), opacity var(--dur-1) var(--ease);
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 820px) {
  .js .nav-toggle { display: flex; }
  .js .site-nav {
    display: none;
    flex-basis: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: var(--sp-2);
    padding: var(--sp-3) 0 var(--sp-4);
    border-top: 1px solid var(--paper-line);
  }
  .js .site-nav.open { display: flex; }
  .js .site-nav > a { padding: 0.55rem 0.25rem; font-size: 1.05rem; }
  .js .site-nav .btn { justify-content: center; }
}

/* ---- Cards ----------------------------------------------------------------
   project-card: top accent sweeps in on hover. article-card: arrow nudges. */

.project-card,
.article-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--paper-line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-1);
  transition:
    box-shadow var(--dur-2) var(--ease),
    transform var(--dur-2) var(--ease),
    border-color var(--dur-2) var(--ease);
  overflow: hidden;
}
.project-card:hover,
.article-card:hover,
.project-card:focus-within,
.article-card:focus-within {
  box-shadow: var(--shadow-3);
  transform: translateY(-3px);
  border-color: var(--blue-line);
}

.project-card::before,
.article-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--blue), var(--star));
  transition: right var(--dur-3) var(--ease);
}
.project-card:hover::before,
.article-card:hover::before,
.project-card:focus-within::before,
.article-card:focus-within::before { right: 0; }

.project-card {
  padding: var(--sp-6);
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.project-card .proj-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: var(--r-md);
  background: var(--paper);
  border: 1px solid var(--paper-line);
  margin-bottom: var(--sp-1);
}

.project-card .proj-meta {
  font-family: var(--mono);
  font-size: var(--fs-micro);
  color: var(--text-muted);
  display: flex;
  gap: 0.9rem;
  flex-wrap: wrap;
}
.project-card .proj-meta .ver { color: var(--blue); }

.project-card h3 { margin: 0; font-size: var(--fs-h3); color: var(--ink); letter-spacing: -0.01em; }
.project-card h3 a { color: inherit; }
.project-card .one-liner { color: var(--blue); font-weight: 500; margin: 0; }
.project-card p { margin: 0; }

.project-card ul { margin: 0; padding-left: 1.2rem; }
.project-card li { margin-bottom: 0.4rem; padding-left: 0.15rem; }
.project-card li::marker { color: var(--star); content: "✦ "; font-size: 0.8em; }

.proj-links { margin-top: auto; padding-top: var(--sp-3); display: flex; gap: 0.7rem; flex-wrap: wrap; }

.article-card { padding: var(--sp-5); display: flex; flex-direction: column; gap: 0.6rem; }

.article-card .art-meta {
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--blue);
}

.article-card h3 { margin: 0; font-size: var(--fs-h4); line-height: 1.4; color: var(--ink); }
.article-card h3 a { color: inherit; }
.article-card h3 a:hover { color: var(--blue); text-decoration: none; }
.article-card p { margin: 0; color: var(--text-muted); font-size: var(--fs-small); }

.article-card .read-more {
  font-weight: 600;
  font-size: 0.92rem;
  margin-top: auto;
  padding-top: var(--sp-2);
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
}
.article-card .read-more::after { content: "→"; transition: transform var(--dur-2) var(--ease); }
.article-card:hover .read-more::after { transform: translateX(4px); }

/* ---- Tables --------------------------------------------------------------- */

.prose table, .data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 0 0 1.3rem;
  font-size: var(--fs-small);
  border: 1px solid var(--paper-line);
  border-radius: var(--r-md);
  overflow: hidden;
  box-shadow: var(--shadow-1);
}
.prose th, .prose td { padding: 0.6rem 0.9rem; text-align: left; border-bottom: 1px solid var(--paper-line); }
.prose tr:last-child td { border-bottom: none; }
.prose th {
  background: var(--ink);
  color: var(--text-on-dark-strong);
  font-family: var(--mono);
  font-size: var(--fs-micro);
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.prose tbody tr:nth-child(even) { background: var(--paper); }

/* ---- Callout --------------------------------------------------------------- */

.callout {
  background: var(--paper);
  border: 1px solid var(--paper-line);
  border-left: 4px solid var(--star);
  border-radius: var(--r-md);
  padding: 1.1rem 1.3rem;
  margin: 0 0 1.3rem;
  box-shadow: var(--shadow-1);
}
.callout p:last-child { margin-bottom: 0; }

/* ---- Reading progress (article pages) -------------------------------------- */

.progress-track {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 3px;
  z-index: 60;
  pointer-events: none;
}
.progress-track .bar {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--blue), var(--star));
}

/* --------------------------------------------------------------------------
   4. PAGE SECTIONS
   -------------------------------------------------------------------------- */

/* ---- Hero ------------------------------------------------------------------ */

.hero {
  background:
    radial-gradient(1100px 520px at 78% -12%, var(--navy-deep-2) 0%, var(--navy-deep) 62%);
  color: var(--text-on-dark-strong);
  padding: var(--sp-9) 0 var(--sp-8);
  position: relative;
  overflow: hidden;
}

/* blueprint grid */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(175, 200, 238, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(175, 200, 238, 0.07) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(120% 100% at 50% 0%, black 55%, transparent 100%);
  -webkit-mask-image: radial-gradient(120% 100% at 50% 0%, black 55%, transparent 100%);
  pointer-events: none;
}

.hero .container {
  position: relative;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: var(--sp-7);
  align-items: center;
}

.hero .tagline {
  font-family: var(--mono);
  font-size: var(--fs-caption);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--blue-line);
  margin: 0 0 var(--sp-4);
  display: inline-flex;
  align-items: center;
  gap: 0.7em;
}
.hero .tagline::before { content: "✦"; color: var(--star); }

.hero h1 {
  font-size: var(--fs-display);
  line-height: var(--lh-tight);
  margin: 0 0 var(--sp-4);
  letter-spacing: -0.02em;
  font-weight: 650;
  text-wrap: balance;
}
.hero h1 .accent { color: var(--star); }

.hero p.lede {
  font-size: 1.15rem;
  color: var(--text-on-dark);
  margin: 0 0 var(--sp-6);
  max-width: 34em;
}

.hero-cta { display: flex; gap: 0.9rem; flex-wrap: wrap; }

/* hero constellation art */
.hero-art { position: relative; }
.hero-art svg { width: 100%; max-width: 420px; display: block; margin: 0 auto; }

.hero-art .edge {
  stroke: var(--blue-line);
  stroke-width: 1.6;
  stroke-linecap: round;
  opacity: 0.55;
  stroke-dasharray: 220;
  stroke-dashoffset: 220;
  animation: draw-edge var(--dur-3) var(--ease) forwards;
}
.hero-art .edge:nth-of-type(2) { animation-delay: 120ms; }
.hero-art .edge:nth-of-type(3) { animation-delay: 240ms; }
.hero-art .edge:nth-of-type(4) { animation-delay: 360ms; }
.hero-art .edge:nth-of-type(5) { animation-delay: 480ms; }
.hero-art .edge:nth-of-type(6) { animation-delay: 600ms; }
.hero-art .edge:nth-of-type(7) { animation-delay: 720ms; }
.hero-art .edge:nth-of-type(8) { animation-delay: 840ms; }

.hero-art .node { opacity: 0; animation: pop-node var(--dur-2) var(--ease) forwards; }
.hero-art .node:nth-of-type(1) { animation-delay: 200ms; }
.hero-art .node:nth-of-type(2) { animation-delay: 320ms; }
.hero-art .node:nth-of-type(3) { animation-delay: 440ms; }
.hero-art .node:nth-of-type(4) { animation-delay: 560ms; }
.hero-art .node:nth-of-type(5) { animation-delay: 680ms; }
.hero-art .node:nth-of-type(6) { animation-delay: 800ms; }

.hero-art .star-main { transform-origin: center; transform-box: fill-box; animation: twinkle 3.6s ease-in-out 1s infinite; }
.hero-art .star-halo { transform-origin: center; transform-box: fill-box; animation: halo 3.6s ease-in-out 1s infinite; }
.hero-art .dust { animation: twinkle 4.8s ease-in-out infinite; }
.hero-art .dust.d2 { animation-delay: 1.2s; }
.hero-art .dust.d3 { animation-delay: 2.4s; }

@keyframes draw-edge { to { stroke-dashoffset: 0; } }
@keyframes pop-node { from { opacity: 0; transform: scale(0.4); } to { opacity: 1; transform: scale(1); } }
@keyframes twinkle { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.72; transform: scale(0.93); } }
@keyframes halo { 0%, 100% { opacity: 0.16; transform: scale(1); } 50% { opacity: 0.3; transform: scale(1.15); } }

/* ---- 404 (reuses .hero, centered single column) ----------------------------- */

.hero.notfound { display: flex; align-items: center; min-height: 70vh; }
.hero.notfound .container { grid-template-columns: 1fr; text-align: center; justify-items: center; }
.hero.notfound .code {
  font-family: var(--mono);
  font-size: clamp(3.5rem, 13vw, 7rem);
  line-height: 1;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--star);
  margin: 0 0 var(--sp-4);
}
.hero.notfound .tagline { justify-content: center; }
.hero.notfound .hero-cta { justify-content: center; }

/* ---- Generic sections -------------------------------------------------------- */

.section { padding: var(--sp-8) 0; }
.section.alt {
  background: var(--paper);
  border-top: 1px solid var(--paper-line);
  border-bottom: 1px solid var(--paper-line);
}

.section-head { max-width: 46em; margin-bottom: var(--sp-7); }

.section h2 {
  font-size: var(--fs-h2);
  line-height: var(--lh-heading);
  color: var(--ink);
  margin: 0 0 0.7rem;
  letter-spacing: -0.015em;
  text-wrap: balance;
}
.section-head p { color: var(--text-muted); margin: 0; }

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: var(--sp-5);
}

.article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--sp-5);
}

/* ---- Support strip -------------------------------------------------------- */

.support {
  position: relative;
  background:
    radial-gradient(640px 300px at 88% 0%, var(--navy-deep-2) 0%, var(--navy-deep) 70%);
  color: var(--text-on-dark-strong);
  border-radius: var(--r-lg);
  padding: var(--sp-7) var(--sp-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-6);
  flex-wrap: wrap;
  overflow: hidden;
  box-shadow: var(--shadow-2);
}
.support::before {
  content: "✦";
  position: absolute;
  top: -0.4em;
  right: 0.4em;
  font-size: 7rem;
  color: var(--star);
  opacity: 0.12;
  pointer-events: none;
}
.support h2 { color: var(--text-on-dark-strong); margin: 0 0 0.4rem; font-size: 1.5rem; }
.support p { margin: 0; color: var(--text-on-dark); max-width: 38em; }

/* ---- Article pages --------------------------------------------------------- */

.article-hero {
  background:
    linear-gradient(180deg, var(--paper) 0%, var(--surface) 100%);
  border-bottom: 1px solid var(--paper-line);
  padding: var(--sp-7) 0 var(--sp-6);
  position: relative;
  overflow: hidden;
}
.article-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--paper-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--paper-line) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: 0.45;
  mask-image: radial-gradient(90% 120% at 20% 0%, black 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(90% 120% at 20% 0%, black 30%, transparent 80%);
  pointer-events: none;
}
.article-hero .container { position: relative; }

.breadcrumbs {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: var(--sp-4);
}
.breadcrumbs a { color: var(--text-muted); }
.breadcrumbs a:hover { color: var(--blue); }

.article-hero h1 {
  font-size: var(--fs-h1);
  color: var(--ink);
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0 0 0.9rem;
  max-width: 24em;
  text-wrap: balance;
}

.article-hero .byline { font-family: var(--mono); font-size: var(--fs-caption); color: var(--text-muted); }

article.prose { max-width: 720px; margin: 0 auto; padding: var(--sp-7) var(--sp-5) var(--sp-8); }

.prose h2 {
  font-size: 1.5rem;
  color: var(--ink);
  margin: 2.6rem 0 0.8rem;
  letter-spacing: -0.01em;
  padding-top: 0.4rem;
}
.prose h2::before {
  content: "";
  display: block;
  width: 2.2rem;
  height: 3px;
  border-radius: 2px;
  margin-bottom: 0.8rem;
  background: linear-gradient(90deg, var(--star), var(--blue));
}

.prose h3 { font-size: var(--fs-h4); color: var(--ink); margin: 1.8rem 0 0.6rem; }

.prose p { margin: 0 0 1.1rem; }
.prose ul, .prose ol { margin: 0 0 1.1rem; padding-left: 1.4rem; }
.prose li { margin-bottom: 0.45rem; }
.prose li::marker { color: var(--blue); }
.prose pre { margin: 0 0 1.3rem; }

.prose blockquote {
  margin: 0 0 1.1rem;
  padding: 0.7rem 1.2rem;
  border-left: 3px solid var(--star);
  background: var(--paper);
  border-radius: 0 8px 8px 0;
  color: var(--ink);
}
.prose blockquote p { margin: 0; }

.article-footer-cta {
  margin-top: var(--sp-7);
  padding-top: var(--sp-5);
  border-top: 1px solid var(--paper-line);
  display: flex;
  gap: 0.9rem;
  flex-wrap: wrap;
  align-items: center;
}

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

.site-footer {
  background: var(--navy-deep);
  color: var(--text-on-dark-muted);
  padding: var(--sp-7) 0 var(--sp-6);
  font-size: 0.92rem;
  border-top: 3px solid transparent;
  border-image: linear-gradient(90deg, var(--blue), var(--star)) 1;
}

.site-footer .cols {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: var(--sp-6);
  margin-bottom: var(--sp-6);
}

.site-footer h4 {
  color: var(--text-on-dark-strong);
  font-size: var(--fs-caption);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-family: var(--mono);
  margin: 0 0 0.8rem;
}

.site-footer a { color: var(--text-on-dark); }
.site-footer a:hover { color: var(--star); }

.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 0.5rem; }

.site-footer .brandline {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--text-on-dark-strong);
  font-weight: 600;
  font-size: 1.1rem;
  margin-bottom: 0.7rem;
}
.site-footer .brandline img { width: 26px; height: 30px; }

.site-footer .legal {
  border-top: 1px solid rgba(175, 200, 238, 0.18);
  padding-top: var(--sp-5);
  font-size: 0.82rem;
  color: var(--text-on-dark-muted);
}
.site-footer .legal a { color: var(--text-on-dark); }

/* --------------------------------------------------------------------------
   5. MOTION — scroll reveals + reduced-motion overrides
   -------------------------------------------------------------------------- */

.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity var(--dur-3) var(--ease), transform var(--dur-3) var(--ease);
}
.js .reveal.in { opacity: 1; transform: none; }
.js .reveal:nth-child(2) { transition-delay: 80ms; }
.js .reveal:nth-child(3) { transition-delay: 160ms; }
.js .reveal:nth-child(4) { transition-delay: 240ms; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .js .reveal { opacity: 1; transform: none; }
  .hero-art .edge { stroke-dashoffset: 0; }
  .hero-art .node { opacity: 1; }
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 820px) {
  .hero { padding: var(--sp-8) 0 var(--sp-7); }
  .hero .container { grid-template-columns: 1fr; gap: var(--sp-6); }
  .hero-art svg { max-width: 280px; }
  .section { padding: var(--sp-7) 0; }
  .site-footer .cols { grid-template-columns: 1fr; gap: var(--sp-5); }
  .support { padding: var(--sp-6) var(--sp-5); }
}
