/* VANISH: a school for perspective drawing. Drafting-table art direction. */
:root {
  --paper: #f1efe8;
  --paper-2: #e9e6dd;
  --paper-3: #dedad0;
  --ink: #1f1f1f;
  --ink-2: #55534d;
  --ink-3: #8a877f;
  --con: rgba(31, 31, 31, .2);
  --hair: rgba(31, 31, 31, .14);
  --grid: rgba(31, 31, 31, .045);
  --red: #1f6fbf; /* drafting blue pencil */
  --disp: 'Encode Sans', 'Helvetica Neue', Arial, sans-serif;
  --mono: 'Overpass Mono', ui-monospace, Menlo, monospace;
  --gut: clamp(16px, 3.4vw, 48px);
  --max: 1440px;
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--disp); font-stretch: 100%; font-weight: 400; font-size: 16px; line-height: 1.5;
  overflow-x: clip; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
body::before { /* drafting paper: faint 24px grid and 120px major grid */
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px),
    linear-gradient(rgba(31,31,31,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(31,31,31,.035) 1px, transparent 1px);
  background-size: 24px 24px, 24px 24px, 120px 120px, 120px 120px;
}
main, footer, header { position: relative; z-index: 1; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
svg { display: block; overflow: visible; }
::selection { background: var(--ink); color: var(--paper); }
:focus-visible { outline: 1.5px solid var(--ink); outline-offset: 3px; }
.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gut); }
.lab { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; line-height: 1.3; font-weight: 400; }
.m { color: var(--ink-3); }
.r { color: var(--red); }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- type ---------- */
.h2 {
  font-size: clamp(38px, 6.2vw, 92px); line-height: .96; font-weight: 300; font-stretch: 118%;
  letter-spacing: -.035em; margin: 0;
}
.h2 b { font-weight: 600; }
.h3 { font-size: clamp(22px, 2.2vw, 30px); font-weight: 500; font-stretch: 112%; letter-spacing: -.02em; line-height: 1.08; margin: 0; }
.p { color: var(--ink-2); font-size: clamp(15px, 1.15vw, 17px); line-height: 1.58; max-width: 46ch; margin: 0; }
.ln { padding-bottom: .06em; }

/* ---------- sheet frame: registration marks and title block ---------- */
.sheet { position: relative; padding: clamp(84px, 12vw, 160px) 0; }
.sheet-h { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--hair); margin-bottom: clamp(26px, 4vw, 48px); }
.sheet-h .lab { display: flex; gap: 18px; flex-wrap: wrap; }
.reg { position: absolute; width: 14px; height: 14px; pointer-events: none; }
.reg::before, .reg::after { content: ''; position: absolute; background: var(--ink); }
.reg::before { left: 6.5px; top: 0; width: 1px; height: 14px; }
.reg::after { top: 6.5px; left: 0; height: 1px; width: 14px; }
.tblock { display: grid; grid-template-columns: repeat(4, auto); border: 1px solid var(--ink); width: max-content; max-width: 100%; }
.tblock > div { padding: 6px 10px; border-right: 1px solid var(--ink); }
.tblock > div:last-child { border-right: 0; }
.tblock span { display: block; }
.tblock b { font-family: var(--mono); font-size: 12px; font-weight: 500; }

/* ---------- header ---------- */
.hd { position: fixed; top: 0; left: 0; right: 0; z-index: 50; pointer-events: none; }
.hd-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px var(--gut); max-width: none; }
.hd a, .hd button { pointer-events: auto; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 600; font-stretch: 125%; letter-spacing: .02em; font-size: 15px; }
.logo svg { width: 30px; height: 18px; }
.logo path { fill: none; stroke: var(--ink); stroke-width: 1.4; }
.logo circle { fill: var(--red); }
.nav { display: flex; gap: 4px; background: rgba(241, 239, 232, .82); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border: 1px solid var(--hair); padding: 4px; pointer-events: auto; }
.nav a { position: relative; display: block; padding: 7px 12px; font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; overflow: hidden; }
.nav a .roll { display: grid; overflow: hidden; }
.nav a .roll > span { grid-area: 1 / 1; }
.nav a .roll > span + span { transform: translateY(100%); }
.nav a.on { background: var(--ink); color: var(--paper); }
.nav .sh { display: none; }
.hd-r { display: flex; gap: 14px; align-items: center; }
.hd-r .sheetno { min-width: 9ch; text-align: right; }
.hd-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--ink); transform-origin: 0 50%; transform: scaleX(0); opacity: .5; }

