/* 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; } }

/* how I work: five steps on one line, each linking into the case studies */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; border-top: 2px solid var(--ink); counter-reset: s; }
.step { position: relative; padding: 26px 22px 28px; border-right: 1px solid var(--rule); display: flex; flex-direction: column; transition: background .3s var(--ease); }
.step:first-child { padding-left: 0; }
.step:last-child { border-right: 0; padding-right: 0; }
.step::before { content: ""; position: absolute; left: 0; right: 0; top: -2px; height: 2px; background: var(--signal); transform: scaleX(0); transform-origin: left; transition: transform .5s var(--ease); }
.step:hover::before, .step:focus-within::before { transform: scaleX(1); }
.step-n { font-family: var(--pixel); font-size: 12px; color: var(--ink-3); display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border: 1.5px solid var(--rule); border-radius: 10px; transition: background .3s, color .3s, border-color .3s, transform .4s var(--ease); }
.step:hover .step-n, .step:focus-within .step-n { background: var(--signal-fill); border-color: var(--signal-fill); color: var(--on-signal); transform: rotate(-6deg); }
.step h3 { font-size: 26px; margin: 18px 0 8px; }
.step p { margin: 0 0 18px; color: var(--ink-2); font-size: 15.5px; }
.step-links { margin-top: auto; display: grid; gap: 6px; }
.step-links a { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 14.5px; text-decoration: none; justify-self: start; }
.step-links svg { width: 15px; height: 15px; flex: none; transition: transform .3s var(--ease); }
.step-links a:hover svg { transform: translateX(3px); }
@media (max-width: 1060px) { .steps { grid-template-columns: 1fr; border-top: 0; } .step, .step:first-child, .step:last-child { padding: 22px 0 22px 64px; border-right: 0; border-bottom: 1px solid var(--rule); } .step::before { display: none; } .step-n { position: absolute; left: 0; top: 22px; } .step h3 { margin-top: 4px; } .step-links { grid-auto-flow: column; justify-content: start; gap: 18px; flex-wrap: wrap; } }
@media (max-width: 520px) { .step-links { grid-auto-flow: row; } }

/* outcomes on work cards */
.wins { list-style: none; margin: auto 0 0; padding: 18px 0 0; border-top: 1px solid var(--rule); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; font-size: 13.5px; color: var(--ink-2); line-height: 1.35; }
.wins b { display: block; font-family: var(--display); font-size: 24px; font-weight: 600; letter-spacing: -.02em; color: var(--ink); margin-bottom: 4px; }
@media (max-width: 460px) { .wins { grid-template-columns: 1fr 1fr; } }

