/* ==========================================================================
   zkBricks — site styles
   White, ink, and translucent blue. Aileron throughout, with weight and size for hierarchy and emphasis.
   ========================================================================== */

@font-face {
  font-family: "Aileron";
  src: url("../fonts/aileron/Aileron-Regular.otf") format("opentype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Aileron";
  src: url("../fonts/aileron/Aileron-Italic.otf") format("opentype");
  font-style: italic;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Aileron";
  src: url("../fonts/aileron/Aileron-SemiBold.otf") format("opentype");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: "Aileron";
  src: url("../fonts/aileron/Aileron-SemiBoldItalic.otf") format("opentype");
  font-style: italic;
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: "Aileron";
  src: url("../fonts/aileron/Aileron-Bold.otf") format("opentype");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "Aileron";
  src: url("../fonts/aileron/Aileron-BoldItalic.otf") format("opentype");
  font-style: italic;
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "Aileron";
  src: url("../fonts/aileron/Aileron-UltraLight.otf") format("opentype");
  font-style: normal;
  font-weight: 100;
  font-display: swap;
}

@font-face {
  font-family: "Aileron";
  src: url("../fonts/aileron/Aileron-Light.otf") format("opentype");
  font-style: normal;
  font-weight: 300;
  font-display: swap;
}

@font-face {
  font-family: "Aileron";
  src: url("../fonts/aileron/Aileron-LightItalic.otf") format("opentype");
  font-style: italic;
  font-weight: 300;
  font-display: swap;
}

:root {
  --paper: #fff;
  --paper-2: #f5f5f5;
  --paper-3: #ebebeb;
  --ink: #121212;
  --ink-2: #3b3b3b;
  --muted: #737373;
  --rule: rgba(18, 18, 18, 0.12);
  --rule-strong: rgba(18, 18, 18, 0.32);
  --accent: #4665c5;
  --accent-soft: rgba(70, 101, 197, 0.12);
  --accent-surface: rgba(70, 101, 197, 0.10);
  --brick-top: rgba(70, 101, 197, 0.14);
  --brick-left: rgba(70, 101, 197, 0.09);
  --brick-right: rgba(70, 101, 197, 0.05);
  --brick-outline: var(--ink);
  --research-crypto: 70, 101, 197;
  --research-security: 38, 123, 120;
  --research-theory: 130, 89, 165;
  --research-ml: 146, 107, 40;
  --research-other: 115, 115, 115;
  --tower-top-tint: 24%;
  --tower-left-tint: 35%;
  --tower-right-tint: 48%;
  --on-accent: #fff;
  /* Heatmap value text on mid-strength accent cells; dark mode flips it earlier than light. */
  --heat-mid-text: var(--ink);

  --emphasis-weight: 700;

  --sans: "Aileron", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;

  --maxw: 1360px;
  --gutter: clamp(16px, 4vw, 56px);
  --nav-h: 72px;
  --ease: cubic-bezier(0.2, 0.7, 0, 1);
  --ease-io: cubic-bezier(0.65, 0, 0.35, 1);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --paper: #0e0e0e;
  --paper-2: #181818;
  --paper-3: #242424;
  --ink: #ececec;
  --ink-2: #c4c4c4;
  --muted: #909090;
  --rule: rgba(236, 236, 236, 0.12);
  --rule-strong: rgba(236, 236, 236, 0.32);
  --accent: #a6bcff;
  --accent-soft: rgba(166, 188, 255, 0.14);
  --accent-surface: rgba(166, 188, 255, 0.24);
  --brick-top: rgba(166, 188, 255, 0.22);
  --brick-left: rgba(166, 188, 255, 0.14);
  --brick-right: rgba(166, 188, 255, 0.08);
  --brick-outline: var(--ink);
  --research-crypto: 166, 188, 255;
  --research-security: 130, 204, 188;
  --research-theory: 194, 169, 233;
  --research-ml: 225, 194, 128;
  --research-other: 144, 144, 144;
  --tower-top-tint: 50%;
  --tower-left-tint: 40%;
  --tower-right-tint: 30%;
  --on-accent: #0e0e0e;
  --heat-mid-text: var(--on-accent);
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0e0e0e;
    --paper-2: #181818;
    --paper-3: #242424;
    --ink: #ececec;
    --ink-2: #c4c4c4;
    --muted: #909090;
    --rule: rgba(236, 236, 236, 0.12);
    --rule-strong: rgba(236, 236, 236, 0.32);
    --accent: #a6bcff;
    --accent-soft: rgba(166, 188, 255, 0.14);
    --accent-surface: rgba(166, 188, 255, 0.24);
    --brick-top: rgba(166, 188, 255, 0.22);
    --brick-left: rgba(166, 188, 255, 0.14);
    --brick-right: rgba(166, 188, 255, 0.08);
    --brick-outline: var(--ink);
    --research-crypto: 166, 188, 255;
    --research-security: 130, 204, 188;
    --research-theory: 194, 169, 233;
    --research-ml: 225, 194, 128;
    --research-other: 144, 144, 144;
    --tower-top-tint: 50%;
    --tower-left-tint: 40%;
    --tower-right-tint: 30%;
    --on-accent: #0e0e0e;
    --heat-mid-text: var(--on-accent);
    color-scheme: dark;
  }
}

/* ---------- Reset & base ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--nav-h) + 24px);
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: background-color 0.5s var(--ease), color 0.5s var(--ease);
}

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

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

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

p { margin: 0 0 1em; }

h1, h2, h3, h4 { margin: 0; font-weight: 400; }

button { font: inherit; color: inherit; }

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

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 200;
  padding: 10px 16px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 12px;
}
.skip-link:focus { top: 12px; }

/* ---------- Layout primitives ---------- */

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

main { flex: 1 0 auto; }

.section { padding-block: clamp(80px, 12vw, 180px); position: relative; }
.section + .section { border-top: 1px solid var(--rule); }

/* ---------- Type ---------- */

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.75em;
  margin: 0;
  font-family: var(--sans);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.display {
  font-weight: 300;
  font-family: var(--sans);
  font-size: clamp(2.25rem, 8.5vw, 8.5rem);
  line-height: 1.08;
  letter-spacing: -0.035em;
  font-feature-settings: "kern", "liga", "dlig";
}
.display em { font-style: normal; font-weight: 700; font-size: 1.05em; letter-spacing: -0.02em; }
.display .accent, .accent { color: var(--accent); }