/* ---------- buttons ---------- */
.btn { position: relative; display: inline-flex; align-items: center; gap: 12px; height: 52px; padding: 0 22px; background: var(--ink); color: var(--paper); font-family: var(--mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; overflow: hidden; }
.btn > span { display: inline-flex; align-items: center; gap: 12px; position: relative; z-index: 1; }
.btn::after { content: ''; position: absolute; inset: 0; background: var(--paper-3); transform: scaleY(0); transform-origin: 50% 100%; transition: transform .45s cubic-bezier(.16, 1, .3, 1); }
.btn:hover { color: var(--ink); }
.btn:hover::after { transform: scaleY(1); }
.btn i { width: 14px; height: 1px; background: currentColor; position: relative; }
.btn i::after { content: ''; position: absolute; right: 0; top: -3px; width: 7px; height: 7px; border-top: 1px solid currentColor; border-right: 1px solid currentColor; transform: rotate(45deg); transform-origin: 100% 0; }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.btn.sm { height: 40px; padding: 0 16px; font-size: 11px; }
.btn[disabled] { opacity: .35; pointer-events: none; }
.chip { display: inline-flex; align-items: center; height: 34px; padding: 0 12px; border: 1px solid var(--hair); font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; background: var(--paper); transition: border-color .2s; }
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* segmented control with a Flip indicator */
.seg { position: relative; display: inline-flex; border: 1px solid var(--ink); padding: 3px; gap: 0; background: var(--paper); }
.seg button { position: relative; z-index: 1; height: 32px; padding: 0 14px; font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; transition: color .3s; }
.seg button[aria-pressed="true"] { color: var(--paper); }
.seg .ind { position: absolute; z-index: 0; background: var(--ink); pointer-events: none; }

/* ---------- SVG drawing classes ---------- */
.con { fill: none; stroke: var(--ink); stroke-opacity: .2; stroke-width: .75; vector-effect: non-scaling-stroke; }
.con2 { fill: none; stroke: var(--ink); stroke-opacity: .12; stroke-width: .75; }
.hid { fill: none; stroke: var(--ink); stroke-opacity: .32; stroke-width: .9; stroke-dasharray: 3 4; }
.edge { fill: none; stroke: var(--ink); stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.thin { fill: none; stroke: var(--ink); stroke-width: .9; stroke-linejoin: round; stroke-linecap: round; }
.det { fill: none; stroke: var(--ink); stroke-opacity: .5; stroke-width: .7; }
.f-ink { fill: var(--ink); stroke: var(--ink); stroke-width: 1; stroke-linejoin: round; }
.f-pap { fill: var(--paper); stroke: var(--ink); stroke-width: 1.2; stroke-linejoin: round; }
.f-top { fill: #f7f5f0; stroke: var(--ink); stroke-width: 1.2; stroke-linejoin: round; }
.f-side { fill: url(#v-hatch); stroke: var(--ink); stroke-width: 1.2; stroke-linejoin: round; }
.f-dark { fill: url(#v-hatch2); stroke: var(--ink); stroke-width: 1.2; stroke-linejoin: round; }
.f-tone { fill: var(--paper-2); stroke: var(--ink); stroke-width: 1.2; stroke-linejoin: round; }
.nf { stroke: none !important; }
.f-gnd { fill: var(--paper-2); stroke: none; }
.hl { fill: none; stroke: var(--red); stroke-width: 1.25; }
.vpdot { fill: var(--red); }
.vpring { fill: none; stroke: var(--red); stroke-width: 1; }
.svgt { font-family: var(--mono); font-size: 10px; letter-spacing: .08em; fill: var(--ink-2); text-transform: uppercase; }
.svgt.r { fill: var(--red); }

/* ---------- vanishing point handles ---------- */
.stage { position: relative; overflow: hidden; touch-action: pan-y; }
.stage > svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.vp { position: absolute; left: 0; top: 0; width: 44px; height: 44px; margin: -22px 0 0 -22px; z-index: 5; touch-action: none; cursor: grab; }
.vp::before { content: ''; position: absolute; left: 50%; top: 50%; width: 10px; height: 10px; margin: -5px 0 0 -5px; background: var(--red); border-radius: 50%; transition: transform .3s cubic-bezier(.34, 1.56, .64, 1); }
.vp::after { content: ''; position: absolute; left: 50%; top: 50%; width: 28px; height: 28px; margin: -14px 0 0 -14px; border: 1px solid var(--red); border-radius: 50%; transition: transform .4s cubic-bezier(.34, 1.56, .64, 1); }
.vp:hover::after, .vp.on::after { transform: scale(1.35); }
.vp.on::before { transform: scale(.7); }
.vp .vp-l { position: absolute; left: 34px; top: -6px; font-family: var(--mono); font-size: 10px; letter-spacing: .08em; color: var(--red); white-space: nowrap; pointer-events: none; }
.vp .vp-x { position: absolute; left: 50%; top: 50%; pointer-events: none; }
.vp .vp-x::before, .vp .vp-x::after { content: ''; position: absolute; background: var(--red); }
.vp .vp-x::before { width: 44px; height: 1px; left: -22px; top: 0; opacity: .0; }
.vp.hlh { width: 30px; height: 22px; margin: -11px 0 0 0; }
.vp.hlh::before, .vp.hlh::after { display: none; }
.vp.hlh span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: var(--red); color: #fff; font-family: var(--mono); font-size: 10px; letter-spacing: .08em; }
.vp.hlh span::after { content: ''; position: absolute; left: -6px; top: 50%; margin-top: -6px; border-right: 6px solid var(--red); border-top: 6px solid transparent; border-bottom: 6px solid transparent; }
.vp.off::before { border-radius: 0; transform: rotate(45deg) scale(.8); background: transparent; box-shadow: inset 0 0 0 1.5px var(--red); }
.vp.static { cursor: default; pointer-events: none; }

/* ---------- cursor ---------- */
.has-cur, .has-cur * { cursor: none !important; }
.cur { position: fixed; inset: 0; pointer-events: none; z-index: 200; opacity: 0; }
.cur > * { position: absolute; left: 0; top: 0; }
.cur-x { width: 26px; height: 26px; margin: -13px 0 0 -13px; }
.cur-x::before, .cur-x::after { content: ''; position: absolute; background: var(--ink); }
.cur-x::before { left: 12.5px; top: 0; width: 1px; height: 26px; }
.cur-x::after { top: 12.5px; left: 0; height: 1px; width: 26px; }
.cur-o { width: 34px; height: 34px; margin: -17px 0 0 -17px; border: 1px solid var(--ink); border-radius: 50%; transform: scale(.32); }
.cur-o.red { border-color: var(--red); }
.cur-lab { margin: 18px 0 0 18px; padding: 6px 10px; background: var(--ink); color: var(--paper); font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; opacity: 0; }
.cur-xy { margin: -26px 0 0 16px; font-family: var(--mono); font-size: 9.5px; letter-spacing: .06em; color: var(--ink-3); white-space: pre; }
.cur-gh, .cur-gv { background: var(--ink); opacity: 0; }
.cur-gh { left: 0; width: 100vw; height: 1px; opacity: 0; }
.cur-gv { top: 0; height: 100vh; width: 1px; }

/* ---------- preloader and wipe ---------- */
.pre, .wipe { position: fixed; inset: 0; z-index: 150; display: grid; place-items: center; }
.pre { background: var(--paper); }
.pre-in { width: min(560px, 86vw); }
.pre svg { width: 100%; height: auto; }
.pre .pre-row { display: flex; justify-content: space-between; margin-top: 14px; }
.pre-num { font-family: var(--mono); font-size: 13px; }
.wipe { background: var(--ink); color: var(--paper); visibility: hidden; clip-path: polygon(0 0, 0 0, 0 100%, 0 100%); }
html.wiping .wipe { visibility: visible; clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%); }
.wipe-in { text-align: center; }
.wipe svg { width: min(520px, 80vw); height: auto; margin: 0 auto 18px; }
.wipe svg .wl { stroke: var(--paper); stroke-opacity: .35; stroke-width: 1; fill: none; }
.wipe .wipe-t { display: block; font-size: clamp(34px, 6vw, 80px); font-weight: 300; font-stretch: 118%; letter-spacing: -.03em; line-height: 1; margin-top: 8px; }
.wipe .lab { color: var(--ink-3); }

/* ---------- toast ---------- */
.toast { position: fixed; left: 50%; bottom: 20px; z-index: 120; translate: -50% 0; background: var(--ink); color: var(--paper); padding: 12px 16px; display: flex; gap: 12px; align-items: center; font-family: var(--mono); font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; opacity: 0; transform: translateY(160%); pointer-events: none; max-width: calc(100vw - 32px); }
.toast i { width: 8px; height: 8px; border-radius: 50%; background: var(--red); flex: none; }

/* ---------- footer ---------- */
.ft { border-top: 1px solid var(--ink); margin-top: 40px; padding: clamp(50px, 8vw, 110px) 0 24px; }
.ft-big { font-size: clamp(40px, 8.4vw, 132px); line-height: .92; font-weight: 300; font-stretch: 120%; letter-spacing: -.04em; }
.ft-big em { font-style: normal; font-weight: 600; }
.ft-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin-top: clamp(40px, 6vw, 80px); }
.ft-cols > div { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--hair); padding-top: 14px; }
.ft-cols a { width: max-content; font-size: 15px; }
.ft-cols a:hover { text-decoration: underline; text-underline-offset: 4px; }
.ft-note { color: var(--ink-2); font-size: 14px; margin: 0; max-width: 36ch; }
.ft-base { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; margin-top: 48px; padding-top: 14px; border-top: 1px solid var(--hair); }

/* =================== INDEX =================== */
.hero { position: relative; min-height: 100svh; display: flex; flex-direction: column; justify-content: flex-end; overflow: hidden; }
.hero .stage { position: absolute; inset: 0; }
.hero-copy { position: relative; z-index: 6; padding-bottom: clamp(22px, 4vw, 44px); pointer-events: none; }
.hero-copy a, .hero-copy button { pointer-events: auto; }
.hero-row { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 28px; align-items: end; border-top: 1px solid var(--ink); padding-top: 18px; }
.hero-h { margin: 0; font-size: clamp(34px, 5vw, 76px); line-height: .98; font-weight: 300; font-stretch: 120%; letter-spacing: -.035em; }
.hero-h b { font-weight: 600; }
.hero-side { display: flex; flex-direction: column; gap: 18px; align-items: flex-start; }
.ctas { display: flex; gap: 10px; flex-wrap: wrap; }
.hero-read { position: absolute; z-index: 6; top: 74px; left: var(--gut); right: var(--gut); display: flex; justify-content: space-between; gap: 16px; pointer-events: none; }
.hero-read > div { display: flex; flex-direction: column; gap: 4px; }
.hero-read .rd { display: grid; grid-template-columns: 4.5ch 9ch; gap: 8px; }
.hero-read .rd b { font-weight: 500; color: var(--ink); }
.hint { display: flex; align-items: center; gap: 8px; }
.hint i { width: 6px; height: 6px; border-radius: 50%; background: var(--red); }

/* corridor: scroll velocity */
.corr { position: relative; height: clamp(260px, 46vh, 460px); border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); overflow: hidden; background: var(--paper); }
.corr svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.corr-t { position: absolute; left: var(--gut); bottom: 14px; right: var(--gut); display: flex; justify-content: space-between; gap: 12px; z-index: 2; }
.corr-word { position: absolute; inset: 0; display: grid; place-items: center; z-index: 2; pointer-events: none; }
.corr-word span { background: var(--paper); padding: 6px 14px; font-size: clamp(18px, 2.6vw, 34px); font-weight: 400; font-stretch: 122%; letter-spacing: -.01em; border: 1px solid var(--ink); }

/* pinned scenes */
.pin { position: relative; height: 100svh; overflow: hidden; }
.pin-in { position: relative; height: 100%; display: grid; grid-template-columns: minmax(0, 400px) minmax(0, 1fr); gap: clamp(16px, 3vw, 44px); padding-top: 76px; padding-bottom: 24px; }
.pin-copy { display: flex; flex-direction: column; gap: 18px; position: relative; z-index: 3; }
.pin .stage { height: 100%; border: 1px solid var(--ink); background: rgba(241, 239, 232, .7); }
.bignum { font-size: clamp(80px, 11vw, 168px); font-weight: 200; font-stretch: 125%; line-height: .8; letter-spacing: -.06em; display: flex; align-items: flex-end; gap: 14px; }
.bignum small { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; font-weight: 400; text-transform: uppercase; padding-bottom: 8px; color: var(--ink-2); }
.bignum svg { width: 58px; height: 58px; margin-bottom: 6px; }
.bignum svg path { fill: none; stroke: var(--ink); stroke-width: 1.3; }
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.steps li { position: relative; display: grid; grid-template-columns: 34px 1fr; gap: 6px; padding: 12px 0 12px 12px; border-top: 1px solid var(--hair); color: var(--ink-3); transition: color .4s; }
.steps li.on { color: var(--ink); }
.steps li b { font-weight: 600; color: inherit; }
.steps .brk { position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--ink); }
.steps p { margin: 0; font-size: 14.5px; line-height: 1.5; }
.readout { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--ink); }
.readout > div { padding: 7px 10px; border-right: 1px solid var(--hair); min-width: 0; }
.readout > div:last-child { border-right: 0; }
.readout b { display: block; font-family: var(--mono); font-weight: 500; font-size: 13px; margin-top: 2px; white-space: nowrap; }
.stage-lab { position: absolute; z-index: 4; left: 12px; top: 10px; right: 12px; display: flex; justify-content: space-between; gap: 10px; pointer-events: none; }
.stage-lab .big { font-family: var(--disp); text-transform: none; letter-spacing: -.02em; font-size: clamp(20px, 2.4vw, 32px); font-weight: 500; font-stretch: 118%; color: var(--ink); }

.pin2 .pin-in { grid-template-columns: minmax(0, 1fr) minmax(0, 340px); }
.pin2 .pin-copy { order: 2; }
.eye-scale { display: flex; flex-direction: column; gap: 0; border: 1px solid var(--ink); }
.eye-scale > div { display: flex; justify-content: space-between; padding: 8px 10px; border-top: 1px solid var(--hair); color: var(--ink-3); transition: color .3s, background .3s; }
.eye-scale > div:first-child { border-top: 0; }
.eye-scale > div.on { color: var(--paper); background: var(--ink); }

/* VP lab: street + room share one set of points */
.vplab { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 16px; }
.panel { position: relative; border: 1px solid var(--ink); background: rgba(241, 239, 232, .75); }
.panel .ph { position: absolute; z-index: 4; left: 0; right: 0; top: 0; display: flex; justify-content: space-between; gap: 10px; padding: 9px 12px; border-bottom: 1px solid var(--hair); background: rgba(241, 239, 232, .9); pointer-events: none; }
.panel .stage { height: 100%; }
.vplab .panel { height: clamp(340px, 42vw, 600px); }
.vplab-side { display: grid; grid-template-rows: 1fr auto; gap: 16px; }
.vplab-side .panel { height: auto; min-height: 300px; }
.vplab-info { display: flex; flex-direction: column; gap: 14px; }
.vplab-ctl { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); gap: clamp(20px, 4vw, 64px); align-items: start; }
.two.rev { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); }
.two .copy { display: flex; flex-direction: column; gap: 20px; }
.demo { height: clamp(380px, 42vw, 580px); }
.demo-ctl { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.notes { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--hair); }
.notes li { display: grid; grid-template-columns: 34px 1fr; padding: 10px 0; border-bottom: 1px solid var(--hair); font-size: 14.5px; color: var(--ink-2); }
.notes li .lab { padding-top: 3px; }

