/* ---------------------------------------------------------------------------
   Siddarth Nyati — Crypto & Stablecoin portfolio
   Design tokens + shared components. No build step; this file is the system.
   ------------------------------------------------------------------------ */

:root {
  /* color */
  --bg: #0b0c0f;
  --bg-raised: #111318;
  --bg-inset: #0e1013;
  --border: rgba(231, 234, 238, 0.09);
  --border-strong: rgba(231, 234, 238, 0.16);
  --text: #e7eaee;
  --text-dim: #9aa3ae;
  --text-faint: #7f8994;
  --accent: #e2b33c;          /* amber — reserved for the three questions & key signals */
  --accent-ink: #0b0c0f;
  --accent-soft: rgba(226, 179, 60, 0.12);
  --hollow: #7d8590;          /* open-question gray */

  /* type */
  --serif: "Charter", "Iowan Old Style", "Palatino", Georgia, Cambria, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  /* modular scale (1.25) on a 17px base */
  --fs-0: 0.8125rem;   /* 13 — meta, labels */
  --fs-1: 0.9375rem;   /* 15 — ui, captions */
  --fs-2: 1.0625rem;   /* 17 — body */
  --fs-3: 1.3125rem;   /* 21 — lede, h4 */
  --fs-4: 1.6875rem;   /* 27 — h3 */
  --fs-5: 2.125rem;    /* 34 — h2 */
  --fs-6: 2.625rem;    /* 42 — h1 */
  --fs-7: 3.3125rem;   /* 53 — hero */

  /* 8px rhythm */
  --s1: 8px;  --s2: 16px; --s3: 24px; --s4: 32px;
  --s5: 48px; --s6: 64px; --s7: 96px; --s8: 128px;

  --prose: 68ch;
  --wide: 1120px;
  --radius: 4px;
}

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

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

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background:
    radial-gradient(90rem 44rem at 88% -12%, rgba(226, 179, 60, 0.055), transparent 62%),
    radial-gradient(70rem 40rem at -12% -4%, rgba(96, 118, 148, 0.09), transparent 58%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--serif);
  font-size: var(--fs-2);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 0 0 var(--s3);
  text-wrap: balance;
}
h1 { font-size: clamp(var(--fs-6), 5.5vw, var(--fs-7)); }
h2 { font-size: clamp(var(--fs-4), 3.5vw, var(--fs-5)); }
h3 { font-size: var(--fs-4); }
h4 { font-size: var(--fs-3); }

p, ul, ol { margin: 0 0 var(--s3); max-width: var(--prose); }
li { margin-bottom: var(--s1); }
strong { font-weight: 600; }
em { font-style: italic; }

a { color: var(--text); text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 3px; transition: text-decoration-color 140ms ease; }
a:hover { text-decoration-color: var(--accent); }

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

::selection { background: var(--accent-soft); }

hr { border: 0; border-top: 1px solid var(--border); margin: var(--s6) 0; }

code { font-family: var(--mono); font-size: 0.88em; background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--radius); padding: 1px 5px; }

/* ---- layout ------------------------------------------------------------ */

.container { max-width: var(--wide); margin: 0 auto; padding: 0 var(--s3); }
@media (min-width: 720px) { .container { padding: 0 var(--s5); } }

.section { padding: var(--s7) 0; }
.section + .section { border-top: 1px solid var(--border); }

/* eyebrow — small caps label above sections */
.eyebrow {
  font-family: var(--sans);
  font-size: var(--fs-0);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin: 0 0 var(--s2);
}
.eyebrow .num { color: var(--accent); font-variant-numeric: tabular-nums; }

.lede { font-size: var(--fs-3); line-height: 1.5; color: var(--text-dim); max-width: var(--prose); }

/* skip link */
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  font-family: var(--sans); font-size: var(--fs-1); font-weight: 600;
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 0 0 var(--radius) var(--radius);
  text-decoration: none;
}
.skip-link:focus { left: var(--s3); }

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

.site-header {
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  position: sticky; top: 0; z-index: 50;
}
.site-header .bar {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 60px; gap: var(--s3);
}
.wordmark {
  font-family: var(--sans); font-weight: 600; font-size: var(--fs-1);
  letter-spacing: 0.02em; text-decoration: none; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 10px;
}
.wordmark .tick { width: 18px; height: 10px; flex: none; }
.site-nav { display: flex; gap: var(--s3); align-items: center; flex-wrap: wrap; }
.site-nav a {
  font-family: var(--sans); font-size: var(--fs-1); color: var(--text-dim);
  text-decoration: none; padding: 4px 0;
}
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--text); }
.site-nav a[aria-current="page"] { box-shadow: 0 1px 0 0 var(--accent); }

@media (max-width: 640px) {
  .site-header .bar { flex-direction: column; align-items: flex-start; padding-top: var(--s2); padding-bottom: var(--s2); }
  .site-nav { gap: var(--s2) var(--s3); }
}

/* ---- honesty badge ----------------------------------------------------- */

