/* CognitionWire — site styles
   Tokens → base → layout → components → pages → responsive. */

/* ---------------------------------------------------------------- tokens */
:root {
  color-scheme: light dark;
  --bg: #fbfbf9;
  --bg-alt: #f3f3ef;
  --surface: #ffffff;
  --surface-2: #f4f4f1;
  --ink: #0d1117;
  --ink-2: #353b45;
  --muted: #6a717d;
  --line: #e7e6e1;
  --line-2: #d8d7d0;
  --accent: #2b5cff;
  --accent-hover: #1e48e0;
  --accent-ink: #1d3fbf;
  --accent-soft: #edf1ff;
  --accent-line: #c9d5ff;
  --violet: #8b5cf6;
  --cyan: #19b8e6;
  --amber: #b25e09;
  --amber-soft: #fff5e6;
  --amber-line: #f3d6ad;
  --green: #0f8a63;
  --red: #c4372b;
  --brand-gradient: linear-gradient(100deg, #19b8e6 0%, #2b5cff 48%, #8b5cf6 100%);
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px -6px rgba(16, 24, 40, .08);
  --shadow-lg: 0 2px 4px rgba(16, 24, 40, .04), 0 24px 48px -12px rgba(16, 24, 40, .14);

  --font-sans: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-serif: 'Newsreader', ui-serif, Georgia, 'Times New Roman', serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --max: 1200px;
  --gutter: clamp(16px, 4vw, 32px);
  --header-h: 64px;
  --r-sm: 8px;
  --r: 12px;
  --r-lg: 20px;
  --ease: cubic-bezier(.22, .8, .24, 1);
  --ease-out: cubic-bezier(.32, .72, 0, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c0e12;
    --bg-alt: #101319;
    --surface: #13161c;
    --surface-2: #191d24;
    --ink: #eef1f6;
    --ink-2: #c4cad4;
    --muted: #8a93a1;
    --line: #232832;
    --line-2: #2f3541;
    --accent: #7a9bff;
    --accent-hover: #93afff;
    --accent-ink: #a9bdff;
    --accent-soft: #161f3a;
    --accent-line: #2a3970;
    --amber: #f2b45c;
    --amber-soft: #241b0f;
    --amber-line: #4a3517;
    --green: #4fd1a1;
    --red: #ff7b6e;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px -6px rgba(0, 0, 0, .4);
    --shadow-lg: 0 2px 4px rgba(0, 0, 0, .3), 0 24px 48px -12px rgba(0, 0, 0, .55);
  }
}

/* ---------------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 24px);
}
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.6 var(--font-sans);
  font-feature-settings: 'cv11', 'ss01';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
main { flex: 1; }
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; }
button, input { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; text-wrap: balance; }
p { margin: 0; }
p, li { text-wrap: pretty; }
::selection { background: color-mix(in srgb, var(--accent) 24%, transparent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.wrap { width: min(var(--max), 100% - 2 * var(--gutter)); margin-inline: auto; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; left: 16px; top: 12px; z-index: 100;
  padding: 10px 14px; border-radius: var(--r-sm);
  background: var(--ink); color: var(--bg); font-weight: 600; text-decoration: none;
  transform: translateY(-160%); transition: transform .2s var(--ease);
}
.skip-link:focus { transform: none; }
.i { flex: none; }

/* Smooth cross-page transitions (Chrome / Safari 18+). */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .22s; }
.site-header { view-transition-name: site-header; }

/* ---------------------------------------------------------------- type */
.eyebrow {
  margin-bottom: 14px;
  color: var(--accent);
  font: 500 .75rem/1.3 var(--font-mono);
  letter-spacing: .08em;
  text-transform: uppercase;
}
.text-link {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--accent); font-weight: 600; font-size: .94rem;
  text-decoration: none;
}
.text-link .i { transition: transform .2s var(--ease); }
.text-link:hover .i { transform: translateX(3px); }
.text-link:hover { color: var(--accent-hover); }

/* ---------------------------------------------------------------- buttons */
.btn {
  --btn-h: 46px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: var(--btn-h); padding: 0 20px;
  border: 1px solid transparent; border-radius: var(--r-sm);
  font-weight: 600; font-size: .94rem; letter-spacing: -.005em;
  text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background-color .18s var(--ease), border-color .18s var(--ease), color .18s var(--ease), box-shadow .18s var(--ease), transform .18s var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 1px 2px rgba(16, 24, 40, .12), inset 0 1px 0 rgba(255, 255, 255, .14); }