/* foreshortening dial */
.dial { position: absolute; right: 14px; bottom: 14px; width: 112px; height: 112px; z-index: 5; }
.dial svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.dial-k { position: absolute; inset: 0; touch-action: none; cursor: grab; border-radius: 50%; }
.dial-k i { position: absolute; left: 50%; top: 4px; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: var(--ink); box-shadow: 0 0 0 4px var(--paper), 0 0 0 5px var(--ink); }
.elev { position: absolute; left: 12px; bottom: 12px; width: min(40%, 240px); z-index: 3; background: rgba(241, 239, 232, .92); border: 1px solid var(--hair); }
.elev svg { width: 100%; height: auto; }

/* mistakes */
.mgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--ink); border-left: 1px solid var(--ink); }
.mc { position: relative; display: flex; flex-direction: column; text-align: left; border-right: 1px solid var(--ink); border-bottom: 1px solid var(--ink); padding: 14px; gap: 12px; background: transparent; transition: background .3s; }
.mc:hover { background: rgba(31, 31, 31, .03); }
.mc svg { width: 100%; height: auto; aspect-ratio: 3 / 2; }
.mc .mc-h { display: flex; justify-content: space-between; gap: 8px; }
.mc .mc-s { font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; padding: 3px 7px; border: 1px solid var(--ink); }
.mc[aria-pressed="true"] .mc-s { background: var(--ink); color: var(--paper); }
.mc p { margin: 0; color: var(--ink-2); font-size: 14px; line-height: 1.5; }
.mc .bad { fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-dasharray: 5 4; stroke-linecap: round; }
.mc[aria-pressed="true"] .bad { stroke-dasharray: none; }