.demo-badge {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--sans); font-size: var(--fs-0); font-weight: 600;
  letter-spacing: 0.04em; color: var(--text-dim);
  border: 1px solid var(--border-strong); border-radius: 999px;
  padding: 5px 12px; white-space: nowrap;
}
.demo-badge::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  border: 1.5px solid var(--accent); flex: none;
}

/* page-level persistent badge (top of every screen) */
.page-badge { margin: var(--s4) 0 0; }

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

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--sans); font-size: var(--fs-1); font-weight: 600;
  padding: 10px 18px; border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  color: var(--text); background: transparent;
  text-decoration: none; cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease;
}
.btn:hover { border-color: var(--text-faint); background: var(--bg-raised); }
.btn.primary { background: var(--text); color: var(--bg); border-color: var(--text); }
.btn.primary:hover { background: #fff; }

/* ---- visual tiles (homepage v3) ----------------------------------------- */

.vgrid { display: grid; gap: var(--s2); grid-template-columns: repeat(2, 1fr); }
@media (max-width: 760px) { .vgrid { grid-template-columns: 1fr; } }

.vtile {
  display: flex; flex-direction: column;
  border: 1px solid var(--border); border-radius: 8px;
  background: linear-gradient(180deg, #151820 0%, #0f1115 100%);
  overflow: hidden;
  text-decoration: none;
  box-shadow: 0 1px 0 rgba(231,234,238,0.04) inset, 0 10px 30px rgba(0,0,0,0.35);
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}
a.vtile:hover {
  border-color: rgba(226,179,60,0.35); transform: translateY(-3px);
  box-shadow: 0 1px 0 rgba(231,234,238,0.06) inset, 0 18px 44px rgba(0,0,0,0.5);
}
.vtile .thumb { position: relative; aspect-ratio: 8 / 5; background: var(--bg-inset); border-bottom: 1px solid var(--border); overflow: hidden; }
.vtile .thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; transition: transform 400ms ease; }
a.vtile:hover .thumb img { transform: scale(1.03); }
@media (prefers-reduced-motion: reduce) { .vtile .thumb img { transition: none; } a.vtile:hover .thumb img { transform: none; } }
.vtile .thumb .flag {
  position: absolute; top: 10px; left: 10px; z-index: 2;
  font-family: var(--sans); font-size: 11px; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--text-dim);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border: 1px solid var(--border-strong); border-radius: 999px; padding: 3px 10px;
  backdrop-filter: blur(6px);
}
.vtile .thumb .flag.hot { color: var(--accent); }
.vtile .meta-row {
  display: flex; align-items: baseline; justify-content: space-between; gap: var(--s2);
  padding: var(--s2) var(--s3) var(--s3);
}
.vtile .meta-row h2 { font-size: var(--fs-3); margin: 0; }
.vtile .meta-row .sub { font-family: var(--sans); font-size: var(--fs-0); color: var(--text-faint); white-space: nowrap; }
.vtile .oneline { font-family: var(--serif); font-size: var(--fs-1); color: var(--text-dim); margin: 0; padding: 0 var(--s3) var(--s3); }

/* interactive rails thumb (tile 1) */
.rails-play { cursor: crosshair; }
.rails-play svg { width: 100%; height: 100%; display: block; }
.rails-play .torch {
  position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 200ms ease;
  background: radial-gradient(140px circle at var(--tx, 50%) var(--ty, 50%), rgba(226,179,60,0.14), transparent 70%);
}
.rails-play:hover .torch { opacity: 1; }
.rails-play .qa { opacity: 0.35; transition: opacity 180ms ease; }
.rails-play .qa.lit { opacity: 1; }
.rails-play .dotc { transition: r 150ms ease; }