.btn-primary:hover { background: var(--accent-hover); }
@media (prefers-color-scheme: dark) { .btn-primary { color: #0b1020; } }
.btn-ghost { background: var(--surface); border-color: var(--line-2); color: var(--ink); }
.btn-ghost:hover { border-color: var(--muted); }
.btn-sm { --btn-h: 36px; padding: 0 14px; font-size: .875rem; }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2);
  cursor: pointer; text-decoration: none;
  transition: color .18s var(--ease), border-color .18s var(--ease), background .18s var(--ease);
}
.icon-btn:hover { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }
.icon-btn.copied { color: var(--green); border-color: var(--green); }

/* ---------------------------------------------------------------- header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
  backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s var(--ease), background-color .25s var(--ease);
}
.site-header.is-scrolled { border-bottom-color: var(--line); }
.header-inner { height: var(--header-h); display: flex; align-items: center; gap: 28px; }
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 1.05rem; letter-spacing: -.02em;
  text-decoration: none; color: var(--ink);
}
.brand img { width: 32px; height: 32px; border-radius: 8px; box-shadow: 0 0 0 1px rgba(255, 255, 255, .06), var(--shadow-sm); }
.site-nav { flex: 1; }
.nav-links { display: flex; gap: 2px; margin: 0; padding: 0; list-style: none; }
.nav-links a {
  display: block; padding: 8px 12px; border-radius: var(--r-sm);
  color: var(--muted); font-size: .92rem; font-weight: 500; text-decoration: none;
  transition: color .18s var(--ease), background-color .18s var(--ease);
}
.nav-links a:hover { color: var(--ink); background: var(--surface-2); }
.nav-links a[aria-current='page'] { color: var(--ink); }
.header-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.header-actions .btn[aria-current='page'] { visibility: hidden; }
.menu-toggle { display: none; }
.read-progress {
  position: absolute; left: 0; bottom: -1px; height: 2px; width: 100%;
  background: var(--brand-gradient);
  transform-origin: 0 50%; transform: scaleX(var(--progress, 0));
  opacity: 0; transition: opacity .2s var(--ease);
}
.page-post .read-progress { opacity: 1; }

/* ---------------------------------------------------------------- sections */
.section { padding-block: clamp(64px, 9vw, 112px); }
.section-tight { padding-block: clamp(40px, 6vw, 72px); }
.section-alt { background: var(--bg-alt); border-block: 1px solid var(--line); }
.section-head {
  display: flex; align-items: end; justify-content: space-between; gap: 24px;
  margin-bottom: clamp(28px, 4vw, 44px);
}
.section-head h2 {
  font-family: var(--font-serif); font-weight: 500;
  font-size: clamp(1.9rem, 3.4vw, 2.6rem); line-height: 1.1; letter-spacing: -.02em;
}
.section-head .eyebrow { margin-bottom: 10px; }
.split { display: grid; grid-template-columns: minmax(200px, 4fr) 8fr; gap: clamp(32px, 6vw, 96px); }
.split-label { align-self: start; position: sticky; top: calc(var(--header-h) + 32px); }
.split-label h2 {
  font-family: var(--font-serif); font-weight: 500;
  font-size: clamp(1.8rem, 3vw, 2.4rem); line-height: 1.1; letter-spacing: -.02em;
}
.split-body { max-width: 720px; }

/* ---------------------------------------------------------------- hero */
.hero { padding: clamp(48px, 8vw, 104px) 0 clamp(56px, 8vw, 96px); position: relative; overflow: hidden; }
.hero::before {
  content: ''; position: absolute; inset: -40% -10% auto auto; width: 70%; height: 140%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 10%, transparent), transparent 70%);
  pointer-events: none;
}
.hero-grid { position: relative; display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(40px, 6vw, 80px); align-items: center; }
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  margin-bottom: 26px; padding: 6px 12px 6px 10px;
  border: 1px solid var(--line-2); border-radius: 999px; background: var(--surface);
  color: var(--ink-2); font-size: .8rem; font-weight: 500;
  box-shadow: var(--shadow-sm);
}
.pill-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 20%, transparent); }
.hero h1 {
  font-family: var(--font-serif); font-weight: 500;
  font-size: clamp(2.75rem, 6.4vw, 5.25rem); line-height: 1.02; letter-spacing: -.035em;
  font-variation-settings: 'opsz' 72;
}
.hero h1 em {
  font-style: italic;
  background: var(--brand-gradient); -webkit-background-clip: text; background-clip: text; color: transparent;
  padding-right: .06em;
}
.hero-dek { max-width: 560px; margin: 24px 0 32px; color: var(--ink-2); font-size: clamp(1.06rem, 1.5vw, 1.2rem); line-height: 1.55; }

