/* Hallmark · macrostructure: studied-DNA (Obys Grids: pixel wordmark band, 4-col ruled bench, sticky giant section word, grey panel ladder) · tone: technical, austere · anchor hue: neutral ink + one lime #d4fa46 · studied: yes · DNA-source: url (grids03.obys.agency) */
@font-face { font-family: Switzer; src: url(/assets/fonts/switzer-400.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: Switzer; src: url(/assets/fonts/switzer-500.woff2) format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: Switzer; src: url(/assets/fonts/switzer-600.woff2) format('woff2'); font-weight: 600; font-display: swap; }

:root {
  --paper: #f3f3ef;
  --white: #fbfbf8;
  --ink: #0b0b0b;
  --grey: #dcdcd5;
  --grey2: #e8e8e2;
  --mute: #5d5d58;
  --line: rgba(11, 11, 11, .16);
  --lime: #d4fa46;
  --warn: #b3261e;
  --wire-alt: var(--wire-alt);
  --on-ink-mute: var(--on-ink-mute);
  --gap: 10px;
  --m: 20px;
  --strip: 46px;
  --ease: cubic-bezier(.16, 1, .3, 1);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 13px/1.2 Switzer, 'Helvetica Neue', Arial, sans-serif;
  font-feature-settings: 'tnum' 1, 'ss01' 1;
  overflow-x: clip;
}
a { color: inherit; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; box-shadow: 0 0 0 4px var(--lime); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--paper); padding: 8px 12px; z-index: 99; }
.skip:focus { left: 8px; }
h2 { margin: 0; font-weight: 400; }

/* ---------- barcode strip ---------- */
.strip {
  position: fixed; left: 0; top: 0; bottom: 0; width: var(--strip); z-index: 5;
  display: flex; flex-direction: column; gap: 2px; padding: 0 0 0 0; background: var(--paper);
}
.strip .seg { flex: 1; display: flex; gap: 3px; }
.strip .seg span { display: block; background: var(--grey); transition: background .5s var(--ease), flex-grow .9s var(--ease); }
.strip .seg.done span { background: var(--ink); }
.strip .seg.done span:nth-child(3n) { background: var(--grey); }

/* ---------- pixel wordmark ---------- */
.band { padding: var(--m) var(--m) 0 calc(var(--strip) + var(--m)); }
.pix { display: grid; grid-template-columns: repeat(var(--cols), 1fr); gap: 4px 4px; }
.pix i { display: block; aspect-ratio: 1 / .44; background: transparent; position: relative; }
.pix i.on { background: var(--ink); }
.pix i.ghost { background: var(--grey); }
.pix i.lime { background: var(--lime); }
.pix i.on, .pix i.ghost { transform: scaleY(0); transform-origin: 50% 100%; transition: transform .5s steps(5, end) var(--d), background .4s; }
.pix.in i.on, .pix.in i.ghost { transform: none; }
.pix.in i.move { transform: translate(calc(var(--tx) * (100% + 4px)), calc(var(--ty) * (100% + 4px))); transition: transform .38s steps(4, end); z-index: 2; }

/* ---------- top bar ---------- */
.bar-top {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gap); align-items: center;
  padding: 12px var(--m) 12px calc(var(--strip) + var(--m)); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 500; font-size: 15px; letter-spacing: -.01em; }
.brand img { border-radius: 7px; display: block; }
.tag { margin: 0; color: var(--mute); }
.tools { grid-column: 3 / 5; display: flex; justify-content: flex-end; align-items: center; gap: 8px; flex-wrap: wrap; }
.pairnote { color: var(--mute); margin-right: 4px; }
.pairnote a { text-decoration: underline; text-underline-offset: 2px; }
.ca { border: 1px solid var(--line); background: var(--white); padding: 7px 10px; border-radius: 0; color: var(--mute); }
.ca.live { color: var(--ink); background: var(--lime); border-color: var(--ink); }
.ico { width: 32px; height: 32px; display: inline-grid; place-items: center; border: 1px solid var(--line); background: var(--white); transition: background .25s; }
.ico:hover { background: var(--lime); }
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 8px 14px; border: 1px solid var(--ink); text-decoration: none; background: transparent; border-radius: 0; transition: background .25s, color .25s; white-space: nowrap; }
.btn.solid { background: var(--ink); color: var(--paper); }
.btn.solid:hover:not([disabled]) { background: var(--lime); color: var(--ink); }
.btn.ghost:hover { background: var(--ink); color: var(--paper); }
.btn[disabled], .btn[aria-disabled='true'] { opacity: .45; cursor: not-allowed; }
.btn.wide { width: 100%; padding: 14px; font-size: 15px; }