/* five-across tile row */
.vgrid.five { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 1080px) { .vgrid.five { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 720px) { .vgrid.five { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 460px) { .vgrid.five { grid-template-columns: 1fr; } }
.vgrid.five .vtile .meta-row { padding: var(--s2) var(--s2) 4px; }
.vgrid.five .vtile .meta-row h2 { font-size: var(--fs-2); }
.vgrid.five .vtile .oneline { font-size: var(--fs-0); font-family: var(--sans); color: var(--text-faint); padding: 0 var(--s2) var(--s2); }
.vgrid.five .vtile .thumb { aspect-ratio: 4 / 3; }
.vgrid.five .vtile .thumb .flag { top: 8px; left: 8px; padding: 2px 8px; font-size: 10px; }

/* capability arc (who am I / why legit) */
.arc { display: grid; gap: var(--s2); grid-template-columns: repeat(3, 1fr); margin: var(--s4) 0 0; }
@media (max-width: 760px) { .arc { grid-template-columns: 1fr; } }
.arc .step {
  position: relative;
  border: 1px solid var(--border); border-radius: 8px;
  background: linear-gradient(180deg, #14161c 0%, #0f1114 100%);
  padding: var(--s2) var(--s3);
  box-shadow: 0 1px 0 rgba(231,234,238,0.04) inset;
}
.arc .step .dom { font-family: var(--sans); font-size: 11px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); margin: 0 0 2px; }
.arc .step .org { font-family: var(--sans); font-size: var(--fs-1); font-weight: 600; margin: 0; }
.arc .step .win { font-family: var(--sans); font-size: var(--fs-0); color: var(--text-dim); margin: 2px 0 0; }
.arc .step::after {
  content: "→"; position: absolute; right: -15px; top: 50%; transform: translateY(-50%);
  color: var(--text-faint); font-family: var(--sans); z-index: 2;
}
.arc .step:last-child::after { content: none; }
@media (max-width: 760px) { .arc .step::after { content: none; } }

/* case-study compact layouts */
.row3 { display: grid; gap: var(--s4); grid-template-columns: repeat(3, 1fr); }
@media (max-width: 860px) { .row3 { grid-template-columns: 1fr; gap: var(--s3); } }
.row3 p { font-size: var(--fs-1); color: var(--text-dim); margin: 0; max-width: none; }

.shot-hero {
  position: relative; border: 1px solid var(--border-strong); border-radius: 8px;
  overflow: hidden; margin: var(--s4) 0;
  box-shadow: 0 18px 50px rgba(0,0,0,0.45);
}
.shot-hero img { width: 100%; display: block; }
.shot-hero .cta-row {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; align-items: center; justify-content: space-between; gap: var(--s2);
  padding: var(--s3);
  background: linear-gradient(180deg, transparent, rgba(8, 9, 11, 0.88) 55%);
}
.shot-hero .cta-row .demo-badge { background: rgba(11,12,15,0.7); backdrop-filter: blur(6px); }

.northstar {
  border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: var(--radius);
  background: linear-gradient(180deg, #14161c 0%, #0f1114 100%);
  padding: var(--s3) var(--s4); margin: var(--s4) 0 0;
}
.northstar .ns-big { font-family: var(--serif); font-size: var(--fs-3); margin: 0; }
.northstar .ns-why { font-family: var(--sans); font-size: var(--fs-1); color: var(--text-dim); margin: var(--s1) 0 var(--s2); max-width: none; }
.northstar .chips { margin: 0; }

/* gap → feature map (DeFiLend) */
.gapmap { display: flex; flex-direction: column; gap: var(--s1); margin: var(--s4) 0 0; }
.gapmap .g-row {
  display: grid; grid-template-columns: 150px 24px 220px 1fr; gap: var(--s2); align-items: center;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: linear-gradient(180deg, #14161c 0%, #0f1114 100%);
  padding: 10px var(--s3);
  font-family: var(--sans); font-size: var(--fs-1);
}
@media (max-width: 760px) { .gapmap .g-row { grid-template-columns: 1fr; gap: 4px; } .gapmap .g-row .g-arrow { display: none; } }
.gapmap .g-gap { font-size: var(--fs-0); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.gapmap .g-arrow { color: var(--text-faint); text-align: center; }
.gapmap .g-feat { font-weight: 600; }
.gapmap .g-why { color: var(--text-faint); font-size: var(--fs-0); }

/* secondary strip */
.substrip { display: grid; gap: var(--s2); grid-template-columns: repeat(3, 1fr); margin-top: var(--s2); }
@media (max-width: 760px) { .substrip { grid-template-columns: 1fr; } }
.subcard {
  display: flex; flex-direction: column; gap: var(--s2);
  border: 1px solid var(--border); border-radius: 6px; background: var(--bg-raised);
  padding: var(--s3); text-decoration: none; justify-content: space-between;
  transition: border-color 140ms ease, transform 140ms ease;
}
a.subcard:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.subcard h2 { font-size: var(--fs-2); font-family: var(--sans); font-weight: 600; margin: 0; }
.subcard .k { font-family: var(--sans); font-size: 11px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-faint); margin: 0; }
.subcard img { border-radius: 3px; border: 1px solid var(--border); }

/* ---- v6: curved journey timeline ---------------------------------------- */

.tl-curve { position: relative; height: 210px; margin-top: var(--s3); }
.tl-curve .track { position: absolute; inset: 0; width: 100%; height: 100%; }
.tl-curve button {
  position: absolute; transform: translate(-50%, -50%);
  background: none; border: 0; cursor: pointer;
  font-family: var(--sans); color: var(--text-dim); text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 6px;
}
.tl-curve button .nd {
  width: 13px; height: 13px; border-radius: 50%;
  border: 2px solid var(--text-faint); background: var(--bg);
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}
.tl-curve button .yr { font-family: var(--mono); font-size: var(--fs-0); color: var(--text-faint); }
.tl-curve button .lb { font-size: var(--fs-1); font-weight: 600; white-space: nowrap; }
.tl-curve button:hover { color: var(--text); }
.tl-curve button:hover .nd { transform: scale(1.25); border-color: var(--accent); }
.tl-curve button[aria-selected="true"] { color: var(--text); }
.tl-curve button[aria-selected="true"] .nd {
  border-color: var(--accent); background: var(--accent);
  box-shadow: 0 0 0 0 rgba(226,179,60,0.5);
  animation: tl-pulse 2s ease-out infinite;
}
.tl-curve button[aria-selected="true"] .yr { color: var(--accent); }
@keyframes tl-pulse {
  0% { box-shadow: 0 0 0 0 rgba(226,179,60,0.45); }
  70% { box-shadow: 0 0 0 12px rgba(226,179,60,0); }
  100% { box-shadow: 0 0 0 0 rgba(226,179,60,0); }
}
@media (prefers-reduced-motion: reduce) { .tl-curve button[aria-selected="true"] .nd { animation: none; } }
.tl-detail > div { animation: tl-fade 260ms ease; }
@keyframes tl-fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .tl-detail > div { animation: none; } }
@media (max-width: 780px) {
  .tl-curve { height: auto; }
  .tl-curve .track { display: none; }
  .tl-curve { display: flex; flex-wrap: wrap; gap: var(--s1) var(--s3); }
  .tl-curve button { position: static; transform: none; flex-direction: row; }
}

/* credibility strip */
.cred-strip {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s3);
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  padding: var(--s3) 0; margin-top: var(--s3);
}
@media (max-width: 760px) { .cred-strip { grid-template-columns: repeat(2, 1fr); } }
.cred-strip b { display: block; font-family: var(--mono); font-size: var(--fs-4); font-weight: 400; color: var(--text); font-variant-numeric: tabular-nums; }
.cred-strip span { font-family: var(--sans); font-size: var(--fs-0); color: var(--text-faint); }

/* combined first screen: timeline beside its detail card */
.tl-split { display: grid; grid-template-columns: 1.35fr 1fr; gap: var(--s4); align-items: center; margin-top: var(--s3); }
@media (max-width: 980px) { .tl-split { grid-template-columns: 1fr; } }
.tl-split .tl-curve { height: 190px; margin-top: 0; }
.tl-split .tl-detail { margin-top: 0; padding: var(--s2) var(--s3); min-height: 150px; }
.tl-split .tl-detail ul { font-size: var(--fs-0); }
.tl-split .tl-detail p { font-size: var(--fs-0); }
.tl-split .tl-detail h2 { font-size: var(--fs-1); }

/* big section heading for the work */
.work-head { font-size: clamp(var(--fs-5), 4.5vw, var(--fs-6)); max-width: 26ch; margin-bottom: var(--s1); }
.work-sub { font-family: var(--serif); font-size: var(--fs-2); color: var(--text-dim); margin: 0 0 var(--s4); }

/* ---- v5: journey timeline ---------------------------------------------- */

.tl-wrap { margin-top: var(--s5); }
.tl { display: flex; gap: 0; overflow-x: auto; padding: var(--s2) 0 var(--s3); position: relative; scrollbar-width: none; }
.tl::-webkit-scrollbar { display: none; }
.tl button {
  flex: 1 0 auto; min-width: 128px;
  background: none; border: 0; cursor: pointer; text-align: left;
  font-family: var(--sans); color: var(--text-dim);
  padding: 0 var(--s2) 0 0; position: relative;
}
.tl button .yr { display: block; font-family: var(--mono); font-size: var(--fs-0); color: var(--text-faint); }
.tl button .lb { display: block; font-size: var(--fs-1); font-weight: 600; margin-top: 2px; }
.tl button .nd {
  display: block; width: 11px; height: 11px; border-radius: 50%;
  border: 2px solid var(--text-faint); background: var(--bg); margin: 10px 0 8px;
  position: relative; z-index: 2; transition: border-color 140ms ease, background 140ms ease;
}
.tl button::after { /* connecting line */
  content: ""; position: absolute; left: 5px; right: 0; top: calc(100% - 36px); height: 2px;
  background: var(--border-strong); transform: translateY(-14px); z-index: 1;
}
.tl button:last-child::after { right: calc(100% - 12px); }
.tl button:hover { color: var(--text); }
.tl button[aria-selected="true"] { color: var(--text); }
.tl button[aria-selected="true"] .nd { border-color: var(--accent); background: var(--accent); }
.tl button[aria-selected="true"] .yr { color: var(--accent); }
.tl-detail {
  border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: var(--radius);
  background: linear-gradient(180deg, #14161c 0%, #0f1114 100%);
  padding: var(--s3) var(--s4); min-height: 108px;
}
.tl-detail h2, .tl-detail h3 { font-family: var(--sans); font-size: var(--fs-2); font-weight: 600; margin: 0 0 var(--s1); letter-spacing: 0; }
.tl-detail ul { margin: 0; padding-left: 18px; font-family: var(--sans); font-size: var(--fs-1); color: var(--text-dim); max-width: none; }
.tl-detail ul li { margin-bottom: 4px; }
.tl-detail p { font-family: var(--sans); font-size: var(--fs-1); color: var(--text-dim); margin: 0; max-width: none; }

/* ---- v5: hero slideshow ------------------------------------------------- */

.shot-hero.slides { aspect-ratio: 8 / 5; }
.shot-hero.slides img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 700ms ease; }
.shot-hero.slides img.on { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .shot-hero.slides img { transition: none; } }
.shot-hero .dots-nav {
  position: absolute; top: var(--s2); right: var(--s2); display: flex; gap: 6px; z-index: 3;
}
.shot-hero .dots-nav i { width: 8px; height: 8px; border-radius: 50%; background: rgba(231,234,238,0.35); }
.shot-hero .dots-nav i.on { background: var(--accent); }

/* ---- v5: slide-deck console (Parity) ------------------------------------ */

.deck { border: 1px solid var(--border-strong); border-radius: 8px; overflow: hidden; background: linear-gradient(180deg, #14161c 0%, #0f1114 100%); box-shadow: 0 14px 40px rgba(0,0,0,0.4); }
.deck-tabs { display: flex; flex-wrap: wrap; border-bottom: 1px solid var(--border); }
.deck-tabs button {
  flex: 1 1 auto; background: none; border: 0; border-right: 1px solid var(--border);
  font-family: var(--sans); font-size: var(--fs-0); font-weight: 600; letter-spacing: 0.04em;
  color: var(--text-faint); padding: 12px 10px; cursor: pointer;
}
.deck-tabs button:last-child { border-right: 0; }
.deck-tabs button:hover { color: var(--text); }
.deck-tabs button[aria-selected="true"] { color: var(--accent); box-shadow: inset 0 -2px 0 var(--accent); }
.deck-panel { padding: var(--s4); }
.deck-panel[hidden] { display: none; }
.deck-nav { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--border); padding: var(--s2) var(--s3); font-family: var(--sans); font-size: var(--fs-0); color: var(--text-faint); }

/* default live-prototype embed, cropped to hide the share-page chrome */
.proto-crop {
  position: relative; overflow: hidden;
  height: min(78vh, 720px);
  border-radius: 8px;
}
.proto-crop iframe {
  position: absolute; top: -57px; left: 0; border: 0;
  width: calc(100% + 350px);
  height: calc(100% + 57px);
  background: #0e1013;
}
@media (max-width: 760px) {
  .proto-crop { height: 70vh; }
  .proto-crop iframe { width: 100%; }
}
.proto-open { font-family: var(--sans); font-size: var(--fs-1); margin: var(--s2) 0 0; }

/* breadcrumb */
.crumb { font-family: var(--sans); font-size: var(--fs-1); margin: var(--s4) 0 0; }
.crumb a { color: var(--text-dim); text-decoration: none; }
.crumb a:hover { color: var(--text); }

/* ---- bento tiles (homepage) -------------------------------------------- */

.bento { display: grid; gap: var(--s2); grid-template-columns: repeat(4, 1fr); }
@media (max-width: 980px) { .bento { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .bento { grid-template-columns: 1fr; } }

.tile {
  display: flex; flex-direction: column; gap: var(--s2);
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg-raised); padding: var(--s3);
  text-decoration: none; min-height: 200px;
  transition: border-color 140ms ease, transform 140ms ease;
}
a.tile:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.tile .kicker {
  font-family: var(--sans); font-size: 11px; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-faint);
  display: flex; justify-content: space-between; gap: var(--s2); margin: 0;
}
.tile .kicker .live { color: var(--accent); }
.tile h2 { font-size: var(--fs-3); margin: 0; }
.tile .line { font-family: var(--serif); font-size: var(--fs-1); color: var(--text-dim); margin: 0; }
.tile .peek { margin-top: auto; font-family: var(--sans); font-size: var(--fs-0); color: var(--text-dim); }
.tile .go { font-family: var(--sans); font-size: var(--fs-0); color: var(--text-faint); }
a.tile:hover .go { color: var(--text); }
.tile.span2 { grid-column: span 2; }
@media (max-width: 560px) { .tile.span2 { grid-column: span 1; } }

/* fit tile rows */
.fitmap { display: flex; flex-direction: column; margin: 0; }
.fitmap a {
  display: grid; grid-template-columns: 1fr auto; gap: var(--s2); align-items: baseline;
  padding: 5px 0; border-bottom: 1px solid var(--border);
  font-family: var(--sans); font-size: var(--fs-0);
  color: var(--text-dim); text-decoration: none;
}
.fitmap a:last-child { border-bottom: 0; }
.fitmap a b { color: var(--text); font-weight: 600; }
.fitmap a span:last-child { color: var(--text-faint); white-space: nowrap; }
.fitmap a:hover span:last-child { color: var(--accent); }

/* tile peek widgets */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips i {
  font-style: normal; font-family: var(--sans); font-size: 11px; font-weight: 600;
  border: 1px solid var(--border-strong); border-radius: 999px; padding: 2px 9px;
  color: var(--text-dim);
}
.chips i.hot { border-color: var(--accent); color: var(--accent); }
.mini-bars { display: grid; gap: 6px; }
.mini-bars .r { display: grid; grid-template-columns: 96px 1fr 52px; gap: 8px; align-items: center; }
.mini-bars .r em { font-style: normal; font-weight: 600; }
.mini-bars .t { height: 7px; background: var(--bg-inset); border: 1px solid var(--border); border-radius: 2px; overflow: hidden; }
.mini-bars .t b { display: block; height: 100%; background: var(--text-faint); }
.mini-bars .r.win .t b { background: var(--accent); }
.mini-bars .n { font-family: var(--mono); text-align: right; font-size: 12px; }
.gate-dots { display: flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 11px; color: var(--text-faint); flex-wrap: wrap; }
.gate-dots i { width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--accent); }
.flow-chips { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-family: var(--sans); font-size: 11px; font-weight: 600; color: var(--text-dim); }
.flow-chips i { font-style: normal; border: 1px solid var(--border-strong); border-radius: 999px; padding: 2px 9px; }
.flow-chips span { color: var(--text-faint); }

/* identity strip above the grid */
.identity { padding: var(--s4) 0 var(--s3); }
.identity .cols { display: grid; gap: var(--s3) var(--s6); grid-template-columns: 1fr; align-items: start; }
@media (min-width: 980px) { .identity .cols { grid-template-columns: 1.05fr 1fr; } }
.identity .who {
  font-family: var(--sans); font-size: var(--fs-1); color: var(--text-dim);
  display: flex; flex-wrap: wrap; gap: var(--s1) var(--s2); align-items: center; margin: 0 0 var(--s2);
}
.identity .who b { color: var(--text); font-weight: 600; letter-spacing: 0.02em; }
.identity h1 { font-size: clamp(var(--fs-4), 3.4vw, var(--fs-5)); max-width: 22ch; margin-bottom: 0; }
.identity .thesis { font-size: var(--fs-1); line-height: 1.6; color: var(--text-dim); max-width: 62ch; margin: 0; }

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

.card-grid { display: grid; gap: var(--s2); grid-template-columns: 1fr; }
@media (min-width: 720px) { .card-grid { grid-template-columns: 1fr 1fr; } }

.poc-card {
  display: block; text-decoration: none;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg-raised);
  padding: var(--s4);
  transition: border-color 140ms ease, transform 140ms ease;
}
.poc-card:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.poc-card .kicker {
  font-family: var(--sans); font-size: var(--fs-0); font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-faint);
  display: flex; justify-content: space-between; gap: var(--s2);
  margin-bottom: var(--s2);
}
.poc-card h3 { font-size: var(--fs-3); margin-bottom: var(--s1); }
.poc-card p { font-size: var(--fs-1); color: var(--text-dim); margin: 0; }
.poc-card .go { font-family: var(--sans); font-size: var(--fs-1); color: var(--text-dim); margin-top: var(--s3); display: block; }
.poc-card:hover .go { color: var(--text); }
.poc-card.featured { border-color: var(--border-strong); position: relative; grid-column: 1 / -1; }
.poc-card.featured::after {
  content: "Interactive"; position: absolute; top: var(--s2); right: var(--s2);
  font-family: var(--sans); font-size: 11px; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--accent);
}