.hero-visual {
  position: relative; aspect-ratio: 1 / .92; min-height: 340px;
  border-radius: var(--r-lg); overflow: hidden;
  background:
    radial-gradient(120% 90% at 20% 30%, rgba(43, 92, 255, .22), transparent 60%),
    radial-gradient(90% 80% at 90% 90%, rgba(139, 92, 246, .22), transparent 60%),
    #0a0d14;
  box-shadow: var(--shadow-lg), inset 0 0 0 1px rgba(255, 255, 255, .06);
  isolation: isolate;
}
.hero-visual::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background-image: linear-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .05) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: radial-gradient(closest-side, #000 40%, transparent);
}
#hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.hub {
  position: absolute; z-index: 2;
  width: 88px; height: 88px; border-radius: 50%;
  display: grid; place-items: center; padding: 10px;
  font: 500 .66rem/1.25 var(--font-mono); letter-spacing: .06em; text-transform: uppercase; text-align: center;
  color: #e9eefc;
  background: rgba(15, 20, 32, .72);
  border: 1px solid rgba(255, 255, 255, .14);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
}
.hub-ai { left: 9%; top: 38%; background: linear-gradient(135deg, #2b5cff, #6d4bff); border-color: rgba(255, 255, 255, .25); color: #fff; }
.hub-pay { right: 10%; top: 12%; border-color: rgba(25, 184, 230, .55); }
.hub-stock { right: 16%; bottom: 11%; border-color: rgba(139, 92, 246, .6); }
.visual-label {
  position: absolute; left: 20px; bottom: 16px; z-index: 3;
  color: rgba(233, 238, 252, .55); font: 400 .7rem var(--font-mono); letter-spacing: .08em; text-transform: uppercase;
}

/* ---------------------------------------------------------------- subscribe (Beehiiv embed) */
/* Beehiiv renders its form inside a white box with --embed-pad padding on
   every side (frame height --embed-frame, field row --embed-h, as set in its
   form designer). site.js crops the frame to just the field row while it is
   at that height. If the form design changes in Beehiiv, update these. */
.subscribe-form { width: 100%; max-width: 400px; }
.subscribe-embed {
  --embed-frame: 207px; --embed-pad: 80px; --embed-h: 47px;
  width: 100%; min-height: var(--embed-h);
  border-radius: 9px; overflow: hidden;
  box-shadow: var(--shadow);
}
.subscribe-embed iframe { display: block; width: 100%; border: 0; color-scheme: light; }
.subscribe-embed.is-cropped { height: var(--embed-h); }
.subscribe-embed.is-cropped iframe {
  width: calc(100% + 2 * var(--embed-pad)) !important; max-width: none;
  margin: calc(-1 * var(--embed-pad)) 0 0 calc(-1 * var(--embed-pad));
}
.subscribe-embed.is-loading { height: var(--embed-h); background: var(--surface-2); box-shadow: none; animation: pulse 1.4s ease-in-out infinite; }
.subscribe-embed.is-loading iframe { opacity: 0; }
.subscribe-embed iframe { transition: opacity .3s var(--ease); }
@keyframes pulse { 50% { opacity: .55; } }
.form-note { margin-top: 12px; color: var(--muted); font-size: .84rem; }
/* On dark backgrounds, seat the white Beehiiv field in a white dock so its
   black button keeps contrast. */
@media (prefers-color-scheme: dark) {
  .subscribe-embed.is-cropped { box-shadow: 0 0 0 5px #fff; }
  .subscribe-form .form-note { margin-top: 16px; }
}

/* ---------------------------------------------------------------- subscribe block */
.subscribe-card {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(32px, 5vw, 72px); align-items: center;
  padding: clamp(32px, 5vw, 64px);
  border-radius: var(--r-lg);
  background:
    radial-gradient(80% 120% at 100% 0%, rgba(139, 92, 246, .28), transparent 55%),
    radial-gradient(70% 100% at 0% 100%, rgba(25, 184, 230, .2), transparent 55%),
    #0b0f1a;
  color: #eef1f8;
  box-shadow: var(--shadow-lg), inset 0 0 0 1px rgba(255, 255, 255, .06);
  isolation: isolate;
}
.subscribe-card::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background-image: linear-gradient(rgba(255, 255, 255, .04) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .04) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(90deg, transparent, #000);
}
.subscribe-card .eyebrow { color: #8fb0ff; }
.subscribe-card h2 {
  font-family: var(--font-serif); font-weight: 500;
  font-size: clamp(2rem, 4vw, 3.1rem); line-height: 1.05; letter-spacing: -.025em;
}
.subscribe-copy > p:not(.eyebrow) { margin-top: 16px; max-width: 480px; color: rgba(238, 241, 248, .72); font-size: 1.05rem; }
.subscribe-points { display: grid; gap: 10px; margin: 0 0 24px; padding: 0; list-style: none; }
.subscribe-points li { display: flex; align-items: center; gap: 10px; font-size: .95rem; }
.subscribe-points .i { color: var(--green); }
.subscribe-card .subscribe-points li { color: rgba(238, 241, 248, .88); }
.subscribe-card .subscribe-points .i { color: #4fd1a1; }
.subscribe-card .form-note { margin-top: 16px; color: rgba(238, 241, 248, .55); }
.subscribe-card .subscribe-embed.is-cropped { box-shadow: 0 0 0 5px #fff, 0 12px 32px rgba(0, 0, 0, .35); }
.subscribe-card .subscribe-embed.is-loading { background: rgba(255, 255, 255, .08); }

/* ---------------------------------------------------------------- stats */
.stats-band { border-block: 1px solid var(--line); background: var(--surface); }
.stats-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 22px 0 18px; border-bottom: 1px solid var(--line); }
.stats-head h2 { font-size: .95rem; font-weight: 600; letter-spacing: -.01em; }
.stats-head p { color: var(--muted); font: 400 .75rem var(--font-mono); letter-spacing: .06em; text-transform: uppercase; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); }
.stats .stat { padding: 28px 24px 30px; border-left: 1px solid var(--line); }
.stats .stat:first-child { border-left: 0; padding-left: 0; }
.stat-value {
  display: block;
  font: 500 clamp(1.9rem, 3.2vw, 2.75rem)/1 var(--font-mono); letter-spacing: -.04em;
  color: var(--ink);
}
.stat-label { display: block; margin-top: 12px; color: var(--ink-2); font-size: .92rem; line-height: 1.4; }
.stat-source { display: block; margin-top: 8px; color: var(--muted); font: 400 .7rem/1.4 var(--font-mono); letter-spacing: .04em; text-transform: uppercase; }

/* ---------------------------------------------------------------- cards */
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card {
  position: relative; display: flex; flex-direction: column;
  padding: 26px; min-height: 240px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  text-decoration: none; color: var(--ink);
  box-shadow: var(--shadow-sm);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s var(--ease);
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--line-2); }
.card-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); font-size: .8rem; }
.tag {
  display: inline-block; padding: 3px 9px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent-ink);
  font: 500 .7rem/1.5 var(--font-mono); letter-spacing: .06em; text-transform: uppercase;
}
.card h3 {
  margin: 18px 0 10px;
  font-family: var(--font-serif); font-weight: 500;
  font-size: 1.5rem; line-height: 1.15; letter-spacing: -.015em;
}
.card p { flex: 1; color: var(--ink-2); font-size: .95rem; line-height: 1.55; }
.card-link { display: inline-flex; align-items: center; gap: 6px; margin-top: 22px; color: var(--accent); font-weight: 600; font-size: .9rem; }
.card-link .i { transition: transform .2s var(--ease); }
.card:hover .card-link .i { transform: translateX(3px); }