/* 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(auto-fit, minmax(170px, 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; } }
/* v1 screen carousel (StudyQuest case study) */
.v1strip { display: grid; grid-auto-flow: column; grid-auto-columns: 132px; gap: 14px; overflow-x: auto; padding: 4px 2px; scroll-snap-type: x mandatory; scroll-behavior: smooth; scrollbar-width: none; }
.v1strip::-webkit-scrollbar { display: none; }
.v1strip .shot { scroll-snap-align: start; text-align: center; }
.v1strip .phone { border-width: 4px; border-radius: 18px; }
.v1strip .shot > span { display: block; margin-top: 8px; font-size: 13px; color: var(--ink-3); }
.v1nav { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.v1nav figcaption { margin: 0 auto 0 0; }
.v1nav .hbtn { width: 44px; height: 44px; padding: 0; }
.v1nav .hbtn:disabled { opacity: .35; cursor: default; transform: none; }
@media (prefers-reduced-motion: reduce) { .v1strip { scroll-behavior: auto; } }
.v1strip .phone { cursor: zoom-in; transition: transform .2s; }
.v1strip .phone:hover { transform: translateY(-3px); }
.v1strip .phone:focus-visible { outline: 3px solid var(--xp-ink); outline-offset: 3px; }
/* Enlarged phone screen with back/next */
.phonebox .panel { width: min(560px, 100%); }
.pb-body { background: var(--paper-2); display: flex; justify-content: center; align-items: center; padding: 20px; min-height: 0; overflow: hidden; }
.pb-body img { height: min(68vh, 844px); width: auto; max-width: 100%; object-fit: contain; border-radius: 22px; border: 6px solid #101514; background: #101514; box-shadow: 0 24px 40px -24px rgba(0,0,0,.5); }
.pb-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 18px; border-top: 1px solid var(--rule); }
.pb-nav .hbtn { width: 44px; height: 44px; padding: 0; }
@media (max-width: 600px) { .pb-body img { height: min(62vh, 844px); } }

/* ---------- Micro-interactions ---------- */
/* buttons: a fill sweeps up from the bottom, icons nudge in the direction they point, a slight magnetic pull (site.js) */
.btn { position: relative; overflow: hidden; isolation: isolate; transition: transform .2s var(--ease), translate .35s var(--ease), color .35s var(--ease), border-color .35s, background .35s; }
.btn::before { content: ""; position: absolute; inset: -1px; z-index: -1; border-radius: inherit; transform: translateY(101%); transition: transform .45s var(--ease); }
.btn-ink::before { background: var(--signal-fill); }
.btn-line::before { background: var(--ink); }
.btn-ink:hover { background: var(--ink); border-color: var(--signal-fill); }
.btn-line:hover { background: transparent; }
.btn:hover::before, .btn:focus-visible::before { transform: translateY(0); }
.btn:focus-visible { color: var(--paper); }
.btn-ink:focus-visible { color: var(--on-signal); }
.btn svg { transition: transform .35s var(--ease); }
.btn:hover svg { transform: translateX(3px); }
.btn[href^="#"]:hover svg { transform: translateY(3px); }
.btn:hover svg.ext { transform: translate(2px, -2px); }
.btn svg[fill="currentColor"] { width: 14px; height: 14px; }
.btn:hover svg[fill="currentColor"] { transform: scale(1.15); }
.btn:active { transform: scale(.97); }

/* header */
.brand-mark { transition: transform .4s var(--ease), background .3s; }
.brand:hover .brand-mark { transform: rotate(-8deg) scale(1.06); background: var(--signal-fill); color: var(--on-signal); }
.nav a { position: relative; }
.nav a::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 4px; height: 2px; border-radius: 2px; background: var(--signal); transform: scaleX(0); transition: transform .35s var(--ease); }
.nav a[aria-current]::after { transform: scaleX(1); }
.hbtn { transition: border-color .2s, transform .15s, translate .25s var(--ease), background .2s; }
.hbtn:hover:not(:disabled) { translate: 0 -1px; }
.hbtn svg { transition: transform .4s var(--ease); }
#themeBtn:hover svg { transform: rotate(25deg); }
#achBtn:hover svg { transform: rotate(-10deg) scale(1.1); }

