/* ==========================================================================
   garyalcock.com — design system
   Display: Instrument Serif · UI/body: Geist · Data/labels: Geist Mono
   ========================================================================== */

:root {
  color-scheme: light;
  --bg: #fafaf8;
  --bg-elev: #ffffff;
  --bg-sunken: #f2f2ee;
  --ink: #0d0d10;
  --ink-2: #4a4b52;
  --ink-3: #74757d;
  --line: rgba(13, 13, 16, 0.09);
  --line-strong: rgba(13, 13, 16, 0.17);
  --accent: #2446d8;
  --accent-ink: #1f3cc0;
  --accent-soft: rgba(36, 70, 216, 0.08);
  --accent-glow: rgba(36, 70, 216, 0.16);
  --on-accent: #ffffff;
  --btn-bg: #0d0d10;
  --btn-ink: #fafaf8;
  --field-ink: 13, 13, 16;
  --field-accent: 36, 70, 216;
  --series-accent: #2446d8;
  --series-gray: #9a9ba2;
  --grid: #e8e8e3;
  --axis: #c9c9c2;
  --shadow-sm: 0 1px 2px rgba(13, 13, 16, 0.05);
  --shadow-md: 0 1px 0 rgba(13, 13, 16, 0.03), 0 18px 40px -18px rgba(13, 13, 16, 0.18);
  --radius-sm: 10px;
  --radius: 18px;
  --radius-lg: 28px;
  /* Geist and Instrument Serif have no Greek or math operators; Inter, STIX Two Text and
     Noto Sans Math are loaded as tiny glyph-only subsets to cover ψ, γ, σ, ∝, ∇ and friends. */
  --font-display: "Instrument Serif", "STIX Two Text", "Noto Sans Math", ui-serif, "Iowan Old Style", Georgia, serif;
  --font-sans: "Geist", "Inter", "Noto Sans Math", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "Geist Mono", "Inter", "Noto Sans Math", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --container: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
  --nav-h: 64px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0a0a0c;
    --bg-elev: #121215;
    --bg-sunken: #0e0e11;
    --ink: #f3f3f1;
    --ink-2: #a9aab1;
    --ink-3: #7b7c84;
    --line: rgba(255, 255, 255, 0.08);
    --line-strong: rgba(255, 255, 255, 0.15);
    --accent: #7c9bff;
    --accent-ink: #9db4ff;
    --accent-soft: rgba(124, 155, 255, 0.10);
    --accent-glow: rgba(124, 155, 255, 0.18);
    --on-accent: #0a0a0c;
    --btn-bg: #f3f3f1;
    --btn-ink: #0a0a0c;
    --field-ink: 243, 243, 241;
    --field-accent: 124, 155, 255;
    --series-accent: #6d8cf5;
    --series-gray: #6c6d75;
    --grid: #1f1f23;
    --axis: #34343a;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 24px 48px -24px rgba(0, 0, 0, 0.7);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0a0a0c;
  --bg-elev: #121215;
  --bg-sunken: #0e0e11;
  --ink: #f3f3f1;
  --ink-2: #a9aab1;
  --ink-3: #7b7c84;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.15);
  --accent: #7c9bff;
  --accent-ink: #9db4ff;
  --accent-soft: rgba(124, 155, 255, 0.10);
  --accent-glow: rgba(124, 155, 255, 0.18);
  --on-accent: #0a0a0c;
  --btn-bg: #f3f3f1;
  --btn-ink: #0a0a0c;
  --field-ink: 243, 243, 241;
  --field-accent: 124, 155, 255;
  --series-accent: #6d8cf5;
  --series-gray: #6c6d75;
  --grid: #1f1f23;
  --axis: #34343a;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 24px 48px -24px rgba(0, 0, 0, 0.7);
}

/* ---------- Base ---------- */

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

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

p a,
li a,
.prose a {
  color: var(--accent-ink);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent-ink) 35%, transparent);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: text-decoration-color 0.2s var(--ease);
}
p a:hover,
li a:hover,
.prose a:hover { text-decoration-color: currentColor; }

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

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

h1, h2, h3, h4 { margin: 0; font-weight: 400; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; }