.latest-grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: 20px; }
.latest-side { display: grid; gap: 20px; }
.latest-side .card { min-height: 0; }
.latest-side .card h3 { font-size: 1.3rem; margin-top: 14px; }
.latest-side .card p { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-featured {
  padding: clamp(28px, 4vw, 44px);
  background:
    radial-gradient(90% 70% at 100% 0%, color-mix(in srgb, var(--violet) 12%, transparent), transparent 60%),
    radial-gradient(70% 60% at 0% 100%, color-mix(in srgb, var(--cyan) 10%, transparent), transparent 60%),
    var(--surface);
}
.card-featured h3 { font-size: clamp(2rem, 3.4vw, 2.75rem); line-height: 1.06; letter-spacing: -.025em; margin-top: auto; padding-top: 64px; }
.card-featured p { flex: 0; font-size: 1.05rem; max-width: 520px; }

/* rows (brief archive) */
.post-list { border-top: 1px solid var(--line); }
.post-row {
  display: grid; grid-template-columns: 140px 1fr auto; gap: 24px; align-items: start;
  padding: 26px 0; border-bottom: 1px solid var(--line); text-decoration: none;
}
.post-row time { color: var(--muted); font: 400 .8rem/2 var(--font-mono); }
.post-row h3 { font-family: var(--font-serif); font-weight: 500; font-size: 1.45rem; line-height: 1.2; transition: color .18s var(--ease); }
.post-row p { margin-top: 6px; color: var(--ink-2); }
.row-arrow { color: var(--muted); padding-top: 6px; transition: transform .2s var(--ease), color .2s var(--ease); }
.post-row:hover h3, .post-row:hover .row-arrow { color: var(--accent); }
.post-row:hover .row-arrow { transform: translateX(3px); }

/* ---------------------------------------------------------------- watchlist / features */
.watch-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.watch {
  display: flex; flex-direction: column;
  padding: 24px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface);
}
.watch .tag { align-self: flex-start; background: var(--surface-2); color: var(--muted); }
.watch h3 { margin: 18px 0 8px; font-size: 1.2rem; font-weight: 650; letter-spacing: -.015em; }
.watch > p:not(.tag):not(.watching) { color: var(--ink-2); font-size: .92rem; flex: 1; }
.watching { margin-top: 20px; padding-top: 16px; border-top: 1px dashed var(--line-2); color: var(--ink); font-size: .9rem; }
.watching span { display: block; margin-bottom: 4px; color: var(--accent); font: 500 .68rem var(--font-mono); letter-spacing: .08em; text-transform: uppercase; }

