/* Min Han portfolio. Paper + ink, one signal colour. Type: Bricolage Grotesque (display), Atkinson Hyperlegible Next (text), Silkscreen (game HUD bits only). */
:root {
  --paper: #F2EFE7;
  --paper-2: #E9E5DA;
  --card: #FBF9F4;
  --ink: #161513;
  --ink-2: #4E4B44;
  --ink-3: #66625A;
  --rule: #D9D4C7;
  --signal: #E8471F;
  --signal-ink: #B8330F;
  --signal-fill: #C63D17; /* solid fills behind white text: 5.1:1 */
  --on-signal: #fff;
  --xp-ink: #1F7A50;
  --xp: #2F9E6E;
  --sq: #1E7A71;
  --soy: #22365A;
  --soy-cream: #F6EFE3;
  --max: 1240px;
  --gut: clamp(20px, 4vw, 48px);
  --display: "Bricolage Grotesque", "Helvetica Neue", Arial, sans-serif;
  --sans: "Atkinson Hyperlegible Next", "Atkinson Hyperlegible", system-ui, sans-serif;
  --mono: "Atkinson Hyperlegible Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --pixel: "Silkscreen", var(--mono);
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}
[data-theme="dark"] {
  --paper: #121210;
  --paper-2: #1B1A17;
  --card: #1E1D1A;
  --ink: #EEEBE3;
  --ink-2: #B7B2A6;
  --ink-3: #8C887E;
  --rule: #33312C;
  --signal: #FF6A3D;
  --signal-ink: #FF8A63;
  --signal-fill: #FF6A3D;
  --on-signal: #161513;
  --xp-ink: #4CC28E;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scrollbar-gutter: stable; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; } }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: 17px; line-height: 1.6; -webkit-font-smoothing: antialiased; transition: background .3s, color .3s; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
::selection { background: var(--signal-fill); color: var(--on-signal); }
code { font-family: var(--mono); font-size: .88em; background: var(--paper-2); padding: 1px 6px; border-radius: 5px; color: var(--ink); }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; border-radius: 4px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--paper); padding: 8px 14px; border-radius: 8px; z-index: 200; }
.skip:focus { left: 8px; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gut); }
.mono { font-family: var(--sans); font-weight: 600; font-size: 13.5px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Header / HUD ---------- */
.hdr { position: sticky; top: 0; z-index: 50; background: var(--paper); border-bottom: 1px solid var(--rule); }
.hdr-in { display: flex; align-items: center; gap: 24px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--display); font-weight: 700; font-size: 19px; letter-spacing: -.01em; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--ink); color: var(--paper); display: grid; place-items: center; font-family: var(--pixel); font-size: 13px; }
.status { display: inline-flex; align-items: center; gap: 7px; font-family: var(--sans); font-weight: 600; font-size: 13.5px; color: var(--ink-2); }
.nav { margin-left: auto; display: flex; gap: 4px; }
.nav a { text-decoration: none; font-size: 15px; padding: 8px 12px; border-radius: 99px; color: var(--ink-2); transition: color .2s, background .2s; }
.nav a:hover, .nav a[aria-current] { color: var(--ink); background: var(--paper-2); }
.hud-btns { display: flex; gap: 8px; }
.hbtn { height: 38px; min-width: 38px; border-radius: 99px; border: 1px solid var(--rule); background: var(--card); color: var(--ink); display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 12px; font-family: var(--sans); font-weight: 600; font-size: 13.5px; cursor: pointer; transition: border-color .2s, transform .15s; }
.hbtn:hover { border-color: var(--ink-3); }
.hbtn:active { transform: scale(.96); }
.hbtn svg { width: 16px; height: 16px; }
.xpbar { height: 3px; background: var(--rule); position: relative; }
.xpbar i { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--signal); transition: width .1s linear; }
.xplvl { position: absolute; right: var(--gut); top: 7px; font-family: var(--pixel); font-size: 11px; color: var(--ink-3); pointer-events: none; background: var(--paper); padding: 1px 6px 2px; border-radius: 0 0 6px 6px; }
@media (max-width: 860px) {
  .hdr-in { flex-wrap: wrap; height: auto; padding-top: 10px; gap: 0 16px; }
  .brand { height: 44px; }
  .status { display: none; }
  .hud-btns { margin-left: auto; }
  .nav { order: 3; width: calc(100% + 2 * var(--gut)); margin: 0 calc(-1 * var(--gut)); padding: 2px var(--gut) 8px; overflow-x: auto; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { flex: none; font-size: 14.5px; padding: 6px 12px; }
  .xplvl { display: none; }
}
.status-m { display: none; }
@media (max-width: 860px) { .status-m { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; color: var(--ink-2); margin: 0 0 18px; } .status-m::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--xp); } }