/* next */
.next { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.nc { position: relative; display: flex; flex-direction: column; gap: 18px; border: 1px solid var(--ink); padding: 18px; min-height: 320px; overflow: hidden; }
.nc svg { width: 100%; height: 150px; }
.nc .go { display: flex; justify-content: space-between; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--hair); }
.nc::after { content: ''; position: absolute; inset: 0; background: var(--ink); clip-path: inset(100% 0 0 0); transition: clip-path .6s cubic-bezier(.76, 0, .24, 1); z-index: 0; }
.nc > * { position: relative; z-index: 1; transition: color .4s; }
.nc:hover::after { clip-path: inset(0 0 0 0); }
.nc:hover > * { color: var(--paper); }
.nc:hover .con, .nc:hover .edge { stroke: var(--paper); }
.nc .edge, .nc .con { transition: stroke .4s; }

/* =================== DRAFTING =================== */
.dr { padding-top: 70px; }
.dr-top { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; padding: 26px 0 16px; border-bottom: 1px solid var(--ink); }
.dr-top .h2 { font-size: clamp(34px, 4.6vw, 64px); }
.dr-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; padding: 16px 0 40px; }
.dr-board { height: min(74svh, 760px); min-height: 420px; border: 1px solid var(--ink); }
.dr-board .stage { height: 100%; touch-action: none; background: rgba(241, 239, 232, .65); }
.dr-side { display: flex; flex-direction: column; gap: 14px; }
.box-sec { border: 1px solid var(--ink); }
.box-sec > .lab { display: flex; justify-content: space-between; padding: 9px 12px; border-bottom: 1px solid var(--hair); }
.box-sec .in { padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.tog { display: flex; justify-content: space-between; align-items: center; width: 100%; padding: 6px 0; font-size: 14px; }
.tog .sw { width: 38px; height: 20px; border: 1px solid var(--ink); position: relative; flex: none; }
.tog .sw::after { content: ''; position: absolute; top: 3px; left: 3px; width: 12px; height: 12px; background: var(--ink); transition: transform .35s cubic-bezier(.34, 1.56, .64, 1); }
.tog[aria-pressed="true"] .sw { background: var(--ink); }
.tog[aria-pressed="true"] .sw::after { background: var(--paper); transform: translateX(18px); }
.rng { display: flex; flex-direction: column; gap: 6px; }
.rng-h { display: flex; justify-content: space-between; }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 22px; background: transparent; margin: 0; }
input[type=range]::-webkit-slider-runnable-track { height: 1px; background: var(--ink); }
input[type=range]::-moz-range-track { height: 1px; background: var(--ink); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; margin-top: -7px; background: var(--paper); border: 1px solid var(--ink); }
input[type=range]::-moz-range-thumb { width: 12px; height: 12px; border-radius: 0; background: var(--paper); border: 1px solid var(--ink); }
input[type=range]:disabled { opacity: .35; }
.blist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; max-height: 210px; overflow: auto; scrollbar-width: thin; overscroll-behavior: contain; }
.blist li button { width: 100%; display: flex; justify-content: space-between; gap: 8px; padding: 8px 10px; border: 1px solid var(--hair); font-family: var(--mono); font-size: 11px; letter-spacing: .04em; text-align: left; }
.blist li button[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.blist .empty { color: var(--ink-3); font-size: 13px; padding: 6px 0; }
.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.btn-row .btn { justify-content: center; padding: 0 10px; }
.dr-help { position: absolute; z-index: 4; left: 12px; bottom: 12px; pointer-events: none; display: flex; flex-direction: column; gap: 4px; }
.ghost-box { fill: rgba(31, 31, 31, .06); stroke: var(--ink); stroke-width: 1; stroke-dasharray: 4 3; }
.sel-o { fill: none; stroke: var(--ink); stroke-width: 2.6; stroke-linejoin: round; }

/* =================== GAME =================== */
.gm { padding-top: 70px; }
.gm-top { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; padding: 26px 0 16px; border-bottom: 1px solid var(--ink); }
.gm-top .h2 { font-size: clamp(34px, 4.6vw, 64px); }
.gm-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; padding: 16px 0 40px; }
.gm-board { position: relative; height: min(70svh, 700px); min-height: 400px; border: 1px solid var(--ink); }
.gm-board .stage { height: 100%; background: rgba(241, 239, 232, .65); }
.gm-q { position: absolute; z-index: 4; left: 12px; top: 10px; right: 12px; display: flex; justify-content: space-between; gap: 10px; pointer-events: none; }
.gm-q .big { font-size: clamp(18px, 2vw, 26px); font-weight: 500; font-stretch: 115%; letter-spacing: -.015em; }
.gm-foot { position: absolute; z-index: 4; left: 12px; right: 12px; bottom: 12px; display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; pointer-events: none; }
.gm-foot .btn { pointer-events: auto; }
.res { position: absolute; z-index: 6; left: 12px; bottom: 12px; background: var(--ink); color: var(--paper); padding: 16px 18px; width: min(300px, calc(100% - 24px)); visibility: hidden; text-align: left; }
.res .n { font-size: 52px; font-weight: 300; font-stretch: 120%; letter-spacing: -.04em; line-height: 1; }
.res .row { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.res .btn { background: var(--paper); color: var(--ink); }
.res .btn::after { background: var(--paper-3); }
.score-big { display: flex; align-items: baseline; justify-content: space-between; padding: 12px; }
.score-big b { font-size: 54px; font-weight: 300; font-stretch: 120%; letter-spacing: -.04em; line-height: 1; }
.pips { display: flex; gap: 4px; padding: 0 12px 12px; }
.pips i { flex: 1; height: 6px; border: 1px solid var(--ink); }
.pips i.done { background: var(--ink); }
.pips i.cur { background: var(--paper-3); }
.hist { list-style: none; margin: 0; padding: 0; }
.hist li { display: flex; justify-content: space-between; padding: 7px 12px; border-top: 1px solid var(--hair); font-family: var(--mono); font-size: 11.5px; }
.hist li:first-child { border-top: 0; }
.hit { fill: none; stroke: transparent; stroke-width: 22; pointer-events: stroke; cursor: pointer; }
.cand { fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-linecap: round; pointer-events: none; transition: stroke-width .2s; }
.cand.hov { stroke-width: 3; }
.cand.ok { stroke-width: 2.4; }
.cand.miss { stroke-dasharray: 5 4; }
.guess { stroke: var(--ink); stroke-width: 1; stroke-dasharray: 3 3; fill: none; }

/* =================== responsive =================== */
@media (max-width: 1000px) {
  .pin-in, .pin2 .pin-in { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); gap: 12px; padding-top: 66px; }
  .pin2 .pin-copy { order: 0; }
  .pin-copy { gap: 10px; }
  .pin .steps li { display: none; }
  .pin .steps li.on { display: grid; }
  .pin .readout { display: none; }
  .bignum { font-size: 64px; }
  .bignum svg { width: 40px; height: 40px; }
  .vplab { grid-template-columns: minmax(0, 1fr); }
  .two, .two.rev { grid-template-columns: minmax(0, 1fr); }
  .two.rev .copy { order: -1; }
  .mgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dr-grid, .gm-grid { grid-template-columns: minmax(0, 1fr); }
  .hero-row { grid-template-columns: minmax(0, 1fr); gap: 16px; }
}
@media (max-width: 640px) {
  .nav .lg { display: none; }
  .nav .sh { display: inline; }
  .nav a { padding: 7px 9px; }
  .hd-r .sheetno { display: none; }
  .logo span { display: none; }
  .hero-read .rd:nth-child(n+4) { display: none; }
  .hero-read > div:last-child { display: none; }
  .mgrid { grid-template-columns: minmax(0, 1fr); }
  .next { grid-template-columns: minmax(0, 1fr); }
  .ft-cols { grid-template-columns: minmax(0, 1fr); }
  .readout { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pin .steps p { font-size: 13.5px; }
  .pin .p { display: none; }
  .tblock { grid-template-columns: repeat(2, auto); }
  .tblock > div:nth-child(2) { border-right: 0; }
  .tblock > div:nth-child(-n+2) { border-bottom: 1px solid var(--ink); }
  .btn { height: 46px; padding: 0 16px; }
  .elev { width: 54%; }
  /* compact results strip: sits over the hint row only, below the scene */
  .res { left: 8px; right: 8px; bottom: 8px; width: auto; padding: 10px 12px; display: grid; grid-template-columns: auto 1fr; grid-template-areas: "l l" "n p" "b b"; column-gap: 12px; align-items: center; }
  .res #gResL { grid-area: l; }
  .res .n { grid-area: n; font-size: 34px; }
  .res #gResP { grid-area: p; margin: 0 !important; font-size: 10px; }
  .res .row { grid-area: b; margin-top: 8px; }
  .res .btn { height: 36px; }
  .dial { width: 92px; height: 92px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
