/* ================================================================
   AACortex — design tokens & global styles
   Light scientific theme · graphite + green · Inter / Inter Tight /
   JetBrains Mono
   ================================================================ */

:root {
  --paper: #F7F8F5;
  --surface: #EEF1EC;
  --card: #FFFFFF;
  --ink: #101412;
  --ink-2: #3C4540;
  --ink-3: #59635C;
  --acc: #2F6B4F;
  --acc-deep: #1A2420;
  --acc-soft: #D8EBDD;
  --acc-tint: #E2F0E7;
  --line: #E1E6DE;
  --danger: #A93D31;
  --dark: #131A16;
  --dark-ink: #EDF2EC;
  --dark-line: rgba(237, 242, 236, .14);

  --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-tight: 'Inter Tight', 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Space Grotesk', 'Inter Tight', 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --shadow-1: 0 1px 2px rgba(16, 20, 18, .04), 0 4px 16px rgba(16, 20, 18, .05);
  --shadow-2: 0 2px 4px rgba(16, 20, 18, .05), 0 12px 32px rgba(16, 20, 18, .09);
  --hdr-h: 76px;
  --ease: cubic-bezier(.22, .61, .21, 1);
}

/* ---------------------------------------------------------- base */

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1rem/1.65 var(--font-sans);
  font-feature-settings: 'cv02', 'cv03';
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--acc-soft); color: var(--acc-deep); }

img, svg, canvas { display: block; max-width: 100%; }

a { color: inherit; }

h1, h2, h3, h4 {
  font-family: var(--font-tight);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -.022em;
  margin: 0 0 .5em;
  text-wrap: balance;
}

p { margin: 0 0 1em; }

:focus-visible {
  outline: 2px solid var(--acc);
  outline-offset: 2px;
  border-radius: 3px;
}

.wrap { max-width: 1200px; margin-inline: auto; padding-inline: clamp(20px, 4vw, 32px); }
.wrap-narrow { max-width: 780px; margin-inline: auto; padding-inline: clamp(20px, 4vw, 32px); }

.mono {
  font-family: var(--font-mono);
  font-size: .775rem;
  letter-spacing: .045em;
  font-weight: 400;
}

.skip {
  position: absolute; left: 16px; top: -60px; z-index: 200;
  background: var(--acc-deep); color: #fff; padding: 12px 18px;
  border-radius: var(--r-sm); text-decoration: none; transition: top .2s;
}
.skip:focus-visible { top: 12px; }

.ic { width: 15px; height: 15px; flex: none; }

/* ---------------------------------------------------------- buttons */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 12px 24px;
  border: 1px solid transparent; border-radius: 10px;
  font: 500 .95rem/1.2 var(--font-sans);
  letter-spacing: .01em;
  text-decoration: none; cursor: pointer;
  transition: background-color .2s var(--ease), border-color .2s var(--ease),
              color .2s var(--ease), transform .2s var(--ease), box-shadow .2s var(--ease);
}
.btn .ic { transition: transform .2s var(--ease); }
.btn:hover .ic { transform: translateX(3px); }
.btn:active { transform: translateY(1px); }