.h-section {
  font-weight: 300;
  font-family: var(--sans);
  font-size: clamp(2rem, 5.2vw, 4.6rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
}
.h-section em { font-style: normal; font-weight: var(--emphasis-weight); font-size: 1.04em; }

.lede {
  font-size: clamp(1.05rem, 1.4vw, 1.25rem);
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 34em;
}

.mono { font-family: var(--mono); }
.muted { color: var(--muted); }

.section-head {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
  margin-bottom: clamp(48px, 7vw, 96px);
}
@media (min-width: 900px) {
  .section-head { grid-template-columns: 3fr 9fr; align-items: end; }
  .section-head .kicker { align-self: start; padding-top: 1.2em; }
}
.section-head .section-head-end {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
}

/* Explicit heading line breaks, visible from the first render. */
.line { display: block; padding-bottom: 0.08em; margin-bottom: -0.08em; }
.line > span { display: inline-block; }

/* ---------- Links & buttons ---------- */

.link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding-block: 4px;
}
.link::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: currentColor;
  transform-origin: right;
  transition: transform 0.6s var(--ease);
}
.link:hover::after { transform: scaleX(0); }
.link .arrow { transition: transform 0.5s var(--ease); }
.link:hover .arrow { transform: translateX(4px); }
.link .arrow-ne { transition: transform 0.5s var(--ease); }
.link:hover .arrow-ne { transform: translate(3px, -3px); }

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  height: 52px;
  padding: 0 24px;
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  overflow: hidden;
  isolation: isolate;
  cursor: pointer;
  transition: color 0.5s var(--ease), border-color 0.5s var(--ease);
}
.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--accent);
  transform: translateY(101%);
  transition: transform 0.55s var(--ease);
}
.btn:hover { color: var(--on-accent); border-color: var(--accent); }
.btn:hover::before { transform: none; }
.btn-solid { background: var(--ink); color: var(--paper); }
.btn .arrow, .btn .arrow-ne { transition: transform 0.5s var(--ease); }
.btn:hover .arrow { transform: translateX(4px); }
.btn:hover .arrow-ne { transform: translate(3px, -3px); }

/* ---------- Header / nav ---------- */

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  height: var(--nav-h);
  transition: background-color 0.5s var(--ease), border-color 0.5s var(--ease), transform 0.6s var(--ease);
  border-bottom: 1px solid transparent;
}
.site-header.is-scrolled {
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  backdrop-filter: blur(14px) saturate(1.3);
  border-bottom-color: var(--rule);
}
.site-header.is-hidden { transform: translateY(-100%); }

.site-header .wrap {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand { display: inline-flex; align-items: center; position: relative; z-index: 2; }
.logo {
  display: block;
  height: 28px;
  aspect-ratio: 1778 / 617;
  background: currentColor;
  -webkit-mask: url("../images/logos/zkBricks-horizontal-outline.png") center / contain no-repeat;
  mask: url("../images/logos/zkBricks-horizontal-outline.png") center / contain no-repeat;
}
@media (min-width: 821px) {
  .site-header .logo { height: 48px; }
}
.logo-mark {
  display: block;
  aspect-ratio: 537 / 617;
  background: currentColor;
  -webkit-mask: url("../images/logos/logo-black.svg") center / contain no-repeat;
  mask: url("../images/logos/logo-black.svg") center / contain no-repeat;
}

.nav { display: flex; align-items: center; gap: 6px; }
.nav-links { display: flex; align-items: center; gap: 4px; margin: 0; padding: 0; list-style: none; }
.nav-links a {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 300;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
  transition: color 0.3s;
}
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--ink); }
.nav-links a[aria-current="page"] { font-weight: 600; }
.nav-links a[aria-current="page"]::before {
  content: "";
  position: absolute;
  left: 3px; top: 50%;
  width: 5px; height: 5px;
  margin-top: -2.5px;
  background: var(--accent);
}

.theme-toggle {
  display: inline-grid;
  place-items: center;
  width: 40px; height: 40px;
  margin-left: 8px;
  border: 1px solid var(--rule-strong);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transition: border-color 0.3s, transform 0.6s var(--ease);
}
.theme-toggle:hover { border-color: var(--ink); transform: rotate(180deg); }
.theme-toggle svg { width: 16px; height: 16px; }

.menu-toggle {
  display: none;
  position: relative;
  z-index: 2;
  width: 44px; height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.menu-toggle span {
  position: absolute;
  left: 11px; right: 11px;
  height: 1.5px;
  background: currentColor;
  transition: transform 0.5s var(--ease), top 0.5s var(--ease);
}
.menu-toggle span:nth-child(1) { top: 17px; }
.menu-toggle span:nth-child(2) { top: 26px; }
.menu-open .menu-toggle span:nth-child(1) { top: 21.5px; transform: rotate(45deg); }
.menu-open .menu-toggle span:nth-child(2) { top: 21.5px; transform: rotate(-45deg); }

@media (max-width: 820px) {
  .menu-toggle { display: block; }
  .nav {
    position: fixed;
    inset: 0;
    z-index: 1;
    flex-direction: column;
    align-items: stretch;
    justify-content: safe center;
    overflow-y: auto;
    gap: 40px;
    padding: calc(var(--nav-h) + 24px) var(--gutter) 40px;
    background: var(--paper);
    clip-path: inset(0 0 100% 0);
    visibility: hidden;
    transition: clip-path 0.8s var(--ease), visibility 0s 0.8s;
  }
  .menu-open .nav { clip-path: inset(0); visibility: visible; transition: clip-path 0.8s var(--ease); }
  .menu-open .site-header { background: transparent; border-color: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; }
  .nav-links { flex-direction: column; align-items: stretch; gap: 0; flex-shrink: 0; }
  .nav-links li { border-bottom: 1px solid var(--rule); }
  .nav-links a {
    display: flex;
    gap: 12px;
    padding: 16px 0;
    font-family: var(--sans);
    font-size: clamp(2rem, 8vw, 3.2rem);
    font-weight: 100;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--ink);
  }
  .nav-links a[aria-current="page"]::before { display: none; }
  .nav-links a[aria-current="page"] { font-weight: 600; }
  .nav-links .arrow-ne { font-size: 0.6em; align-self: center; }
  .theme-toggle { margin: 0; align-self: flex-start; flex-shrink: 0; }
}

/* ---------- Home: hero ---------- */