sup, sub { line-height: 0; }

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

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  background: var(--btn-bg);
  color: var(--btn-ink);
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 14px;
  transition: top 0.2s var(--ease);
}
.skip:focus { top: 12px; }

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

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

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.eyebrow::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.eyebrow--plain::before { display: none; }

.display {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.015em;
  line-height: 1.02;
}

.lede {
  font-size: clamp(1.125rem, 1.6vw, 1.3rem);
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 40rem;
}

.muted { color: var(--ink-3); }
.small { font-size: 0.875rem; }
.show-sm { display: none; }
@media (max-width: 560px) {
  .hide-sm { display: none; }
  .show-sm { display: inline; }
}
.mono { font-family: var(--font-mono); }
.italic { font-style: italic; }

/* ---------- Navigation ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-h);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  -webkit-backdrop-filter: saturate(160%) blur(16px);
  backdrop-filter: saturate(160%) blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease);
}
.nav.is-scrolled { border-bottom-color: var(--line); }

.nav__inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.brand__mark {
  display: grid;
  place-items: center;
  width: 32px; height: 32px;
  border-radius: 9px;
  background: var(--btn-bg);
  color: var(--btn-ink);
  font-family: var(--font-display);
  font-size: 17px;
  letter-spacing: 0.02em;
  line-height: 1;
  padding-top: 1px;
}
.brand__name { font-size: 15px; }

.nav__links {
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav__links a {
  position: relative;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 14.5px;
  color: var(--ink-2);
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
}
.nav__links a:hover { color: var(--ink); background: var(--bg-sunken); }
.nav__links a[aria-current="page"] { color: var(--ink); background: var(--bg-sunken); }

.nav__actions { display: flex; align-items: center; gap: 6px; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 38px; height: 38px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.icon-btn:hover { color: var(--ink); border-color: var(--line-strong); background: var(--bg-sunken); }
.icon-btn svg { width: 17px; height: 17px; }

.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
}

.menu-toggle { display: none; }

.mobile-menu {
  position: absolute;
  top: var(--nav-h);
  left: 0; right: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  padding: 8px var(--gutter) 20px;
  box-shadow: var(--shadow-md);
}
.mobile-menu[hidden] { display: none; }
.mobile-menu a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 2px;
  font-size: 17px;
  border-bottom: 1px solid var(--line);
}
.mobile-menu a:last-child { border-bottom: 0; }
.mobile-menu a::after { content: "→"; color: var(--ink-3); }

@media (max-width: 760px) {
  .nav__links { display: none; }
  .menu-toggle { display: inline-grid; }
}

/* ---------- Buttons ---------- */

.btn {
  --btn-h: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: var(--btn-h);
  padding: 0 20px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.005em;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.2s var(--ease), background 0.2s var(--ease), border-color 0.2s var(--ease), box-shadow 0.2s var(--ease), color 0.2s var(--ease);
}
.btn svg { width: 16px; height: 16px; flex: none; transition: transform 0.2s var(--ease); }
.btn:hover svg.arrow { transform: translateX(3px); }

.btn--primary { background: var(--btn-bg); color: var(--btn-ink); box-shadow: var(--shadow-sm); }
.btn--primary:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }

.btn--ghost { border-color: var(--line-strong); color: var(--ink); background: color-mix(in srgb, var(--bg-elev) 60%, transparent); }
.btn--ghost:hover { border-color: var(--ink-3); background: var(--bg-elev); }

.btn--accent { background: var(--accent); color: var(--on-accent); }
.btn--accent:hover { transform: translateY(-1px); box-shadow: 0 10px 30px -10px var(--accent-glow); }

.btn--sm { --btn-h: 38px; padding: 0 15px; font-size: 14px; }

.btn.is-done { border-color: var(--accent); color: var(--accent-ink); }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--ink);
}
.link-arrow svg { width: 15px; height: 15px; transition: transform 0.2s var(--ease); }
.link-arrow:hover svg { transform: translateX(3px); }

.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }

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