/* ---- case-study skeleton ---------------------------------------------- */

.case-header { padding: var(--s6) 0 var(--s5); }
.case-header .meta {
  display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4);
  font-family: var(--sans); font-size: var(--fs-1); color: var(--text-dim);
  margin-top: var(--s3);
}
.case-header .meta dt { font-weight: 600; color: var(--text-faint); font-size: var(--fs-0); letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 2px; }
.case-header .meta dd { margin: 0; }

.wrong-block {
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  background: var(--bg-raised);
  padding: var(--s4);
  max-width: var(--prose);
}
.wrong-block h3, .wrong-block h4 { margin-bottom: var(--s2); }
.wrong-block p:last-child, .wrong-block ul:last-child { margin-bottom: 0; }

/* metrics presented as a definition table, editorial not dashboard */
.metric-table { width: 100%; border-collapse: collapse; font-size: var(--fs-1); }
.metric-table th, .metric-table td { text-align: left; padding: var(--s2) var(--s2) var(--s2) 0; border-bottom: 1px solid var(--border); vertical-align: top; }
.metric-table th { font-family: var(--sans); font-size: var(--fs-0); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-faint); }
.metric-table td:first-child { font-family: var(--sans); font-weight: 600; white-space: nowrap; }
.metric-table td { color: var(--text-dim); }
.metric-table .north td { color: var(--text); }
.metric-table .north td:first-child::after { content: " ★"; color: var(--accent); }

