/* Hallmark · pre-emit critique: P5 H4 E4 S5 R4 V5 */
/* Hallmark · macrostructure: pinned reveal, hero card shrinking off four rising columns · genre: modern-minimal · theme: studied-DNA (source: Realevate, brand/INSPO.md) · nav: three-part with centred wordmark · footer: statement line */
/* HANDSIQ. Paper white, carmine type, four deep panels, one cut stone. */
@font-face { font-family: 'Google Sans'; src: url('/assets/fonts/google-sans.woff2') format('woff2'); font-weight: 400 500; font-display: swap; }

:root {
  --paper: #ffffff;
  --stone: #e8e5e0;
  --ink: #1d1013;
  --soft: #6d5f62;
  --line: #e2dcd8;
  --carmine: #b50f35;
  --malachite: #1c4a3e;
  --aubergine: #2e1523;
  --coal: #171314;
  --cream: #ede6d6;
  --cream-soft: #d9cec6;
  --tile: #f5f1ea;
  --rule-strong: var(--rule-strong);
  --rule-faint: var(--rule-faint);
  --font: 'Google Sans', system-ui, sans-serif;
  --m: clamp(16px, 2.1vw, 40px);
  --ease: cubic-bezier(.22, .8, .2, 1);
  --ui: clamp(14px, .72vw, 20px);
  --ctl: clamp(36px, 1.9vw, 52px);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 16px/1.45 var(--font); -webkit-font-smoothing: antialiased; overflow-x: clip; }
h1, h2, h3, p, ol, ul, dl, dd, figure { margin: 0; padding: 0; }
ol, ul { list-style: none; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--carmine); outline-offset: 3px; }
.hold :focus-visible, .end :focus-visible { outline-color: var(--cream); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: fixed; left: 12px; top: -60px; z-index: 50; background: var(--ink); color: var(--paper); padding: 8px 16px; }
.skip:focus { top: 12px; }