.hero {
  position: relative;
  isolation: isolate;
  min-height: min(90vh, 860px);
  display: flex;
  align-items: center;
  padding: clamp(56px, 10vh, 120px) 0 clamp(64px, 10vh, 120px);
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: -20% -10% auto auto;
  width: 70vw; height: 70vw;
  max-width: 980px; max-height: 980px;
  background: radial-gradient(closest-side, var(--accent-glow), transparent 70%);
  opacity: 0.55;
  z-index: -2;
  pointer-events: none;
}
.hero__field {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, rgba(0,0,0,0.35) 28%, #000 58%);
  mask-image: linear-gradient(90deg, transparent 0%, rgba(0,0,0,0.35) 28%, #000 58%);
}
.hero__inner { position: relative; }
@media (max-width: 760px) {
  .hero__field {
    -webkit-mask-image: linear-gradient(180deg, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.3) 60%, #000 100%);
    mask-image: linear-gradient(180deg, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.3) 60%, #000 100%);
  }
}

.announce {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  max-width: 100%;
  padding: 5px 14px 5px 5px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: color-mix(in srgb, var(--bg-elev) 72%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  font-size: 14px;
  color: var(--ink-2);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.announce:hover { border-color: var(--ink-3); transform: translateY(-1px); }
.announce__tag {
  flex: none;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.announce__text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.announce__text em { font-style: italic; color: var(--ink); }
.announce svg { width: 15px; height: 15px; flex: none; color: var(--ink-3); transition: transform 0.2s var(--ease); }
.announce:hover svg { transform: translateX(3px); }

.hero__role {
  margin-top: 36px;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.hero__title {
  margin-top: 14px;
  font-family: var(--font-display);
  font-size: clamp(3.75rem, 12vw, 9.5rem);
  line-height: 0.88;
  letter-spacing: -0.025em;
}
.hero__title em { font-style: italic; }
.hero__lede {
  margin-top: 28px;
  max-width: 36rem;
  font-size: clamp(1.125rem, 1.7vw, 1.375rem);
  line-height: 1.5;
  color: var(--ink-2);
}
.hero__cta { margin-top: 36px; }
.hero__meta {
  margin-top: 40px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  list-style: none;
  font-size: 14px;
  color: var(--ink-3);
}
.hero__meta a { color: var(--ink-2); text-decoration: none; transition: color 0.2s var(--ease); }
.hero__meta a:hover { color: var(--ink); }

/* Page hero (subpages) */
.page-hero {
  position: relative;
  padding: clamp(56px, 9vh, 104px) 0 clamp(32px, 5vh, 56px);
  overflow: hidden;
  isolation: isolate;
}
.page-hero::before {
  content: "";
  position: absolute;
  right: -10%; top: -40%;
  width: 60vw; height: 60vw; max-width: 760px; max-height: 760px;
  background: radial-gradient(closest-side, var(--accent-glow), transparent 70%);
  opacity: 0.45;
  z-index: -1;
  pointer-events: none;
}
.page-hero__title {
  margin-top: 18px;
  font-family: var(--font-display);
  font-size: clamp(2.75rem, 7vw, 5.5rem);
  line-height: 0.96;
  letter-spacing: -0.02em;
  max-width: 16ch;
}
.page-hero .lede { margin-top: 22px; }

/* ---------- Sections ---------- */

.section { padding: clamp(64px, 10vh, 120px) 0; }
.section--tight { padding: clamp(40px, 6vh, 72px) 0; }
.section--sunken { background: var(--bg-sunken); border-block: 1px solid var(--line); }

.section__head { max-width: 46rem; margin-bottom: clamp(32px, 5vh, 56px); }
.section__title {
  margin-top: 16px;
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 4.6vw, 3.75rem);
  line-height: 1.02;
  letter-spacing: -0.018em;
}
.section__title em { font-style: italic; color: var(--ink-2); }
.section__lede { margin-top: 18px; font-size: 1.125rem; color: var(--ink-2); line-height: 1.6; }

.split {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(32px, 6vw, 96px);
  align-items: start;
}
@media (max-width: 900px) { .split { grid-template-columns: 1fr; } }

/* ---------- Cards ---------- */

.grid { display: grid; gap: 16px; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1060px) { .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) { .grid--3 { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .grid--2, .grid--4 { grid-template-columns: 1fr; } }

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 28px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--bg-elev);
  transition: border-color 0.25s var(--ease), transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.card--link:hover { border-color: var(--line-strong); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.card__icon {
  display: grid;
  place-items: center;
  width: 40px; height: 40px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent-ink);
}
.card__icon svg { width: 20px; height: 20px; }
.card__kicker {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.card__title {
  font-family: var(--font-display);
  font-size: 1.75rem;
  line-height: 1.08;
  letter-spacing: -0.01em;
}
.card__text { color: var(--ink-2); font-size: 15.5px; line-height: 1.6; }
.card__foot { margin-top: auto; padding-top: 6px; }
.card__stretch::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }

.card ul.ticks { list-style: none; display: grid; gap: 10px; }
.ticks li {
  position: relative;
  padding-left: 24px;
  color: var(--ink-2);
  font-size: 15.5px;
}
.ticks li::before {
  content: "";
  position: absolute;
  left: 2px; top: 0.62em;
  width: 10px; height: 1.5px;
  background: var(--accent);
  border-radius: 2px;
}
.ticks strong { color: var(--ink); font-weight: 500; }

/* ---------- Publication feature ---------- */

.pub {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr);
  grid-template-areas: "head head" "body chart";
  column-gap: clamp(28px, 4vw, 56px);
  row-gap: clamp(20px, 3vw, 36px);
  padding: clamp(24px, 4vw, 52px);
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background:
    radial-gradient(120% 80% at 0% 0%, var(--accent-soft), transparent 60%),
    var(--bg-elev);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.pub__head { grid-area: head; max-width: 60rem; }
.pub__body { grid-area: body; min-width: 0; }
.pub > .chart { grid-area: chart; }
@media (max-width: 980px) {
  .pub { grid-template-columns: 1fr; grid-template-areas: "head" "body" "chart"; }
}

.pub__badges { display: flex; flex-wrap: wrap; gap: 8px; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 28px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-2);
  background: var(--bg-elev);
}
.badge svg { width: 13px; height: 13px; }
.badge--accent { border-color: transparent; background: var(--accent-soft); color: var(--accent-ink); }

.pub__journal {
  margin-top: 26px;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.25rem;
  color: var(--ink-2);
  line-height: 1.3;
}
.pub__cite { margin-top: 4px; font-family: var(--font-mono); font-size: 12.5px; color: var(--ink-3); letter-spacing: 0.02em; }
.pub__title {
  margin-top: 18px;
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 3.3vw, 2.75rem);
  line-height: 1.06;
  letter-spacing: -0.015em;
}
.pub__summary { color: var(--ink-2); font-size: 1.0625rem; line-height: 1.65; }
.pub__summary + .pub__summary { margin-top: 12px; }
.pub__actions { margin-top: 28px; }

.stats {
  margin-top: 28px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-block: 1px solid var(--line);
}
.stat { padding: 18px 16px 18px 0; }
.stat + .stat { padding-left: 16px; border-left: 1px solid var(--line); }
.stat__value {
  font-family: var(--font-sans);
  font-size: clamp(1.35rem, 2vw, 1.75rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--ink);
  white-space: nowrap;
}
.stat__label { margin-top: 8px; font-size: 13.5px; line-height: 1.45; color: var(--ink-2); }
@media (max-width: 560px) {
  .stats { grid-template-columns: 1fr; }
  .stat { padding: 16px 0; }
  .stat + .stat { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); }
}

/* ---------- Chart ---------- */

.chart { margin: 0; position: relative; min-width: 0; }
.chart__title { font-size: 15px; font-weight: 600; letter-spacing: -0.005em; color: var(--ink); }
.chart__sub { margin-top: 4px; font-size: 13px; color: var(--ink-3); line-height: 1.5; }
.chart__legend {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  list-style: none;
  font-size: 12.5px;
  color: var(--ink-2);
}
.chart__legend li { display: inline-flex; align-items: center; gap: 7px; }
.key { display: inline-block; flex: none; }
.key--dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ink); }
.key--ring { width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid var(--ink); background: var(--bg-elev); }
.key--line { width: 18px; height: 2px; border-radius: 2px; background: var(--series-gray); }
.key--accent { background: var(--series-accent); height: 2.5px; }
.key--dash { background: repeating-linear-gradient(90deg, var(--series-gray) 0 4px, transparent 4px 7px); }