/* ---------- the bench (first view) ---------- */
main, .foot { padding-left: var(--strip); }
.bench {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gap);
  padding: 16px var(--m) 0; min-height: calc(100vh - 210px); grid-template-rows: 1fr auto;
}
.c1 { grid-column: 1; }
.c23 { grid-column: 2 / 4; }
.c4 { grid-column: 4; }
.intro { margin: 0 0 18px; max-width: 30ch; font-size: 15px; line-height: 1.22; letter-spacing: -.01em; }
.field { border-top: 1px solid var(--ink); padding: 8px 0 12px; }
.lbl { display: block; color: var(--mute); margin-bottom: 6px; }
.amt { display: flex; align-items: center; gap: 8px; min-width: 0; }
.amt input, .amt output {
  flex: 1; min-width: 0; border: 0; background: transparent; padding: 0; outline: none;
  font-size: clamp(28px, 2.6vw, 44px); letter-spacing: -.04em; line-height: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.amt input:focus-visible { box-shadow: inset 0 -2px 0 var(--lime); }
.tok { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); background: var(--white); padding: 6px 9px 6px 6px; flex: none; max-width: 52%; transition: background .25s; }
.tok:hover { background: var(--lime); }
.tok img, .tok .ph { width: 20px; height: 20px; border-radius: 50%; background: var(--grey); object-fit: cover; flex: none; }
.tok b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.usd { display: block; color: var(--mute); margin-top: 6px; min-height: 1.2em; }
.flip { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; padding: 2px 0 10px; color: var(--mute); }
.flip:hover { color: var(--ink); }
.seg { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); }
.seg button { border: 0; border-right: 1px solid var(--line); background: var(--white); padding: 8px 0; }
.seg button:last-child { border-right: 0; }
.seg button[aria-checked='true'] { background: var(--ink); color: var(--paper); }
.note { color: var(--mute); margin: 8px 0 0; line-height: 1.3; }

.mapcell { position: relative; display: flex; flex-direction: column; min-height: 420px; }
.maphead { display: flex; justify-content: space-between; border-top: 1px solid var(--ink); padding: 8px 0; }
.live { display: inline-flex; align-items: center; gap: 7px; color: var(--mute); }
.live i { width: 8px; height: 8px; background: var(--grey); display: block; }
.live.on i { background: var(--lime); box-shadow: 0 0 0 1px var(--ink); animation: blink 1.6s steps(2, end) infinite; }
.live b { font-weight: 400; }
@keyframes blink { 50% { opacity: .2; } }
.map {
  flex: 1; width: 100%; min-height: 360px; display: block;
  background-color: var(--white);
  background-image: linear-gradient(var(--grey2) 1px, transparent 1px), linear-gradient(90deg, var(--grey2) 1px, transparent 1px);
  background-size: 20px 20px;
}
.map .wire { fill: none; stroke: var(--ink); stroke-linejoin: miter; stroke-linecap: butt; }
.map .wire.draw { stroke-dasharray: var(--len); stroke-dashoffset: var(--len); animation: draw 1.1s var(--ease) forwards; animation-delay: var(--dl, 0ms); }
.map .wire.hot { stroke: var(--lime); }
.map .wire.hot-under { stroke: var(--ink); }
@keyframes draw { to { stroke-dashoffset: 0; } }
.map .node rect { fill: var(--ink); }
.map .node text { fill: var(--paper); font-size: 13px; font-weight: 500; }
.map .venue rect { fill: var(--white); stroke: var(--ink); stroke-width: 1; }
.map .venue.hot rect { fill: var(--lime); }
.map .venue text { fill: var(--ink); font-size: 12px; }
.map .venue .pct { fill: var(--mute); }
.map .empty { fill: var(--mute); font-size: 14px; }
.map g.pop { opacity: 0; animation: pop .5s steps(3, end) forwards; animation-delay: var(--dl, 0ms); }
@keyframes pop { to { opacity: 1; } }
.tick { height: 3px; background: var(--grey2); }
.tick i { display: block; height: 100%; width: 100%; background: var(--ink); transform-origin: 0 50%; transform: scaleX(0); }