.feature-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.feature-list > div { padding: 26px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.feature-list-stack { grid-template-columns: 1fr; gap: 0; }
.feature-list-stack > div {
  display: grid; grid-template-columns: 48px 1fr; column-gap: 8px;
  padding: 24px 0; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: none;
}
.feature-list-stack > div:first-child { padding-top: 4px; }
.feature-list-stack > div:last-child { border-bottom: 0; }
.feature-list-stack h3, .feature-list-stack p { grid-column: 2; }
.feature-list-stack .feature-num { grid-row: span 2; }
.feature-num { display: block; color: var(--accent); font: 500 .85rem/1.9 var(--font-mono); }
.feature-list h3 { margin: 6px 0 6px; font-size: 1.12rem; font-weight: 650; letter-spacing: -.01em; }
.feature-list-stack h3 { margin-top: 0; }
.feature-list p { color: var(--ink-2); font-size: .95rem; }

/* ---------------------------------------------------------------- page headers */
.page-header { padding: clamp(56px, 8vw, 104px) 0 clamp(32px, 5vw, 56px); }
.page-header h1, .not-found h1, .subscribe-hero h1 {
  max-width: 900px;
  font-family: var(--font-serif); font-weight: 500;
  font-size: clamp(2.6rem, 5.6vw, 4.5rem); line-height: 1.04; letter-spacing: -.03em;
}
.page-dek { max-width: 640px; margin-top: 20px; color: var(--ink-2); font-size: clamp(1.06rem, 1.5vw, 1.22rem); line-height: 1.55; }
.page-header .subscribe-form { margin-top: 32px; }
.empty-state .eyebrow { margin-bottom: 20px; }

.subscribe-hero { padding: clamp(56px, 9vw, 120px) 0 clamp(40px, 6vw, 72px); text-align: center; }
.subscribe-hero-inner { display: flex; flex-direction: column; align-items: center; }
.subscribe-hero .page-dek { margin-inline: auto; }
.subscribe-hero .subscribe-form { margin-top: 32px; }
.subscribe-hero .form-note { text-align: center; }
.subscribe-hero .subscribe-form { margin-inline: auto; }
.subscribe-logo { width: 64px; height: 64px; border-radius: 16px; margin-bottom: 28px; box-shadow: var(--shadow-lg); }
.subscribe-points-inline { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 24px; margin-top: 28px; color: var(--ink-2); }
.subscribe-points-inline li { font-size: .9rem; }

.not-found { padding: clamp(80px, 14vw, 180px) 0; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }

/* ---------------------------------------------------------------- post */
.post-header { padding: clamp(40px, 6vw, 80px) 0 clamp(28px, 4vw, 44px); }
.post-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 720px) minmax(0, 1fr); column-gap: 56px; }
.post-main { grid-column: 2; min-width: 0; }
.toc { grid-column: 1; justify-self: end; width: 100%; max-width: 230px; }
.breadcrumbs { display: flex; align-items: center; gap: 10px; margin-bottom: 28px; color: var(--muted); font-size: .88rem; }
.breadcrumbs a { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); font-weight: 500; text-decoration: none; }
.breadcrumbs a:hover { color: var(--accent); }
.post-header h1 {
  font-family: var(--font-serif); font-weight: 500;
  font-size: clamp(2.4rem, 5.2vw, 3.9rem); line-height: 1.05; letter-spacing: -.03em;
  font-variation-settings: 'opsz' 72;
}
.post-dek { margin-top: 20px; color: var(--ink-2); font-family: var(--font-serif); font-size: clamp(1.2rem, 2vw, 1.42rem); line-height: 1.45; }
.post-meta {
  display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 28px; padding-top: 20px;
  border-top: 1px solid var(--line); color: var(--muted); font: 400 .8rem var(--font-mono); letter-spacing: .02em;
}
.post-meta > * + *::before { content: '·'; margin-right: 18px; color: var(--line-2); }
.draft-badge {
  display: inline-block; margin-bottom: 20px; padding: 4px 10px; border-radius: 999px;
  background: var(--amber-soft); border: 1px solid var(--amber-line); color: var(--amber);
  font: 500 .72rem var(--font-mono); letter-spacing: .06em; text-transform: uppercase;
}