.chart__plot { position: relative; margin-top: 12px; width: 100%; }
.chart__plot svg { width: 100%; height: auto; overflow: visible; }
.chart__plot svg text { font-family: var(--font-mono); font-size: 11px; fill: var(--ink-3); }
.chart__plot .c-grid line { stroke: var(--grid); stroke-width: 1; shape-rendering: crispEdges; }
.chart__plot .c-axis line { stroke: var(--axis); stroke-width: 1; shape-rendering: crispEdges; }
.chart__plot .c-model { fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.chart__plot .c-model--accent { stroke: var(--series-accent); stroke-width: 2.25; }
.chart__plot .c-model--gray { stroke: var(--series-gray); }
.chart__plot .c-model--dash { stroke-dasharray: 5 4; }
.chart__plot .c-err { stroke: var(--ink); stroke-width: 1.5; stroke-linecap: round; }
.chart__plot .c-pt { fill: var(--ink); stroke: var(--bg-elev); stroke-width: 2; }
.chart__plot .c-anchor { fill: var(--bg-elev); stroke: var(--ink); stroke-width: 1.75; }
.chart__plot .c-hit { fill: transparent; cursor: pointer; }
.chart__plot .c-hit:focus { outline: none; }
.chart__plot .c-hit:focus-visible + .c-focus,
.chart__plot .c-focus.is-on { opacity: 1; }
.chart__plot .c-focus { fill: none; stroke: var(--accent); stroke-width: 2; opacity: 0; pointer-events: none; }
.chart__plot .c-cross { stroke: var(--ink-3); stroke-width: 1; opacity: 0; pointer-events: none; shape-rendering: crispEdges; }
.chart__plot .c-cross.is-on { opacity: 0.6; }
.chart__plot .c-label { fill: var(--ink-2); font-size: 11.5px; }
.chart__plot .c-label--accent { fill: var(--ink); font-weight: 500; }
.chart__plot .c-axis-title { fill: var(--ink-3); font-size: 11px; }

.chart__tip {
  position: absolute;
  z-index: 5;
  min-width: 190px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: color-mix(in srgb, var(--bg-elev) 94%, transparent);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow-md);
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--ink-2);
  pointer-events: none;
  transform: translate(-50%, calc(-100% - 14px));
}
.chart__tip[hidden] { display: none; }
.chart__tip .tip-head { font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); letter-spacing: 0.04em; margin-bottom: 6px; }
.chart__tip .tip-row { display: flex; align-items: center; gap: 8px; }
.chart__tip .tip-row + .tip-row { margin-top: 3px; }
.chart__tip .tip-val { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; min-width: 3.2em; }
.chart__tip .tip-key { width: 12px; height: 2px; border-radius: 2px; background: var(--series-gray); flex: none; }
.chart__tip .tip-key--accent { background: var(--series-accent); height: 2.5px; }
.chart__tip .tip-key--dash { background: repeating-linear-gradient(90deg, var(--series-gray) 0 3px, transparent 3px 5px); }
.chart__tip .tip-key--dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink); }
.chart__tip .tip-key--ring { width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--ink); background: transparent; }