.legs { display: flex; flex-direction: column; }
.ruled { list-style: none; margin: 0; padding: 0; }
.ruled li {
  display: grid; grid-template-columns: 1fr auto; gap: 0 10px; padding: 0 0 14px; line-height: 14px;
  background: repeating-linear-gradient(to bottom, transparent 0 13px, var(--line) 13px 14px);
  transition: background-color .25s;
}
.legs .ruled li { cursor: default; }
.legs .ruled li:nth-child(even) .lt { padding-left: 40px; }
.legs .ruled li.hot { background-color: var(--lime); }
.ruled .lt b { font-weight: 500; display: block; }
.ruled .lt span { display: block; color: var(--mute); }
.ruled .rt { text-align: right; }
.ruled li.blank { color: var(--mute); grid-template-columns: 1fr; }
.facts { margin: 6px 0 0; display: grid; grid-template-columns: 1fr auto; line-height: 14px;
  background: repeating-linear-gradient(to bottom, transparent 0 13px, var(--line) 13px 14px); }
.facts dt { color: var(--mute); }
.facts dd { margin: 0; text-align: right; }
.facts .warn { color: var(--warn); }

.big { grid-column: 1 / -1; align-self: end; overflow: hidden; padding-top: 18px; }
.bignum { display: inline-block; white-space: nowrap; font-weight: 400; letter-spacing: -.055em; line-height: .86; font-size: 140px; transform: translateY(0); transition: opacity .3s; }
.bignum small { font-size: .42em; letter-spacing: -.03em; color: var(--mute); }