.btn-primary { background: var(--acc-deep); color: #fff; }
.btn-primary:hover { background: var(--acc); }

.btn-ghost { background: transparent; color: var(--ink); border-color: rgba(16, 20, 18, .22); }
.btn-ghost:hover { border-color: var(--acc); color: var(--acc); background: rgba(47, 107, 79, .05); }

.btn-sm { min-height: 42px; padding: 9px 18px; font-size: .875rem; border-radius: 9px; }

.btn-hero { border-color: rgba(16, 20, 18, .34); padding-inline: 28px; }

/* ---------------------------------------------------------- header */

.hdr {
  position: fixed; inset: 0 0 auto; z-index: 100;
  transition: background-color .25s, box-shadow .25s, border-color .25s;
  border-bottom: 1px solid transparent;
}
.hdr.scrolled {
  /* solid, no blur — cheap to composite and no bleed-through artifacts */
  background: var(--paper);
  border-bottom-color: var(--line);
}
.hdr-in { display: flex; align-items: center; gap: 28px; height: var(--hdr-h); }

.logo { display: inline-flex; align-items: center; gap: 14px; text-decoration: none; }
.logo-glyph { width: 52px; height: 46px; object-fit: contain; }
.logo-tx { display: flex; flex-direction: column; line-height: 1.16; }
.logo-name { font: 650 1.28rem/1.1 var(--font-tight); letter-spacing: -.01em; }
.logo-sub { font: 400 .655rem/1.2 var(--font-mono); letter-spacing: .085em; text-transform: uppercase; color: var(--ink-3); margin-top: 3px; }

.nav { display: flex; gap: 4px; margin-inline: auto; }
.nav a {
  position: relative; padding: 12px 14px; text-decoration: none;
  font-size: .92rem; color: var(--ink-2); border-radius: 8px;
  transition: color .18s;
}
.nav a::after {
  content: ''; position: absolute; left: 14px; right: 14px; bottom: 7px; height: 2px;
  background: var(--acc); border-radius: 2px;
  transform: scaleX(0); transform-origin: left; transition: transform .22s var(--ease);
}
.nav a:hover, .ftr-nav a:hover, .ftr-bar a:hover, .ftr-mail:hover, .con-mail:hover, .crumbs a:hover {
  color: var(--acc);
  text-decoration: underline;
  text-decoration-color: rgba(47, 107, 79, .38);
  text-decoration-thickness: 2px;
  text-underline-offset: .28em;
}
.nav a.act { color: var(--ink); }
.nav a.act::after { transform: scaleX(1); }

.hdr-cta { display: flex; align-items: center; gap: 18px; }

.langs { display: flex; align-items: center; gap: 7px; color: var(--ink-3); }
.langs a {
  font: 500 .74rem/1 var(--font-mono); letter-spacing: .06em; text-decoration: none;
  color: var(--ink-3); padding: 12px 3px; transition: color .15s;
}
.langs a:hover { color: var(--ink); }
.langs a[aria-current] { color: var(--acc); }
.langs span { font-size: .7rem; opacity: .5; }

.burger {
  display: none; width: 44px; height: 44px; margin-left: auto;
  align-items: center; justify-content: center;
  background: none; border: 1px solid var(--line); border-radius: 10px;
  color: var(--ink); cursor: pointer;
}
.burger .b-close { display: none; }
.burger[aria-expanded="true"] .b-open { display: none; }
.burger[aria-expanded="true"] .b-close { display: block; }

.mmenu {
  display: none; position: fixed; z-index: 99;
  inset: var(--hdr-h) 0 0;
  background: var(--paper);
  padding: 14px clamp(20px, 4vw, 32px) 32px;
  overflow-y: auto;
}
.mmenu.open { display: block; }
html.mlock { overflow: hidden; }
.mmenu nav:not(.langs) { display: flex; flex-direction: column; margin-bottom: 16px; }
.mmenu nav:not(.langs) a {
  padding: 16px 4px; text-decoration: none; font-size: 1.14rem;
  color: var(--ink); border-bottom: 1px solid var(--line);
}
.mmenu .btn { width: 100%; margin-bottom: 14px; }
.langs-m { justify-content: center; }

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

.hero {
  position: relative;
  min-height: max(560px, 76svh);
  display: flex; flex-direction: column; justify-content: center;
  overflow: clip;
  padding-top: var(--hdr-h);
}
.hero::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background:
    repeating-linear-gradient(to right, rgba(16, 20, 18, .028) 0 1px, transparent 1px 72px),
    repeating-linear-gradient(to bottom, rgba(16, 20, 18, .028) 0 1px, transparent 1px 72px);
  -webkit-mask-image: radial-gradient(120% 90% at 30% 20%, #000 30%, transparent 78%);
  mask-image: radial-gradient(120% 90% at 30% 20%, #000 30%, transparent 78%);
}
.hero-cv {
  position: absolute; inset: 0; width: 100%; height: 100%;
  touch-action: pan-y; cursor: crosshair;
}
.hero-cv.grabbing { cursor: grabbing; }

/* pre-boot still (plain canvas — not an LCP candidate); fades out once WebGL is live */
.hero-still { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; transition: opacity .8s var(--ease); }
.hero.live .hero-still { opacity: 0; }

.hero-in { position: relative; z-index: 2; width: 100%; padding-block: 40px 32px; pointer-events: none; }
.hero-in a, .hero-in button { pointer-events: auto; }
.hero-in::before {
  content: ''; position: absolute; z-index: -1;
  inset: -12% -30% -18% -46%;
  background: radial-gradient(58% 62% at 34% 42%, rgba(247, 248, 245, .92) 34%, rgba(247, 248, 245, 0) 72%);
  pointer-events: none;
}

.hero h1 { font-size: clamp(2.45rem, 5.5vw, 4.4rem); margin-bottom: 24px; font-weight: 620; line-height: 1.07; letter-spacing: -.02em; }
.hero h1 em { font-style: normal; color: var(--acc); }
.hero-sub { font-size: 1.16rem; color: var(--ink); max-width: 56ch; }
.hero-sub2 { font-size: 1rem; color: var(--ink-2); max-width: 60ch; margin-bottom: 34px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; }

/* floating field labels */
.hero-labels { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.fl {
  position: absolute; color: var(--ink-3); font-size: .68rem; letter-spacing: .1em;
  padding: 3px 8px; border: 1px solid rgba(16, 20, 18, .12); border-radius: 999px;
  background: rgba(247, 248, 245, .72);
  opacity: 0; animation: flin 11s ease-in-out infinite;
}
.fl::before { content: '· '; color: var(--acc); }
.fl-1 { right: 12%; top: 26%; animation-delay: 0s; }
.fl-2 { right: 30%; top: 38%; animation-delay: 1.4s; }
.fl-3 { right: 7%;  top: 52%; animation-delay: 2.8s; }
.fl-4 { right: 40%; top: 64%; animation-delay: 4.2s; }
.fl-5 { right: 22%; top: 74%; animation-delay: 5.6s; }
.fl-6 { right: 47%; top: 30%; animation-delay: 7s; }
.fl-7 { right: 16%; top: 63%; animation-delay: 8.4s; }
.fl-8 { right: 34%; top: 82%; animation-delay: 9.8s; }
@keyframes flin {
  0%, 8% { opacity: 0; transform: translateY(6px); }
  16%, 42% { opacity: 1; transform: translateY(0); }
  52%, 100% { opacity: 0; transform: translateY(-8px); }
}

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

.sec { padding-block: clamp(40px, 5vw, 68px); position: relative; }
.sec-alt { background: linear-gradient(180deg, var(--surface), var(--paper)); border-block: 1px solid var(--line); }
section { scroll-margin-top: calc(var(--hdr-h) + 8px); }

.sec-label {
  color: var(--acc); text-transform: uppercase; letter-spacing: .14em; font-size: .7rem;
  margin-bottom: 14px;
}
.sec-label::before { content: '['; margin-right: 6px; opacity: .5; }
.sec-label::after { content: ']'; margin-left: 6px; opacity: .5; }

h2 { font-size: clamp(1.8rem, 3.2vw, 2.6rem); max-width: 24ch; }
.sec-sub { font-size: 1.1rem; color: var(--ink-2); max-width: 62ch; margin-bottom: 12px; }
.lead { font-size: 1.16rem; color: var(--ink); }

/* reveal (hero is exempt: above-the-fold text must paint immediately for LCP) */
.rv { opacity: 0; transform: translateY(16px); transition: opacity .6s var(--ease), transform .6s var(--ease); transition-delay: var(--d, 0s); }
.rv.in { opacity: 1; transform: none; }
.hero .rv { opacity: 1; transform: none; transition: none; }

/* svg line draw (shapes carry class="dr" + pathLength="1") */
.rv .dr { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1.25s var(--ease); transition-delay: calc(var(--d, 0s) + .3s); }
.rv.in .dr { stroke-dashoffset: 0; }

/* ---------------------------------------------------------- cards */

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: clamp(20px, 2.6vw, 30px);
  box-shadow: var(--shadow-1);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s var(--ease);
}

.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 7px; padding: 0; margin: 0; }
.chips li {
  font: 400 .69rem/1 var(--font-mono); letter-spacing: .03em;
  color: var(--ink-2); background: var(--paper);
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 11px;
}

/* ---------------------------------------------------------- analytics */

.an-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); align-items: end; margin-bottom: 10px; }
.an-thesis { display: flex; flex-direction: column; gap: 2px; font-size: 1.12rem; color: var(--ink-3); border-left: 2px solid var(--acc); padding-left: 18px; margin-bottom: 8px; }
.an-thesis strong { color: var(--ink); font-weight: 600; }
.an-body { color: var(--ink-2); max-width: 68ch; margin-bottom: clamp(26px, 3.5vw, 40px); }
.an-intro { margin-bottom: 14px; }