.toc nav { position: sticky; top: calc(var(--header-h) + 32px); padding-top: 6px; }
.toc-title { margin-bottom: 12px; color: var(--muted); font: 500 .7rem var(--font-mono); letter-spacing: .08em; text-transform: uppercase; }
.toc ol { margin: 0; padding: 0; list-style: none; border-left: 1px solid var(--line); }
.toc a {
  display: block; margin-left: -1px; padding: 6px 0 6px 14px;
  border-left: 2px solid transparent; color: var(--muted);
  font-size: .86rem; line-height: 1.4; text-decoration: none;
  transition: color .18s var(--ease), border-color .18s var(--ease);
}
.toc a:hover { color: var(--ink); }
.toc a.is-active { color: var(--ink); border-left-color: var(--accent); font-weight: 500; }

.post-footer {
  display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--line);
}
.disclaimer { color: var(--muted); font-size: .84rem; }
.share { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .84rem; }
.share > span { margin-right: 4px; }
.page-post .subscribe-section { padding-top: clamp(48px, 6vw, 72px); }
.page-post .subscribe-section + .section { padding-top: 0; }

/* ---------------------------------------------------------------- prose */
.prose { color: var(--ink-2); font-family: var(--font-serif); font-size: 1.24rem; line-height: 1.68; }
.prose > * + * { margin-top: 1.1em; }
.prose > :first-child { margin-top: 0; }
.prose h2 {
  margin-top: 2.2em; color: var(--ink);
  font-family: var(--font-serif); font-weight: 500; font-size: 1.9rem; line-height: 1.2; letter-spacing: -.02em;
}
.prose h3 { margin-top: 1.8em; color: var(--ink); font-family: var(--font-sans); font-size: 1.12rem; font-weight: 650; line-height: 1.35; letter-spacing: -.01em; }
.prose h2 + *, .prose h3 + * { margin-top: .6em; }
.prose h2, .prose h3 { position: relative; scroll-margin-top: calc(var(--header-h) + 24px); }
.prose .anchor {
  position: absolute; left: -1.1em; width: 1em; color: var(--line-2);
  text-decoration: none; opacity: 0; transition: opacity .15s var(--ease);
}
.prose h2:hover .anchor, .prose h3:hover .anchor { opacity: 1; }
.prose strong { color: var(--ink); font-weight: 600; }
.prose a { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent); transition: text-decoration-color .15s var(--ease); }
.prose a:hover { text-decoration-color: currentColor; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: .45em; }
.prose li::marker { color: var(--muted); }
.prose ol li::marker { font-family: var(--font-mono); font-size: .85em; }
.prose blockquote {
  margin: 2em 0; padding: 4px 0 4px 26px;
  border-left: 3px solid; border-image: var(--brand-gradient) 1;
  color: var(--ink); font-size: 1.42rem; font-style: italic; line-height: 1.45;
}
.prose hr { margin: 2.6em 0; border: 0; height: 1px; background: var(--line); }
.prose img, .prose figure { margin: 2em 0; border-radius: var(--r); }
.prose figcaption { margin-top: 10px; color: var(--muted); font-family: var(--font-sans); font-size: .85rem; }
.prose code { padding: .12em .38em; border-radius: 5px; background: var(--surface-2); border: 1px solid var(--line); font: .82em var(--font-mono); }
.prose pre { overflow-x: auto; padding: 18px 20px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--line); font-size: .85rem; line-height: 1.6; }
.prose pre code { padding: 0; border: 0; background: none; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); }
.prose table { width: 100%; border-collapse: collapse; font-family: var(--font-sans); font-size: .92rem; }
.prose th, .prose td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--line); }
.prose th { background: var(--surface-2); color: var(--ink); font-weight: 600; }
.prose tr:last-child td { border-bottom: 0; }