.chart__note { margin-top: 10px; font-size: 12px; color: var(--ink-3); line-height: 1.5; }

.data-table { margin-top: 14px; }
.data-table summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  list-style: none;
}
.data-table summary::-webkit-details-marker { display: none; }
.data-table summary::before { content: "+"; font-family: var(--font-mono); color: var(--ink-3); }
.data-table[open] summary::before { content: "−"; }
.data-table table {
  margin-top: 12px;
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.data-table th, .data-table td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--line); }
.data-table th { font-weight: 500; color: var(--ink-3); font-size: 12px; }
.data-table td { color: var(--ink-2); }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ---------- Equations ---------- */

.eqs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 640px) { .eqs { grid-template-columns: 1fr; } }
.eq {
  padding: 26px 28px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--bg-elev);
}
.eq__math {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(2.1rem, 3.6vw, 3.1rem);
  line-height: 1;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.eq__math .up { font-size: 0.55em; vertical-align: 0.9em; margin-left: 0.04em; }
.eq__math .frac { font-style: normal; }
.eq__label { margin-top: 16px; font-size: 15px; color: var(--ink-2); line-height: 1.55; }
.eq__label strong { color: var(--ink); font-weight: 500; }

/* ---------- Record / timeline ---------- */

.record { list-style: none; border-top: 1px solid var(--line); }
.record li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 16px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}
.record__name { font-family: var(--font-display); font-size: clamp(1.5rem, 2.6vw, 2.1rem); line-height: 1.1; letter-spacing: -0.01em; }
.record__role { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); text-align: right; }
@media (max-width: 560px) {
  .record li { grid-template-columns: 1fr; gap: 6px; }
  .record__role { text-align: left; }
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; }
.chip {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  font-size: 14px;
  color: var(--ink-2);
}