.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  padding-top: calc(var(--nav-h) + clamp(40px, 5vh, 72px));
}
.hero-inner {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(32px, 4vw, 64px);
  padding-bottom: clamp(48px, 6vh, 80px);
}
.hero-copy { display: flex; flex-direction: column; gap: clamp(28px, 3vw, 40px); min-width: 0; }
.hero .display { font-size: clamp(2.65rem, 5.85vw, 5.4rem); }
.hero-foot { display: grid; gap: 28px; max-width: 480px; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-stories { min-width: 0; align-self: center; }
.story-topline { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 20px; }
.story-motion { padding: 4px 0 4px 12px; border: 0; background: none; font-size: 11px; color: var(--ink-2); cursor: pointer; }
.story-motion:hover { color: var(--accent); }
.story-motion:disabled { cursor: default; color: var(--muted); }
.story-tabs { display: grid; grid-template-columns: repeat(4, auto); border-bottom: 1px solid var(--rule-strong); }
.story-tabs button { position: relative; display: block; padding: 12px 6px 14px; border: 0; background: none; font-size: 14px; font-weight: 400; line-height: 1.25; text-wrap: balance; color: var(--ink-2); text-align: left; cursor: pointer; }
/* Reserve the bold label width so selecting a tab never reflows its neighbours. */
.story-tabs button::before { content: attr(data-label); display: block; height: 0; overflow: hidden; visibility: hidden; font-weight: 700; }
.story-tabs button::after { content: ""; position: absolute; inset: auto 0 -1px; height: 2px; background: transparent; }
.story-tabs button[aria-selected="true"] { color: var(--accent); font-weight: 700; }
.story-tabs button[aria-selected="true"]::after { background: var(--accent); }
.story-tabs button:hover { color: var(--accent); }
.story-panel[hidden] { display: none; }
.story-panel { outline-offset: 8px; }
.story-stage { position: relative; aspect-ratio: 540 / 340; width: 100%; margin-block: 8px 12px; }
.scene-svg, .hero-canvas { display: block; width: 100%; height: 100%; }
.scene-svg { overflow: visible; }
.story-caption { border-top: 1px solid var(--rule); padding-top: 20px; }
.story-category { margin-bottom: 12px; color: var(--accent); font-size: 10.5px; font-weight: 600; letter-spacing: .11em; text-transform: uppercase; }
.story-caption h2 { font-size: clamp(1.65rem, 2.5vw, 2.25rem); line-height: 1.15; font-weight: 300; letter-spacing: -.025em; margin-bottom: 14px; }
.story-caption h2 em { font-style: normal; font-weight: var(--emphasis-weight); }
.story-caption > p:not(.story-category) { font-size: 15px; line-height: 1.55; color: var(--ink-2); max-width: 34em; min-height: 4.65em; margin-bottom: 18px; }
.story-caption .link { font-size: 11px; }
.story-impact { margin: -2px 0 22px; }
.story-impact-label { margin-bottom: 10px; color: var(--muted); font-size: 10.5px; font-weight: 600; letter-spacing: .11em; text-transform: uppercase; }
.story-impact ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; margin: 0; padding: 0; list-style: none; background: var(--rule); border: 1px solid var(--rule); }
/* An odd card out spans the full row instead of leaving a gap. */
.story-impact li:last-child:nth-child(odd) { grid-column: 1 / -1; }
.story-impact a { display: flex; flex-direction: column; gap: 3px; height: 100%; padding: 10px 12px; background: var(--paper); color: var(--ink); text-decoration: none; }
.story-impact b { font-size: 13.5px; font-weight: 700; }
.story-impact b::after { content: " ↗"; font-weight: 400; color: var(--muted); }
.story-impact span { font-size: 12.5px; line-height: 1.35; color: var(--ink-2); }
.story-impact a:hover b, .story-impact a:hover b::after { color: var(--accent); }
/* Stack the panels in one cell so switching stories never changes the hero's height. */
.js .hero-stories { display: grid; grid-template-columns: minmax(0, 1fr); }
.js .story-panel { grid-row: 3; grid-column: 1; }
.js .story-panel[hidden] { display: block; visibility: hidden; }
.diagram-body { fill: var(--paper-2); }
.diagram-top { fill: var(--paper); }
.diagram-blue { fill: var(--accent-surface); stroke: var(--accent); }
.diagram-badge { fill: var(--accent-surface); stroke: var(--accent); }
.diagram-check { stroke: var(--accent); stroke-width: 2.5; }
.isometric-check { fill: none; stroke: var(--accent); stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.diagram-guide { stroke: var(--rule-strong); }
.diagram-ghost { opacity: .3; }
.diagram-label { font-family: var(--sans); font-size: 12px; font-weight: 600; letter-spacing: 1.1px; fill: var(--ink-2); stroke: none; }
.diagram-accent-text { fill: var(--accent); }
.diagram-accent-line { stroke: var(--accent); }
.js .is-playing .pp-vrc { animation: pp-vouch 9s var(--ease) infinite both; }
.js .is-playing .pp-proof { animation: pp-prove 9s var(--ease) infinite both; }
.js .is-playing .pp-tick { animation: pp-tick 9s var(--ease) infinite both; }
.leak-digit { font-family: var(--sans); font-size: 17px; font-weight: 600; fill: var(--accent); stroke: none; }
.leak-secret text { font-family: var(--sans); font-size: 10px; font-weight: 600; fill: var(--accent); fill-opacity: .4; stroke: none; }
.leak-rows text { font-family: var(--sans); font-size: 9px; fill: var(--muted); stroke: none; }
.heat-hit, .heat-noise { opacity: 0; }
.js .is-playing .leak-refuse { animation: refuse-request 10s var(--ease) infinite both; }
.js .is-playing .leak-stream { animation: stream-replies 10s linear infinite both; }
.js .is-playing .leak-output { animation: leak-output 1.5s var(--ease) infinite both; }
.js .is-playing .leak-output:nth-child(2) { animation-delay: .5s; }
.js .is-playing .leak-output:nth-child(3) { animation-delay: 1s; }
.js .is-playing .heat-hit { animation: heat-lock 10s var(--ease) infinite both; animation-delay: var(--d, 0s); }
.js .is-playing .heat-noise { animation: heat-noise 10s var(--ease) infinite both; animation-delay: var(--d, 0s); }
.js .is-playing .leak-digit { animation: reveal-secret 10s var(--ease) infinite both; }
.babe-coin { font-family: var(--sans); font-size: 22px; font-weight: 600; fill: var(--accent); stroke: none; }
.babe-pi { font-family: var(--serif, serif); font-size: 15px; fill: var(--accent); stroke: none; }
.cost-label { font-family: var(--sans); font-size: 11px; font-weight: 600; letter-spacing: .4px; fill: var(--ink-2); stroke: none; }
.cost-accent { fill: var(--accent); }
.babe-bar { transform-origin: 40px 248px; transform: scaleX(.012); }
.js .is-playing .babe-proof { animation: babe-proof 8s var(--ease) infinite both; }
.js .is-playing .babe-check { animation: babe-check 8s var(--ease) infinite both; }
.js .is-playing .babe-bar { animation: babe-shrink 8s var(--ease) infinite both; }
.js .is-playing .babe-gain { animation: babe-gain 8s var(--ease) infinite both; }
.js .is-playing .sig-msg-a { animation: sig-send 8s var(--ease) infinite both; }
.js .is-playing .sig-msg-b { animation: sig-reply 8s var(--ease) infinite both; }
.js .is-playing .sig-ratchet { animation: sig-ratchet 8s var(--ease) infinite both; }
.js .is-playing .sig-lens { animation: sig-inspect 8s var(--ease) infinite both; }
.js .is-playing .sig-check { animation: sig-check 8s var(--ease) infinite both; }
.hero-stories.is-paused *, .hero-stories.is-suspended * { animation-play-state: paused !important; }
/* Each endorsement travels from its voucher to the person's stack, then the stack is replaced by one proof. */
@keyframes pp-vouch {
  0%, 4% { transform: translate(var(--fx), var(--fy)); opacity: 0; }
  8% { transform: translate(var(--fx), var(--fy)); opacity: 1; }
  24%, 46% { transform: translate(0, 0); opacity: 1; }
  52%, 100% { transform: translate(0, 0); opacity: 0; }
}
@keyframes pp-prove {
  0%, 48% { transform: translateX(-44px); opacity: 0; }
  54% { transform: translateX(-44px); opacity: 1; }
  68% { transform: translateX(44px); opacity: 1; }
  72%, 100% { transform: translateX(44px); opacity: 0; }
}
@keyframes pp-tick { 0%, 70%, 100% { opacity: 0; } 74%, 94% { opacity: 1; } }
@keyframes refuse-request { 0%, 3%, 24%, 100% { opacity: 0; } 7%, 18% { opacity: 1; } }
@keyframes stream-replies { 0%, 18%, 76%, 100% { opacity: 0; } 22%, 72% { opacity: 1; } }
@keyframes leak-output {
  0% { transform: translateX(0); opacity: 0; }
  20% { opacity: 1; }
  80% { opacity: 1; }
  100% { transform: translateX(44px); opacity: 0; }
}
/* Each reply sharpens the estimate: wrong guesses flicker out while the true digit in each column locks in. */
@keyframes heat-lock { 0%, 20% { opacity: 0; } 34% { opacity: .25; } 48% { opacity: .5; } 62% { opacity: .8; } 72%, 94% { opacity: 1; } 100% { opacity: 0; } }
@keyframes heat-noise { 0%, 20% { opacity: 0; } 32% { opacity: .4; } 46% { opacity: .22; } 60% { opacity: .08; } 68%, 100% { opacity: 0; } }
@keyframes reveal-secret { 0%, 72%, 100% { opacity: 0; } 77%, 94% { opacity: 1; } }
@keyframes babe-proof {
  0%, 6% { transform: translate(-96px, 24px); opacity: 0; }
  14% { transform: translate(-96px, 24px); opacity: 1; }
  36% { transform: translate(0, 0); opacity: 1; }
  44%, 100% { transform: translate(0, 0); opacity: 0; }
}
@keyframes babe-check { 0%, 42%, 100% { opacity: 0; } 48%, 92% { opacity: 1; } }
/* BABE's bar starts at BitVM3's length and collapses to roughly a thousandth of it. */
@keyframes babe-shrink { 0%, 48% { transform: scaleX(1); } 66%, 94% { transform: scaleX(.012); } 100% { transform: scaleX(1); } }
@keyframes babe-gain { 0%, 62%, 100% { opacity: 0; } 68%, 92% { opacity: 1; } }
@keyframes sig-send { 0%, 4% { transform: translateX(0); opacity: 0; } 8% { opacity: 1; } 28% { transform: translateX(102px); opacity: 1; } 32%, 100% { transform: translateX(102px); opacity: 0; } }
@keyframes sig-reply { 0%, 36% { transform: translateX(0); opacity: 0; } 40% { opacity: 1; } 60% { transform: translateX(-102px); opacity: 1; } 64%, 100% { transform: translateX(-102px); opacity: 0; } }
/* Both parties advance their ratchet with every message. */
@keyframes sig-ratchet { 0%, 28% { transform: rotate(0); } 34%, 60% { transform: rotate(45deg); } 66%, 94% { transform: rotate(90deg); } 100% { transform: rotate(90deg); } }
@keyframes sig-inspect {
  0%, 4% { transform: translateX(-40px); opacity: 0; }
  10% { transform: translateX(-40px); opacity: 1; }
  66% { transform: translateX(40px); opacity: 1; }
  74%, 100% { transform: translateX(40px); opacity: 0; }
}
@keyframes sig-check { 0%, 68%, 100% { opacity: 0; } 74%, 94% { opacity: 1; } }
.no-js .story-tabs, .no-js .story-motion, .no-js .hero-canvas { display: none; }
.no-js .story-panel[hidden] { display: block; }
.no-js .story-panel + .story-panel { margin-top: 40px; }


@media (max-width: 1050px) {
  .hero-inner { grid-template-columns: minmax(0, 1fr); gap: 56px; }
  .hero-copy { max-width: 720px; }
  .hero .display { font-size: clamp(2.65rem, 8vw, 5.4rem); }
  .hero-stories { width: 100%; max-width: 620px; justify-self: center; }
  .story-caption > p:not(.story-category) { min-height: 0; }
}
@media (max-width: 600px) {
  .story-tabs { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .story-tabs button { min-width: 0; min-height: 56px; font-size: 13px; padding: 10px 4px 12px; text-align: center; }
  .story-topline .kicker { font-size: 10px; letter-spacing: .1em; }
  .story-caption h2 { font-size: 1.8rem; }
  .diagram-label { font-size: 15px; letter-spacing: .5px; }
}
/* Keep the longer labels readable on narrow phones. */
@media (max-width: 360px) {
  .story-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .story-tabs button { min-height: 48px; border-bottom: 1px solid var(--rule); }
}
@media (prefers-reduced-motion: reduce) {
  .js .pp-tick, .js .leak-digit, .js .heat-hit, .js .babe-check, .js .babe-gain, .js .sig-check { animation: none !important; transform: none; opacity: 1; }
  .js .leak-refuse, .js .sig-lens, .js .sig-ratchet { animation: none !important; }
  .js .babe-proof, .js .sig-msg, .js .pp-proof { animation: none !important; opacity: 0; }
  .js .pp-vrc { animation: none !important; transform: none; opacity: 1; }
  .js .babe-bar { animation: none !important; }
  .js .leak-stream, .js .heat-noise { animation: none !important; opacity: 0; }
}

/* ---------- Home: numbers ---------- */

.numbers {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  border-top: 1px solid var(--rule-strong);
}
.number {
  padding: clamp(24px, 3vw, 40px) clamp(0px, 2vw, 28px) clamp(24px, 3vw, 40px) 0;
  border-bottom: 1px solid var(--rule);
}
.number + .number { padding-left: clamp(16px, 2vw, 28px); border-left: 1px solid var(--rule); }
.number:nth-child(3) { padding-left: 0; border-left: 0; }
.number-value {
  display: block;
  font-family: var(--sans);
  font-size: clamp(4rem, 9vw, 8.5rem);
  line-height: 1.08;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}
.number-value sup { font-size: 0.35em; vertical-align: 1.4em; margin-left: 0.08em; color: var(--accent); font-family: var(--sans); letter-spacing: 0; }
.number-label { display: block; margin-top: 14px; font-family: var(--sans); font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); max-width: 22em; line-height: 1.5; }
@media (min-width: 900px) {
  .numbers { grid-template-columns: repeat(4, 1fr); }
  .number:nth-child(3) { padding-left: clamp(16px, 2vw, 28px); border-left: 1px solid var(--rule); }
}

/* ---------- Paper rows (home selected work + research featured) ---------- */

.rows { border-top: 1px solid var(--rule-strong); }
.row-link {
  position: relative;
  display: grid;
  grid-template-columns: 56px 1fr 28px;
  gap: 8px 20px;
  align-items: baseline;
  padding: 26px 0;
  border-bottom: 1px solid var(--rule-strong);
  isolation: isolate;
}
.row-link::before {
  content: "";
  position: absolute;
  inset: 0 calc(-1 * var(--gutter));
  z-index: -1;
  background: var(--paper-2);
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform 0.6s var(--ease);
}
.row-link:hover::before { transform: scaleY(1); }
.row-year { font-family: var(--sans); font-size: 12px; color: var(--muted); letter-spacing: 0.06em; }
.row-title {
  font-family: var(--sans);
  font-size: clamp(1.6rem, 2.6vw, 2.4rem);
  line-height: 1.08;
  letter-spacing: -0.015em;
  transition: transform 0.6s var(--ease);
}
.row-link:hover .row-title { transform: translateX(8px); }
.row-meta { grid-column: 2; display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; font-size: 14px; color: var(--muted); }
.row-arrow { grid-row: 1; grid-column: 3; justify-self: end; font-family: var(--sans); transition: transform 0.5s var(--ease), color 0.3s; }
.row-link:hover .row-arrow { transform: translate(3px, -3px); color: var(--accent); }
@media (min-width: 900px) {
  .row-link { grid-template-columns: 3fr 6fr 2fr 1fr; gap: 32px; padding: 32px 0; }
  .row-meta { grid-column: 3; grid-row: 1; flex-direction: column; align-items: flex-start; gap: 4px; }
  .row-arrow { grid-column: 4; }
}

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

.posts-grid { display: grid; gap: clamp(40px, 5vw, 64px); }
@media (min-width: 900px) { .posts-grid { grid-template-columns: 1fr 1fr; } }
.post-card { display: flex; flex-direction: column; gap: 22px; }
.post-card-img {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--rule);
}
.post-card-img img {
  width: 100%; height: 100%;
  object-fit: contain;
  padding: 6%;
  transition: transform 1.2s var(--ease);
}
.post-card:hover .post-card-img img { transform: scale(1.04); }
.post-card-img::after {
  content: "Read";
  position: absolute;
  right: 16px; bottom: 16px;
  padding: 8px 12px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.4s, transform 0.6s var(--ease);
}
.post-card:hover .post-card-img::after { opacity: 1; transform: none; }
.post-card-meta { display: flex; gap: 16px; font-family: var(--sans); font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.post-card-title { font-weight: 600; font-family: var(--sans); font-size: clamp(1.9rem, 3vw, 2.8rem); line-height: 1.08; letter-spacing: -0.02em; }
.post-card-excerpt { color: var(--ink-2); margin: 0; max-width: 34em; }

/* ---------- People strip ---------- */

.people-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; }
@media (min-width: 900px) {
  /* Align with the heading column of .section-head (3fr / 9fr, 28px gap). */
  .people-strip { grid-template-columns: repeat(4, 1fr); gap: 24px; margin-left: calc((100% - 28px) * 0.25 + 28px); }
}
.person-mini { display: block; }
.person-mini-img { aspect-ratio: 4 / 5; overflow: hidden; background: var(--paper-2); margin-bottom: 16px; }
.person-mini-img img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.05); transition: filter 0.8s var(--ease), transform 1.2s var(--ease); }
.person-mini:hover img { filter: none; transform: scale(1.035); }
.person-mini-name { font-weight: 600; font-family: var(--sans); font-size: 1.7rem; line-height: 1.1; letter-spacing: -0.01em; }
.person-mini-role { font-family: var(--sans); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-top: 4px; }