/* ---- header ---- */
.bar { position: fixed; inset: 0 0 auto 0; z-index: 30; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 20px var(--m); pointer-events: none; transition: color .3s, background .3s; }
.bar > * { pointer-events: auto; }
.bar.solid { background: var(--paper); box-shadow: 0 1px 0 var(--line); pointer-events: auto; transition: transform .45s var(--ease), background .3s; padding-top: 12px; padding-bottom: 12px; }
.bar.tuck { transform: translateY(-101%); }
.bar-left { display: flex; align-items: center; gap: 28px; font-size: var(--ui); }
.bar-left a { position: relative; white-space: nowrap; }
.bar-left a::before { content: ''; position: absolute; left: 0; right: 0; bottom: -3px; height: 1px; background: currentColor; transform: scaleX(0); transform-origin: right; transition: transform .45s var(--ease); }
.bar-left a:hover::before { transform: scaleX(1); transform-origin: left; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 500; font-size: 17px; letter-spacing: .08em; color: var(--carmine); }
.bar-right { display: flex; justify-content: flex-end; align-items: center; gap: 8px; font-size: var(--ui); }
.pair { color: var(--soft); margin-right: 4px; }
.pair a { text-decoration: underline; text-underline-offset: 3px; }
.ca { height: var(--ctl); padding: 0 12px; background: transparent; border: 1px solid var(--line); border-radius: 2px; cursor: pointer; white-space: nowrap; color: var(--soft); background: var(--paper); }
.ca:disabled { cursor: not-allowed; }
.ca:not(:disabled) { color: var(--ink); }
.ico { width: var(--ctl); height: var(--ctl); display: inline-grid; place-items: center; border: 1px solid var(--line); border-radius: 2px; background: var(--paper); transition: background .25s, color .25s, border-color .25s; }
.ico:hover { background: var(--carmine); border-color: var(--carmine); color: var(--paper); }
.btn { height: var(--ctl); display: inline-flex; align-items: center; gap: 8px; padding: 0 16px; background: var(--paper); border: 1px solid var(--line); border-radius: 2px; cursor: pointer; white-space: nowrap; font-size: var(--ui); transition: background .25s, color .25s, border-color .25s; }
.btn:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn[aria-disabled="true"], .btn:disabled { color: var(--soft); cursor: not-allowed; }
.btn[aria-disabled="true"]:hover, .btn:disabled:hover { background: var(--paper); color: var(--soft); border-color: var(--line); }
.btn-ink { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn-ink:hover { background: var(--carmine); border-color: var(--carmine); }
.btn-ink:disabled { background: transparent; }
.btn-go { background: var(--carmine); color: var(--paper); border-color: var(--carmine); height: clamp(48px, 2.5vw, 68px); padding: 0 24px; font-weight: 500; font-size: clamp(15px, .8vw, 21px); }
.btn-go:hover { background: var(--ink); border-color: var(--ink); }
.btn-go:disabled, .btn-go:disabled:hover { background: var(--carmine); color: var(--paper); border-color: var(--carmine); opacity: .55; }
.btn:active, .ico:active, .pick:active, .row:active, .ca:not(:disabled):active { translate: 0 1px; }
.btn:disabled:active, .btn[aria-disabled="true"]:active { translate: none; }
.pick:disabled, .row:disabled, .foot-tape button:disabled, .grade input:disabled { opacity: .55; cursor: not-allowed; }

/* ---- stage: hero over report ---- */
.stage { position: relative; height: 100vh; height: 100svh; min-height: 640px; overflow: hidden; background: var(--stone); }
.hero { position: absolute; inset: 0; z-index: 2; background: var(--paper); transform-origin: 50% 100%; will-change: transform; }

/* the running line, with the window in front of it */
.run { position: absolute; left: 0; right: 0; top: 41%; transform: translateY(-50%); overflow: hidden; white-space: nowrap; line-height: 1.15; pointer-events: none; }
.run-track { display: inline-block; will-change: transform; font-size: clamp(84px, 15.2vw, 420px); font-weight: 400; letter-spacing: -.035em; color: var(--carmine); }
.run-track span { display: inline-block; padding-right: .42em; }
.window { position: absolute; left: 50%; top: 41%; width: clamp(180px, min(25vw, 44vh), 720px); aspect-ratio: 1; transform: translate(-50%, -50%); background: var(--carmine); overflow: hidden; z-index: 1; transition: scale .7s var(--ease); }
.window canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.window.no-gl { background: var(--carmine) url('/assets/img/logo.png') center/70% no-repeat; }
.window:hover { scale: 1.12; }

/* the desk: the working tool, under the window */
.desk { position: absolute; left: 50%; top: calc(41% + clamp(100px, min(12.5vw, 22vh), 360px) + 22px); transform: translateX(-50%); width: min(max(880px, 46vw), calc(100% - 2 * var(--m))); text-align: center; z-index: 2; }
.pitch { font-size: clamp(15px, 1.2vw, 22px); line-height: 1.3; }
.grade { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; margin-top: 16px; text-align: left; }
.grade label { display: block; position: relative; }
.grade label span { position: absolute; left: 12px; top: 6px; font-size: 11px; color: var(--soft); }
.grade input { width: 100%; height: clamp(48px, 2.5vw, 68px); padding: 20px 12px 4px; background: var(--paper); border: 1px solid var(--line); border-radius: 2px; font-size: var(--ui); min-width: 0; outline: 2px solid transparent; outline-offset: 1px; transition: border-color .25s; }
.grade input:hover { border-color: var(--soft); }
.grade input:focus-visible { outline: 2px solid var(--carmine); outline-offset: 1px; }
.grade input::placeholder { color: var(--soft); }
.picks { display: flex; align-items: center; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 8px; }
.pick { display: inline-flex; align-items: center; gap: 8px; height: 28px; padding: 0 8px 0 4px; font-size: 13px; white-space: nowrap; background: var(--paper); border: 1px solid var(--line); border-radius: 2px; cursor: pointer; transition: border-color .2s, color .2s; }
.pick:hover { border-color: var(--carmine); color: var(--carmine); }
.pick img { width: 20px; height: 20px; border-radius: 2px; object-fit: cover; }
.status { min-height: 20px; margin-top: 8px; font-size: 13.5px; color: var(--soft); font-variant-numeric: tabular-nums; }
.status.bad { color: var(--carmine); }

.foot { position: absolute; left: var(--m); right: var(--m); bottom: 18px; display: grid; grid-template-columns: 1fr minmax(0, 2.4fr) 1fr; align-items: center; gap: 16px; font-size: clamp(13.5px, .72vw, 19px); z-index: 2; }
.foot-left { color: var(--soft); }
.foot-tape { text-align: center; text-wrap: balance; line-height: 1.3; }
.foot-tape button { background: none; border: 0; padding: 0; cursor: pointer; }
.foot-tape button:hover { color: var(--carmine); }
.foot-tape b { font-weight: 500; }
.foot-open { justify-self: end; }

/* ---- the report ---- */
.report { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 12px; padding: calc(var(--m) * .9) var(--m) 12px; padding-top: 72px; }
.panels { flex: 1; min-height: 0; display: flex; gap: 12px; }
.panel { flex: 1 1 0; min-width: 0; position: relative; display: flex; flex-direction: column; color: var(--cream); overflow: hidden; transition: flex-grow .7s var(--ease); }
@media (hover: hover) and (min-width: 901px) { .panel:hover, .panel:focus-within { flex-grow: 1.32; } }
.p-carat { background: var(--carmine); }
.p-clarity { background: var(--malachite); }
.p-colour { background: var(--aubergine); }
.p-cut { background: var(--coal); }
.mk { position: absolute; left: 16px; top: 16px; }
.turn { position: absolute; right: 14px; top: 14px; writing-mode: vertical-rl; transform: rotate(180deg); font-size: clamp(28px, 3.25vw, 88px); font-weight: 400; line-height: 1; letter-spacing: -.02em; white-space: nowrap; max-height: calc(58% - 30px); }
.cap { position: absolute; left: 16px; bottom: calc(42% + 14px); width: min(58%, 300px); font-size: clamp(12.5px, .92vw, 17px); line-height: 1.3; }
.tile { position: absolute; left: 0; right: 0; bottom: 0; height: 42%; background: var(--tile); color: var(--ink); overflow: hidden; }
.tile svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.tile .blank { position: absolute; inset: 0; display: grid; place-items: center; color: var(--soft); font-size: 13px; padding: 16px; text-align: center; }
.tray { flex: 0 0 auto; display: grid; grid-template-columns: 1fr minmax(0, 1.5fr) 1fr; gap: 20px; align-items: center; background: var(--paper); padding: clamp(12px, 1.6vh, 24px) clamp(16px, 1.4vw, 28px); }
.tray-who { font-size: clamp(14px, .85vw, 21px); min-width: 0; }
.tray-who a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line); }
.tray-who a:hover { text-decoration-color: currentColor; }
.soft { color: var(--soft); font-size: clamp(13px, .72vw, 18px); }
.tray-score { text-align: center; }
.iq { display: inline-flex; align-items: baseline; gap: .28em; font-size: clamp(30px, 3.4vw, 92px); line-height: 1.02; letter-spacing: -.03em; color: var(--carmine); white-space: nowrap; }
.iq strong { font-weight: 500; font-variant-numeric: tabular-nums; }
.line { font-size: clamp(14px, 1.12vw, 22px); margin-top: 4px; }
.tray-do { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }

/* ---- sections ---- */
.sec-head { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 32px; align-items: end; margin-bottom: clamp(28px, 4vw, 64px); }
.sec-head h2 { font-size: clamp(40px, 6.1vw, 170px); font-weight: 400; line-height: 1; letter-spacing: -.035em; color: var(--carmine); text-wrap: balance; overflow-wrap: anywhere; min-width: 0; }
.sec-head p { font-size: clamp(15px, 1.15vw, 22px); line-height: 1.38; max-width: 56ch; justify-self: end; }
.mask .ln { display: block; overflow: hidden; padding-bottom: .1em; margin-bottom: -.1em; }
.mask .ln > span { display: block; }

.bench { padding: clamp(64px, 9vw, 160px) var(--m); background: var(--paper); position: relative; z-index: 1; }
.bench-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(20px, 2.4vw, 48px); }
.col h3, .side h3, .limits h3, .scales h3 { font-size: clamp(19px, 1.5vw, 28px); font-weight: 500; letter-spacing: -.01em; }
.col h3 { padding-bottom: 12px; border-bottom: 1px solid var(--ink); }
.rows li { border-bottom: 1px solid var(--line); }
.row { width: 100%; display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px 8px 12px 0; background: none; border: 0; text-align: left; cursor: pointer; }
.row > :not(.v) { transition: transform .35s var(--ease); }
.row:hover > :not(.v) { transform: translateX(8px); }
.row img, .row .noimg { width: 30px; height: 30px; object-fit: cover; border-radius: 2px; background: var(--stone); display: block; }
.row .a { min-width: 0; font-size: 14.5px; line-height: 1.25; }
.row .a b { font-weight: 500; }
.row .a small { display: block; color: var(--soft); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .v { font-size: clamp(20px, 1.7vw, 32px); letter-spacing: -.02em; font-variant-numeric: tabular-nums; color: var(--carmine); }
.row-t { grid-template-columns: minmax(0, 1fr) auto; }
.row .v.usd { font-size: 15px; letter-spacing: 0; color: var(--ink); }
.note { margin-top: 12px; color: var(--soft); font-size: 13.5px; }
.none { padding: 20px 0; color: var(--soft); font-size: 14.5px; max-width: 46ch; }

.hold { padding: clamp(64px, 9vw, 160px) var(--m); background: var(--aubergine); color: var(--cream); position: relative; z-index: 1; }
.hold .sec-head h2 { color: var(--cream); }
.hold-grid { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 80px); }
.board-head, .board-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) 62px minmax(0, .8fr) 52px; gap: 16px; align-items: baseline; font-variant-numeric: tabular-nums; }
.board-head { padding-bottom: 12px; border-bottom: 1px solid var(--rule-strong); font-size: 14px; color: var(--cream-soft); }
.board-head span:nth-child(n+3), .board-row > :nth-child(n+3) { text-align: right; }
.board-row { padding: 12px 0; border-bottom: 1px solid var(--rule-faint); font-size: 15px; }
.board-row a:hover { text-decoration: underline; text-underline-offset: 3px; }
.board-row .i { font-size: 20px; letter-spacing: -.02em; }
.empty { font-size: clamp(17px, 1.5vw, 28px); line-height: 1.32; padding: clamp(24px, 3.4vw, 56px) 0 clamp(24px, 3.4vw, 56px); letter-spacing: -.01em; max-width: 34em; }
.side .empty { font-size: 15.5px; padding: 12px 0 28px; color: var(--cream-soft); }
.side h3 { padding-bottom: 12px; border-bottom: 1px solid var(--rule-strong); }
.breaks li { padding: 8px 0; border-bottom: 1px solid var(--rule-faint); font-size: 14.5px; font-variant-numeric: tabular-nums; }
.breaks small { display: block; color: var(--cream-soft); font-size: 13px; }
.terms { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(20px, 2.4vw, 48px); margin-top: clamp(32px, 4.4vw, 80px); }
.terms div { padding-top: 16px; border-top: 1px solid var(--rule-strong); }
.terms dt { min-width: 0; overflow-wrap: anywhere; font-size: clamp(44px, 6.1vw, 170px); line-height: 1.04; letter-spacing: -.035em; }
.terms dd { margin-top: 12px; font-size: clamp(15px, 1.15vw, 22px); line-height: 1.36; color: var(--cream-soft); max-width: 46ch; }