/* ---------- Books ---------- */

.book {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}
@media (max-width: 560px) { .book { grid-template-columns: 110px minmax(0, 1fr); gap: 18px; } }
.book__cover {
  position: relative;
  aspect-ratio: 2 / 3;
  border-radius: 6px 12px 12px 6px;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  box-shadow: 0 1px 0 rgba(255,255,255,0.15) inset, 0 20px 40px -18px rgba(0,0,0,0.45), 0 2px 6px rgba(0,0,0,0.12);
  color: #f6f4ee;
}
.book__cover::before {
  content: "";
  position: absolute;
  left: 7px; top: 0; bottom: 0;
  width: 1px;
  background: rgba(255,255,255,0.18);
}
.book__cover--mba { background: linear-gradient(160deg, #1d2a4d 0%, #0e1426 100%); }
.book__cover--lazy { background: radial-gradient(120% 90% at 70% 20%, #3a2a12 0%, #140f08 65%); }
.book__cover-title { font-family: var(--font-display); font-size: 1.25rem; line-height: 1.02; position: relative; }
.book__cover-author { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.12em; text-transform: uppercase; opacity: 0.7; position: relative; }
.book__cover--lazy .book__cover-title { color: #f3c27a; }
.book__cover-art { position: absolute; inset: auto -20% -12% -20%; height: 55%; opacity: 0.55; }
@media (max-width: 560px) { .book__cover-title { font-size: 1rem; } }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--bg-sunken);
  border: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #d39a2e; }

/* ---------- CTA band ---------- */

.cta {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 32px;
  align-items: end;
  padding: clamp(32px, 6vw, 72px);
  border-radius: var(--radius-lg);
  background: var(--btn-bg);
  color: var(--btn-ink);
}
.cta::before {
  content: "";
  position: absolute;
  right: -15%; bottom: -60%;
  width: 70%; aspect-ratio: 1;
  background: radial-gradient(closest-side, rgba(var(--field-accent), 0.55), transparent 70%);
  opacity: 0.55;
  z-index: -1;
}
.cta__title { font-family: var(--font-display); font-size: clamp(3rem, 8vw, 6rem); line-height: 0.92; letter-spacing: -0.02em; }
.cta__text { margin-top: 18px; max-width: 30rem; font-size: 1.0625rem; line-height: 1.6; opacity: 0.72; }
.cta .btn--primary { background: var(--btn-ink); color: var(--btn-bg); }
.cta .btn--ghost { border-color: color-mix(in srgb, var(--btn-ink) 30%, transparent); color: var(--btn-ink); background: transparent; }
.cta .btn--ghost:hover { border-color: var(--btn-ink); }
.cta__side { display: grid; gap: 14px; justify-items: start; }
.cta__side .muted { color: inherit; opacity: 0.6; font-size: 14px; }
@media (max-width: 820px) { .cta { grid-template-columns: 1fr; align-items: start; } }

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

.contact-list { list-style: none; display: grid; gap: 12px; }
.contact-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--bg-elev);
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.contact-item:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.contact-item__label { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.07em; text-transform: uppercase; color: var(--ink-3); }
.contact-item__value { font-size: 16px; color: var(--ink); overflow-wrap: anywhere; }
.contact-item svg { width: 16px; height: 16px; color: var(--ink-3); }

/* ---------- Forms ---------- */

.form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form .full { grid-column: 1 / -1; }
@media (max-width: 640px) { .form { grid-template-columns: 1fr; } }
.field { display: grid; gap: 8px; }
.field label, .field legend { font-size: 13.5px; font-weight: 500; color: var(--ink-2); padding: 0; }
.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 46px;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.field textarea { min-height: 130px; resize: vertical; line-height: 1.5; }
.field input:focus,
.field select:focus,
.field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
fieldset.field { border: 0; margin: 0; padding: 0; min-width: 0; }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.check { position: relative; }
.check input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.check span {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  font-size: 14px;
  color: var(--ink-2);
  transition: all 0.2s var(--ease);
  user-select: none;
}
.check input:checked + span { background: var(--btn-bg); border-color: var(--btn-bg); color: var(--btn-ink); }
.check input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Prose blocks ---------- */

.prose { color: var(--ink-2); font-size: 1.0625rem; line-height: 1.7; max-width: 42rem; }
.prose p + p { margin-top: 14px; }
.prose strong { color: var(--ink); font-weight: 500; }
.prose code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--bg-sunken);
  border: 1px solid var(--line);
  color: var(--ink);
}

.panel {
  padding: clamp(24px, 3.5vw, 40px);
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--bg-elev);
}