.mods { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.mod-hd { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.mod-n { color: var(--acc); font-size: .74rem; padding-top: 6px; }
.viz-mini { width: min(220px, 46%); height: auto; flex: none; }
.mod h3 { font-size: 1.28rem; margin: 0 0 6px; }
.mod-sub { color: var(--ink-2); font-size: .95rem; margin-bottom: 16px; }
.mod-ml { color: var(--ink-3); text-transform: uppercase; font-size: .62rem; letter-spacing: .12em; margin-bottom: 9px; }

.instr {
  margin-top: clamp(36px, 5vw, 56px);
  border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--card); box-shadow: var(--shadow-1);
  padding: clamp(22px, 3vw, 36px);
}
.instr-hd { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 22px; margin-bottom: 18px; }
.instr-hd .sec-label { margin: 0; }
.instr-note { margin: 0; color: var(--ink-3); font-size: .9rem; }
.metrics { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 36px; }
.metric {
  display: grid; grid-template-columns: 42px minmax(0, 1fr) 108px; align-items: center; gap: 12px;
  padding: 11px 2px; border-bottom: 1px solid var(--line);
}
.metric:nth-last-child(-n+2) { border-bottom: 0; }
.metric-i { color: var(--ink-3); font-size: .68rem; }
.metric-name { font-family: var(--font-mono); font-size: .82rem; letter-spacing: .02em; }
.metric-wave { color: var(--acc); opacity: .75; }
.metric-wave svg { width: 100%; height: 20px; }
.distinct { margin: 20px 0 0; padding-top: 18px; border-top: 1px solid var(--line); font-size: 1.05rem; color: var(--ink-3); }
.distinct strong { color: var(--acc-deep); }

/* -------------------------------------------------- latest analytics */

.sec-lat { padding-block: clamp(28px, 3.5vw, 46px) clamp(16px, 2vw, 28px); }
.hero + .sec-lat { padding-block-start: 24px; }
.lat-h2 { margin-bottom: clamp(16px, 2.2vw, 24px); }
.pubs { display: grid; grid-template-columns: repeat(2, 1fr); column-gap: clamp(28px, 4vw, 56px); row-gap: 30px; }
/* index entries, not cards: a hairline opens each one, the paper stays visible */
.pub {
  display: flex; flex-direction: column; align-items: stretch; text-decoration: none;
  background: none; border: 0; border-radius: 0; box-shadow: none;
  border-top: 2px solid var(--ink); padding: 18px 0 22px;
  transition: border-top-color .25s var(--ease);
}
.pub:hover { transform: none; box-shadow: none; border-top-color: var(--acc); }
.pub-top { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; color: var(--ink-3); font-size: .67rem; text-transform: uppercase; letter-spacing: .1em; margin-bottom: 14px; }
.ic-doc { width: 15px; height: 15px; color: var(--acc); flex: none; }
.pub-tag { color: var(--acc); letter-spacing: .12em; }
.pub h3 {
  font: 600 clamp(1.32rem, 2.1vw, 1.62rem)/1.24 var(--font-display);
  letter-spacing: -.014em;
  color: var(--acc-deep);
  transition: color .2s var(--ease);
  margin-bottom: 12px;
}
.pub:hover h3 { color: var(--acc); }
.pub-dek { color: var(--ink-2); font-size: .95rem; max-width: 54ch; margin-bottom: 24px; }
.pub-ft {
  margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: 12px;
  border-top: 1px solid var(--line); padding-top: 14px;
  color: var(--ink-3); font-size: .68rem; text-transform: uppercase; letter-spacing: .09em;
}
.pub-cta { display: inline-flex; align-items: center; gap: 7px; color: var(--acc); font-weight: 500; }
.pub-cta .ic { transition: transform .25s var(--ease); }
.pub:hover .pub-cta .ic { transform: translateX(3px); }

/* ---------------------------------------------------------- selective */

.sec-dark { background: var(--dark); color: var(--dark-ink); }
.sec-dark::before {
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background:
    repeating-linear-gradient(to right, rgba(237, 242, 236, .05) 0 1px, transparent 1px 72px),
    repeating-linear-gradient(to bottom, rgba(237, 242, 236, .05) 0 1px, transparent 1px 72px);
  -webkit-mask-image: radial-gradient(90% 100% at 70% 40%, #000 20%, transparent 80%);
  mask-image: radial-gradient(90% 100% at 70% 40%, #000 20%, transparent 80%);
}
.sec-dark .sec-label { color: #8FCBA8; }
.sec-dark h2 { color: #fff; }
.sec-dark .lead { color: var(--dark-ink); }
.sec-dark p { color: rgba(237, 242, 236, .78); }
.sel-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 5vw, 80px); position: relative; align-items: center; }
.sel-list {
  border: 1px solid var(--dark-line); border-radius: var(--r-lg);
  padding: 22px 24px; margin-bottom: 16px; background: rgba(237, 242, 236, .03);
}
.sel-lb { display: flex; align-items: center; gap: 9px; text-transform: uppercase; letter-spacing: .12em; font-size: .66rem; color: #8FCBA8; margin-bottom: 12px; }
.sel-unfit .sel-lb { color: rgba(237, 242, 236, .5); }
.sel-list ul { list-style: none; margin: 0; padding: 0; columns: 1; }
.sel-list li { padding: 8px 0; border-bottom: 1px solid var(--dark-line); font-size: .95rem; color: var(--dark-ink); }
.sel-list li:last-child { border-bottom: 0; }
.sel-list li::before { content: '— '; color: #8FCBA8; }
.sel-unfit p { margin: 0; font-size: .92rem; color: rgba(237, 242, 236, .62); }

/* ------------------------------------------------- topo backdrop */

.topo-bg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.topo-bg path.dr { stroke: var(--ink); opacity: .08; stroke-width: 1; transition: opacity .3s var(--ease); }
.topo-bg [data-g] { stroke: var(--acc); opacity: .2; }
.topo-bg .tmark { stroke: var(--ink-3); opacity: .3; stroke-width: 1; fill: none; }

/* ---------------------------------------------------------- contacts */

.con-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 5vw, 72px); align-items: center; }
.con-dl { color: var(--ink-3); text-transform: uppercase; letter-spacing: .12em; font-size: .66rem; margin-bottom: 14px; }
.con-mail {
  display: inline-flex; align-items: center; gap: 10px; text-decoration: none;
  font: 500 1.05rem/1 var(--font-mono); letter-spacing: .01em; color: var(--acc-deep);
  padding: 4px 0; transition: color .15s;
}
.con-note { color: var(--ink-3); font-size: .85rem; margin-top: 14px; max-width: 40ch; }
.con-card { position: relative; overflow: hidden; padding: clamp(28px, 3.4vw, 44px); min-height: 230px; display: flex; align-items: center; }
.con-card .topo-bg path.dr { opacity: .07; }
.cc-in { position: relative; }
.con-mail-lg { font-size: clamp(1.15rem, 2.2vw, 1.5rem); }
.con-mail-lg .ic { width: 20px; height: 20px; }

/* ---------------------------------------------------------- footer */

.ftr { background: var(--surface); border-top: 1px solid var(--line); padding-top: clamp(44px, 6vw, 64px); }
.ftr-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, .7fr) minmax(0, 1fr); gap: clamp(28px, 4vw, 56px); padding-bottom: 40px; }
.ftr-line { color: var(--ink-2); max-width: 44ch; margin: 18px 0 10px; font-size: .95rem; }
.ftr-nav { display: flex; flex-direction: column; gap: 2px; }
.ftr-nav a { text-decoration: none; color: var(--ink-2); padding: 8px 0; font-size: .92rem; transition: color .15s; }
.ftr-mail { display: inline-flex; align-items: center; gap: 9px; font-family: var(--font-mono); font-size: .85rem; color: var(--acc-deep); text-decoration: none; padding: 6px 0; }
.ftr-note { color: var(--ink-3); font-size: .8rem; max-width: 34ch; margin: 10px 0 16px; }
.langs-f a { padding: 10px 4px; }
.ftr-bar {
  display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; align-items: center;
  border-top: 1px solid var(--line); padding-block: 18px 22px;
  color: var(--ink-3); font-size: .68rem;
}
.ftr-bar a { color: var(--ink-3); text-decoration: none; padding: 8px 0; }
.ftr-bar-r { display: inline-flex; align-items: center; gap: 22px; }
.toplink { display: inline-flex; align-items: center; gap: 6px; }

/* ---------------------------------------------------------- article */

.prog { position: fixed; inset: 0 0 auto; height: 3px; z-index: 120; background: transparent; pointer-events: none; }
.prog i { display: block; height: 100%; width: 100%; background: var(--acc); transform: scaleX(0); transform-origin: 0 50%; }

.art { padding-top: calc(var(--hdr-h) + clamp(14px, 2.5vw, 24px)); padding-bottom: clamp(60px, 8vw, 110px); }
/* article column matches the figure width — one aligned measure */
.art .wrap-narrow { max-width: calc(1080px + 2 * clamp(20px, 4vw, 32px)); }
.crumbs { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; color: var(--ink-3); font-size: .66rem; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 22px; }
.crumbs a { color: var(--ink-3); text-decoration: none; padding: 2px 0; }
.crumbs span[aria-hidden] { opacity: .4; }

.art-hd { margin-bottom: 34px; }
.art-kick { color: var(--acc); text-transform: uppercase; letter-spacing: .12em; font-size: .68rem; margin-bottom: 16px; }
.art h1 { font-family: var(--font-display); font-size: clamp(1.9rem, 4.2vw, 3.1rem); letter-spacing: -.022em; max-width: 24ch; }
.art-dek { font-size: 1.22rem; line-height: 1.55; color: var(--ink-2); max-width: 56ch; }
.art-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 22px; margin-top: 20px; }
.art-meta .mono { color: var(--ink-3); font-size: .74rem; }
.art-meta strong { color: var(--ink); font-weight: 550; }
.art-langnote { color: var(--ink-3); font-size: .68rem; margin-top: 14px; letter-spacing: .05em; }

