/* =========================================================
   Kya Scene · case study
   Same editorial dark as the other case studies (Geist +
   Instrument Serif). The game's three vibes lend the light:
   ice blue, chilli red, party yellow.
   ========================================================= */

:root {
  --bg: #07060B;
  --bg-2: #0E0C13;
  --glass: rgba(255, 255, 255, .035);
  --glass-2: rgba(255, 255, 255, .06);
  --line: rgba(255, 255, 255, .09);
  --line-2: rgba(255, 255, 255, .16);
  --text: #F3F1F8;
  --dim: #9893A9;
  --faint: #66617A;
  --yellow: #FFD23F;
  --ice: #7FE3FF;
  --spicy: #FF5A36;
  --drink: #B78BFF;

  --sans: "Geist", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --pad: clamp(20px, 4vw, 48px);
  --max: 1280px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 16px/1.6 var(--sans); letter-spacing: -.005em;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
img, iframe { display: block; max-width: 100%; }
img { height: auto; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
em { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: -.01em; }
:focus-visible { outline: 1.5px solid var(--yellow); outline-offset: 4px; border-radius: 8px; }
::selection { background: var(--yellow); color: #120f17; }

.skip-link { position: absolute; left: 12px; top: -60px; z-index: 99; background: #fff; color: #000; padding: 8px 14px; border-radius: 999px; }
.skip-link:focus { top: 12px; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--pad); }

/* ---------- Editorial pieces ---------- */
.sec { padding-top: clamp(110px, 13vw, 170px); }
.row { display: grid; gap: 18px 48px; margin-top: 72px; }
.row:first-child { margin-top: 0; }
@media (min-width: 900px) { .row { grid-template-columns: repeat(12, minmax(0, 1fr)); } .row > .label { grid-column: 1 / span 3; } .row > .body { grid-column: 4 / -1; } }
.label { font-size: 13px; color: var(--dim); padding-top: .55em; }
.label b { display: inline-block; min-width: 2.2em; font-weight: 500; color: var(--yellow); font-variant-numeric: tabular-nums; }
.statement { font-size: clamp(1.8rem, 3.4vw, 3rem); line-height: 1.1; font-weight: 400; letter-spacing: -.035em; text-wrap: balance; }
.statement span { color: var(--faint); }
.statement em { color: var(--yellow); font-size: 1.06em; }
.copy { color: var(--dim); font-size: 17px; max-width: 62ch; }
.copy + .copy { margin-top: 14px; }
.copy strong { color: var(--text); font-weight: 500; }
.cols-2 { display: grid; gap: 24px 40px; }
@media (min-width: 760px) { .cols-2 { grid-template-columns: 1fr 1fr; } }
.cols-2 > p { color: var(--dim); font-size: 17px; }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; padding-bottom: clamp(110px, 12vw, 180px); isolation: isolate; }
.glow {
  position: absolute; inset: 0; z-index: -2;
  background:
    radial-gradient(34% 40% at 28% 80%, rgba(127, 227, 255, .45), transparent 70%),
    radial-gradient(36% 46% at 50% 76%, rgba(255, 90, 54, .7), transparent 72%),
    radial-gradient(34% 40% at 72% 80%, rgba(255, 210, 63, .45), transparent 70%),
    linear-gradient(180deg, #07060B 0%, #0E0A12 50%, #1A0C0C 78%, #07060B 100%);
}
.meta { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; padding: 28px 0; flex-wrap: wrap; }
.home { font-size: 14px; font-weight: 500; }
.home:hover { color: var(--yellow); }
.meta dl { display: flex; gap: clamp(20px, 4vw, 64px); flex-wrap: wrap; }
.meta dt { font-size: 12px; color: var(--faint); }
.meta dd { font-size: 13px; }

.hero-top { display: grid; gap: 26px; margin-top: clamp(36px, 6vw, 88px); }
@media (min-width: 980px) { .hero-top { grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); align-items: end; } }
.hero h1 { font-size: clamp(2.6rem, 6.2vw, 6rem); line-height: .98; font-weight: 400; letter-spacing: -.05em; text-wrap: balance; }
.hero h1 em { color: var(--yellow); font-size: 1.08em; letter-spacing: -.02em; padding-right: .04em; }
.hero-sub { font-size: 18px; line-height: 1.5; color: #CBC6D6; max-width: 38ch; }
.live-pill { display: inline-flex; align-items: center; gap: 8px; margin-top: 18px; padding: 7px 14px 7px 12px; border: 1px solid var(--line-2); border-radius: 999px; font-size: 13px; background: rgba(255,255,255,.04); }
.live-pill i { width: 7px; height: 7px; border-radius: 50%; background: #3DDC84; box-shadow: 0 0 0 0 rgba(61,220,132,.6); animation: ping 2s infinite; }
@keyframes ping { 70% { box-shadow: 0 0 0 8px rgba(61,220,132,0); } 100% { box-shadow: 0 0 0 0 rgba(61,220,132,0); } }

.fan {
  position: relative; display: flex; justify-content: center; align-items: flex-end;
  margin-top: clamp(40px, 6vw, 72px); height: clamp(400px, 46vw, 620px);
  --w: clamp(150px, 18.5vw, 268px);
}
.fan .ph { position: absolute; bottom: 0; width: var(--w); transform-origin: 50% 100%; }
/* each phone casts a soft glow in its own colour */
.fan .ph { box-shadow: inset 0 0 0 1px rgba(255,255,255,.12), 0 40px 70px -24px rgba(0,0,0,.8), 0 30px 140px -10px rgba(var(--c), .45); }
.fan .p-mid { z-index: 3; transform: translateY(-4%); }
.fan .p-l { z-index: 2; transform: translateX(-96%) rotate(-7deg) scale(.9); }
.fan .p-r { z-index: 2; transform: translateX(96%) rotate(7deg) scale(.9); }
.fan .p-far-l { z-index: 1; transform: translateX(-178%) translateY(4%) rotate(-14deg) scale(.78); filter: brightness(.82); }
.fan .p-far-r { z-index: 1; transform: translateX(178%) translateY(4%) rotate(14deg) scale(.78); filter: brightness(.82); }
.fan-chip {
  position: absolute; z-index: 4; display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
  padding: 10px 16px 10px 12px; border-radius: 999px; font-size: 14px; font-weight: 500; color: var(--text);
  background: rgba(22, 14, 16, .72); border: 1px solid var(--line-2);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); box-shadow: 0 18px 40px -16px rgba(0, 0, 0, .7);
  animation: bob 6s ease-in-out infinite;
}
.fan-chip b { font-weight: 400; }
.chip-a { left: calc(50% - var(--w) * 2.15); top: 16%; }
.chip-b { right: calc(50% - var(--w) * 1.75); bottom: -34px; animation-delay: -3s; }
@keyframes bob { 50% { transform: translateY(-8px); } }
@media (max-width: 900px) {
  .fan .p-far-l, .fan .p-far-r { display: none; }
  .chip-a { left: 50%; top: auto; bottom: -14px; transform: translateX(-50%); animation: none; }
  .chip-b { display: none; }
}
/* the hero glow fades into the page instead of stopping at a hard line */
.glow { -webkit-mask-image: linear-gradient(180deg, #000 70%, transparent 100%); mask-image: linear-gradient(180deg, #000 70%, transparent 100%); }
@media (prefers-reduced-motion: reduce) { .fan-chip { animation: none; } }
.reveal { animation: rise 1s cubic-bezier(.2, .7, .2, 1) both; }
.hero-sub.reveal { animation-delay: .12s; }
.fan.reveal { animation-delay: .22s; animation-duration: 1.3s; }
@keyframes rise { from { opacity: 0; transform: translateY(28px); } }

/* ---------- Phones ---------- */
.ph { position: relative; border-radius: clamp(20px, 2.6vw, 34px); padding: clamp(5px, .6vw, 8px); background: #1B1922; box-shadow: inset 0 0 0 1px rgba(255,255,255,.12), 0 30px 60px -20px rgba(0,0,0,.7); }
.ph img, .ph iframe { width: 100%; border-radius: clamp(15px, 2.1vw, 27px); aspect-ratio: 390 / 844; object-fit: cover; background: #15111a; }
figcaption { margin-top: 14px; font-size: 14px; color: var(--dim); line-height: 1.45; }
figcaption b { display: block; color: var(--text); font-weight: 500; margin-bottom: 2px; }

.screens { display: grid; gap: 28px 20px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 760px) { .screens { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .screens.five { grid-template-columns: repeat(5, minmax(0, 1fr)); } .screens.six { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.screens.wide { margin-top: 56px; }

/* the three vibes */
.vibes { display: grid; gap: 28px 20px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.vibe-tag { display: inline-flex; gap: 6px; align-items: center; font-size: 12px; font-weight: 500; padding: 3px 10px; border-radius: 999px; margin-bottom: 8px; background: color-mix(in srgb, var(--c) 18%, transparent); color: var(--c); }
@media (max-width: 640px) {
  .vibes { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 62%; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; margin-right: calc(var(--pad) * -1); padding-right: var(--pad); }
  .vibes > * { scroll-snap-align: start; }
}

/* ---------- Process ---------- */
.steps { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; }
@media (min-width: 760px) { .steps { grid-template-columns: repeat(5, 1fr); } }
.steps li { background: var(--bg); padding: 22px 20px 24px; }
.steps span { display: block; font-size: 12px; color: var(--yellow); font-variant-numeric: tabular-nums; margin-bottom: 18px; }
.steps b { display: block; font-weight: 500; margin-bottom: 6px; }
.steps p { font-size: 14px; color: var(--dim); line-height: 1.5; }

/* ---------- Iterations ---------- */
.versions { position: relative; display: grid; gap: 0; }
.versions li { position: relative; display: grid; grid-template-columns: 56px 1fr; gap: 0 18px; padding-bottom: 34px; }
.versions li::before { content: ""; position: absolute; left: 27px; top: 34px; bottom: 0; width: 1px; background: var(--line-2); }
.versions li:last-child::before { display: none; }
.versions li:last-child { padding-bottom: 0; }
.v-badge { width: 56px; height: 34px; display: grid; place-items: center; border-radius: 999px; border: 1px solid var(--line-2); font-size: 13px; font-weight: 500; background: var(--bg); position: relative; }
.versions li.now .v-badge { background: var(--yellow); color: #17121b; border-color: var(--yellow); }
.v-body { padding-top: 5px; }
.v-body b { font-weight: 500; font-size: 17px; }
.v-body p { color: var(--dim); font-size: 15px; margin-top: 4px; max-width: 64ch; }
.v-body p i { font-style: normal; color: #CBC6D6; }

/* ---------- Under the hood ---------- */
.stack { display: grid; gap: 16px; }
@media (min-width: 900px) { .stack { grid-template-columns: repeat(3, 1fr); } }
.card { border: 1px solid var(--line); background: var(--glass); border-radius: 20px; padding: 22px 22px 24px; }
.card h3 { font-size: 13px; font-weight: 500; color: var(--yellow); margin-bottom: 4px; letter-spacing: .02em; }
.card .big { font-size: 22px; letter-spacing: -.02em; line-height: 1.2; margin-bottom: 14px; }
.card ul { display: grid; gap: 10px; }
.card li { font-size: 14.5px; color: var(--dim); line-height: 1.5; padding-left: 16px; position: relative; }
.card li::before { content: ""; position: absolute; left: 0; top: .62em; width: 6px; height: 6px; border-radius: 50%; background: var(--line-2); }
.card li b { color: var(--text); font-weight: 500; }

.flow { margin-top: 16px; border: 1px solid var(--line); border-radius: 20px; padding: clamp(20px, 3vw, 32px); background: linear-gradient(180deg, rgba(255,255,255,.03), transparent); }
.flow-h { font-size: 13px; color: var(--dim); margin-bottom: 20px; }
.flow-row { display: grid; gap: 12px; align-items: center; }
@media (min-width: 900px) { .flow-row { grid-template-columns: 1fr auto 1.3fr auto 1fr; } }
.node { border: 1px solid var(--line-2); border-radius: 16px; padding: 14px 16px; background: var(--bg-2); }
.node b { display: block; font-weight: 500; font-size: 15px; }
.node small { display: block; font-size: 13px; color: var(--dim); line-height: 1.45; margin-top: 2px; }
.node.hot { border-color: color-mix(in srgb, var(--yellow) 55%, transparent); box-shadow: 0 0 40px -16px var(--yellow); }
.arrow { text-align: center; color: var(--faint); font-size: 13px; line-height: 1.3; }
.arrow::before { content: "⟷"; display: block; font-size: 22px; color: var(--yellow); }
@media (max-width: 899px) { .arrow::before { content: "↕"; } }

/* ---------- Live ---------- */
.live { display: grid; gap: 40px; align-items: center; }
@media (min-width: 900px) { .live { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); } }
.live-phones { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; max-width: 520px; }
.btn { display: inline-flex; align-items: center; gap: 10px; margin-top: 24px; padding: 13px 22px; border-radius: 999px; background: var(--yellow); color: #17121b; font-weight: 500; font-size: 15px; transition: transform .2s; }
.btn:hover { transform: translateY(-2px); }
.btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; }
.next { margin-top: 28px; display: grid; gap: 10px; }
.next li { color: var(--dim); font-size: 15px; padding-left: 22px; position: relative; }
.next li::before { content: "→"; position: absolute; left: 0; color: var(--yellow); }

/* ---------- Try it ---------- */
.try { position: relative; margin-top: 48px; border: 1px solid var(--line); border-radius: 28px; padding: clamp(18px, 3vw, 40px); background:
  radial-gradient(60% 70% at 50% 100%, rgba(255, 90, 54, .22), transparent 70%), var(--bg-2); }
.try-head { display: flex; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; align-items: center; margin-bottom: 28px; }
.how { display: flex; gap: 8px 22px; flex-wrap: wrap; font-size: 14px; color: var(--dim); }
.how li { display: flex; gap: 8px; align-items: baseline; }
.how b { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--glass-2); color: var(--text); font-size: 12px; font-weight: 500; flex: none; }
.reset { font-size: 13px; color: var(--dim); border: 1px solid var(--line-2); border-radius: 999px; padding: 7px 14px; }
.reset:hover { color: var(--text); }
.sim-bar { display: flex; flex-wrap: wrap; gap: 14px 22px; align-items: flex-end; padding-bottom: 24px; margin-bottom: 28px; border-bottom: 1px solid var(--line); }
.ctl { display: grid; gap: 6px; }
.ctl-l { font-size: 12px; color: var(--faint); }
.ctl select, .stepper { height: 40px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--glass); color: var(--text); font: 500 14px var(--sans); }
.ctl select { padding: 0 34px 0 12px; appearance: none; -webkit-appearance: none; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--dim) 50%), linear-gradient(135deg, var(--dim) 50%, transparent 50%);
  background-position: calc(100% - 17px) 17px, calc(100% - 12px) 17px; background-size: 5px 5px; background-repeat: no-repeat; }
.ctl select option { background: #16131c; }
.stepper { display: inline-flex; align-items: center; }
.stepper button { width: 38px; height: 100%; font-size: 18px; color: var(--dim); }
.stepper button:hover { color: var(--text); }
.stepper b { min-width: 18px; text-align: center; font-weight: 500; font-variant-numeric: tabular-nums; }
.sim-acts { display: flex; flex-wrap: wrap; gap: 10px; margin-left: auto; }
.btn.sm { margin: 0; padding: 0 18px; height: 40px; font-size: 14px; }
.ghost-btn { height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line-2); font-size: 14px; color: #CBC6D6; }
.ghost-btn:hover { color: var(--text); border-color: rgba(255,255,255,.3); }

.tabs { display: none; }
.rig { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 250px)); justify-content: center; gap: clamp(14px, 2vw, 24px); }
.rig figure { margin: 0; }
.rig .ph { overflow: hidden; }
.rig .screen { position: relative; aspect-ratio: 390 / 844; border-radius: clamp(15px, 2.1vw, 27px); overflow: hidden; background: #15111a; }
.rig iframe { position: absolute; left: 0; top: 0; width: 390px; max-width: none; height: 844px; border: 0; transform-origin: 0 0; border-radius: 0; aspect-ratio: auto; }
.rig figcaption { text-align: center; }
.rig .who { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; color: var(--text); font-weight: 500; }
.rig .who i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
@media (max-width: 899px) {
  .tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; padding: 4px; border-radius: 999px; background: var(--glass-2); width: max-content; max-width: 100%; margin: 0 auto 20px; }
  .tabs button { font-size: 13px; padding: 8px 13px; border-radius: 999px; color: var(--dim); }
  .tabs button[aria-selected="true"] { background: var(--text); color: #120f17; }
  .rig { grid-template-columns: minmax(0, 320px); }
  .rig figure:not(.on) { display: none; }
  .sim-acts { margin-left: 0; width: 100%; }
}

.sim-foot { display: grid; gap: 20px; margin-top: 32px; }
@media (min-width: 900px) { .sim-foot { grid-template-columns: 5fr 7fr; } }
.tips, .activity { border: 1px solid var(--line); border-radius: 18px; padding: 18px 20px; background: rgba(7,6,11,.5); }
.sim-foot h4 { font-size: 13px; font-weight: 500; margin: 0 0 12px; }
.sim-foot h4 span { color: var(--faint); font-weight: 400; margin-left: 6px; }
.tips ol { display: grid; gap: 10px; counter-reset: t; }
.tips li { font-size: 14px; color: var(--dim); line-height: 1.5; padding-left: 26px; position: relative; counter-increment: t; }
.tips li::before { content: counter(t); position: absolute; left: 0; top: 1px; width: 18px; height: 18px; border-radius: 50%; background: var(--glass-2); color: var(--text); font-size: 11px; display: grid; place-items: center; }
.tips b { color: var(--text); font-weight: 500; }
.log { display: grid; gap: 6px; max-height: 196px; overflow-y: auto; font-size: 13.5px; color: #CBC6D6; scrollbar-width: thin; }
.log:empty::before { content: "Nothing yet. Start a test room."; color: var(--faint); }
.log li { display: flex; gap: 12px; animation: logIn .35s ease both; }
.log time { color: var(--faint); font-variant-numeric: tabular-nums; flex: none; }
@keyframes logIn { from { opacity: 0; transform: translateY(-4px); } }
.try-note { margin-top: 26px; text-align: center; font-size: 13px; color: var(--faint); }

/* ---------- Footer ---------- */
.foot { margin-top: clamp(110px, 13vw, 170px); border-top: 1px solid var(--line); padding: 32px 0 48px; display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; font-size: 14px; color: var(--dim); }
.foot a:hover { color: var(--yellow); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
.cols-2 strong { color: var(--text); font-weight: 500; }
@media (max-width: 640px) {
  .screens { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 46%; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; margin-right: calc(var(--pad) * -1); padding-right: var(--pad); scrollbar-width: none; }
  .screens > * { scroll-snap-align: start; }
  .fan { height: 380px; --w: 150px; }
}

/* =========================================================
   v3: visual-first layout
   ========================================================= */
.kicker { font-size: 13px; color: var(--dim); margin-bottom: 18px; }
.kicker b { display: inline-block; min-width: 2.2em; font-weight: 500; color: var(--yellow); font-variant-numeric: tabular-nums; }
.statement { max-width: 22ch; }
.statement.sm { font-size: clamp(1.6rem, 2.6vw, 2.3rem); max-width: 18ch; }
.sec .statement + * { margin-top: 44px; }

.facts { display: flex; gap: clamp(24px, 4vw, 48px); }
.facts li { display: grid; }
.facts b { font-size: clamp(2.6rem, 4.6vw, 3.8rem); font-weight: 300; line-height: 1; letter-spacing: -.05em; }
.facts span { font-size: 13px; color: #CBC6D6; }
.facts.reveal { animation-delay: .12s; }

/* goals */
.goals { display: grid; gap: 14px; }
@media (min-width: 760px) { .goals { grid-template-columns: repeat(3, 1fr); } }
.goals li, .flowline li, .mode-card, .a-node { border: 1px solid var(--line); background: var(--glass); border-radius: 20px; }
.goals li { padding: 22px; display: grid; gap: 4px; }
.g-ico { font-size: 28px; margin-bottom: 10px; }
.goals b { font-weight: 500; font-size: 17px; }
.goals small, .flowline small, .mode-card small, .a-node small, .vtrack small { font-size: 14px; color: var(--dim); line-height: 1.45; }

/* process */
.flowline { display: grid; gap: 12px; grid-template-columns: repeat(5, minmax(0, 1fr)); position: relative; }
.flowline li { padding: 20px 16px; text-align: center; display: grid; gap: 4px; justify-items: center; position: relative; }
.flowline li > span { font-size: 30px; margin-bottom: 8px; }
.flowline b { font-weight: 500; }
.flowline li:not(:last-child)::after { content: "→"; position: absolute; right: -11px; top: 50%; transform: translateY(-50%); color: var(--yellow); font-size: 14px; z-index: 1; }
@media (max-width: 760px) {
  .flowline { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 42%; overflow-x: auto; scroll-snap-type: x mandatory; margin-right: calc(var(--pad) * -1); padding-right: var(--pad); scrollbar-width: none; }
  .flowline li { scroll-snap-align: start; }
}
.aside { margin-top: 18px; font-size: 14px; color: var(--faint); }

/* vibes: bigger, centered */
.vibes { max-width: 980px; margin-left: auto; margin-right: auto; }
.vibes figcaption { text-align: center; }
.vibes figcaption b { font-size: 16px; }

/* two ways */
.modes2 { display: flex; align-items: center; justify-content: center; gap: 18px; flex-wrap: wrap; }
.mode-card { padding: 22px 30px; display: grid; justify-items: center; gap: 2px; min-width: 210px; }
.mode-card span { font-size: 34px; margin-bottom: 6px; }
.mode-card b { font-weight: 500; font-size: 18px; }
.mode-card.hot { border-color: color-mix(in srgb, var(--yellow) 50%, transparent); box-shadow: 0 0 50px -18px var(--yellow); }
.or { font-family: var(--serif); font-style: italic; font-size: 26px; color: var(--faint); }
.steps-num { counter-reset: s; }
.steps-num li { counter-increment: s; }
.steps-num figcaption b::before { content: counter(s); display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--yellow); color: #17121b; font-size: 11px; margin-right: 8px; vertical-align: 1px; }
.screens figcaption { text-align: center; }

/* iterations track */
.vtrack { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 18px; position: relative; padding-top: 4px; }
.vtrack::before { content: ""; position: absolute; left: 4%; right: 4%; top: calc(var(--th, 0px)); height: 0; }
.vtrack li { display: grid; justify-items: center; text-align: center; gap: 6px; }
.vtrack .ph { width: 100%; opacity: .55; transition: opacity .3s, transform .3s; }
.vtrack li:hover .ph, .vtrack li.now .ph { opacity: 1; transform: translateY(-4px); }
.vtrack .v-badge { margin-top: 12px; width: 48px; height: 28px; display: grid; place-items: center; border-radius: 999px; border: 1px solid var(--line-2); font-size: 12px; font-weight: 500; }
.vtrack li.now .v-badge { background: var(--yellow); border-color: var(--yellow); color: #17121b; }
.vtrack b { font-weight: 500; font-size: 15px; }
.vtrack small { font-size: 13px; max-width: 20ch; }
@media (max-width: 900px) {
  .vtrack { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 40%; overflow-x: auto; scroll-snap-type: x mandatory; margin-right: calc(var(--pad) * -1); padding-right: var(--pad); scrollbar-width: none; }
  .vtrack li { scroll-snap-align: start; }
}

/* architecture */
.arch { border: 1px solid var(--line); border-radius: 24px; padding: clamp(18px, 3vw, 34px); display: grid; gap: 18px;
  background: radial-gradient(50% 80% at 50% 0%, rgba(255, 210, 63, .08), transparent 70%), var(--bg-2); }
.arch-row { display: grid; grid-template-columns: 1fr 90px 1.1fr 90px 1fr; align-items: center; }
.arch-row.ship { padding-top: 18px; border-top: 1px dashed var(--line-2); }
.a-node { padding: 18px 16px; display: grid; justify-items: center; text-align: center; gap: 2px; background: var(--bg); }
.a-node span { font-size: 28px; margin-bottom: 6px; }
.a-node b { font-weight: 500; }
.a-node.hot { border-color: color-mix(in srgb, var(--yellow) 55%, transparent); box-shadow: 0 0 44px -16px var(--yellow); }
.a-link { position: relative; display: grid; justify-items: center; gap: 6px; }
.a-link i { width: 100%; height: 2px; background: repeating-linear-gradient(90deg, var(--yellow) 0 6px, transparent 6px 12px); background-size: 24px 2px; animation: dash 1s linear infinite; }
.a-link small { font-size: 11px; color: var(--faint); }
@keyframes dash { to { background-position: 24px 0; } }
@media (max-width: 760px) {
  .arch-row { grid-template-columns: 1fr; gap: 6px; }
  .a-link { height: 40px; }
  .a-link i { width: 2px; height: 22px; background: repeating-linear-gradient(180deg, var(--yellow) 0 6px, transparent 6px 12px); }
}
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.chips li { font-size: 14px; padding: 9px 15px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--glass); color: #DAD6E4; }
.next-h { margin-top: 30px; font-size: 13px; color: var(--faint); }
.next-h + .chips { margin-top: 10px; }
.live .statement.sm + .btn { margin-top: 22px; }

/* =========================================================
   Chapter navigation, same as the other case studies:
   reading bar, Medium-style rail (wide screens), chapter dock (tablets and phones)
   ========================================================= */
.topbar { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 100; background: rgba(255,255,255,.06); pointer-events: none; }
.topbar i { display: block; height: 100%; width: 100%; transform: scaleX(0); transform-origin: left; background: linear-gradient(90deg, var(--spicy), var(--yellow)); will-change: transform; }

.dock { position: fixed; left: 50%; bottom: 20px; z-index: 50; transform: translate(-50%, 160%); transition: transform .5s cubic-bezier(.2,.8,.2,1); }
.dock.show { transform: translate(-50%, 0); }
.dock-btn, .dock-list {
  background: rgba(30, 16, 14, .66); border: 1px solid var(--line-2); color: var(--text);
  -webkit-backdrop-filter: blur(18px) saturate(1.4); backdrop-filter: blur(18px) saturate(1.4);
  box-shadow: 0 20px 50px -10px rgba(0,0,0,.6);
}
.dock-btn { display: flex; align-items: center; gap: 12px; padding: 7px 20px 7px 8px; border-radius: 999px; white-space: nowrap; font: inherit; cursor: pointer; }
.ring { width: 34px; height: 34px; transform: rotate(-90deg); }
.ring circle { fill: none; stroke: rgba(255,255,255,.14); stroke-width: 2.5; }
.ring .ring-fill { stroke: var(--spicy); stroke-dasharray: 97.4; stroke-dashoffset: 97.4; stroke-linecap: round; }
.dock-num { font-size: 12px; color: var(--dim); font-variant-numeric: tabular-nums; margin-left: -40px; width: 28px; text-align: center; }
.dock-name { font-size: 14px; font-weight: 500; }
.dock-list { list-style: none; margin: 0; position: absolute; bottom: calc(100% + 10px); left: 50%; transform: translateX(-50%); width: min(320px, 90vw); border-radius: 22px; padding: 8px; }
.dock-list a { display: flex; gap: 14px; padding: 10px 12px; border-radius: 14px; font-size: 14px; color: var(--dim); text-decoration: none; }
.dock-list a span { color: var(--faint); font-variant-numeric: tabular-nums; }
.dock-list a:hover, .dock-list a[aria-current="true"] { background: var(--glass-2); color: var(--text); }

.rail { display: none; }
@media (min-width: 1180px) {
  .dock { display: none; }
  .rail { display: block; position: fixed; left: 20px; top: 50%; transform: translateY(-50%); z-index: 50; opacity: 0; pointer-events: none; transition: opacity .35s; }
  .rail.show { opacity: 1; pointer-events: auto; }
  .rail ol { list-style: none; margin: 0; display: grid; gap: 2px; padding: 10px; border-radius: 16px; border: 1px solid transparent; transition: background .18s ease .14s, border-color .18s ease .14s, box-shadow .18s ease .14s; }
  .rail a { display: flex; align-items: center; gap: 0; height: 26px; color: var(--faint); font-size: 13px; font-weight: 500; white-space: nowrap; text-decoration: none; transition: gap .3s cubic-bezier(.2, .8, .2, 1); }
  .rail a::before { content: ""; flex: none; width: 16px; height: 2px; border-radius: 2px; background: currentColor; opacity: .5; transition: width .25s, opacity .25s, background .25s; }
  .rail .rail-tx { display: block; max-width: 0; overflow: hidden; opacity: 0; transform: translateX(-6px); transition: max-width .3s cubic-bezier(.2, .8, .2, 1), opacity .12s, transform .12s; }
  .rail a[aria-current="true"] { color: var(--text); }
  .rail a[aria-current="true"]::before { width: 24px; opacity: 1; background: var(--spicy); }
  .rail:hover ol, .rail:focus-within ol { background: rgba(20, 12, 12, .92); border-color: var(--line-2); box-shadow: 0 20px 50px -20px rgba(0, 0, 0, .6); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); transition: background .2s ease .12s, border-color .2s ease .12s, box-shadow .25s ease .12s; }
  .rail:hover a, .rail:focus-within a { gap: 12px; transition: gap .3s cubic-bezier(.2, .8, .2, 1) .12s; }
  .rail:hover .rail-tx, .rail:focus-within .rail-tx { max-width: 220px; opacity: 1; transform: none; transition: max-width .3s cubic-bezier(.2, .8, .2, 1) .12s, opacity .2s ease .26s, transform .2s ease .26s; }
  .rail a:hover { color: var(--yellow); }
}
@media (prefers-reduced-motion: reduce) { .dock, .rail { transition: none; } }