/* ---------- Closing CTA ---------- */

.closer { text-align: left; }
.closer .display { font-size: clamp(2.5rem, 7.5vw, 7.5rem); max-width: 10em; }
.closer-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: clamp(32px, 5vw, 56px); }

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

.site-footer {
  position: relative;
  border-top: 1px solid var(--rule-strong);
  padding-top: clamp(48px, 6vw, 80px);
  overflow: hidden;
}
.footer-grid { display: grid; gap: 40px; grid-template-columns: repeat(2, 1fr); }
.footer-col h2 { font-family: var(--sans); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin-bottom: 16px; }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.footer-col a { position: relative; transition: color 0.3s; }
.footer-col a:hover { color: var(--accent); }
.footer-intro { grid-column: 1 / -1; min-width: 0; }
.footer-contact { display: inline-block; margin-top: 20px; color: var(--accent); overflow-wrap: anywhere; }
.footer-contact:hover { text-decoration: underline; text-underline-offset: 4px; }
.footer-statement { font-family: var(--sans); font-size: clamp(1.6rem, 2.6vw, 2.2rem); line-height: 1.1; letter-spacing: -0.01em; max-width: 14em; margin: 0; }
.footer-statement em { font-style: normal; font-weight: var(--emphasis-weight); }
@media (min-width: 900px) {
  .footer-grid { grid-template-columns: 6fr 2fr 2fr 2fr; }
  .footer-intro { grid-column: auto; }
}
.footer-mark {
  display: block;
  width: clamp(220px, 26vw, 320px);
  max-width: 100%;
  aspect-ratio: 1778 / 617;
  margin-block: clamp(40px, 5vw, 64px) 40px;
  background: var(--ink);
  -webkit-mask: url("../images/logos/zkBricks-horizontal-outline.png") center bottom / contain no-repeat;
  mask: url("../images/logos/zkBricks-horizontal-outline.png") center bottom / contain no-repeat;
  opacity: 0.95;
}
.footer-base .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
.footer-base {
  padding-block: 20px;
  border-top: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  position: relative;
  background: var(--paper);
}