/* work cards: lift, soft spotlight that follows the pointer, link underline draws in */
.wcard { position: relative; transition: transform .45s var(--ease), box-shadow .45s var(--ease), border-color .25s; }
.wcard:hover { transform: translateY(-4px); box-shadow: 0 28px 50px -30px rgba(22,21,19,.45); }
.wcard .txt { position: relative; }
.wcard .txt::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), color-mix(in srgb, var(--signal) 9%, transparent), transparent 65%); opacity: 0; transition: opacity .4s; }
.wcard:hover .txt::before { opacity: 1; }
.wcard .go span, .wcard .go { background: linear-gradient(currentColor, currentColor) 0 100% / 0 1.5px no-repeat; transition: background-size .4s var(--ease); padding-bottom: 2px; }
.wcard:hover .go { background-size: calc(100% - 26px) 1.5px; }
.wcard .browser img { transition: transform .8s var(--ease); }
.wcard:hover .browser img { transform: scale(1.02); transform-origin: top center; }
.wcard .wins li { transition: transform .35s var(--ease); }
.wcard:hover .wins li { transform: translateY(-2px); }
.wcard:hover .wins li:nth-child(2) { transition-delay: .04s; }
.wcard:hover .wins li:nth-child(3) { transition-delay: .08s; }
.playable { transition: transform .3s var(--ease), box-shadow .3s; }
.wcard:hover .playable { transform: translateY(-2px); box-shadow: 0 5px 0 #C49A3A; }

/* quest log: the checkboxes turn into game diamonds on hover */
.quest h3 { transition: color .25s; }
.quest li::before { transition: transform .35s var(--ease), border-color .25s, background .25s; }
.quest:hover h3 { color: var(--signal-ink); }
.quest:hover li::before { transform: rotate(45deg) scale(.85); border-color: var(--signal); }

/* text links and small controls */
.foot button, .foot a { transition: text-underline-offset .25s var(--ease), color .2s; }
.foot button:hover, .foot a:hover { text-underline-offset: 6px; color: var(--ink); }
.back svg { transition: transform .3s var(--ease); }
.back:hover svg { transform: translateX(-4px); }
.toc a { transition: color .2s, border-color .2s, padding .3s var(--ease); }
.toc a:hover { color: var(--ink); padding-left: 18px; }
.next-cs h2 { transition: color .25s, transform .5s var(--ease); }
.next-cs:hover h2 { transform: translateX(12px); }
.chap p a:not(.btn) { text-decoration-thickness: 1px; text-underline-offset: 3px; transition: text-underline-offset .25s var(--ease), text-decoration-color .25s; }
.chap p a:not(.btn):hover { text-underline-offset: 6px; text-decoration-color: var(--signal); }

/* zoomable Figma frames: the image eases in and an "Enlarge" chip appears */
.frame.zoomable { position: relative; }
.frame.zoomable img { transition: transform .7s var(--ease); }
.frame.zoomable:hover img { transform: scale(1.025); }
.frame.zoomable::after { content: "Click to enlarge"; position: absolute; right: 12px; bottom: 12px; font: 600 12.5px var(--sans); color: var(--paper); background: var(--ink); padding: 6px 11px; border-radius: 99px; opacity: 0; translate: 0 6px; transition: opacity .3s, translate .35s var(--ease); pointer-events: none; }
.frame.zoomable:hover::after, .frame.zoomable:focus-visible::after { opacity: 1; translate: 0 0; }
@media (hover: none), (pointer: coarse) { .frame.zoomable::after { content: "Tap to enlarge"; opacity: .92; translate: 0 0; } }

/* reveal on scroll (only when JS runs, so content never stays hidden) */
.js .rv { opacity: 0; translate: 0 22px; transition: opacity .8s var(--ease) var(--d, 0s), translate .8s var(--ease) var(--d, 0s), transform .45s var(--ease), box-shadow .45s var(--ease), border-color .25s, background .3s; }
.js .rv.in { opacity: 1; translate: none; }
.js .steps .rv:nth-child(2), .js .quests .rv:nth-child(2) { --d: .08s; }
.js .steps .rv:nth-child(3), .js .quests .rv:nth-child(3) { --d: .16s; }
.js .steps .rv:nth-child(4) { --d: .24s; }
.js .steps .rv:nth-child(5) { --d: .32s; }
@media (prefers-reduced-motion: reduce) {
  .js .rv { opacity: 1; translate: none; }
  .wcard:hover, .wcard:hover .wins li, .next-cs:hover h2, .frame.zoomable:hover img, .wcard:hover .browser img { transform: none; }
  .btn { translate: none !important; }
}

/* ======================================================================
   v5: at-a-glance, 60-second mode, v1 to v2 sliders, page transitions,
   player card, hover cycles, footer clock, 404
   ====================================================================== */
.states { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.states span { font-size: 14px; border: 1px solid var(--rule); background: var(--card); padding: 5px 10px; border-radius: 8px; }

/* at a glance (top of each case study) */
.glance { border: 1px solid var(--rule); border-radius: 16px; background: var(--card); padding: 22px 24px 8px; margin-bottom: clamp(48px, 6vw, 72px); }
.glance-hd { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.glance-hd h2 { font-family: var(--pixel); font-size: 13px; font-weight: 400; letter-spacing: .02em; color: var(--signal-ink); line-height: 1; }
.glance dl { margin: 0; }
.glance dl div { display: grid; grid-template-columns: 112px 1fr; gap: 16px; padding: 13px 0; border-top: 1px solid var(--rule); }
.glance dt { font-weight: 600; font-size: 14px; color: var(--ink-3); padding-top: 1px; }
.glance dd { margin: 0; font-size: 16px; }
@media (max-width: 560px) { .glance dl div { grid-template-columns: 1fr; gap: 2px; } }

/* 60-second mode toggle */
.quick-btn { display: inline-flex; align-items: center; gap: 10px; height: 40px; padding: 0 16px 0 12px; border-radius: 99px; border: 1px solid var(--ink); background: transparent; color: var(--ink); font: 600 14px var(--sans); cursor: pointer; transition: background .25s, color .25s, translate .25s var(--ease); }
.quick-btn:hover { translate: 0 -1px; }
.qb-dot { position: relative; width: 30px; height: 18px; border-radius: 99px; background: var(--rule); transition: background .25s; flex: none; }
.qb-dot::after { content: ""; position: absolute; top: 3px; left: 3px; width: 12px; height: 12px; border-radius: 50%; background: var(--card); box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .3s var(--ease); }
.quick-btn[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.quick-btn[aria-pressed="true"] .qb-dot { background: var(--signal-fill); }
.quick-btn[aria-pressed="true"] .qb-dot::after { transform: translateX(12px); }
.quick-fab { position: fixed; right: 20px; bottom: 20px; z-index: 60; box-shadow: 0 14px 30px -14px rgba(0,0,0,.5); background: var(--card); opacity: 0; translate: 0 14px; pointer-events: none; visibility: hidden; transition: opacity .3s, translate .35s var(--ease), background .25s, color .25s, visibility .3s; }
.quick-fab.show { opacity: 1; translate: 0 0; pointer-events: auto; visibility: visible; }
.qsum { display: none; }
.quick .qsum { display: block; font-size: clamp(18px, 1.5vw, 20px); color: var(--ink); max-width: 62ch; margin: 14px 0 0; }
.quick .chap > :not(.num):not(h2):not(.qsum):not(.qkeep) { display: none !important; }
.quick .chap { padding-bottom: clamp(28px, 4vw, 44px); }
.quick .chap h2 { font-size: clamp(26px, 2.6vw, 34px); }
.quick .qkeep { margin-top: 18px; }

/* v1 to v2 sliders on phone-shaped frames */
.vs { display: grid; grid-template-columns: repeat(2, minmax(0, 280px)); gap: 24px; margin-top: 22px; justify-content: start; }
.vs figure { margin: 0; }
.vs figcaption { font-size: 13.5px; color: var(--ink-3); margin-top: 10px; }
.ba.ba-phone { aspect-ratio: 390 / 844; border: 6px solid #0E1513; border-radius: 30px; background: #0E1513; }
.ba.ba-phone .lab { top: 10px; font-family: var(--pixel); font-size: 11px; font-weight: 400; }
.ba.ba-phone .lab.l { left: 10px; } .ba.ba-phone .lab.r { right: 10px; }
.ba.ba-phone .handle::after { width: 40px; height: 40px; }
@media (max-width: 560px) { .vs { grid-template-columns: 1fr 1fr; gap: 12px; } }

/* page transitions between pages (Chrome, Edge, Safari 18+; other browsers just load normally) */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  ::view-transition-old(root), ::view-transition-new(root) { animation-duration: .3s; }
  ::view-transition-group(*) { animation-duration: .55s; animation-timing-function: cubic-bezier(.2, .8, .2, 1); }
  ::view-transition-old(sq-cover), ::view-transition-new(sq-cover), ::view-transition-old(soy-cover), ::view-transition-new(soy-cover) { height: 100%; object-fit: cover; overflow: clip; }
}
.vt-sq-cover { view-transition-name: sq-cover; }
.vt-sq-title { view-transition-name: sq-title; }
.vt-soy-cover { view-transition-name: soy-cover; }
.vt-soy-title { view-transition-name: soy-title; }
.vt-sq-title, .vt-soy-title { width: fit-content; }

/* hover cycles on the work cards */
.ph[data-cycle], .cyc { position: relative; }
.cyc-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top; opacity: 0; transition: opacity .45s var(--ease); }
.cyc-img.on { opacity: 1; }
.cyc-dots { position: absolute; left: 50%; bottom: 10px; translate: -50% 0; display: flex; gap: 5px; z-index: 4; opacity: 0; transition: opacity .3s; }
.cyc-dots i { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,.55); box-shadow: 0 0 0 1px rgba(0,0,0,.2); transition: background .3s, scale .3s; }
.cyc-dots i.on { background: #fff; scale: 1.3; }
.wcard:hover .cyc-dots { opacity: 1; }

/* player card in About */
.about-l { perspective: 900px; }
.pcard { position: sticky; top: 100px; margin: 0; max-width: 360px; transform-style: preserve-3d; transition: transform .5s var(--ease); }
.pcard-in { position: relative; border-radius: 20px; padding: 14px; background: var(--ink); color: var(--paper); box-shadow: 0 30px 60px -30px rgba(0,0,0,.55); overflow: hidden; }
.pcard-in::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(500px circle at var(--gx, 30%) var(--gy, 0%), rgba(255,255,255,.16), transparent 45%), linear-gradient(115deg, transparent 35%, rgba(255,210,122,.12) 48%, rgba(179,148,255,.12) 54%, transparent 66%); background-size: 100% 100%, 250% 250%; background-position: 0 0, var(--sx, 100%) 0; mix-blend-mode: screen; opacity: .7; }
.pcard-top { display: flex; justify-content: space-between; font-family: var(--pixel); font-size: 11px; padding: 2px 4px 12px; color: #FFD27A; }
.pcard-photo { aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: #2a2925; border: 3px solid var(--signal-fill); }
.pcard-photo img { width: 100%; height: 100%; object-fit: cover; }
.pcard figcaption { padding: 16px 6px 6px; }
.pcard figcaption > b { font-family: var(--display); font-size: 30px; font-weight: 600; letter-spacing: -.02em; display: block; margin-bottom: 10px; }
.pcard dl { margin: 0 0 14px; }
.pcard dl div { display: grid; grid-template-columns: 100px 1fr; gap: 10px; padding: 7px 0; border-top: 1px solid rgba(255,255,255,.12); font-size: 14.5px; }
.pcard dt { font-family: var(--pixel); font-size: 10.5px; color: #B7B2A6; padding-top: 3px; }
.pcard dd { margin: 0; }
.pcard-status { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600; color: #B7F0D2; }
.pcard-status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--xp); animation: ping 2.4s infinite; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(47,158,110,.6); } 70%, 100% { box-shadow: 0 0 0 8px rgba(47,158,110,0); } }
[data-theme="dark"] .pcard-in { background: #26251F; color: #EEEBE3; border: 1px solid #3a3832; }
@media (max-width: 860px) { .pcard { position: relative; top: 0; max-width: 340px; margin: 0 auto 8px; } }

/* footer clock */
.foot .wrap { align-items: center; }
.clock { display: inline-flex; align-items: center; gap: 8px; }
.clock[hidden] { display: none; }
.clock i { width: 8px; height: 8px; border-radius: 50%; background: var(--xp); flex: none; }
.clock.away i { background: var(--ink-3); }
.clock.night i { background: #7C8CC8; }
.foot [data-sound][aria-pressed="true"] { color: var(--ink); }

/* 404 */
.lost { min-height: calc(100vh - 220px); display: grid; align-items: center; padding: clamp(48px, 8vw, 96px) 0; }
.lost-in { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(32px, 6vw, 80px); align-items: center; }
.lost h1 { font-size: clamp(48px, 7vw, 96px); }
.lost .lede { margin: 22px 0 30px; }
.lost-room { width: 100%; max-width: 440px; justify-self: center; overflow: visible; }
.lr-floor { fill: #C9A97A; } .lr-wall-l { fill: #E8DFCE; } .lr-wall-r { fill: #DCD1BC; } .lr-edge-l { fill: #9C7E55; } .lr-edge-r { fill: #86693F; }
.lr-door { fill: #1E7A71; transform-box: fill-box; transform-origin: left center; transition: transform .6s var(--ease); }
.lr-knob { fill: #FFD27A; }
.lr-q { font-family: var(--pixel); font-size: 64px; fill: var(--signal); animation: bob 2.4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-8px); } }
.lost-room:hover .lr-door { transform: skewY(-12deg) scaleX(.6); }
[data-theme="dark"] .lr-wall-l { fill: #3A362E; } [data-theme="dark"] .lr-wall-r { fill: #312E27; } [data-theme="dark"] .lr-floor { fill: #6E5A3E; }
@media (max-width: 820px) { .lost-in { grid-template-columns: 1fr; } .lost-room { max-width: 300px; } }

.wins b { font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: reduce) { .pcard { transform: none !important; } .pcard-status::before, .lr-q { animation: none; } }
.about h2 { font-size: clamp(34px, 4.2vw, 56px); margin-bottom: 26px; text-wrap: balance; }