.method { padding: clamp(64px, 9vw, 160px) var(--m) clamp(48px, 6vw, 100px); background: var(--paper); position: relative; z-index: 1; }
.calc { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: clamp(24px, 4vw, 80px); align-items: stretch; }
.calc-in { display: flex; flex-direction: column; gap: 24px; }
.calc-in label span { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; margin-bottom: 8px; }
.calc-in output { font-weight: 500; font-variant-numeric: tabular-nums; }
input[type="range"] { width: 100%; height: 28px; appearance: none; -webkit-appearance: none; background: transparent; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { height: 2px; background: var(--ink); }
input[type="range"]::-moz-range-track { height: 2px; background: var(--ink); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; margin-top: -8px; background: var(--carmine); transform: rotate(45deg); border: 0; }
input[type="range"]::-moz-range-thumb { width: 18px; height: 18px; background: var(--carmine); transform: rotate(45deg); border: 0; border-radius: 0; }
.formula { padding-top: 20px; border-top: 1px solid var(--line); font-size: 15.5px; line-height: 1.4; }
.calc-out { position: relative; background: var(--tile); padding: clamp(16px, 1.6vw, 28px); }
.calc-iq { margin-top: auto; font-size: clamp(56px, 8vw, 220px); letter-spacing: -.04em; line-height: 1; color: var(--carmine); font-variant-numeric: tabular-nums; }
.calc-iq strong { font-weight: 400; }
.calc-out svg { width: 100%; height: auto; display: block; }
.calc-out figcaption { color: var(--soft); font-size: 13.5px; margin-top: 8px; }
.scales { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(16px, 2.2vw, 44px); margin-top: clamp(40px, 5vw, 88px); }
.scales > div { border-top: 1px solid var(--ink); padding-top: 12px; }
.scales p { margin-top: 8px; font-size: 15px; line-height: 1.42; }
.limits { margin-top: clamp(40px, 5vw, 88px); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: clamp(16px, 4vw, 80px); }
.limits li { padding: 12px 0; border-top: 1px solid var(--line); font-size: 15.5px; line-height: 1.42; max-width: 72ch; }

.end { background: var(--carmine); color: var(--cream); padding: clamp(24px, 3vw, 48px) 0 20px; overflow: hidden; position: relative; z-index: 1; }
.run-end { position: static; transform: none; }
.run-end .run-track { color: var(--cream); }
.end-row { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 20px var(--m) 0; font-size: 14px; }
.end-links { display: flex; align-items: center; gap: 8px; }
.end .ico { background: transparent; border-color: var(--rule-strong); }
.end .ico:hover { background: var(--cream); color: var(--carmine); border-color: var(--cream); }

/* ---- narrow screens: the bar drops to two rows, nothing pins, panels sit in a 2x2 ---- */
@media (max-width: 1180px) { .bar-left { display: none; } .bar { grid-template-columns: auto 1fr; } }
@media (max-width: 900px) {
  :root { --ctl: 32px; }
  .bar { position: relative; padding: 12px var(--m) 8px; gap: 8px; grid-template-columns: 1fr; justify-items: center; background: var(--paper); }
  .bar-right { flex-wrap: wrap; justify-content: center; gap: 8px; font-size: 13px; }
  .ca, .btn { padding: 0 8px; font-size: 13px; }
  .btn-go { height: 48px; font-size: 15px; }
  .stage { display: flex; flex-direction: column; height: auto; min-height: 0; overflow: visible; background: var(--paper); }
  .hero { position: relative; inset: auto; order: -1; padding-bottom: 16px; }
  .run { top: calc(14px + 26vw); }
  .run-track { font-size: 25vw; }
  .window { position: relative; left: auto; top: auto; transform: none; width: 52vw; margin: 16px auto 0; }
  .window:hover { scale: 1; }
  .desk { position: relative; left: auto; top: auto; transform: none; width: auto; margin: 16px var(--m) 0; }
  .pitch br.wide { display: none; }
  .grade { grid-template-columns: 1fr; }
  .btn-go { justify-content: center; }
  .foot { position: relative; left: auto; right: auto; bottom: auto; margin: 20px var(--m) 0; grid-template-columns: 1fr; text-align: center; gap: 12px; }
  .foot-open { justify-self: center; }
  .report { position: relative; inset: auto; padding: 0 var(--m) 28px; background: var(--paper); }
  .panels { display: grid; grid-template-columns: 1fr; flex: none; }
  .panel { height: 112vw; max-height: 680px; }
  .turn { font-size: 46px; max-height: 50%; }
  .cap { font-size: 14px; width: calc(100% - 92px); }
  .tray { grid-template-columns: 1fr; text-align: center; order: -1; margin-bottom: 8px; padding: 20px 0 8px; }
  .tray-do { justify-content: center; }
  .iq { font-size: 44px; }
  .sec-head { grid-template-columns: 1fr; gap: 16px; }
  .sec-head p { justify-self: start; }
  .sec-head h2 { font-size: 46px; }
  .bench-grid { grid-template-columns: 1fr; gap: 36px; }
  .hold-grid { grid-template-columns: 1fr; }
  .board-head, .board-row { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) 38px 46px; gap: 8px; }
  .board-head span:nth-child(4), .board-row > :nth-child(4) { display: none; }
  .calc { grid-template-columns: 1fr; }
  .calc-iq { font-size: 64px; }
  .terms { grid-template-columns: 1fr; }
  .scales { grid-template-columns: 1fr 1fr; }
  .limits { grid-template-columns: 1fr; }
  .end-row { flex-direction: column; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