/* ---------- Page header (inner pages) ---------- */

.page-head { padding-top: calc(var(--nav-h) + clamp(56px, 10vw, 140px)); padding-bottom: clamp(48px, 7vw, 96px); }
.page-head .display { margin-top: 28px; }
.page-head .display em, .closer .display em { font-weight: var(--emphasis-weight); }
.page-head-grid { display: grid; gap: 32px; margin-top: clamp(32px, 4vw, 56px); }
@media (min-width: 900px) {
  .page-head-grid { grid-template-columns: 6fr 6fr; align-items: end; }
}

.stats-inline { display: flex; flex-wrap: wrap; gap: 0; border-top: 1px solid var(--rule-strong); }
.stat-inline { flex: 1 1 0; min-width: 120px; padding: 18px 20px 0 0; }
.stat-inline + .stat-inline { padding-left: 20px; border-left: 1px solid var(--rule); }
.stat-inline b { display: block; font-family: var(--sans); font-weight: 400; font-size: clamp(2.4rem, 4vw, 3.4rem); line-height: 1; letter-spacing: -0.03em; }
.stat-inline > span { display: block; margin-top: 8px; font-family: var(--sans); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }

/* Align the abbreviated end year with the final digits of the start year. */
.stat-inline .stat-year-range { display: inline-grid; justify-items: end; font-variant-numeric: tabular-nums; }
.stat-year-range > span { white-space: nowrap; }
.stat-year-dash { opacity: .3; }

/* ---------- Contact ---------- */

.contact-head .display { margin-top: 0; font-weight: var(--emphasis-weight); }
.contact-head .lede { margin-top: clamp(28px, 4vw, 48px); }
.contact-details { display: flex; flex-wrap: wrap; align-items: center; gap: 24px 32px; margin-top: clamp(36px, 5vw, 64px); }
.contact-email { color: var(--accent); font-size: clamp(1.5rem, 4.5vw, 3.5rem); font-weight: 600; line-height: 1.2; letter-spacing: -0.025em; overflow-wrap: anywhere; }
.contact-email:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.16em; }
.contact-copy { flex-shrink: 0; }
.contact-copy[hidden] { display: none; }
.contact-status { min-height: 1.5em; margin-top: 16px; font-size: 14px; color: var(--ink-2); }

/* ---------- Research: publication wall ---------- */