/* ---- artifact frame (prototype screens) -------------------------------- */

.artifact {
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: var(--bg-inset);
  overflow: hidden;
  margin: var(--s4) 0;
}
.artifact .chrome {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s2);
  padding: 10px var(--s2);
  border-bottom: 1px solid var(--border);
  font-family: var(--sans); font-size: var(--fs-0); color: var(--text-faint);
}
.artifact .chrome .dots { display: flex; gap: 5px; }
.artifact .chrome .dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--border-strong); }
.artifact .body { padding: var(--s4); }
.artifact figcaption { padding: var(--s2) var(--s3); border-top: 1px solid var(--border); font-family: var(--sans); font-size: var(--fs-1); color: var(--text-dim); }

/* numbered callouts */
.callouts { counter-reset: co; list-style: none; padding: 0; margin: var(--s3) 0 0; max-width: var(--prose); }
.callouts li { counter-increment: co; position: relative; padding-left: 40px; margin-bottom: var(--s2); font-size: var(--fs-1); color: var(--text-dim); }
.callouts li::before {
  content: counter(co);
  position: absolute; left: 0; top: 1px;
  width: 24px; height: 24px; border-radius: 50%;
  border: 1px solid var(--accent); color: var(--accent);
  font-family: var(--sans); font-size: 12px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}