/* Sans prose (homepage / about) */
.prose-sans { font-family: var(--font-sans); font-size: 1.06rem; line-height: 1.7; }
.prose-sans .lead { color: var(--ink); font-family: var(--font-serif); font-size: clamp(1.5rem, 2.4vw, 1.95rem); line-height: 1.3; letter-spacing: -.015em; }
.prose-sans .text-link { text-decoration: none; }

/* Components inside prose — always sans */
.prose .callout, .prose .thesis, .prose .terms, .prose .stat-row, .prose .accordion { font-family: var(--font-sans); }
.callout {
  margin: 2em 0 !important; padding: 20px 22px;
  border: 1px solid var(--accent-line); border-radius: var(--r);
  background: var(--accent-soft); color: var(--ink-2); font-size: 1rem; line-height: 1.6;
}
.callout > * + * { margin-top: .6em; }
.callout-title { color: var(--ink); font-weight: 650; }
.callout-warning { border-color: var(--amber-line); background: var(--amber-soft); }
.callout-warning .callout-title { color: var(--amber); }
.thesis {
  margin: 2em 0 !important; padding: 26px 28px;
  border-radius: var(--r); background: var(--amber-soft); border: 1px solid var(--amber-line);
  color: var(--ink); font-family: var(--font-serif) !important;
  font-size: clamp(1.3rem, 2.2vw, 1.6rem); line-height: 1.38; letter-spacing: -.01em;
}
.terms { margin: 1.4em 0 0; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); overflow: hidden; }
.terms > div { display: grid; grid-template-columns: 190px 1fr; gap: 20px; padding: 16px 22px; border-bottom: 1px solid var(--line); }
.terms > div:last-child { border-bottom: 0; }
.terms dt { color: var(--ink); font-weight: 600; font-size: .95rem; }
.terms dd { margin: 0; color: var(--ink-2); font-size: .95rem; line-height: 1.55; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); margin: 2em 0 !important; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); overflow: hidden; }
.stat-row .stat { padding: 20px 22px; border-left: 1px solid var(--line); }
.stat-row .stat:first-child { border-left: 0; }
.stat-row .stat-value { font-size: 1.85rem; color: var(--accent); }
.stat-row .stat-label { font-size: .88rem; margin-top: 10px; }