.brick, .chip { --area-rgb: var(--research-other); --area-fill: color-mix(in srgb, rgb(var(--area-rgb)) var(--tower-left-tint), var(--paper)); }
.brick[data-area="crypto"], .chip[data-area="crypto"] { --area-rgb: var(--research-crypto); }
.brick[data-area="security"], .chip[data-area="security"] { --area-rgb: var(--research-security); }
.brick[data-area="theory"], .chip[data-area="theory"] { --area-rgb: var(--research-theory); }
.brick[data-area="ml"], .chip[data-area="ml"] { --area-rgb: var(--research-ml); }
.wall-note { max-width: 44em; margin: 0 0 20px; color: var(--muted); font-size: 14px; }
.wall-wrap { position: relative; }
.wall-scroll { overflow-x: auto; padding-block: 8px; scrollbar-width: thin; scrollbar-color: var(--rule-strong) transparent; }
.wall {
  display: grid;
  grid-template-columns: repeat(var(--wall-years), minmax(64px, 1fr));
  min-width: calc(var(--wall-years) * 64px);
  max-width: 1000px;
  align-items: end;
  padding: 8px 0;
}
.wall-col { display: flex; flex-direction: column; align-items: center; min-width: 0; }
.paper-tower { width: 56px; max-width: none; height: auto; overflow: visible; fill: none; }
.wall-year { display: block; width: 100%; margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--rule); font-family: var(--sans); font-size: 11px; color: var(--muted); text-align: center; }
.wall-scroll-hint { display: none; color: var(--muted); font-size: 12px; margin-top: 12px; }
@media (max-width: 760px) { .wall-scroll-hint { display: block; } }
.brick { color: color-mix(in srgb, var(--ink) 65%, var(--paper)); cursor: pointer; }
.paper-cube-body { fill: var(--paper); stroke: none; }
.paper-cube-left { fill: var(--area-fill); }
.paper-cube-right { fill: color-mix(in srgb, rgb(var(--area-rgb)) var(--tower-right-tint), var(--paper)); }
.paper-cube-top { fill: color-mix(in srgb, rgb(var(--area-rgb)) var(--tower-top-tint), var(--paper)); }
.paper-cube-faces { transition: opacity 0.2s; }
.paper-cube-edge { fill: none; stroke: currentColor; stroke-width: 1; stroke-linejoin: round; vector-effect: non-scaling-stroke; transition: stroke 0.2s; }
.brick:hover, .brick:focus-visible, .brick.is-hot, .wall.is-filtered .brick.is-match { color: var(--ink); }
.brick:hover .paper-cube-faces, .brick:focus-visible .paper-cube-faces, .brick.is-hot .paper-cube-faces, .wall.is-filtered .brick.is-match .paper-cube-faces { opacity: 1; }
.brick:focus-visible { outline: none; }
.brick:focus-visible .paper-cube-edge { stroke-width: 2.5; }
.wall.is-filtered .brick:not(.is-match) { color: var(--rule); }
.wall.is-filtered .brick:not(.is-match) .paper-cube-faces { opacity: 0.2; }

.wall-tip {
  position: absolute;
  z-index: 5;
  width: max-content;
  max-width: min(340px, 80vw);
  padding: 14px 16px;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--rule-strong);
  pointer-events: none;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.2s, transform 0.3s var(--ease);
}
.wall-tip.is-on { opacity: 1; transform: none; }
.wall-tip-meta { font-family: var(--sans); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; opacity: 0.7; margin-bottom: 6px; }
.wall-tip-title { font-family: var(--sans); font-size: 1.25rem; line-height: 1.15; }

.legend { display: flex; flex-wrap: wrap; gap: 4px 20px; margin: 0; padding: 0; list-style: none; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 6px 0;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 400;
  color: var(--ink-2);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.chip::before { content: ""; width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--area-fill); }
.chip:hover { color: var(--ink); }
.chip[aria-pressed="true"] { border-bottom-color: rgb(var(--area-rgb)); color: var(--ink); font-weight: 600; }
.chip .ct { color: var(--muted); font-size: 12px; }
.chip[aria-pressed="true"] .ct { color: inherit; }

/* ---------- Research: featured ---------- */

.featured-grid { display: grid; border-top: 1px solid var(--rule-strong); border-left: 1px solid var(--rule-strong); }
@media (min-width: 700px) { .featured-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .featured-grid { grid-template-columns: repeat(3, 1fr); } }
.feat {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 260px;
  padding: clamp(22px, 2.4vw, 32px);
  border-right: 1px solid var(--rule-strong);
  border-bottom: 1px solid var(--rule-strong);
  background: var(--paper);
  transition: background-color 0.5s var(--ease);
}
.feat:hover { background: var(--paper-2); }
.feat-top { display: flex; justify-content: space-between; gap: 12px; font-family: var(--sans); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.feat-venue { color: var(--ink); }
.feat-title { font-weight: 600; font-family: var(--sans); font-size: clamp(1.6rem, 2.2vw, 2rem); line-height: 1.08; letter-spacing: -0.01em; flex: 1; }
.feat-authors { font-size: 13.5px; color: var(--muted); line-height: 1.45; margin: 0; }
.feat-arrow { position: absolute; right: clamp(22px, 2.4vw, 32px); bottom: clamp(22px, 2.4vw, 32px); font-family: var(--sans); transition: transform 0.5s var(--ease), color 0.3s; }
.feat:hover .feat-arrow { transform: translate(3px, -3px); color: var(--accent); }
.feat .feat-authors { padding-right: 32px; }

.is-team { color: var(--accent); font-weight: 400; }

/* ---------- Research: list ---------- */

.pub-tools {
  position: sticky;
  top: var(--nav-h);
  z-index: 4;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  background: color-mix(in srgb, var(--paper) 90%, transparent);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--rule-strong);
}
.search {
  position: relative;
  flex: 1 1 260px;
  max-width: 380px;
}
.search input {
  width: 100%;
  height: 40px;
  padding: 0 14px 0 36px;
  border: 1px solid var(--rule-strong);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 13px;
  -webkit-appearance: none;
  appearance: none;
}
.search input::placeholder { color: var(--muted); }
.search input:focus { outline: none; border-color: var(--ink); }
.search svg { position: absolute; left: 12px; top: 50%; width: 14px; height: 14px; margin-top: -7px; color: var(--muted); }
.pub-count { font-family: var(--sans); font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }

.year-group { display: grid; gap: 8px 32px; padding-block: 28px 12px; border-bottom: 1px solid var(--rule); }
.year-label {
  font-family: var(--sans);
  font-size: clamp(2.6rem, 5vw, 4.4rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  color: var(--ink);
}
@media (min-width: 900px) {
  .year-group { grid-template-columns: 3fr 9fr; }
  .year-label { position: sticky; top: calc(var(--nav-h) + 90px); align-self: start; }
}
.pubs { list-style: none; margin: 0; padding: 0; }
.pub {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 24px;
  padding: 16px 0 18px;
  border-top: 1px solid var(--rule);
  transition: background-color 0.8s;
}
.pub:first-child { border-top: 0; padding-top: 4px; }
.pub-title { font-size: 1.08rem; font-weight: 600; line-height: 1.35; letter-spacing: -0.005em; }
.pub-title a { background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size 0.5s var(--ease); }
.pub-title a:hover { background-size: 100% 1px; }
.pub-authors { grid-column: 1; font-size: 14px; color: var(--muted); line-height: 1.5; }
.pub-venue { grid-row: 1 / span 2; grid-column: 2; align-self: start; justify-self: end; text-align: right; }
.pub-venue .tag { display: inline-flex; align-items: center; gap: 7px; }
.pub.is-flash { background: var(--accent-soft); }
.pub[hidden], .year-group[hidden] { display: none; }
.pubs-empty { padding: 48px 0; font-family: var(--sans); font-size: 2rem; color: var(--muted); }

/* ---------- Team ---------- */

.group-label { display: flex; justify-content: space-between; align-items: baseline; padding-bottom: 16px; border-bottom: 1px solid var(--rule-strong); margin-bottom: 0; }
.people { margin-bottom: clamp(72px, 10vw, 140px); }
.person {
  display: grid;
  gap: 28px;
  padding-block: clamp(32px, 5vw, 64px);
  border-bottom: 1px solid var(--rule);
}
.person-img {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--paper-2);
  max-width: 440px;
}
.person-img img {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: grayscale(1) contrast(1.06) brightness(1.02);
  transform: scale(1.04);
  transition: filter 1s var(--ease), transform 1.6s var(--ease);
}
.person:hover .person-img img { filter: none; transform: scale(1); }
.person-name {
  font-weight: 300; font-family: var(--sans); font-size: clamp(2.6rem, 5.4vw, 5rem); line-height: 1.08; letter-spacing: -0.03em; }