.callouts li strong { color: var(--text); }
.co-ref {
  display: inline-flex; width: 20px; height: 20px; border-radius: 50%;
  border: 1px solid var(--accent); color: var(--accent);
  font-family: var(--sans); font-size: 11px; font-weight: 600;
  align-items: center; justify-content: center; vertical-align: 2px;
}

/* ---- rails diagram ------------------------------------------------------ */

.rails { margin: var(--s5) 0; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.rails svg { width: 100%; height: auto; display: block; min-width: 780px; }
.rails .lane-label { font-family: var(--sans); font-size: 12px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; fill: var(--text-faint); }
.rails .node rect { fill: var(--bg-raised); stroke: var(--border-strong); rx: 4; }
.rails .node text { font-family: var(--sans); font-size: 13px; fill: var(--text); }
.rails .node .sub { font-size: 11px; fill: var(--text-dim); }
.rails .flow { stroke: var(--text-faint); stroke-width: 1.2; fill: none; }
.rails .flow.dashed { stroke-dasharray: 4 5; }
.rails .q-dot { fill: var(--accent); }
.rails .q-dot.hollow { fill: none; stroke: var(--hollow); stroke-width: 1.6; }
.rails .q-dot.half { fill: none; stroke: var(--accent); stroke-width: 1.6; }
.rails .q-label { font-family: var(--sans); font-size: 11.5px; fill: var(--text-dim); }
.rails .q-label.on { fill: var(--accent); }
.rails .q-title { font-family: var(--sans); font-size: 12px; font-weight: 600; fill: var(--text); }
.rails-legend {
  display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4);
  font-family: var(--sans); font-size: var(--fs-0); color: var(--text-dim);
  margin-top: var(--s2);
}
.rails-legend span { display: inline-flex; align-items: center; gap: 8px; }
.rails-legend i { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.rails-legend .full i { background: var(--accent); }
.rails-legend .half i { border: 1.5px solid var(--accent); }
.rails-legend .open i { border: 1.5px solid var(--hollow); }

/* mini rails strip for case-study headers */
.rails-mini { margin: var(--s3) 0 0; max-width: 560px; }
.rails-mini svg { width: 100%; height: auto; display: block; }

/* ---- TK marker ---------------------------------------------------------- */

.tk {
  font-family: var(--mono); font-size: 0.85em;
  color: var(--accent);
  border: 1px dashed var(--accent);
  border-radius: var(--radius);
  padding: 1px 6px;
  white-space: nowrap;
}

/* ---- interactive console (Parity) --------------------------------------- */

.console {
  border: 1px solid var(--border-strong); border-radius: 6px;
  background: var(--bg-inset); overflow: hidden; margin: var(--s4) 0;
  font-family: var(--sans);
}
.console .console-head {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s2);
  padding: var(--s2) var(--s3); border-bottom: 1px solid var(--border);
}
.console .console-head h3, .console .console-head strong { font-family: var(--sans); font-size: var(--fs-1); font-weight: 600; margin: 0; }
.console .console-body { padding: var(--s3); }
@media (min-width: 720px) { .console .console-body { padding: var(--s4); } }