.art-body { counter-reset: sec; font-size: 1.12rem; line-height: 1.78; color: var(--ink); }
.art-body > p { color: #2A312D; margin-bottom: 1.25em; }
.art-body h2 {
  counter-increment: sec;
  font-size: clamp(1.4rem, 2.6vw, 1.85rem);
  /* the rule spans the measure, so the heading block must too */
  max-width: none; text-wrap: balance;
  margin: 2.4em 0 .9em; padding-bottom: .5em; border-bottom: 1px solid var(--line);
  scroll-margin-top: calc(var(--hdr-h) + 16px);
}
.art-body h2::before {
  content: '§ ' counter(sec, decimal-leading-zero);
  display: block; font: 400 .7rem/1 var(--font-mono);
  color: var(--acc); letter-spacing: .14em; margin-bottom: 10px;
}
.art-body h3 { font-size: 1.15rem; margin: 1.7em 0 .5em; color: var(--acc-deep); }
.art-ul { padding-left: 0; list-style: none; margin: 0 0 1.4em; }
.art-ul li { position: relative; padding: 7px 0 7px 26px; color: #2A312D; }
.art-ul li::before { content: '—'; position: absolute; left: 2px; color: var(--acc); font-family: var(--font-mono); }
.pull {
  margin: 2em 0; padding: 6px 0 6px 26px; border-left: 3px solid var(--acc);
}
.pull p {
  margin: 0; font-family: var(--font-tight); font-weight: 600; font-size: 1.45rem;
  line-height: 1.35; letter-spacing: -.015em; color: var(--acc-deep); text-wrap: balance;
}
/* definition rows: hairline-separated list, no cards */
.art-defs { margin: 2em 0; display: block; border-top: 1px solid var(--line); }
.art-def {
  border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: none;
  padding: 14px 0;
}
.art-def dt { font-weight: 600; font-family: var(--font-tight); margin-bottom: 3px; color: var(--acc-deep); }
.art-def dd { margin: 0; color: #2A312D; font-size: .98rem; }
.art-sig { text-align: right; color: var(--ink-3); letter-spacing: .08em; margin-top: 2.4em; }
.art-signote { text-align: right; color: var(--ink-3); font-size: .68rem; margin-top: -1.6em; }
.art-tblcap { color: var(--acc); text-transform: uppercase; letter-spacing: .12em; font-size: .66rem; margin: 2em 0 -1em; }

/* article: citations, lists, callouts, code, tables, cards, flows, ladder, refs */

.art-body code { overflow-wrap: anywhere; }
/* figures sit directly on the paper — the diagrams carry their own frame */
.art-fig { width: 100%; margin: 2.6em 0; }
.art-fig-scroll { overflow-x: auto; }
.art-fig-scroll svg, .art-fig-scroll img { display: block; width: 100%; height: auto; }
.art-fig figcaption {
  margin-top: 12px; font-size: .84rem; line-height: 1.55;
  color: var(--ink-3); max-width: 82ch;
}
.art-fig figcaption b { font-weight: 600; color: var(--ink-2); }
/* article tags are flat labels, not UI pills (the module chips keep their pill) */
.art-tags li { background: var(--surface); border: 0; border-radius: 3px; padding: 5px 9px; }
.cite { font-family: var(--font-mono); font-size: .78em; color: var(--acc); text-decoration: none; padding: 0 1px; }
.cite:hover { text-decoration: underline; }
.art-ol { padding-left: 22px; margin: 0 0 1.4em; }
.art-ol li { padding: 5px 0; color: #2A312D; }
.art-ol li::marker { font-family: var(--font-mono); color: var(--acc); font-size: .85em; }
.art-check, .art-cross { list-style: none; padding-left: 0; margin: 0 0 1.4em; }
.art-check li, .art-cross li { position: relative; padding: 6px 0 6px 28px; color: #2A312D; }
.art-check li::before, .art-cross li::before {
  position: absolute; left: 2px; font-family: var(--font-mono); font-size: .9em;
}
.art-check li::before { content: '✓'; color: var(--acc); }
.art-cross li::before { content: '✗'; color: var(--danger); }
/* asides read as quiet set-apart prose: a rule and a colored lead-in, no fill */
.art-callout {
  margin: 2em 0; padding: 14px 0 0; border: 0; border-top: 1px solid var(--line);
  border-radius: 0; background: none; font-size: 1rem; color: #2A312D;
}
.art-callout strong { color: var(--acc-deep); }
.art-callout > :last-child { margin-bottom: 0; }
.art-callout-green { border-top-color: rgba(47, 107, 79, .55); }
.art-callout-green strong { color: var(--acc); }
.art-callout-amber { border-top-color: rgba(176, 138, 46, .55); }
.art-callout-amber strong { color: #8A6D24; }
.art-callout-red { border-top-color: rgba(169, 61, 49, .5); }
.art-callout-red strong { color: var(--danger); }
.art-code {
  margin: 1.6em 0; padding: 16px 18px; overflow-x: auto;
  background: var(--surface); border: 0; border-radius: 4px;
  font: 400 .82rem/1.65 var(--font-mono); color: var(--acc-deep); white-space: pre-wrap;
}
/* tables are rules and whitespace, flush with the text column */
.art-tablewrap { overflow-x: auto; margin: 2.2em 0; }
/* three descending rule weights close the block, the header, and each row */
.art-table {
  width: 100%; border-collapse: collapse; font-size: .9rem; min-width: 560px;
  border-bottom: 1px solid rgba(16, 20, 18, .26);
}
.art-table th {
  text-align: left; font: 600 .84rem/1.35 var(--font-tight); letter-spacing: 0;
  color: var(--ink); background: none; padding: 0 16px 9px; border-bottom: 1px solid rgba(16, 20, 18, .26);
}
.art-table td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: top; color: #2A312D; }
.art-table th:first-child, .art-table td:first-child { padding-left: 0; }
.art-table th:last-child, .art-table td:last-child { padding-right: 0; }
.art-table tr:last-child td { border-bottom: 0; }
.art-table td strong { color: var(--ink); }
.art-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(24px, 4vw, 48px); margin: 2em 0; }
/* a prose comparison, so it gets a rule per column rather than two boxes */
.art-card { border: 0; border-top: 1px solid var(--line); border-radius: 0; background: none; padding: 14px 0 0; }
.art-card .art-card-h { margin: 0 0 10px; font-size: 1.02rem; color: var(--ink); }
.art-card .art-ul { margin: 0; }
.art-flow { display: flex; flex-wrap: wrap; align-items: stretch; gap: 10px; margin: 1.8em 0; }
.art-flow-b {
  flex: 1 1 150px; min-width: 150px; display: flex; flex-direction: column; gap: 5px;
  border: 1px solid var(--line); border-top: 3px solid var(--ink-3);
  border-radius: var(--r-sm); background: var(--card); padding: 13px 14px;
}
.art-flow-k { font-family: var(--font-tight); font-weight: 650; font-size: .88rem; line-height: 1.25; }
.art-flow-d { font-size: .78rem; color: var(--ink-2); line-height: 1.45; }
.art-flow-c { font-size: .6rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin-top: auto; padding-top: 6px; }
.art-flow-a { align-self: center; color: var(--ink-3); font-size: 1rem; }
.art-t-green { border-top-color: var(--acc); }
.art-t-blue { border-top-color: #4A89B8; }
.art-t-amber { border-top-color: #B08A2E; }
.art-t-red { border-top-color: var(--danger); }
.art-t-deep { border-top-color: var(--acc-deep); background: var(--acc-deep); }
.art-t-deep .art-flow-k { color: #fff; }
.art-t-deep .art-flow-d, .art-t-deep .art-flow-c { color: rgba(237, 242, 236, .75); }
.art-ladder { display: flex; flex-direction: column; gap: 8px; margin: 1.8em 0; }
.art-rung {
  display: grid; grid-template-columns: 84px minmax(0, .9fr) minmax(0, 1.1fr); gap: 8px 18px; align-items: baseline;
  border: 1px solid var(--line); border-radius: var(--r-sm); padding: 13px 18px;
}
.art-rung-l { font-size: .66rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); }
.art-rung-t { font-family: var(--font-tight); font-weight: 650; font-size: .95rem; }
.art-rung-n { font-size: .84rem; color: var(--ink-2); }
.art-l-0 { background: #F8E9E6; border-color: #EBD0CA; }
.art-l-1 { background: #F6EFDC; border-color: #E8DCC0; }
.art-l-2 { background: #F5F3E0; border-color: #E5E1C4; }
.art-l-3 { background: #E7EDF3; border-color: #D2DDE8; }
.art-l-4 { background: var(--acc-tint); border-color: #CBE2D3; }
.art-link { color: var(--acc); text-decoration: underline; text-decoration-color: rgba(47, 107, 79, .35); text-underline-offset: .16em; }
.art-link:hover { text-decoration-color: var(--acc); }
.art-tk {
  border: 0; border-top: 1px solid rgba(16, 20, 18, .26); border-bottom: 1px solid var(--line);
  background: none; border-radius: 0;
  padding: 16px 0 18px; margin-bottom: 26px;
}
.art-tk-lb { color: var(--acc); text-transform: uppercase; font-size: .64rem; letter-spacing: .14em; margin: 0 0 10px; }
.art-tk ul { margin: 0; padding-left: 18px; }
.art-tk li { padding: 3px 0; font-size: .95rem; color: #2A312D; }
.art-tk li::marker { color: var(--acc); }
.art-ref-acc { font-family: var(--font-mono); font-size: .72rem; color: var(--ink-3); }
.art-refs { padding-left: 22px; margin: 0; font-size: .88rem; color: #2A312D; }
.art-refs li { padding: 6px 0; scroll-margin-top: calc(var(--hdr-h) + 16px); }

/* -------------------------------------- research-note components */

.pubs-res { margin-top: 28px; }
/* stat figures: the number is the object, the rule gives it a shelf */
.art-stats { display: flex; gap: clamp(20px, 4vw, 46px); flex-wrap: wrap; margin: 2em 0; }
.art-stat {
  flex: 1 1 180px; background: none; border: 0; border-top: 1px solid var(--line);
  border-radius: 0; padding: 12px 0 0;
}
.art-stat strong { display: block; font-family: var(--font-tight); font-size: 1.7rem; font-weight: 650; color: var(--acc-deep); }
.art-stat span { display: block; margin-top: 4px; font-size: .8rem; line-height: 1.45; color: var(--ink-3); }
/* the caption lives outside the scroll wrapper so it wraps at the text width on mobile */
.art-tcap { margin: 2.2em 0 -1.4em; font-size: .84rem; line-height: 1.55; color: var(--ink-3); max-width: 82ch; }
.art-tcap b { font-weight: 600; color: var(--ink-2); }
.art-table caption { caption-side: top; text-align: left; padding: 0 0 12px; font-size: .84rem; line-height: 1.55; color: var(--ink-3); }
.art-table caption b { font-weight: 600; color: var(--ink-2); }
.art-table td.win { background: rgba(221, 235, 225, .38); }
/* artifact blocks: opened by a rule, the quoted artifact on a light ground */
.art-case { background: none; border: 0; border-top: 1px solid var(--line); border-radius: 0; padding: 18px 0 6px; margin: 0; }
.art-case h3 { margin: 0 0 2px; font-size: 1.02rem; }
.art-case-src { margin: 0 0 12px; font-size: .66rem; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-3); }
.art-case-q { background: var(--surface); border: 0; border-radius: 4px; padding: 14px 16px; font-size: .92rem; color: var(--ink-2); margin-bottom: 12px; }
.art-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.art-chip { font: 400 .68rem/1 var(--font-mono); letter-spacing: .04em; padding: 5px 8px; border-radius: 3px; border: 0; white-space: nowrap; }
.art-chip-safe { color: #24523C; background: #DDEBE1; }
.art-chip-unsafe { color: #7B2A20; background: #F8E9E6; }
.art-chip-inc { color: #8A6D24; background: #F6EFDC; }
.art-chip-fail { color: var(--ink-2); background: var(--surface); }
.art-case-an { margin: 0; font-size: .93rem; color: var(--ink-2); }
.art-refs li::marker { font-family: var(--font-mono); color: var(--ink-3); font-size: .8em; }
.art-ref-link { font-family: var(--font-mono); font-size: .78rem; color: var(--acc); text-decoration: none; white-space: nowrap; }
.art-ref-link:hover { text-decoration: underline; }
.art-share { color: var(--ink-3); font-size: .7rem; letter-spacing: .06em; border-top: 1px solid var(--line); padding-top: 22px; margin-top: 44px; }
.art-cta { margin-top: 30px; text-align: left; }
.art-cta h2 { font-size: 1.45rem; }
.art-cta p { color: var(--ink-2); max-width: 56ch; }

/* ---------------------------------------------------------- legal/404 */

.legal { padding-top: calc(var(--hdr-h) + clamp(28px, 5vw, 56px)); padding-bottom: clamp(60px, 8vw, 110px); }
.legal h1 { font-size: clamp(1.9rem, 4vw, 2.7rem); }
.legal h2 { font-size: 1.25rem; margin-top: 1.8em; }
.legal p { color: #2A312D; }

.nf { min-height: 100svh; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; max-width: 720px; margin-inline: auto; padding: 32px; }
.nf-code { color: var(--acc); letter-spacing: .1em; }
.nf h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
.nf-links { display: flex; gap: 22px; }
.nf-links a { color: var(--ink-2); }

/* ---------------------------------------------------------- responsive */

@media (max-width: 1080px) {
  .metrics { grid-template-columns: 1fr; }
  .metric { grid-template-columns: 38px minmax(0, 1fr) 64px; gap: 10px; padding: 9px 2px; }
  .metric:nth-last-child(-n+2) { border-bottom: 1px solid var(--line); }
  .metric:last-child { border-bottom: 0; }
}

@media (max-width: 900px) {
  .an-head, .sel-grid, .con-grid { grid-template-columns: 1fr; }
  .an-thesis { border-left: 2px solid var(--acc); margin-bottom: 20px; }
  .mods { grid-template-columns: 1fr; }
  .pubs { grid-template-columns: 1fr; }
  .hero-fig { display: none; }
  .about-viz { order: -1; max-width: 480px; }
}

@media (max-width: 780px) {
  .nav, .hdr-cta { display: none; }
  .burger { display: inline-flex; flex: none; }
  .hdr-in { gap: 14px; }
  :root { --hdr-h: 86px; }
  .logo { gap: 12px; }
  .logo-glyph { width: 74px; height: 65px; }
  .logo-name { font-size: 1.16rem; }
  .logo-sub { max-width: 172px; white-space: normal; }
  .hero { min-height: max(520px, 78svh); }
  .hero-in { padding-block: 24px 96px; }
  .hero-in::before {
    inset: -14% -24% -6% -34%;
    background: radial-gradient(92% 72% at 46% 34%, rgba(247, 248, 245, .96) 42%, rgba(247, 248, 245, 0) 82%);
  }
  .hero-still, .hero-cv { opacity: .6; }
  .hero h1 { font-size: clamp(2.1rem, 8.4vw, 2.9rem); }
  .fl-2, .fl-3, .fl-4, .fl-6, .fl-7, .fl-8 { display: none; }
  .fl-5 { top: 87%; right: 14%; }
  .fl { font-size: .62rem; }
  .ftr-grid { grid-template-columns: 1fr; gap: 26px; }
  .viz-mini { width: min(200px, 52%); }
}

@media (max-width: 560px) {
  .hero-cta .btn { width: 100%; }
  .mod-hd { flex-direction: column; }
  .viz-mini { width: 78%; max-width: 240px; }
  .art-cards { grid-template-columns: 1fr; }
  .art-fig-scroll svg, .art-fig-scroll img { min-width: 780px; }
  .art-flow { flex-direction: column; }
  .art-flow-b { min-width: 0; }
  .art-flow-a { transform: rotate(90deg); }
  .art-rung { grid-template-columns: 1fr; gap: 3px; }
}

/* ---------------------------------------------------------- motion */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .rv { opacity: 1; transform: none; }
  .rv .dr { stroke-dashoffset: 0; }
  .fl { opacity: .8; animation: none; }
  .tr-ln { opacity: 1; transform: none; animation: none; }
  .tr-caret { opacity: .8; animation: none; }
}