.person-role { margin-top: 14px; font-family: var(--sans); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); }
.person-bio { margin-top: 24px; color: var(--ink-2); max-width: 36em; font-size: 1.05rem; }
.person-foot { display: flex; flex-wrap: wrap; gap: 20px 32px; align-items: center; margin-top: 28px; }
.person-stat { font-family: var(--sans); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.person-stat b { font-family: var(--sans); font-size: 2rem; font-weight: 400; color: var(--ink); letter-spacing: -0.02em; margin-right: 6px; text-transform: none; }
@media (min-width: 900px) {
  .person { grid-template-columns: 3fr 1fr 8fr; }
  .person-img { grid-column: 1; }
  .person-text { grid-column: 3; align-self: end; }
  .person:nth-child(even) .person-img { grid-column: 3; grid-row: 1; justify-self: end; width: 100%; max-width: 360px; }
  .person:nth-child(even) .person-text { grid-column: 1 / span 2; grid-row: 1; }
}

/* ---------- Blog index ---------- */

.post-list { border-top: 1px solid var(--rule-strong); }
.post-item {
  position: relative;
  display: grid;
  gap: 18px;
  padding-block: clamp(32px, 4vw, 56px);
  border-bottom: 1px solid var(--rule-strong);
}
.post-item-title {
  font-family: var(--sans);
  font-size: clamp(2.4rem, 5.2vw, 4.8rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  transition: transform 0.7s var(--ease);
}
.post-item:hover .post-item-title { transform: translateX(12px); }
.post-item-title a::after { content: ""; position: absolute; inset: 0; }
.post-item-excerpt { color: var(--ink-2); max-width: 38em; margin: 0; }
.post-item-excerpt p { margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.post-item-meta { display: flex; flex-wrap: wrap; gap: 6px 20px; font-family: var(--sans); font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.post-item-thumb { aspect-ratio: 16 / 10; background: #fff; border: 1px solid var(--rule); overflow: hidden; }
.post-item-thumb img { width: 100%; height: 100%; object-fit: contain; padding: 6%; transition: transform 1.2s var(--ease); }
.post-item:hover .post-item-thumb img { transform: scale(1.05); }
@media (min-width: 900px) {
  .post-item { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 32px; align-items: start; }
  .post-item-body { display: grid; gap: 20px; }
}

/* Reuse article SVGs for covers so artwork and theme colors stay in sync. */
.post-thumb-figure { background: var(--paper); color: var(--ink); }
.post-thumb-figure .figure-svg { width: 100%; height: 100%; padding: 5%; }

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

.progress {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 60;
  height: 2px;
  background: var(--accent);
  transform-origin: left;
  transform: scaleX(0);
}

.post-head { padding-top: calc(var(--nav-h) + clamp(48px, 9vw, 120px)); padding-bottom: clamp(40px, 6vw, 80px); border-bottom: 1px solid var(--rule-strong); }
.post-title {
  font-weight: 300;
  margin-top: 28px;
  font-family: var(--sans);
  font-size: clamp(2.8rem, 7.4vw, 7rem);
  line-height: 1.08;
  letter-spacing: -0.035em;
  max-width: 13em;
}
.post-byline { display: flex; flex-wrap: wrap; gap: 8px 28px; margin-top: 36px; font-family: var(--sans); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.post-byline b { font-weight: 600; color: var(--ink); }

.post-layout { display: grid; gap: 40px; padding-block: clamp(40px, 6vw, 80px); }
@media (min-width: 1000px) {
  .post-layout { grid-template-columns: 3fr 7fr 2fr; gap: 48px; }
  .post-layout.no-toc .article { grid-column: 2; }
}

.toc { font-size: 14px; }
.toc-toggle {
  display: flex;
  width: 100%;
  justify-content: space-between;
  align-items: center;
  padding: 0 0 12px;
  border: 0;
  border-bottom: 1px solid var(--rule-strong);
  background: none;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  cursor: pointer;
}
.toc-toggle::after { content: "−"; font-size: 14px; }
.toc.is-collapsed .toc-toggle::after { content: "+"; }
.toc.is-collapsed .toc-list { display: none; }
.toc-items { list-style: none; margin: 0; padding: 12px 0 0; }
.toc-item a {
  position: relative;
  display: block;
  padding: 6px 0 6px 18px;
  color: var(--muted);
  line-height: 1.35;
  transition: color 0.3s;
}
.toc-item a::before {
  content: "";
  position: absolute;
  left: 0; top: 50%;
  width: 8px; height: 1px;
  background: currentColor;
  transition: width 0.4s var(--ease), background-color 0.3s;
}
.toc-item a:hover { color: var(--ink); }
.toc-item a.is-active { color: var(--ink); }
.toc-item a.is-active::before { width: 12px; background: var(--accent); height: 2px; margin-top: -0.5px; }
.toc-item.is-child a { padding-left: 32px; font-size: 13px; }
.toc-item.is-child a::before { left: 14px; width: 5px; }
@media (min-width: 1000px) {
  .toc { position: sticky; top: calc(var(--nav-h) + 32px); align-self: start; max-height: calc(100vh - var(--nav-h) - 64px); overflow: auto; }
}

/* Article typography */
.article { min-width: 0; font-size: 1.08rem; line-height: 1.75; color: var(--ink-2); }
.article > * { max-width: 44rem; }
.article p, .article ul, .article ol { margin: 0 0 1.35em; }
.article strong { color: var(--ink); font-weight: 600; }
.article h2, .article h3, .article h4 { color: var(--ink); scroll-margin-top: calc(var(--nav-h) + 24px); }
.article h2 { font-family: var(--sans); font-size: clamp(2rem, 3.4vw, 2.8rem); line-height: 1.05; letter-spacing: -0.02em; margin: 2.2em 0 0.6em; }
.article h3 { font-family: var(--sans); font-size: 1.2rem; font-weight: 600; letter-spacing: -0.01em; margin: 1.8em 0 0.5em; }
.article h4 { font-family: var(--sans); font-size: 0.8rem; letter-spacing: 0.1em; text-transform: uppercase; margin: 1.6em 0 0.4em; }
.article a:not(.footnote):not(.reversefootnote) {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: text-decoration-thickness 0.2s;
}
.article a:hover { text-decoration-thickness: 2px; }
.article ul, .article ol { padding-left: 1.3em; }
.article li { margin-bottom: 0.5em; }
.article li::marker { color: var(--accent); font-family: var(--sans); font-size: 0.9em; }
.article blockquote {
  margin: 2em 0;
  padding: 0 0 0 1.4em;
  border-left: 2px solid var(--accent);
  font-family: var(--sans);
  font-size: 1.6rem;
  line-height: 1.3;
  color: var(--ink);
}
.article blockquote p:last-child { margin: 0; }
.article hr { border: 0; height: 1px; background: var(--rule-strong); margin: 3em 0; }
.article img { margin-inline: auto; }
.article > p > img, .article p > img:only-child {
  background: #fff;
  border: 1px solid var(--rule);
  padding: 4%;
  margin-block: 2em;
}
.article > p > em:only-child, .article > p:has(> em:only-child) { font-size: 0.92rem; color: var(--muted); }
.article code {
  font-family: var(--mono);
  font-size: 0.86em;
  padding: 0.15em 0.4em;
  background: var(--paper-2);
  color: var(--ink);
}
.article pre {
  margin: 0 0 1.5em;
  padding: 1.2em 1.4em;
  overflow-x: auto;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  font-size: 0.92rem;
  line-height: 1.6;
}
.article pre code { padding: 0; background: none; font-size: inherit; }
.article table { width: 100%; border-collapse: collapse; margin: 0 0 1.5em; font-size: 0.95rem; }
.article th, .article td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--rule); }
.article th { font-family: var(--sans); font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }

.article .footnotes { margin-top: 4em; padding-top: 2em; border-top: 1px solid var(--rule-strong); font-size: 0.9rem; color: var(--muted); }
.article .footnotes ol { padding-left: 1.4em; }
.article .footnotes a { word-break: break-word; }
.article sup a, .article a.footnote {
  display: inline-block;
  min-width: 1.5em;
  padding: 0 0.3em;
  margin-left: 1px;
  font-family: var(--sans);
  font-size: 0.72em;
  line-height: 1.5;
  text-align: center;
  text-decoration: none !important;
  background: var(--accent-soft);
  color: var(--accent) !important;
}
.article a.reversefootnote { text-decoration: none; color: var(--accent); margin-left: 4px; }

/* Components used inside posts */
.jellyk-figure { margin: 2em auto; }
.jellyk-figure img { background: #fff; border: 1px solid var(--rule); }
.jellyk-figure figcaption { font-size: 0.85rem; line-height: 1.5; color: var(--muted); }
.jellyk-highlight-box, .jellyk-claim-box, .jellyk-code-box { margin: 1.8em 0; }
.jellyk-highlight-box {
  position: relative;
  padding: 1.1em 1.4em 1.1em 1.6em;
  background: var(--paper-2);
  border-left: 2px solid var(--accent);
  color: var(--ink);
}
.jellyk-highlight-box p:last-child, .jellyk-claim-box p:last-child { margin: 0; }
.jellyk-claim-box {
  padding: 1.2em 1.4em;
  border: 1px dashed var(--rule-strong);
  font-family: var(--sans);
  font-size: 1.4rem;
  line-height: 1.3;
  color: var(--ink);
}
.jellyk-claim-box strong { font-family: var(--sans); font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; display: block; color: var(--accent); margin-bottom: 4px; }
.jellyk-code-box pre { margin: 0; }

/* Inline SVG figures in posts, drawn with the same tokens and line work as the homepage scenes so they follow the theme. */
.post-figure { margin: 2.4em 0; }
.post-figure .figure-svg { display: block; width: 100%; height: auto; overflow: visible; }
.post-figure figcaption { margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--rule); font-size: 0.92rem; line-height: 1.55; color: var(--muted); }
.post-figure-narrow { max-width: 420px; margin-inline: auto; }
.figure-pair { display: grid; gap: 28px; margin: 2.4em 0; }
.figure-pair .post-figure { margin: 0; }
@media (min-width: 720px) { .figure-pair { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.diagram-text { font-family: var(--sans); font-size: 12px; fill: var(--ink-2); stroke: none; }
.diagram-small { font-size: 10px; letter-spacing: .8px; }
/* Charts: hairline grid, accent marks with a surface ring, text in text tokens only. */
.chart-text { font-family: var(--sans); font-size: 12.5px; fill: var(--ink-2); stroke: none; font-variant-numeric: tabular-nums; }
.chart-muted { fill: var(--muted); }
.chart-grid { stroke: var(--rule); stroke-width: 1; }
.chart-axis { stroke: var(--rule-strong); stroke-width: 1; }
.chart-ref { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 2 4; }
.chart-dot { fill: var(--accent); stroke: var(--paper); stroke-width: 2; transition: stroke-width .2s; }
.chart-hit { fill: transparent; stroke: none; }
.chart-point:hover .chart-dot { stroke: var(--ink); stroke-width: 1.5; }
.heat-base { fill: var(--paper-2); }
.heat-fill { fill: var(--accent); }
.heat-ring { fill: none; stroke: none; }
.heat-cell:hover .heat-ring { stroke: var(--ink); stroke-width: 1.5; }
.heat-value { font-family: var(--sans); font-size: 12.5px; font-weight: 600; fill: var(--ink); stroke: none; font-variant-numeric: tabular-nums; }
.heat-value.is-mid { fill: var(--heat-mid-text); }
.heat-value.is-high { fill: var(--on-accent); }

/* Minimal compatibility for utility classes used in post markdown */
.row { display: flex; flex-wrap: wrap; margin-inline: -0.5rem; }
.row > * { padding-inline: 0.5rem; }
.row.g-3 { row-gap: 1rem; }
.col-12 { flex: 0 0 100%; max-width: 100%; }
@media (min-width: 768px) { .col-md-6 { flex: 0 0 50%; max-width: 50%; } }
.img-fluid { max-width: 100%; height: auto; }
.rounded { border-radius: 2px; }
.small { font-size: 0.875em; }
.text-body-secondary { color: var(--muted); }
.mb-0 { margin-bottom: 0 !important; }
.mt-2 { margin-top: 0.5rem !important; }
.my-4 { margin-block: 1.5rem !important; }

.post-end { display: grid; gap: 1px; margin-top: clamp(56px, 8vw, 96px); background: var(--rule-strong); border: 1px solid var(--rule-strong); }
@media (min-width: 700px) { .post-end { grid-template-columns: 1fr 1fr; } }
.post-end a { display: flex; flex-direction: column; gap: 10px; padding: 28px; background: var(--paper); transition: background-color 0.4s; }
.post-end a:hover { background: var(--paper-2); }
.post-end .next { text-align: right; align-items: flex-end; }
.post-end span { font-family: var(--sans); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.post-end b { font-family: var(--sans); font-weight: 400; font-size: 1.6rem; line-height: 1.1; color: var(--ink); }

/* MathJax */
mjx-container { color: var(--ink); }
mjx-container[display="true"] { overflow-x: auto; overflow-y: hidden; padding-block: 4px; }

/* ---------- 404 ---------- */
.lost { min-height: 80vh; display: flex; flex-direction: column; justify-content: center; padding-top: var(--nav-h); }
.lost .display { margin: 24px 0 32px; }

/* ---------- Motion preferences ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; transition-delay: 0s !important; scroll-behavior: auto !important; }
}
