/* gin-craze: garret dark, gin-lane gold. Light + dark via html.dark outside the scene. */
@font-face {
  font-family: Fraunces; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("fonts/fraunces-normal-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: Fraunces; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("fonts/fraunces-normal-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Source Serif 4"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("fonts/source-serif-4-normal-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Source Serif 4"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("fonts/source-serif-4-normal-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
:root {
  --paper: #f3eee1;
  --paper-2: #e7dfc9;
  --ink: #23201a;
  --ink-soft: #38332a;
  --muted: #414755;
  --line: #c9c0a6;
  --accent: #7a3b12;
  --accent-ink: #faf6ea;
  --chip: #e2d9bf;
  --card: #faf7ee;
  --good: #175c30;
  --bad: #a01c1c;
  --focus: #1a4fd6;
  --shadow: 0 1px 2px rgba(35, 32, 26, 0.12), 0 4px 18px rgba(35, 32, 26, 0.08);
  --radius: 10px;
  --measure: 42rem;
  --bar-h: 44px;
}
html.dark {
  --paper: #141210;
  --paper-2: #201c17;
  --ink: #ece7da;
  --ink-soft: #d3ccbc;
  --muted: #a8a193;
  --line: #38322a;
  --accent: #e0a54c;
  --accent-ink: #171310;
  --chip: #272218;
  --card: #1c1915;
  --good: #7fd79a;
  --bad: #f08a8a;
  --focus: #9db9ff;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 4px 18px rgba(0, 0, 0, 0.35);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Source Serif 4", Georgia, "Times New Roman", serif;
  font-size: 1.075rem;
  line-height: 1.65;
}
h1, h2, h3, .kicker, .topbar, .rail, .chip, button, input {
  font-family: Fraunces, "Source Serif 4", Georgia, serif;
}
a { color: var(--accent); }
a:visited { color: var(--accent); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
main { display: block; }
.wrap { max-width: var(--measure); margin: 0 auto; padding: 0 1.25rem; }
section { scroll-margin-top: calc(var(--bar-h) + 12px); padding: 2.5rem 0 0.5rem; }
h2 { font-size: 1.7rem; line-height: 1.25; margin: 0 0 0.6rem; letter-spacing: -0.01em; }
h2 .anchor { color: inherit; text-decoration: none; }
h2 .anchor:hover { text-decoration: underline; }
.eyebrow {
  font-size: 0.8rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 0.4rem;
}
.lede { font-size: 1.2rem; color: var(--ink-soft); margin-top: 0; }

/* ------------------------------------------------------------ topbar */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 0.75rem;
  min-height: var(--bar-h); padding: 0 0.9rem;
  background: var(--paper); border-bottom: 1px solid var(--line);
}
.topbar .home { font-weight: 700; text-decoration: none; color: var(--ink); white-space: nowrap; }
.topnav { display: flex; gap: 0.15rem; overflow-x: auto; min-width: 0; flex: 0 1 auto; }
.topbar .home, .topbar .chip, .topbar .icon-btn { flex-shrink: 0; }
.topnav a {
  color: var(--ink-soft); text-decoration: none; font-size: 0.92rem;
  padding: 0.3rem 0.55rem; border-radius: 6px; white-space: nowrap;
}
.topnav a:hover { background: var(--chip); color: var(--ink); }
.topbar .spacer { flex: 1 1 auto; }
.topbar .chip {
  border: 1px solid var(--line); border-radius: 999px; padding: 0.15rem 0.7rem;
  font-size: 0.85rem; text-decoration: none; color: var(--ink); background: var(--card);
  white-space: nowrap; min-height: 44px; display: inline-flex; align-items: center;
}
.icon-btn {
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  border-radius: 999px; width: 44px; height: 44px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; padding: 0;
}

/* ---------------------------------------------------------------- rail */
.rail {
  position: fixed; right: 0.6rem; top: 50%; transform: translateY(-50%);
  display: none; flex-direction: column; gap: 0.35rem; z-index: 40;
}
@media (min-width: 1100px) { .rail { display: flex; } }
.rail a {
  position: relative; display: flex; align-items: center; justify-content: flex-end;
  text-decoration: none; color: var(--muted); font-size: 0.75rem;
  min-width: 44px; min-height: 44px;
}
.rail a i { width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--line); flex: none; }
.rail a span {
  position: absolute; right: 100%; margin-right: 0.4rem; white-space: nowrap;
  opacity: 0; transition: opacity 0.15s; pointer-events: none;
}
.rail a:hover span, .rail a:focus-visible span { opacity: 1; }

/* ------------------------------------------- scroll scene: the garret */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.work { position: relative; overflow: clip; padding: 0; background: #171310; color: #e9ecf1; }
.work a { color: #f2c35b; }
.scene-wrap { display: none; }
html.js .scene-wrap { display: block; position: sticky; top: 0; height: 100vh; height: 100svh; margin-bottom: -100vh; margin-bottom: -100svh; }
html.js.no-scene .scene-wrap { display: none; }
#scene { display: block; width: 100%; height: 100%; }
.work .step { position: relative; z-index: 1; display: flex; align-items: center; min-height: 100vh; min-height: 100svh; padding: calc(var(--bar-h) + 1rem) 1.25rem 2rem; scroll-margin-top: 0; }
.work .step .card {
  max-width: 27rem; background: rgba(23, 19, 16, 0.88); border: 1px solid rgba(217, 164, 65, 0.4);
  border-radius: var(--radius); padding: 1.2rem 1.3rem; box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
@media (min-width: 900px) { .work .step { padding-left: max(2rem, 5vw); } }
@media (max-width: 699px) {
  html.js .work .step { align-items: flex-end; padding-bottom: 1.5rem; }
  html.js .work .step:not(.hero) { min-height: 118svh; }
  .work .step .card { font-size: 0.97rem; line-height: 1.55; padding: 1rem 1.05rem; }
  .work .step h2 { font-size: 1.3rem; }
}
.work .step h2 { font-size: clamp(1.35rem, 3.4vw, 1.75rem); line-height: 1.2; margin: 0 0 0.6rem; }
.work .step h2 a.anchor { color: #e9ecf1; text-decoration: none; }
.work .step p { margin: 0 0 0.6rem; color: #d5dbe4; }
.work .step strong[data-out] { color: #f2c35b; font-weight: 700; }
.work .hero .card { max-width: 32rem; }
.work .hero h1 { color: #fff; font-size: clamp(2.1rem, 6vw, 3.4rem); line-height: 1.05; margin: 0.2rem 0 0.8rem; }
.work .kicker { color: #f2c35b; letter-spacing: 0.12em; font-size: 0.78rem; margin: 0; }
.work .hero-answer { font-size: 1.15rem; color: #e9ecf1; border-left: 4px solid #f2c35b; padding-left: 0.8rem; }
.work .deck { font-size: 1.08rem; color: #e9ecf1; }
.work .cta { background: #f2c35b; color: #171310 !important; display: inline-block; font-weight: 700; text-decoration: none; padding: 0.6rem 1.3rem; border-radius: 999px; }
.work .step figure { margin: 0.8rem 0 0; }
.work .step figure img { border-color: rgba(217, 164, 65, 0.4); }
.work .step figcaption { color: #a8a193; }
@media (prefers-reduced-motion: reduce) { .work .step .card { -webkit-backdrop-filter: none; backdrop-filter: none; } }
html:not(.js) .work .step { min-height: auto; padding: 1.2rem 1.25rem; }
html:not(.js) .work .hero { padding-top: calc(var(--bar-h) + 2rem); }

/* pair board + scrubber + verdict + proof rails */
.pair, .scrub, .verdict-box { border-top: 1px solid rgba(233, 236, 241, 0.18); margin-top: 0.8rem; padding-top: 0.8rem; }
.pair h3, .scrub h3, .verdict-box h3, .proof h3 { margin: 0 0 0.3rem; font-size: 1.1rem; color: #e9ecf1; }
[data-out="placed"], [data-out="called"], [data-out="verdict"] { min-height: 1.4em; color: #8fd3ff; font-weight: 600; }
.board { display: grid; gap: 0.7rem; margin: 0.6rem 0; }
.streets { display: grid; gap: 0.5rem; }
.street { border: 1px dashed #6b5a3e; border-radius: 10px; padding: 0.5rem 0.8rem; }
.street-name { min-height: 44px; padding: 0.3rem 0.9rem; border-radius: 999px; cursor: pointer; font-size: 0.95rem; font-weight: 700; border: 1px solid #f2c35b; background: transparent; color: #f2c35b; }
.street-name:disabled { cursor: default; }
.street-fill { font-size: 0.9rem; color: #d5dbe4; margin: 0.4rem 0 0; }
.street-fill p { margin: 0.3rem 0; }
.performed-set .yr { font-size: 0.8rem; color: #a8a193; }
.performed-set img { max-width: 220px; margin: 0.3rem 0; }
.cards { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.fcard { min-height: 44px; min-width: 44px; padding: 0.4rem 1rem; border-radius: 8px; border: 1px solid #8fd3ff; background: transparent; color: #8fd3ff; font-weight: 700; cursor: pointer; font-size: 0.85rem; }
.fcard[aria-pressed="true"] { background: rgba(143, 211, 255, 0.2); }
.fcard.used { border-style: dashed; text-decoration: line-through; cursor: default; }
.fcard:disabled { cursor: default; }
.twin { display: flex; gap: 0.4rem; margin: 0.6rem 0 0; }
.twin figure { margin: 0; flex: 1 1 0; min-width: 0; }
.twin figure:first-child { flex-grow: var(--split, 50); }
.twin figure:last-child { flex-grow: calc(100 - var(--split, 50)); }
.twin img { width: 100%; height: 220px; object-fit: cover; object-position: top; }
.slider-row { display: flex; align-items: center; gap: 0.7rem; font-size: 0.9rem; }
.slider-row input[type="range"] { flex: 1; min-height: 44px; accent-color: #f2c35b; }
.mag { margin: 0.6rem 0 0; }
.mag img { max-height: 300px; object-fit: contain; background: #0d0b09; }
.acts { list-style: none; margin: 0.6rem 0; padding: 0; display: grid; gap: 0.7rem; }
.act { border: 1px solid rgba(233, 236, 241, 0.18); border-radius: 10px; padding: 0.6rem 0.8rem; }
.act-head { font-size: 0.95rem; }
.act-claim { font-style: italic; }
.act-btns { display: flex; gap: 0.5rem; }
.act-btns button { min-height: 44px; padding: 0.4rem 1.2rem; border-radius: 8px; border: 1px solid #f2c35b; background: transparent; color: #f2c35b; font-weight: 700; cursor: pointer; }
.act-btns button:disabled { border-style: dashed; cursor: default; }
.act-btns button.right { border-style: solid; border-width: 3px; }
.act-btns button.wrong { border-style: dotted; }
.act-reveal { border-left: 3px solid #f2c35b; padding-left: 0.7rem; }
.verdicts { list-style: none; margin: 0.6rem 0; padding: 0; display: grid; gap: 0.5rem; }
.verdict { min-height: 44px; width: 100%; text-align: left; padding: 0.5rem 1rem; border-radius: 8px; border: 1px solid #8fd3ff; background: transparent; color: #8fd3ff; font-weight: 700; cursor: pointer; }
.verdict:disabled { border-style: dashed; cursor: default; }
.verdict-a { border-left: 3px solid #f2c35b; padding-left: 0.7rem; margin: 0.4rem 0; }
table.figures { width: 100%; border-collapse: collapse; margin: 0.6rem 0; font-size: 0.92rem; }
table.figures th, table.figures td { border: 1px solid rgba(233, 236, 241, 0.25); padding: 0.3rem 0.6rem; text-align: right; }
table.figures th:first-child, table.figures td:first-child { text-align: left; }
.work .warn { border-left: 4px solid #f2c35b; padding-left: 0.8rem; font-style: italic; }
.proof { margin-top: 0.8rem; }
.performed-set, .rail-rows { list-style: none; margin: 0.6rem 0; padding: 0; display: grid; gap: 0.7rem; }
.performed-set blockquote, .rail-rows blockquote { margin: 0; padding: 0.5rem 0.8rem; border-left: 3px solid #f2c35b; background: rgba(242, 195, 91, 0.07); font-style: italic; }
.rail-rows .cite { font-size: 0.85rem; color: #a8a193; margin: 0.2rem 0 0; }
.rail-rows .cite a { color: #8fd3ff; }
.tally { font-weight: 700; color: #f2c35b !important; min-height: 1.4em; }
.hint { font-size: 0.85rem; color: #a8a193 !important; }
html.js .stack-only { display: none; }
html:not(.js) .needs-js { display: none; }

/* ---------------------------------------------------------------- beats */
.beats { list-style: none; margin: 1rem 0; padding: 0; counter-reset: beat; }
.beats > li {
  counter-increment: beat; position: relative; padding: 0.9rem 0 0.9rem 3.2rem;
  border-bottom: 1px solid var(--line);
}
.beats > li::before {
  content: counter(beat, decimal-leading-zero);
  position: absolute; left: 0; top: 0.9rem;
  font-family: Fraunces, Georgia, serif; font-weight: 700; font-size: 1.3rem;
  color: var(--accent);
}
.beats h3 { margin: 0 0 0.25rem; font-size: 1.2rem; }
.beats p { margin: 0; }

/* ---------------------------------------------------------------- house */
.quotes { list-style: none; margin: 1rem 0; padding: 0; }
.quotes li {
  margin: 0.4rem 0; padding: 0.5rem 0.9rem; font-size: 1.05rem;
  border-left: 4px solid var(--accent); background: var(--card); border-radius: 0 8px 8px 0;
}
.cite { font-size: 0.9rem; color: var(--muted); }

/* -------------------------------------------------------------- sources */
.src-groups { display: grid; gap: 1rem; margin-top: 1rem; }
.src-groups h3 { font-size: 1.05rem; margin: 0 0 0.3rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.src-groups ul { margin: 0; padding-left: 1.1rem; }
.src-groups li { margin-bottom: 0.4rem; }
.src-groups li::marker { color: var(--accent); }
.small { font-size: 0.88rem; color: var(--muted); }

/* ------------------------------------------------------------------ faq */
.faq details { border: 1px solid var(--line); border-radius: 8px; margin: 0.5rem 0; background: var(--card); }
.faq summary { cursor: pointer; padding: 0.7rem 1rem; font-weight: 700; }
.faq details p { padding: 0 1rem 0.8rem; margin: 0; }

/* --------------------------------------------------------------- figures */
figure { margin: 1.5rem 0; }
figure img { display: block; width: 100%; height: auto; border-radius: 6px; border: 1px solid var(--line); }
figcaption { font-size: 0.88rem; color: var(--muted); margin-top: 0.5rem; }
figcaption details { margin-top: 0.35rem; font-size: 0.85rem; }
figcaption summary { cursor: pointer; }

/* ---------------------------------------------------------------- footer */
footer { border-top: 1px solid var(--line); margin-top: 3rem; padding: 1.5rem 0 3rem; }
footer p { font-size: 0.9rem; color: var(--muted); margin: 0.3rem 0; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 0.5rem; top: 0.5rem; background: var(--card); padding: 0.5rem 1rem; z-index: 99; }
.nf main { max-width: var(--measure); margin: 0 auto; padding: 3rem 1.25rem; }