/* ---------- Type ---------- */
h1, h2, h3 { font-family: var(--display); font-weight: 600; letter-spacing: -.025em; line-height: 1.02; margin: 0; }
.eyebrow { font-family: var(--sans); font-weight: 600; font-size: 13.5px; color: var(--ink-3); display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.lede { font-size: clamp(18px, 1.6vw, 21px); line-height: 1.55; color: var(--ink-2); max-width: 56ch; }
.sig { color: var(--signal); }

/* ---------- Hero ---------- */
.hero { padding: clamp(56px, 9vw, 120px) 0 clamp(48px, 7vw, 96px); }
.hero-grid { display: grid; grid-template-columns: .92fr 1.08fr; gap: clamp(32px, 6vw, 88px); align-items: center; }
.hero h1 { font-size: clamp(40px, 4.7vw, 76px); text-wrap: balance; font-weight: 600; }
.hero h1 .soft { color: var(--ink-3); }
.hero h1 em { font-style: normal; position: relative; white-space: nowrap; }
.hero h1 em::after { content: ""; position: absolute; left: -2%; right: -2%; bottom: .06em; height: .2em; background: var(--signal); opacity: .9; z-index: -1; border-radius: 2px; transform-origin: left; animation: mark 1s .5s var(--ease) both; }
@keyframes mark { from { transform: scaleX(0); } }
.hero .lede { margin: 28px 0 32px; }
.hero-ctas { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.btn { display: inline-flex; align-items: center; gap: 10px; height: 50px; padding: 0 22px; border-radius: 99px; text-decoration: none; font-weight: 600; font-size: 16px; border: 1px solid var(--ink); transition: transform .15s var(--ease), background .2s, color .2s; cursor: pointer; font-family: var(--sans); }
.btn-ink { background: var(--ink); color: var(--paper); }
.btn-ink:hover { background: var(--signal-fill); border-color: var(--signal-fill); color: var(--on-signal); }
.btn-line { background: transparent; color: var(--ink); }
.btn-line:hover { background: var(--ink); color: var(--paper); }
.btn:active { transform: scale(.97); }
.btn svg { width: 18px; height: 18px; }
.kbd-hint { font-family: var(--mono); font-size: 12.5px; color: var(--ink-3); margin-left: 6px; padding: 8px 4px; background: none; border: 0; cursor: pointer; }
@media (hover: none), (pointer: coarse) { .kbd-hint { display: none; } }
kbd { font-family: var(--mono); font-size: 11px; border: 1px solid var(--rule); border-bottom-width: 2px; border-radius: 5px; padding: 1px 6px; background: var(--card); color: var(--ink); }

@media (max-width: 920px) { .hero-grid { grid-template-columns: 1fr; } }

/* ---------- Sections ---------- */
.sec { padding: clamp(64px, 9vw, 128px) 0; border-top: 1px solid var(--rule); }
.sec-head { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 24px; margin-bottom: clamp(32px, 5vw, 56px); }
.sec-head h2 { font-size: clamp(36px, 5vw, 64px); }
.sec-head p { color: var(--ink-2); max-width: 40ch; margin: 0; }
@media (max-width: 760px) { .sec-head { grid-template-columns: 1fr; } }

/* work cards */
.work { display: grid; gap: clamp(28px, 4vw, 48px); }
.wcard { display: grid; grid-template-columns: 1.5fr 1fr; gap: 0; border-radius: 16px; overflow: hidden; text-decoration: none; background: var(--card); border: 1px solid var(--rule); transition: transform .45s var(--ease), box-shadow .45s var(--ease); }
.wcard:hover { border-color: var(--ink); }
.wcard .vis { position: relative; min-height: 460px; overflow: hidden; }
.wcard .txt { padding: clamp(24px, 3.4vw, 44px); display: flex; flex-direction: column; }
.wcard .no { font-family: var(--pixel); font-size: 12px; color: var(--ink-2); }
.wcard h3 { font-size: clamp(34px, 3.6vw, 52px); margin: 14px 0 12px; }
.wcard p { color: var(--ink-2); margin: 0 0 22px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }
.tag { font-family: var(--sans); font-weight: 600; font-size: 13.5px; padding: 5px 10px; border-radius: 99px; border: 1px solid var(--rule); color: var(--ink-2); }
.tag.hot { border-color: var(--signal); color: var(--signal-ink); }
.wmeta { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; margin: 0 0 26px; font-size: 14px; }
.wmeta dt { font-family: var(--sans); font-weight: 600; font-size: 13.5px; color: var(--ink-3); }
.wmeta dd { margin: 2px 0 0; }
.wcard .go { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; margin-top: 26px; }
.wcard .go svg { width: 18px; height: 18px; transition: transform .3s var(--ease); }
.wcard:hover .go svg { transform: translateX(4px); }
.vis-sq { background: #1E7A71; }
.vis-sq .ph { position: absolute; width: 36%; border-radius: 26px; box-shadow: 0 30px 50px -20px rgba(0,0,0,.5); border: 6px solid #0E1513; overflow: hidden; transition: transform .6s var(--ease); background: #0E1513; }
.vis-sq .ph img { width: 100%; }
.vis-sq .ph.a { left: 6%; top: 15%; transform: rotate(-7deg); }
.vis-sq .ph.b { left: 32%; top: 7%; z-index: 2; }
.vis-sq .ph.c { left: 58%; top: 15%; transform: rotate(7deg); }
.wcard:hover .vis-sq .ph.a { transform: rotate(-10deg) translate(-10px, 6px); }
.wcard:hover .vis-sq .ph.c { transform: rotate(10deg) translate(10px, 6px); }
.wcard:hover .vis-sq .ph.b { transform: translateY(-8px); }
.playable { position: absolute; left: 20px; bottom: 20px; z-index: 3; display: inline-flex; gap: 8px; align-items: center; background: #FFD27A; color: #3A2A05; font-family: var(--pixel); font-size: 12px; padding: 8px 12px; border-radius: 8px; box-shadow: 0 3px 0 #C49A3A; }
.vis-soy { background: var(--soy-cream); display: grid; place-items: center; padding: 6% 6% 0; align-content: end; }
.browser { width: 100%; border-radius: 12px 12px 0 0; overflow: hidden; box-shadow: 0 -10px 40px -10px rgba(34,54,90,.3); background: #fff; transition: transform .6s var(--ease); }
.wcard:hover .browser { transform: translateY(-8px); }
.browser .bar { height: 30px; background: #EEE7DB; display: flex; align-items: center; gap: 6px; padding: 0 12px; }
.browser .bar i { width: 9px; height: 9px; border-radius: 50%; background: #D1C6B4; }
.browser .bar span { margin-left: 10px; font-family: var(--sans); font-weight: 600; font-size: 13.5px; color: #6c6455; background: #F6EFE3; padding: 2px 10px; border-radius: 6px; }
@media (max-width: 920px) { .wcard { grid-template-columns: 1fr; } .wcard .vis { min-height: 360px; } }

/* process archive */
.arch { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; }
.acard { grid-column: span 2; text-align: left; background: var(--card); border: 1px solid var(--rule); border-radius: 14px; padding: 12px; cursor: zoom-in; font: inherit; color: inherit; transition: transform .35s var(--ease), border-color .2s; display: flex; flex-direction: column; }
.acard:nth-child(4), .acard:nth-child(5) { grid-column: span 3; }
.acard:hover { border-color: var(--ink); }
.acard .th { height: 220px; border-radius: 12px; overflow: hidden; background: #fff; border: 1px solid var(--rule); }
.acard .th img { width: 100%; height: 100%; object-fit: cover; object-position: top left; transition: transform 1.2s var(--ease); }
.acard .meta { padding: 14px 6px 4px; }
.acard b { font-family: var(--display); font-size: 21px; font-weight: 600; letter-spacing: -.01em; display: block; }
.acard span { font-size: 14px; color: var(--ink-2); }
.acard .k { font-family: var(--sans); font-weight: 600; font-size: 13.5px; color: var(--ink-3); display: block; margin-bottom: 4px; }
@media (max-width: 860px) { .arch { grid-template-columns: 1fr; } .acard, .acard:nth-child(4), .acard:nth-child(5) { grid-column: auto; } }

/* quest log: one row per quest, like an in-game log */
.quests { border-top: 2px solid var(--ink); }
.quest { display: grid; grid-template-columns: 130px minmax(0, 1.2fr) minmax(0, 1fr) 200px; gap: 28px; padding: 28px 0; border-bottom: 1px solid var(--rule); align-items: start; }
.quest .st { display: grid; gap: 6px; font-family: var(--pixel); font-size: 11px; color: var(--ink-2); }
.quest .st b { font-weight: 400; color: var(--signal-ink); }
.quest .st b.now { color: var(--on-signal); background: var(--signal-fill); justify-self: start; padding: 3px 7px; }
.quest h3 { font-size: 26px; margin-bottom: 8px; }
.quest p { margin: 0; color: var(--ink-2); font-size: 16px; }
.quest ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; font-size: 15px; }
.quest li { display: flex; gap: 10px; }
.quest li::before { content: ""; flex: none; width: 13px; height: 13px; margin-top: 5px; border: 1.5px solid var(--ink-3); }
.quest .rw { font-size: 15px; color: var(--ink-2); }
.quest .rw b { font-family: var(--pixel); font-size: 11px; color: var(--ink-2); font-weight: 400; display: block; margin-bottom: 4px; }
@media (max-width: 960px) { .quest { grid-template-columns: 1fr; gap: 14px; } .quest .st { grid-auto-flow: column; justify-content: start; gap: 12px; } }

/* about */
.about { display: grid; grid-template-columns: 1fr 1.2fr; gap: clamp(32px, 6vw, 96px); }
.about h2 { font-size: clamp(36px, 5vw, 64px); }
.about .big { font-family: var(--display); font-size: clamp(24px, 2.4vw, 32px); line-height: 1.25; letter-spacing: -.015em; margin: 0 0 22px; font-weight: 500; }
.about p { color: var(--ink-2); }
.kit { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 36px; padding-top: 28px; border-top: 1px solid var(--rule); }
.kit h3 { font-family: var(--sans); font-size: 13.5px; color: var(--ink-3); font-weight: 600; letter-spacing: 0; line-height: 1.4; margin: 0 0 10px; }
.kit ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 15px; }
@media (max-width: 860px) { .about, .kit { grid-template-columns: 1fr; } }

/* contact */
.contact { padding: clamp(80px, 12vw, 160px) 0; border-top: 1px solid var(--rule); }
.contact h2 { font-size: clamp(44px, 8vw, 120px); max-width: 14ch; }
.contact .row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 40px; }
.foot { border-top: 1px solid var(--rule); padding: 28px 0 40px; font-size: 14px; color: var(--ink-3); }
.foot .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.foot button { background: none; border: 0; color: inherit; font: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; padding: 0; }

/* reveal on scroll */

/* ---------- Overlays: achievements, controls, lightbox ---------- */
.toasts { position: fixed; left: 20px; bottom: 20px; z-index: 300; display: grid; gap: 10px; pointer-events: none; }
.ach-toast { display: flex; align-items: center; gap: 14px; min-width: 300px; max-width: 360px; padding: 12px 18px 12px 12px; border-radius: 16px; background: #141413; color: #F2EFE7; box-shadow: 0 16px 40px -12px rgba(0,0,0,.5); animation: achIn .5s var(--ease) both; pointer-events: auto; border: 1px solid #2c2b27; }
.ach-toast.out { animation: achOut .35s ease-in both; }
.ach-toast .ic { width: 46px; height: 46px; flex: none; border-radius: 12px; background: var(--signal); display: grid; place-items: center; }
.ach-toast .ic svg { width: 24px; height: 24px; }
.ach-toast small { font-family: var(--pixel); font-size: 10px; color: #FFD27A; display: block; letter-spacing: .04em; }
.ach-toast b { font-weight: 600; font-size: 15px; display: block; }
.ach-toast span { font-size: 13px; color: #B7B2A6; }
@keyframes achIn { from { transform: translateY(20px) scale(.96); opacity: 0; } }
@keyframes achOut { to { transform: translateX(-20px); opacity: 0; } }
.modal { position: fixed; inset: 0; z-index: 250; display: grid; place-items: center; padding: 20px; }
.modal[hidden] { display: none; }
.modal .scrim { position: absolute; inset: 0; background: rgba(12,11,9,.6); animation: fade .25s; }
@keyframes fade { from { opacity: 0; } }
.panel { position: relative; background: var(--card); color: var(--ink); border-radius: 14px; padding: 28px; width: min(560px, 100%); max-height: 86vh; overflow: auto; border: 1px solid var(--rule); box-shadow: 0 40px 80px -30px rgba(0,0,0,.5); animation: pop .35s var(--ease); }
@keyframes pop { from { transform: translateY(14px) scale(.98); opacity: 0; } }
.panel h2 { font-size: 30px; margin-bottom: 4px; }
.panel .sub { color: var(--ink-2); margin: 0 0 20px; font-size: 15px; }
.panel .x { position: absolute; right: 16px; top: 16px; }
.ach-list { display: grid; gap: 8px; }
.ach { display: flex; gap: 14px; align-items: center; padding: 10px; border-radius: 14px; border: 1px solid var(--rule); }
.ach .ic { width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; background: var(--paper-2); color: var(--ink-3); flex: none; }
.ach .ic svg { width: 20px; height: 20px; }
.ach.got .ic { background: var(--signal-fill); color: var(--on-signal); }
.ach b { display: block; font-weight: 600; font-size: 15px; }
.ach span { font-size: 13.5px; color: var(--ink-2); }
.ach .when { margin-left: auto; font-family: var(--sans); font-weight: 600; font-size: 13.5px; color: var(--ink-3); }
.ach-prog { height: 6px; background: var(--paper-2); border-radius: 9px; overflow: hidden; margin: 0 0 18px; }
.ach-prog i { display: block; height: 100%; background: var(--signal); }
.ctl { display: grid; grid-template-columns: auto 1fr; gap: 10px 18px; align-items: center; font-size: 15px; }
.ctl kbd { justify-self: start; }
.lightbox .panel { width: min(1280px, 100%); padding: 0; overflow: hidden; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; max-height: 92vh; }
.lb-head { display: flex; gap: 12px 16px; align-items: center; padding: 14px 18px 14px 22px; border-bottom: 1px solid var(--rule); flex-wrap: wrap; }
.lb-t { display: flex; flex-direction: column; min-width: 0; margin-right: auto; }
.lb-head b { font-family: var(--display); font-size: 22px; font-weight: 600; }
.lb-head span { color: var(--ink-2); font-size: 14px; }
.lb-tools { display: flex; align-items: center; gap: 6px; }
.lb-pct { min-width: 52px; text-align: center; font-family: var(--mono); font-size: 13.5px; color: var(--ink-2); }
.lb-fit { font: 600 13.5px var(--sans); color: var(--ink); background: var(--paper-2); border: 1px solid var(--rule); border-radius: 999px; padding: 0 14px; min-height: 40px; cursor: pointer; }
.lb-fit:hover { border-color: var(--ink); }
.lb-body { overflow: auto; background: #fff; cursor: zoom-in; touch-action: pan-x pan-y; overscroll-behavior: contain; }
.lb-body.zoomed { cursor: grab; }
.lb-body.dragging { cursor: grabbing; user-select: none; }
.lb-body img { width: 100%; max-width: none; user-select: none; }
.lb-note { padding: 12px 22px 14px; border-top: 1px solid var(--rule); font-size: 14.5px; color: var(--ink-2); max-height: 22vh; overflow: auto; }
.lb-note p { margin: 6px 0 0; }
.lb-hint { font-size: 13px; color: var(--ink-2); }
.lb-hint kbd { font-size: 11.5px; }
@media (max-width: 600px) { .lb-head b { font-size: 18px; } .lb-hint { display: none; } .lb-note p { margin: 0; } .lightbox .panel { max-height: 96vh; } }

/* custom cursor label (fine pointers only) */
.cursor { position: fixed; left: 0; top: 0; z-index: 400; pointer-events: none; transform: translate(-50%, -50%); font-family: var(--sans); font-weight: 600; font-size: 13.5px; background: var(--ink); color: var(--paper); padding: 7px 11px; border-radius: 99px; opacity: 0; transition: opacity .2s, scale .2s; scale: .6; white-space: nowrap; }
.cursor.on { opacity: 1; scale: 1; }
@media (hover: none), (pointer: coarse) { .cursor { display: none; } }

/* confetti (easter egg) */
.confetti { position: fixed; top: -10px; width: 8px; height: 14px; z-index: 500; pointer-events: none; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }

/* ============ Case study pages ============ */
.cs-hero { padding: clamp(40px, 6vw, 80px) 0 clamp(32px, 4vw, 56px); }
.back { display: inline-flex; gap: 8px; align-items: center; text-decoration: none; font-family: var(--sans); font-weight: 600; font-size: 13.5px; color: var(--ink-2); margin: -10px 0 26px; padding: 10px 0; }
.back:hover { color: var(--ink); }
.back svg { width: 16px; height: 16px; }
.cs-hero h1 { font-size: clamp(48px, 8vw, 120px); }
.cs-hero .lede { margin-top: 22px; max-width: 62ch; }
.cs-meta { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; margin-top: clamp(32px, 4vw, 56px); padding-top: 24px; border-top: 1px solid var(--rule); }
.cs-meta dt { font-family: var(--sans); font-weight: 600; font-size: 13.5px; color: var(--ink-3); }
.cs-meta dd { margin: 6px 0 0; font-size: 15.5px; }
@media (max-width: 760px) { .cs-meta { grid-template-columns: 1fr 1fr; } }
.cs-cover { border-radius: 16px; overflow: hidden; position: relative; }
.cs-body { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: clamp(32px, 6vw, 96px); padding-block: clamp(56px, 8vw, 112px); }
.toc { position: sticky; top: 96px; align-self: start; display: grid; gap: 2px; font-size: 14px; }
.toc b { font-family: var(--sans); font-size: 13.5px; color: var(--ink-3); font-weight: 400; margin-bottom: 10px; }
.toc a { text-decoration: none; color: var(--ink-3); padding: 5px 0 5px 14px; border-left: 2px solid var(--rule); transition: color .2s, border-color .2s; }
.toc a.on { color: var(--ink); border-left-color: var(--signal); }
@media (max-width: 960px) { .cs-body { grid-template-columns: minmax(0, 1fr); } .toc { display: none; } }
.cs-body > article { min-width: 0; }
/* phones: each table row becomes a small card, with the column name above each value */
@media (max-width: 600px) {
  .table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .table, .table tbody, .table tr, .table td { display: block; }
  .table tr { padding: 14px 0; border-bottom: 1px solid var(--rule); }
  .table td { border: 0; padding: 2px 0; }
  .table td:first-child { white-space: normal; font-size: 16px; margin-bottom: 6px; }
  .table td[data-label]:not(:first-child)::before { content: attr(data-label); display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-3); margin-top: 6px; }
  .screens { gap: 12px; }
}
.chap { padding-bottom: clamp(56px, 7vw, 96px); scroll-margin-top: 90px; }
.chap > .num { font-family: var(--pixel); font-size: 11.5px; color: var(--signal-ink); margin-bottom: 14px; display: block; }
.chap h2 { font-size: clamp(32px, 4vw, 52px); margin-bottom: 20px; max-width: 20ch; }
.chap h3 { font-size: 24px; margin: 40px 0 12px; }
.chap p { max-width: 66ch; color: var(--ink-2); }
.chap p strong { color: var(--ink); font-weight: 600; }
.fig { margin: 28px 0 0; }
.fig .frame { border-radius: 14px; overflow: hidden; border: 1px solid var(--rule); background: #fff; }
.fig figcaption { font-size: 13.5px; color: var(--ink-3); margin-top: 10px; display: flex; gap: 10px; }
.fig figcaption::before { content: "↳"; font-family: var(--sans); font-weight: 600; }
.zoomable { cursor: zoom-in; }
.crop { overflow: hidden; }
.crop img { width: 100%; object-fit: cover; object-position: top; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 28px; }
.trio { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 28px; }
@media (max-width: 760px) { .pair, .trio { grid-template-columns: 1fr; } }
.phone { border-radius: 34px; overflow: hidden; border: 7px solid #101514; background: #101514; box-shadow: 0 30px 50px -28px rgba(0,0,0,.45); }
.phone img { width: 100%; }
.screens { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-top: 28px; }
.screens figure { margin: 0; }
.screens figcaption { font-size: 13px; color: var(--ink-2); margin-top: 12px; line-height: 1.45; }
.screens figcaption b { display: block; color: var(--ink); font-weight: 600; font-size: 14px; }
@media (max-width: 960px) { .screens { grid-template-columns: 1fr 1fr; } }
.callout { margin-top: 28px; padding: 0; font-family: var(--display); font-size: clamp(22px, 2.2vw, 28px); line-height: 1.3; letter-spacing: -.01em; max-width: 34ch; }
.table { width: 100%; border-collapse: collapse; margin-top: 24px; font-size: 15px; }
.table th { text-align: left; font-family: var(--sans); font-size: 13.5px; color: var(--ink-3); font-weight: 400; padding: 0 12px 10px 0; border-bottom: 1px solid var(--rule); }
.table td { padding: 14px 12px 14px 0; border-bottom: 1px solid var(--rule); vertical-align: top; color: var(--ink-2); }
.table td:first-child { color: var(--ink); font-weight: 600; white-space: nowrap; }
.dec { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 24px; }
.dec > div { border: 1px solid var(--rule); border-radius: 12px; padding: 20px; background: var(--card); }
.dec .k { font-family: var(--sans); font-weight: 600; font-size: 13.5px; color: var(--ink-3); }
.dec .k.was { color: var(--ink-3); } .dec .k.now { color: var(--xp-ink); }
.dec p { margin: 8px 0 0; font-size: 15px; }
@media (max-width: 760px) { .dec { grid-template-columns: 1fr; } }
.decision { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 40px; align-items: start; margin-top: 48px; padding-top: 40px; border-top: 1px solid var(--rule); }
.decision:first-of-type { border-top: 0; padding-top: 0; }
.decision h3 { margin-top: 0; }
.decision .lbl { font-family: var(--sans); font-weight: 600; font-size: 13.5px; color: var(--ink-3); }
@media (max-width: 900px) { .decision { grid-template-columns: 1fr; } .decision .phone { max-width: 300px; } }
.checks { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 8px; max-width: 64ch; }
.checks li { position: relative; padding-left: 26px; color: var(--ink-2); font-size: 15.5px; }
.checks li::before { content: "✓"; position: absolute; left: 2px; top: 0; color: var(--xp-ink); font-weight: 700; }
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; margin-top: 24px; }
.swatches.c3 { grid-template-columns: repeat(3, 1fr); }
.swatches.c4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 760px) { .swatches.c3, .swatches.c4 { grid-template-columns: repeat(2, 1fr); } .swatches.c3 .sw:last-child:nth-child(odd), .swatches.c4 .sw:last-child:nth-child(odd) { grid-column: span 2; } }
.sw { border-radius: 14px; overflow: hidden; border: 1px solid var(--rule); background: var(--card); font-size: 12.5px; }
.sw i { display: block; height: 72px; }
.sw div { padding: 8px 10px; }
.sw b { display: block; font-weight: 600; }
.sw span { font-family: var(--sans); font-weight: 600; font-size: 13.5px; color: var(--ink-3); }
.play { display: grid; grid-template-columns: 1fr 400px; gap: 48px; align-items: center; margin-top: 28px; background: var(--paper-2); border-radius: 16px; padding: clamp(24px, 4vw, 48px); }
.play .dev { width: 100%; max-width: 380px; aspect-ratio: 390 / 844; border-radius: 48px; border: 10px solid #101514; overflow: hidden; background: #101514; box-shadow: 0 40px 70px -30px rgba(0,0,0,.5); justify-self: center; }
.play iframe { width: 100%; height: 100%; border: 0; display: block; }
@media (max-width: 960px) { .play { grid-template-columns: 1fr; } }
.ba { position: relative; aspect-ratio: 1440 / 900; border-radius: 14px; overflow: hidden; border: 1px solid var(--rule); user-select: none; touch-action: pan-y; }
.ba img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top; pointer-events: none; }
.ba .after { clip-path: inset(0 0 0 var(--pos, 50%)); }
.ba .handle { position: absolute; top: 0; bottom: 0; left: var(--pos, 50%); width: 2px; background: #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.15); }
.ba .handle::after { content: "⟷"; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 48px; height: 48px; border-radius: 50%; background: #fff; color: #222; display: grid; place-items: center; font-size: 20px; box-shadow: 0 6px 20px rgba(0,0,0,.25); }
.ba .lab { position: absolute; top: 14px; font-family: var(--sans); font-weight: 600; font-size: 13.5px; background: rgba(20,20,19,.75); color: #fff; padding: 5px 10px; border-radius: 99px; }
.ba .lab.l { left: 14px; } .ba .lab.r { right: 14px; }
.ba input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: ew-resize; margin: 0; }
.ba:has(input:focus-visible) { outline: 2px solid var(--signal); outline-offset: 3px; }
.ba:has(input:focus-visible) .handle::after { box-shadow: 0 0 0 3px var(--signal), 0 6px 20px rgba(0,0,0,.25); }
.next-cs { display: block; text-decoration: none; border-top: 1px solid var(--rule); padding: clamp(48px, 8vw, 96px) 0; }
.next-cs .mono { color: var(--ink-3); }
.next-cs h2 { font-size: clamp(44px, 7vw, 100px); margin-top: 12px; transition: color .25s; }
.next-cs:hover h2 { color: var(--signal); }

/* ---------- Hero studio (diegetic menu) ---------- */
.room { margin: 0; }
.room-stage { position: relative; aspect-ratio: 448 / 334; }
.room-stage svg { display: block; width: 100%; height: 100%; overflow: visible; }
.room .hs { cursor: pointer; }
.room .hs > *, .room .lid, .room .door-panel, .room .pinned { transition: transform .35s var(--ease), filter .2s; }
.room .hs.hot { filter: brightness(1.07) saturate(1.08); }
.room .hs[data-k="lamp"].hot, .room .hs[data-k="cat"].hot, .room .hs[data-k="sq"].hot { transform: translateY(-3px); }
.room .hs.hot .lid { transform: translateY(-7px); }
.room .hs.hot .door-panel { transform: scaleX(.62); }
.room .hs.hot .pinned:nth-child(odd) { transform: rotate(-2deg) translateY(-3px); }
.room .tag { opacity: 0; transform-box: fill-box; pointer-events: none; transition: opacity .15s; }
.room .tag.hot { opacity: 1; }
.room .tag rect, .room .tag path { fill: var(--ink); }
.room .tag text { fill: var(--paper); font-family: var(--pixel); font-size: 10px; }
.room .slide { opacity: 0; animation: slide 12s infinite; }
.room .slide:first-of-type { opacity: 1; }
@keyframes slide { 0%, 22% { opacity: 1; } 27%, 100% { opacity: 0; } }
.room .attract { animation: attract 1.4s steps(1) infinite; }
@keyframes attract { 50% { opacity: .25; } }
.room .hs.hot .attract { animation-duration: .4s; }
.room .heart { font-size: 16px; fill: var(--signal); animation: heart 1.1s var(--ease) forwards; }
@keyframes heart { to { transform: translateY(-26px); opacity: 0; } }
.room .still .slide, .room .still .attract { animation: none; }
.room-cap { margin: 14px 0 12px; font-size: 15px; color: var(--ink-2); min-height: 3em; }
.room-cap b { color: var(--ink); }
.room-legend { display: flex; flex-wrap: wrap; gap: 6px; }
.room-legend a, .room-legend button { font: inherit; font-size: 14px; color: var(--ink-2); text-decoration: none; border: 1px solid var(--rule); background: var(--card); padding: 6px 11px; border-radius: 8px; cursor: pointer; }
.room-legend b { font-weight: 600; color: var(--ink); margin-right: 4px; }
.room-legend .on, .room-legend a:hover, .room-legend button:hover { border-color: var(--ink); color: var(--ink); }
@media (prefers-reduced-motion: reduce) { .room .hs, .room .hs > *, .room .lid, .room .door-panel { transition: none; } .room .slide { animation: none; } }
@media (max-width: 960px) { .hero-grid { grid-template-columns: 1fr; } }
.tldr { margin: 24px 0 0; border-top: 1px solid var(--rule); }
.tldr div { display: grid; grid-template-columns: 90px 1fr; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.tldr dt { font-family: var(--pixel); font-size: 11.5px; color: var(--signal-ink); padding-top: 5px; }
.tldr dd { margin: 0; color: var(--ink-2); }
/* "Transfers to": names the general product skill behind a game or client decision */
.ux { display: grid; grid-template-columns: 110px 1fr; gap: 14px; margin: 24px 0 0; padding: 14px 16px; background: var(--paper-2); border-radius: 10px; font-size: 15.5px; color: var(--ink-2); max-width: 66ch; }
.ux b { font-family: var(--pixel); font-size: 11px; font-weight: 400; color: var(--signal-ink); padding-top: 4px; }
@media (max-width: 560px) { .ux { grid-template-columns: 1fr; gap: 4px; } }