/* Accordion (":::accordion" in Markdown) */
.accordion { margin: 1.4em 0 0 !important; border-top: 1px solid var(--line); }
.acc-item { border-bottom: 1px solid var(--line); }
.acc-item summary {
  display: grid; grid-template-columns: 40px 1fr 28px; gap: 12px; align-items: center;
  padding: 18px 4px; cursor: pointer; list-style: none;
  color: var(--ink); font-weight: 600; font-size: 1.04rem; letter-spacing: -.01em;
  border-radius: var(--r-sm);
  transition: color .18s var(--ease);
}
.acc-item summary::-webkit-details-marker { display: none; }
.acc-item summary:hover { color: var(--accent); }
.acc-num { color: var(--accent); font: 500 .78rem var(--font-mono); }
.acc-icon {
  position: relative; width: 28px; height: 28px; border-radius: 50%;
  border: 1px solid var(--line-2);
  transition: transform .35s var(--ease-out), background-color .2s var(--ease), border-color .2s var(--ease);
}
.acc-icon::before, .acc-icon::after {
  content: ''; position: absolute; inset: 0; margin: auto; width: 11px; height: 1.6px; border-radius: 2px;
  background: var(--muted); transition: background-color .2s var(--ease);
}
.acc-icon::after { transform: rotate(90deg); }
.acc-item.is-open .acc-icon, .acc-item[open]:not(.js) .acc-icon { transform: rotate(45deg); background: var(--accent); border-color: var(--accent); }
.acc-item.is-open .acc-icon::before, .acc-item.is-open .acc-icon::after { background: #fff; }
.acc-body { overflow: hidden; }
.acc-inner { padding: 0 40px 22px 56px; color: var(--ink-2); font-size: 1rem; line-height: 1.65; }
.acc-inner > * + * { margin-top: .7em; }

/* ---------------------------------------------------------------- footer */
.site-footer { border-top: 1px solid var(--line); background: var(--bg-alt); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; padding: 56px 0 40px; }
.footer-brand p { max-width: 340px; margin-top: 14px; color: var(--muted); font-size: .92rem; }
.footer-brand .brand img { width: 28px; height: 28px; border-radius: 7px; }
.social { display: flex; gap: 8px; margin-top: 20px; }
.social a { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line-2); color: var(--ink-2); transition: color .18s var(--ease), border-color .18s var(--ease); }
.social a:hover { color: var(--accent); border-color: var(--accent-line); }
.footer-title { margin-bottom: 14px; color: var(--ink); font-size: .85rem; font-weight: 600; }
.site-footer ul { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.site-footer nav a { color: var(--muted); font-size: .9rem; text-decoration: none; transition: color .18s var(--ease); }
.site-footer nav a:hover { color: var(--ink); }
.footer-base {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 20px 0 32px; border-top: 1px solid var(--line);
  color: var(--muted); font-size: .8rem;
}

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1100px) {
  .post-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 720px) minmax(0, 1fr); column-gap: 0; }
  .toc { display: none; }
  .watch-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual { aspect-ratio: 16 / 10; min-height: 300px; }
  .subscribe-card { grid-template-columns: 1fr; }
  .latest-grid { grid-template-columns: 1fr; }
  .card-featured h3 { padding-top: 40px; }
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stats .stat:nth-child(odd) { border-left: 0; padding-left: 0; }
  .stats .stat:nth-child(-n + 2) { border-bottom: 1px solid var(--line); }
  .split { grid-template-columns: 1fr; gap: 24px; }
  .split-label { position: static; }
  .feature-list { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  :root { --header-h: 60px; }
  .site-nav { flex: 0; }
  .menu-toggle {
    display: inline-grid; place-content: center; gap: 5px;
    width: 40px; height: 40px; padding: 0; margin-right: -6px;
    border: 0; border-radius: var(--r-sm); background: transparent; cursor: pointer;
  }
  .menu-toggle span { display: block; width: 18px; height: 1.6px; border-radius: 2px; background: var(--ink); transition: transform .3s var(--ease-out); }
  .menu-toggle[aria-expanded='true'] span:first-child { transform: translateY(3.3px) rotate(45deg); }
  .menu-toggle[aria-expanded='true'] span:last-child { transform: translateY(-3.3px) rotate(-45deg); }
  .header-actions .btn[aria-current='page'] { visibility: visible; }
  .nav-links {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; gap: 0;
    padding: 8px var(--gutter) 20px;
    background: var(--bg); border-bottom: 1px solid var(--line);
    box-shadow: 0 24px 40px -16px rgba(16, 24, 40, .18);
    opacity: 0; transform: translateY(-8px); visibility: hidden;
    transition: opacity .25s var(--ease), transform .3s var(--ease-out), visibility 0s linear .3s;
  }
  .nav-open .nav-links { opacity: 1; transform: none; visibility: visible; transition: opacity .25s var(--ease), transform .3s var(--ease-out); }
  .nav-links li + li { border-top: 1px solid var(--line); }
  .nav-links a { padding: 16px 2px; border-radius: 0; font-size: 1.05rem; color: var(--ink); }
  .nav-links a:hover { background: none; color: var(--accent); }
  .nav-links a[aria-current='page'] { color: var(--accent); }
  .nav-open .site-header { border-bottom-color: var(--line); background: var(--bg); }

  .card-grid, .watch-grid { grid-template-columns: 1fr; }
  .card { min-height: 0; }
  .section-head { flex-direction: column; align-items: flex-start; gap: 12px; }
  .post-row { grid-template-columns: 1fr auto; gap: 6px 16px; }
  .post-row time { grid-column: 1 / -1; line-height: 1.4; }
  .post-row .row-arrow { grid-row: 2; grid-column: 2; }
  .prose { font-size: 1.14rem; }
  .prose h2 { font-size: 1.6rem; }
  .prose .anchor { display: none; }
  .terms > div { grid-template-columns: 1fr; gap: 4px; }
  .acc-inner { padding: 0 4px 20px 52px; }
  .post-footer { flex-direction: column; align-items: flex-start; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 520px) {
  .hero h1 { font-size: clamp(2.5rem, 11vw, 3rem); }
  .hero-visual { aspect-ratio: 1 / .85; min-height: 0; }
  .hub { width: 72px; height: 72px; font-size: .58rem; }
  .stats-head { flex-direction: column; gap: 4px; }
  .stats .stat { padding: 22px 0 22px 16px; }
  .stats .stat:nth-child(odd) { padding-left: 0; padding-right: 12px; }
  .stat-row { grid-template-columns: 1fr; }
  .stat-row .stat { border-left: 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: 110px 1fr; gap: 12px; align-items: baseline; padding: 16px 18px; }
  .stat-row .stat:first-child { border-top: 0; }
  .stat-row .stat-value { font-size: 1.5rem; }
  .stat-row .stat-label { margin-top: 0; }
  .subscribe-card { border-radius: var(--r); }
  .acc-item summary { grid-template-columns: 30px 1fr 28px; }
  .acc-inner { padding-left: 42px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  @view-transition { navigation: none; }
}