.field { margin-bottom: var(--s3); }
.field label { display: block; font-size: var(--fs-0); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-faint); margin-bottom: var(--s1); }
.field input[type="range"] { width: 100%; accent-color: var(--accent); }
.field .value { font-family: var(--mono); font-size: var(--fs-2); color: var(--text); }

.seg {
  display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--radius); overflow: hidden;
}
.seg button {
  font-family: var(--sans); font-size: var(--fs-1); font-weight: 600;
  background: transparent; color: var(--text-dim); border: 0; padding: 8px 16px; cursor: pointer;
}
.seg button + button { border-left: 1px solid var(--border-strong); }
.seg button[aria-pressed="true"] { background: var(--text); color: var(--bg); }
.seg button:focus-visible { outline-offset: -2px; }

.stat { border-top: 1px solid var(--border); padding-top: var(--s2); }
.stat .n { font-family: var(--mono); font-size: var(--fs-4); line-height: 1.2; display: block; font-variant-numeric: tabular-nums; }
.stat .l { font-size: var(--fs-0); color: var(--text-faint); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.stat .d { font-size: var(--fs-0); color: var(--text-dim); display: block; margin-top: 4px; }

.cost-bars { display: grid; gap: var(--s2); }
.cost-row { display: grid; grid-template-columns: 130px 1fr 90px; gap: var(--s2); align-items: center; font-size: var(--fs-1); }
.cost-row .name { font-weight: 600; }
.cost-row .track { height: 10px; background: var(--bg-raised); border: 1px solid var(--border); border-radius: 2px; overflow: hidden; }
.cost-row .fill { height: 100%; background: var(--text-faint); transition: width 300ms ease; }
.cost-row.benchmark .fill { background: var(--hollow); }
.cost-row.best .fill { background: var(--accent); }
.cost-row .amt { font-family: var(--mono); text-align: right; font-variant-numeric: tabular-nums; }
.cost-row .amt small { display: block; color: var(--text-faint); font-family: var(--sans); }
@media (max-width: 560px) { .cost-row { grid-template-columns: 90px 1fr 80px; } }

.note { font-family: var(--sans); font-size: var(--fs-0); color: var(--text-faint); max-width: var(--prose); }

/* step visual (redemption path) */
.steps { list-style: none; margin: 0; padding: 0; counter-reset: st; }
.steps li { counter-increment: st; display: grid; grid-template-columns: 32px 1fr; gap: var(--s2); padding: var(--s2) 0; border-bottom: 1px solid var(--border); font-size: var(--fs-1); }
.steps li:last-child { border-bottom: 0; }
.steps li::before {
  content: counter(st);
  width: 26px; height: 26px; border-radius: 50%;
  border: 1px solid var(--border-strong); color: var(--text-dim);
  font-family: var(--sans); font-size: 12px; font-weight: 600;
  display: flex; align-items: center; justify-content: center; margin-top: 2px;
}
.steps li { transition: opacity .3s ease, background-color .3s ease, box-shadow .3s ease; }
/* during playback, the current step is the only lit one */
.steps.playing li { opacity: 0.38; }
.steps.playing li.active,
.steps.playing li.done { opacity: 1; }
.steps li.active {
  background: rgba(226, 179, 60, 0.07);
  box-shadow: inset 2px 0 0 var(--accent);
}
.steps li.active .who { color: var(--accent); }
.steps li.active::before {
  border-color: var(--accent);
  background: var(--accent);
  color: #0d0e10;
}
.steps li.done::before { border-color: var(--accent); color: var(--accent); }
/* the supply number reacts when the burn lands */
.value.flash { animation: valflash .9s ease both; }
@keyframes valflash {
  0%   { color: var(--accent); transform: scale(1.14); }
  100% { color: inherit; transform: scale(1); }
}
.steps .who {
  grid-column: 2;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.01em;
}
.steps .what {
  grid-column: 2;
  color: var(--text-dim);
  line-height: 1.55;
  max-width: 62ch;
}
/* the em-dash that opens each description is redundant once stacked */
.steps .what { text-indent: 0; }

/* choice cards (custody) */
.choice-grid { display: grid; gap: var(--s2); grid-template-columns: 1fr; }
@media (min-width: 720px) { .choice-grid { grid-template-columns: 1fr 1fr; } }
.choice {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg-raised); padding: var(--s3);
  cursor: pointer; text-align: left; color: var(--text); font-family: var(--sans);
  transition: border-color 140ms ease;
}
.choice:hover { border-color: var(--border-strong); }
.choice[aria-pressed="true"] { border-color: var(--accent); }
.choice h3, .choice h4 { font-family: var(--sans); font-size: var(--fs-2); font-weight: 600; margin-bottom: var(--s1); }
.choice p { font-size: var(--fs-1); color: var(--text-dim); margin: 0; }