/* ---------- experiments ---------- */
.exp { padding: 70px var(--m) 30px; }
.sticky { position: sticky; top: 0; z-index: 3; display: flex; justify-content: space-between; align-items: flex-start; background: var(--paper); padding: 10px 0 8px; }
.sticky h2, .sticky .run, .sechead h2 { font-size: clamp(56px, 8.4vw, 150px); letter-spacing: -.06em; line-height: .84; white-space: nowrap; }
.sticky .run { color: var(--grey); transition: color .6s; }
.sticky .run.fresh { color: var(--ink); }
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 50px var(--gap); margin-top: 40px; }
.card { grid-column: span 2; }
.card:nth-child(1) { grid-column: 1 / 3; }
.card:nth-child(2) { grid-column: 3 / 5; margin-top: 120px; }
.card:nth-child(3) { grid-column: 2 / 4; }
.card .rule { height: 20px; background: var(--ink); transform: scaleX(0); transform-origin: 0 50%; transition: transform 1s var(--ease); }
.card.seen .rule { transform: none; }
.card.best .rule { background: linear-gradient(90deg, var(--ink) 0 calc(100% - 60px), var(--lime) calc(100% - 60px)); }
.card .row { display: grid; grid-template-columns: 1fr 1fr auto; gap: var(--gap); padding-top: 8px; line-height: 14px; }
.card .row .t b { font-weight: 500; display: block; }
.card .row .t span { color: var(--mute); }
.card .out { font-size: clamp(34px, 3.6vw, 62px); letter-spacing: -.05em; line-height: .95; margin: 34px 0 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .delta { color: var(--mute); }
.card .delta.neg { color: var(--warn); }
.card .delta.pos { color: var(--ink); background: var(--lime); padding: 0 4px; }
.card .vlist { margin: 18px 0 14px; line-height: 14px; background: repeating-linear-gradient(to bottom, transparent 0 13px, var(--line) 13px 14px); }
.card .vlist div { display: flex; justify-content: space-between; }
.card .why { color: var(--mute); max-width: 46ch; line-height: 1.3; margin: 0 0 14px; }
.card .btn { min-width: 220px; }

/* ---------- ladder ---------- */
.ladder, .log, .method { padding: 60px var(--m) 20px; }
.sechead { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gap); align-items: end; margin-bottom: 26px; }
.sechead h2 { grid-column: 1 / 3; }
.sechead p { grid-column: 4; margin: 0; color: var(--mute); line-height: 1.3; max-width: 34ch; }
.panels { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gap); }
.panel { position: relative; height: clamp(380px, 62vh, 640px); background: var(--grey); overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; padding: 12px; }
.panel .fill { position: absolute; left: 0; right: 0; bottom: 0; height: 0; background: var(--ink); transition: height 1.2s var(--ease); }
.panel .fill::after { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 6px; background: var(--lime); }
.panel .top, .panel .bot { position: relative; z-index: 1; line-height: 14px; }
.panel .size { font-size: clamp(26px, 2.6vw, 44px); letter-spacing: -.045em; line-height: 1; display: block; margin-bottom: 10px; white-space: nowrap; }
.panel .bot { color: var(--paper); mix-blend-mode: normal; }
.panel .imp { font-size: clamp(30px, 3.4vw, 58px); letter-spacing: -.05em; line-height: 1; display: block; }
.panel.low .bot { color: var(--ink); }
.panel .muted { color: var(--mute); display: block; }
.panel.low .bot .muted, .panel .top .muted { color: var(--mute); }
.panel .bot .muted { color: var(--on-ink-mute); }
.panel.low .bot .muted { color: var(--mute); }
.panel.off { background: var(--grey2); }

/* ---------- log ---------- */
.notebook li { grid-template-columns: 120px 1.1fr 2fr 2fr auto; }
.notebook li > span:last-child { text-align: right; }
.notebook .muted { color: var(--mute); }
.notebook li.blank { grid-template-columns: 1fr; padding: 0 0 56px; }

/* ---------- method ---------- */
.method .cols { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gap); }
.method p { margin: 0; line-height: 1.3; border-top: 1px solid var(--ink); padding-top: 8px; }
.method b { font-weight: 500; }

/* ---------- footer ---------- */
.foot { padding-top: 80px; }
.pix-foot { padding: 0 var(--m); }
.footrow { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gap); padding: 14px var(--m) 22px; color: var(--mute); }
.footrow span:nth-child(2) { grid-column: 2 / 4; }
.footico { display: flex; gap: 8px; justify-content: flex-end; }

/* ---------- picker ---------- */
.picker { width: min(520px, 94vw); max-height: 80vh; border: 1px solid var(--ink); border-radius: 0; padding: 0; background: var(--paper); color: var(--ink); }
.picker::backdrop { background: rgba(243, 243, 239, .78); backdrop-filter: blur(3px); }
.pickhead { display: flex; justify-content: space-between; align-items: baseline; padding: 14px 14px 10px; margin: 0; }
.pickhead h2 { font-size: 34px; letter-spacing: -.05em; }
.pickhead .x { border: 0; background: none; color: var(--mute); text-decoration: underline; }
#pickQ { width: calc(100% - 28px); margin: 0 14px; border: 0; border-bottom: 1px solid var(--ink); background: transparent; padding: 10px 0; font-size: 18px; outline: none; }
.pickcap { margin: 10px 14px 4px; color: var(--mute); }
.picklist { list-style: none; margin: 0; padding: 0 14px 14px; overflow: auto; max-height: 52vh; }
.picklist button { width: 100%; display: grid; grid-template-columns: 26px 1fr auto; gap: 10px; align-items: center; text-align: left; border: 0; border-bottom: 1px solid var(--line); background: none; padding: 8px 0; }
.picklist button:hover, .picklist button:focus-visible { background: var(--lime); }
.picklist img, .picklist .ph { width: 26px; height: 26px; border-radius: 50%; background: var(--grey); object-fit: cover; }
.picklist b { font-weight: 500; }
.picklist span.n { color: var(--mute); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picklist .r { color: var(--mute); text-align: right; }

.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); background: var(--ink); color: var(--paper); padding: 11px 16px; z-index: 50; max-width: 92vw; }