.list-rows { list-style: none; border-top: 1px solid var(--line); }
.list-rows li {
  display: grid;
  grid-template-columns: 2.4rem minmax(0, 1fr);
  gap: 16px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}
.list-rows__n { font-family: var(--font-mono); font-size: 12px; color: var(--ink-3); padding-top: 5px; }
.list-rows h3 { font-size: 1.125rem; font-weight: 500; letter-spacing: -0.01em; }
.list-rows p { margin-top: 6px; color: var(--ink-2); font-size: 15.5px; line-height: 1.6; }

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

.footer { padding: 56px 0 44px; border-top: 1px solid var(--line); margin-top: clamp(40px, 8vh, 96px); }
.footer__inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px 40px; }
.footer__brand { font-family: var(--font-display); font-size: 1.75rem; line-height: 1; }
.footer__fine { margin-top: 12px; max-width: 34rem; font-size: 13px; color: var(--ink-3); line-height: 1.6; }
.footer__links { display: grid; grid-template-columns: repeat(2, auto); gap: 10px 40px; list-style: none; font-size: 14px; }
.footer__links a { color: var(--ink-2); text-decoration: none; transition: color 0.2s var(--ease); }
.footer__links a:hover { color: var(--ink); }

/* ---------- Reveal ---------- */

.js [data-reveal] { opacity: 0; transform: translateY(14px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
.js [data-reveal].is-in { opacity: 1; transform: none; }
.js [data-reveal-delay="1"] { transition-delay: 0.08s; }
.js [data-reveal-delay="2"] { transition-delay: 0.16s; }
.js [data-reveal-delay="3"] { transition-delay: 0.24s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js [data-reveal] { opacity: 1; transform: none; transition: none; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* ---------- 404 ---------- */
.lost { min-height: 70vh; display: grid; place-items: center; text-align: center; padding: 80px 0; }
.lost__code { font-family: var(--font-display); font-size: clamp(6rem, 22vw, 14rem); line-height: 0.85; letter-spacing: -0.03em; }

/* ---------- Print ---------- */
@media print {
  .nav, .hero__field, .theme-toggle, .menu-toggle, .cta::before, .hero::before, .page-hero::before { display: none !important; }
  body { background: #fff; color: #000; }
  .section { padding: 24px 0; }
  .card, .pub, .panel { box-shadow: none; border-color: #ccc; }
}

/* Lead form status + honeypot */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form__status { min-height: 1.4em; margin: 0; font-size: 14.5px; color: var(--ink-2); }
.form__status[data-state="ok"] { color: #1f8a5b; }
.form__status[data-state="error"] { color: #c2413a; }
:root[data-theme="dark"] .form__status[data-state="ok"] { color: #7fdcb0; }
:root[data-theme="dark"] .form__status[data-state="error"] { color: #ff9f96; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .form__status[data-state="ok"] { color: #7fdcb0; }
  :root:not([data-theme="light"]) .form__status[data-state="error"] { color: #ff9f96; }
}