.kv { display: grid; grid-template-columns: max-content 1fr; gap: var(--s1) var(--s3); font-size: var(--fs-1); margin: 0; }
.kv dt { font-weight: 600; color: var(--text-faint); }
.kv dd { margin: 0; color: var(--text-dim); }

/* ---- reveal ------------------------------------------------------------- */

.reveal { opacity: 0; transform: translateY(12px); transition: opacity 500ms ease, transform 500ms ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .cost-row .fill { transition: none; }
}

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

.site-footer { border-top: 1px solid var(--border); padding: var(--s5) 0 var(--s6); margin-top: var(--s7); }
.site-footer .inner { display: flex; flex-wrap: wrap; gap: var(--s3) var(--s5); justify-content: space-between; align-items: baseline; }
.site-footer p { font-family: var(--sans); font-size: var(--fs-0); color: var(--text-faint); margin: 0; max-width: none; }
.site-footer a { color: var(--text-dim); }

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

.err { min-height: 60vh; display: flex; align-items: center; }
.err .code { font-family: var(--mono); color: var(--accent); font-size: var(--fs-1); letter-spacing: 0.1em; }

/* ---- print-ish niceties -------------------------------------------------- */

figure { margin: 0; }
img, svg { max-width: 100%; height: auto; }
.overflow-x { overflow-x: auto; }