/* reveal */
.rv { opacity: 0; transform: translateY(18px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.rv.seen { opacity: 1; transform: none; }

@media (min-width: 2000px) {
  body { font-size: 15px; }
  .ruled li, .facts, .card .vlist { line-height: 17px; background-image: repeating-linear-gradient(to bottom, transparent 0 16px, var(--line) 16px 17px); }
  .ruled li { padding-bottom: 17px; }
  .intro { font-size: 19px; }
  .mapcell { min-height: 620px; }
}

@media (max-width: 1100px) {
  .bar-top { grid-template-columns: 1fr 1fr; }
  .tag { display: none; }
  .tools { grid-column: 2; }
  .bench { grid-template-columns: 1fr 1fr; }
  .c1 { grid-column: 1; } .c4 { grid-column: 2; grid-row: 1; }
  .c23 { grid-column: 1 / -1; grid-row: 2; }
  .big { grid-row: 3; }
}
@media (max-width: 760px) {
  :root { --strip: 0px; --m: 14px; }
  .strip { display: none; }
  .bar-top { grid-template-columns: 1fr; }
  .tools { grid-column: 1; justify-content: flex-start; }
  .bench { grid-template-columns: 1fr; min-height: 0; }
  .c1, .c4, .c23 { grid-column: 1; grid-row: auto; }
  .mapcell { min-height: 320px; }
  .map { min-height: 300px; }
  .cards { grid-template-columns: 1fr; gap: 40px; }
  .card, .card:nth-child(n) { grid-column: 1; margin-top: 0; }
  .card .btn { width: 100%; }
  .sechead { grid-template-columns: 1fr; }
  .sechead h2, .sechead p { grid-column: 1; }
  .panels { grid-template-columns: 1fr 1fr; }
  .panel { height: 300px; }
  .notebook li { grid-template-columns: 1fr auto; }
  .notebook li > span:nth-child(2), .notebook li > span:nth-child(4) { display: none; }
  .method .cols { grid-template-columns: 1fr; gap: 18px; }
  .footrow { grid-template-columns: 1fr; }
  .footrow span:nth-child(2) { grid-column: 1; }
  .footico { justify-content: flex-start; }
  .legs .ruled li:nth-child(even) .lt { padding-left: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .rv { opacity: 1; transform: none; }
}
.map .wire.alt { stroke: var(--wire-alt); stroke-dasharray: 4 4; }
.map .wire.alt.draw { animation: pop .6s steps(3, end) both; animation-delay: var(--dl, 0ms); }
.map .venue.alt rect { fill: var(--paper); stroke: var(--wire-alt); }
.map .venue.alt text { fill: var(--mute); }
.map .key { fill: var(--mute); font-size: 12px; }
.notebook li.blank > span { text-align: left; }
.trend { margin-top: 28px; }
.trend .th { margin: 0 0 4px; border-top: 1px solid var(--ink); padding-top: 6px; }
.trend li button { all: unset; box-sizing: border-box; display: flex; justify-content: space-between; width: 100%; cursor: pointer; }
.trend li button:hover, .trend li button:focus-visible { background: var(--lime); }
.trend li:nth-child(even) .lt { padding-left: 40px; }
.trend li { grid-template-columns: 1fr; padding-bottom: 0; }
.bench > * { min-width: 0; }
.amt input, .amt output { min-width: 0; }
@media (max-width: 760px) {
  .bench { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto; }
  .seg button { min-width: 0; }
}
