:root, [data-theme="light"] {
  --background-primary: #fff;
  --background-hover: #f8f8f8;
  --background-pressed: #f2f2f2;
  --background-primary-inverse: #0d0d0d;
  --content-primary: #1a1a1a;
  --content-secondary: #333;
  --content-tertiary: #666;
  --content-disabled: #b3b3b3;
  --content-primary-inverse: #fff;
  --border-disabled: #f2f2f2;
  --border-tertiary: #e5e5e5;
  --band: #f8f8f8;
  --grid-line: rgba(0, 0, 0, .06);
  --link-ul: #2f6bf0;
  --big: #e5e5e5;
}
[data-theme="dark"] {
  --background-primary: #000;
  --background-hover: #0d0d0d;
  --background-pressed: #333;
  --background-primary-inverse: #fff;
  --content-primary: #fff;
  --content-secondary: #e5e5e5;
  --content-tertiary: #b3b3b3;
  --content-disabled: #4c4c4c;
  --content-primary-inverse: #1a1a1a;
  --border-disabled: #333;
  --border-tertiary: #404040;
  --band: #0d0d0d;
  --grid-line: rgba(255, 255, 255, .07);
  --link-ul: #3b74ff;
  --big: #4c4c4c;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--background-primary); }
body {
  margin: 0;
  background: var(--background-primary);
  color: var(--content-primary);
  font: 400 16px/1.23 "Geist", system-ui, sans-serif;
  text-transform: lowercase;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color .3s ease, color .3s ease;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; text-transform: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
h1, h2, h3, p { margin: 0; font-weight: 400; }
.mono, .topbar__nav a, .theme-toggle, .pile__label, .ttt { font-family: "Geist Mono", ui-monospace, monospace; }

/* ---------- top bar ---------- */
.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  height: 64px; padding: 0 32px;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  background: var(--background-hover);
  border-bottom: 1px solid transparent;
  transition: border-color .3s, background-color .3s;
}
.topbar.is-scrolled { border-bottom-color: var(--border-disabled); }
.topbar__left { display: flex; align-items: center; gap: 28px; }
.logo { font-weight: 600; font-size: 15px; letter-spacing: -.02em; display: inline-flex; align-items: center; gap: 6px; }
.wave { display: inline-block; transform-origin: 70% 70%; font-size: 13px; }
.logo:hover .wave { animation: wave 1s ease-in-out; }
@keyframes wave { 0%,100%{transform:rotate(0)} 20%{transform:rotate(16deg)} 40%{transform:rotate(-8deg)} 60%{transform:rotate(14deg)} 80%{transform:rotate(-4deg)} }
.topbar__nav { display: flex; gap: 20px; }
.topbar__nav a, .theme-toggle {
  font-size: 12px; letter-spacing: -.03em; color: var(--content-tertiary);
  transition: color .2s;
}
.topbar__nav a:hover { color: var(--content-primary); }
.theme-toggle { display: flex; gap: 8px; align-items: center; color: var(--content-disabled); }
.theme-toggle button { color: var(--content-disabled); transition: color .2s; }
.theme-toggle button[aria-pressed="true"] { color: var(--content-primary); }
.theme-toggle button:hover { color: var(--content-tertiary); }
.topbar__icons { display: flex; justify-content: flex-end; gap: 18px; color: var(--content-tertiary); }
.topbar__icons a { display: grid; place-items: center; width: 20px; height: 20px; transition: color .2s, transform .2s; }
.topbar__icons a:hover { color: var(--content-primary); transform: translateY(-1px); }

/* ---------- hero ---------- */
.hero { background: var(--background-hover); padding-top: 136px; overflow: hidden; transition: background-color .3s; }
.hero__copy { max-width: 460px; margin: 0 auto; padding: 0 16px; color: var(--content-tertiary); display: grid; gap: 20px; }
.hero__copy a { color: var(--content-primary); }
.hero__copy a.ul { white-space: nowrap; }
.hero__copy a.ul, .hero__copy a.em {
  font-weight: 500;
  background: linear-gradient(var(--link-ul), var(--link-ul)) 0 100% / 100% 2px no-repeat;
  padding-bottom: 1px; transition: background-size .3s ease, color .2s;
}
.hero__copy a.ul:hover, .hero__copy a.em:hover { background-size: 100% 100%; color: #fff; }

.collage { position: relative; margin-top: 96px; height: calc(580px * var(--s, 1)); }
.collage__grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 44px 44px; background-position: center top;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 22%);
          mask-image: linear-gradient(to bottom, transparent 0, #000 22%);
}
.collage__stage {
  position: absolute; left: 50%; top: 0;
  width: 1200px; height: 580px;
  transform: translateX(-50%) scale(var(--s, 1)); transform-origin: top center;
}
.ci {
  position: absolute; left: var(--x); top: var(--y); width: var(--w);
  transform: translate(var(--dx, 0px), var(--dy, 0px)) rotate(var(--r)) scale(var(--sc, 1));
  cursor: grab; touch-action: none; user-select: none;
  transition: transform .35s cubic-bezier(.2,.9,.3,1.2), filter .2s;
  filter: drop-shadow(0 10px 18px rgba(0,0,0,.28));
  will-change: transform;
}
.ci.is-dragging { cursor: grabbing; transition: none; --sc: 1.04; filter: drop-shadow(0 22px 30px rgba(0,0,0,.35)); }
.ci img, .ci svg { pointer-events: none; display: block; }

.polaroid { margin: 0; background: #fff; padding: 14px 14px 0; border-radius: 3px; }
.polaroid__photo { position: relative; aspect-ratio: 26 / 28; overflow: hidden; background: #ddd; }
.polaroid__photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.05); z-index: 1; }
.polaroid__photo svg { width: 100%; height: 100%; }
.polaroid figcaption { font: 600 24px/1 "Caveat", cursive; color: #222; text-align: center; padding: 14px 0 18px; }

.flag svg { width: 100%; height: auto; }

.ruhly-card { aspect-ratio: 46 / 30; border-radius: 6px; overflow: hidden; }
.ruhly-card__sky, .cover--ruhly {
  position: relative; width: 100%; height: 100%;
  background:
    linear-gradient(rgba(255,255,255,.07) 1px, transparent 1px) 0 0 / 32px 32px,
    linear-gradient(90deg, rgba(255,255,255,.07) 1px, transparent 1px) 0 0 / 32px 32px,
    linear-gradient(180deg, #0a4fe6 0%, #4cbfff 100%);
  display: grid; place-content: center; justify-items: center; gap: 14px; color: #fff; overflow: hidden;
}
.ruhly-mark { width: 54px; height: auto; filter: drop-shadow(0 0 18px rgba(255,255,255,.55)); position: relative; z-index: 1; }
.ruhly-card__sky p, .cover--ruhly p { font-weight: 700; font-size: 22px; letter-spacing: -.03em; position: relative; z-index: 1; }
.pill {
  position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 8px;
  background: linear-gradient(#fff, #eef3ff); color: #0b2a6b; font-size: 13px; font-weight: 600;
  padding: 8px 14px; border-radius: 99px; box-shadow: 0 6px 16px rgba(0,30,90,.25), inset 0 1px 0 #fff;
}
.pill i { width: 7px; height: 7px; border-radius: 50%; background: #2bd36b; box-shadow: 0 0 8px #2bd36b; }
.cloud { position: absolute; background: #fff; border-radius: 99px; filter: blur(14px); opacity: .55; animation: drift 18s linear infinite; }
.cloud.c1 { width: 180px; height: 40px; left: -10%; top: 62%; }
.cloud.c2 { width: 120px; height: 30px; left: 60%; top: 18%; animation-duration: 24s; animation-delay: -8s; }
.cloud.c3 { width: 220px; height: 50px; left: 30%; top: 82%; animation-duration: 30s; animation-delay: -14s; opacity: .4; }
@keyframes drift { from { transform: translateX(-40px); } to { transform: translateX(40px); } }
.cloud { animation-direction: alternate; }

.term { background: #111; border: 1px solid #2a2a2a; border-radius: 8px; overflow: hidden; color: #ddd; }
.term__bar { display: flex; align-items: center; gap: 6px; padding: 8px 10px; background: #1b1b1b; border-bottom: 1px solid #2a2a2a; }
.term__bar i { width: 9px; height: 9px; border-radius: 50%; background: #444; }
.term__bar i:nth-child(1) { background: #ff5f57; } .term__bar i:nth-child(2) { background: #febc2e; } .term__bar i:nth-child(3) { background: #28c840; }
.term__bar span { margin-left: 8px; font: 11px "Geist Mono", monospace; color: #888; }
.term pre { margin: 0; padding: 12px 14px 14px; font: 12px/1.55 "Geist Mono", monospace; white-space: pre-wrap; }
.dim { color: #777; } .bad { color: #ff6b5e; } .good { color: #5ee38a; } .warn { color: #ffcc4d; }

.suit { aspect-ratio: 22 / 15; }
.suit__card {
  position: absolute; inset: 0; background: #fbfaf7; color: #111; border-radius: 14px; padding: 16px;
  display: flex; flex-direction: column; justify-content: space-between; box-shadow: 0 1px 0 rgba(0,0,0,.05);
}
.suit__card.back { transform: rotate(7deg) translate(10px, -6px); background: #e8e4da; }
.suit__tag { font: 600 12px "Geist", sans-serif; color: #555; }
.suit__card p { font-weight: 600; font-size: 17px; line-height: 1.2; letter-spacing: -.02em; }
.suit__chips { display: flex; gap: 6px; }
.suit__chips b { font: 500 11px "Geist Mono", monospace; background: #111; color: #fff; padding: 4px 8px; border-radius: 99px; }
.suit__chips b + b { background: #e8e4da; color: #333; }

.strip { height: 76px; background: #141414; border-radius: 2px; display: flex; gap: 8px; padding: 14px 10px; position: absolute;
  background-image: radial-gradient(circle, #000 0 3px, transparent 3.5px), radial-gradient(circle, #000 0 3px, transparent 3.5px);
  background-size: 14px 10px; background-repeat: repeat-x; background-position: 0 2px, 0 66px; background-color: #1c1c1c; }
.strip span { flex: 1; border-radius: 2px; background: linear-gradient(135deg, #ff9466, #ff4d3d); }
.strip span:nth-child(2) { background: linear-gradient(135deg, #4cbfff, #0a4fe6); }
.strip span:nth-child(3) { background: linear-gradient(135deg, #ffe14d, #ff9466); }

.cal { background: #fff; color: #111; border-radius: 10px; overflow: hidden; text-align: center; }
.cal__top { background: #e63b2e; color: #fff; font: 600 15px "Geist", sans-serif; padding: 8px 0; letter-spacing: .02em; }
.cal__day { font: 700 76px/1 "Geist", sans-serif; letter-spacing: -.05em; padding: 10px 0 2px; }
.cal__sub { font: 11px "Geist Mono", monospace; color: #c2391b; padding: 0 8px 14px; }

.ticket {
  background: #ffe14d; color: #111; padding: 18px 20px; border-radius: 4px; display: grid; gap: 4px;
  -webkit-mask: radial-gradient(circle at 0 50%, transparent 12px, #000 12.5px) left / 51% 100% no-repeat,
                radial-gradient(circle at 100% 50%, transparent 12px, #000 12.5px) right / 51% 100% no-repeat;
          mask: radial-gradient(circle at 0 50%, transparent 12px, #000 12.5px) left / 51% 100% no-repeat,
                radial-gradient(circle at 100% 50%, transparent 12px, #000 12.5px) right / 51% 100% no-repeat;
}
.ticket__big { font: 900 44px/0.9 "Geist", sans-serif; letter-spacing: -.04em; }
.ticket__small { font: 500 12px "Geist Mono", monospace; }

.pmos { aspect-ratio: 1; background: #1d3b2a; color: #9ff0b8; border-radius: 28px; display: grid; place-content: center; text-align: center; gap: 4px;
  outline: 3px solid #fff; outline-offset: -3px; }
.pmos b { font: 800 30px/1 "Geist", sans-serif; letter-spacing: -.04em; }
.pmos span { font: 11px "Geist Mono", monospace; opacity: .8; }

.note { background: #fff59a; color: #222; padding: 16px 16px 20px; font: 600 22px/1.05 "Caveat", cursive; transform-origin: top center; }

/* ---------- marquee ---------- */
.logo-marquee {
  overflow: hidden; height: 76px; display: flex; align-items: center;
  border-block: 1px solid var(--border-disabled); background: var(--background-primary);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.logo-marquee__track { display: flex; gap: 64px; width: max-content; animation: marquee 40s linear infinite; }
.logo-marquee:hover .logo-marquee__track { animation-play-state: paused; }
.logo-marquee__track span { font-weight: 600; font-size: 19px; letter-spacing: -.03em; color: var(--content-tertiary); white-space: nowrap; transition: color .2s; }
.logo-marquee__track span:hover { color: var(--content-primary); }
.logo-marquee__track span:nth-child(3n+2) { font-family: "Geist Mono", monospace; font-weight: 500; font-size: 16px; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- section heads ---------- */
.section-head h2 { display: flex; align-items: center; gap: 8px; font-weight: 500; font-size: 16px; color: var(--content-primary); }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--dot); box-shadow: 0 0 0 3px color-mix(in srgb, var(--dot) 22%, transparent); }
.section-head p { margin-top: 14px; color: var(--content-tertiary); font-size: 14px; line-height: 1.35; max-width: 240px; }
.section-head--wide p { max-width: 380px; }

/* ---------- featured ---------- */
.featured {
  display: grid; grid-template-columns: minmax(220px, 1fr) 2.6fr; gap: 64px;
  padding: 120px 32px 140px; background: var(--background-primary);
}
.featured .section-head { position: sticky; top: 104px; align-self: start; }
.featured__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-items: start; }
.featured__col { display: grid; gap: 28px; }
.featured__card { display: grid; gap: 10px; }
.featured__media {
  position: relative; aspect-ratio: var(--card-aspect); border-radius: 4px; overflow: hidden;
  background: var(--background-hover);
}
.featured__media > .cover { position: absolute; inset: 0; transition: transform .6s cubic-bezier(.2,.8,.2,1); }
@media (hover: hover) { .featured__card:hover .featured__media > .cover { transform: scale(1.025); } }
.featured__writing {
  position: absolute; top: 12px; left: 12px; z-index: 3; font: 500 11px "Geist Mono", monospace;
  background: rgba(0,0,0,.66); color: #fff; padding: 6px 10px; border-radius: 99px; backdrop-filter: blur(8px);
  opacity: 0; transform: translateY(-4px); transition: .25s ease;
}
.featured__card:hover .featured__writing, .featured__card:focus-visible .featured__writing { opacity: 1; transform: none; }
.featured__details { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.featured__identity { display: flex; gap: 10px; align-items: baseline; }
.featured__identity h3 { font-weight: 500; font-size: 14px; }
.featured__muted { color: var(--content-tertiary); }

/* covers */
.cover { overflow: hidden; }
.cover--ruhly { gap: 18px; }
.cover--ruhly .ruhly-mark { width: 70px; }
.cover--ruhly p { font-size: 26px; }
.cover--ruhly .rings { position: absolute; inset: 0; display: grid; place-items: center; }
.cover--ruhly .rings span { position: absolute; border: 1px solid rgba(255,255,255,.22); border-radius: 50%; animation: ring 6s ease-out infinite; }
.cover--ruhly .rings span:nth-child(1) { width: 160px; height: 160px; }
.cover--ruhly .rings span:nth-child(2) { width: 300px; height: 300px; animation-delay: -2s; }
.cover--ruhly .rings span:nth-child(3) { width: 460px; height: 460px; animation-delay: -4s; }
@keyframes ring { 0% { transform: scale(.85); opacity: 0; } 30% { opacity: 1; } 100% { transform: scale(1.15); opacity: 0; } }

.cover--pmos { background: #0a120d; display: grid; place-items: center; }
.cover--pmos svg { width: 92%; height: auto; }
.cover--pmos .node { fill: #12241a; stroke: #2c5a3e; }
.cover--pmos .node-label { font: 11px "Geist Mono", monospace; fill: #9ff0b8; text-anchor: middle; }
.cover--pmos .gate { fill: #9ff0b8; }
.cover--pmos .wire { stroke: #2c5a3e; stroke-width: 1.5; fill: none; }
.cover--pmos .pulse { stroke: #9ff0b8; stroke-width: 2.5; fill: none; stroke-dasharray: 30 600; animation: pulse 3.2s linear infinite; filter: drop-shadow(0 0 6px #9ff0b8); }
@keyframes pulse { from { stroke-dashoffset: 630; } to { stroke-dashoffset: 0; } }
.cover--pmos .title { font: 800 30px "Geist", sans-serif; fill: #fff; letter-spacing: -.04em; }

.cover--suitup { background: #f1eee6; display: grid; place-items: center; }
.cover--suitup .deckmini { position: relative; width: 58%; aspect-ratio: 3 / 2.1; }
.cover--suitup .deckmini > div { position: absolute; inset: 0; border-radius: 18px; background: #fff; box-shadow: 0 14px 30px rgba(60,40,10,.14); padding: 20px; display: flex; flex-direction: column; justify-content: space-between; color: #111; }
.cover--suitup .deckmini > div:nth-child(1) { transform: rotate(-6deg) translate(-14px, 8px); background: #e6e1d4; }
.cover--suitup .deckmini > div:nth-child(2) { transform: rotate(4deg) translate(10px, 4px); background: #f6f3ec; }
.cover--suitup .deckmini > div:nth-child(3) { animation: swipe 4.5s cubic-bezier(.5,0,.3,1) infinite; }
.cover--suitup .deckmini b { font: 600 12px "Geist Mono", monospace; color: #8a7f68; }
.cover--suitup .deckmini p { font-weight: 650; font-size: clamp(14px, 1.6vw, 20px); letter-spacing: -.025em; line-height: 1.15; }
.cover--suitup .deckmini .score { align-self: flex-start; font: 600 12px "Geist Mono", monospace; background: #111; color: #fff; padding: 5px 9px; border-radius: 99px; }
.cover--suitup .emoji { position: absolute; top: 9%; right: 9%; font-size: 44px; transform: rotate(10deg); }
@keyframes swipe { 0%, 55% { transform: none; opacity: 1; } 75% { transform: translateX(130%) rotate(16deg); opacity: 0; } 76% { transform: translateY(16px) scale(.95); opacity: 0; } 100% { transform: none; opacity: 1; } }

.cover--crossexam { background: #0c0c0c; padding: 7% 7.5%; container-type: inline-size; }
.cover--crossexam pre { margin: 0; font: 3.1cqi/1.7 "Geist Mono", monospace; color: #cfcfcf; white-space: pre; }
.cover--crossexam .caret { display: inline-block; width: .55em; height: 1em; background: #cfcfcf; vertical-align: -2px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.cover--holidaymade { background: linear-gradient(180deg, #cfe3ff 0%, #f6e7f1 55%, #ffe3d1 100%); display: grid; place-items: center; perspective: 900px; }
.cover--holidaymade .cube { --d: clamp(110px, 15vw, 190px); width: var(--d); aspect-ratio: 1; position: relative; transform-style: preserve-3d; animation: spin 9s ease-in-out infinite alternate; }
.cover--holidaymade .face { position: absolute; inset: 0; border-radius: 14%; background: #fff; display: grid; place-content: center; text-align: center; color: #1b1b1b; backface-visibility: hidden; box-shadow: inset 0 0 0 1px rgba(0,0,0,.05); }
.cover--holidaymade .face b { font: 800 calc(var(--d) * .3)/.9 "Geist", sans-serif; letter-spacing: -.06em; }
.cover--holidaymade .face i { font: normal 600 calc(var(--d) * .085) "Geist", sans-serif; color: #e63b2e; margin-bottom: 4px; }
.cover--holidaymade .face.front { transform: translateZ(calc(var(--d) / 2)); }
.cover--holidaymade .face.right { transform: rotateY(90deg) translateZ(calc(var(--d) / 2)); background: #f3f3f3; }
.cover--holidaymade .face.top { transform: rotateX(90deg) translateZ(calc(var(--d) / 2)); background: #e63b2e; }
.cover--holidaymade .tag { position: absolute; bottom: 12%; font: 600 13px "Geist", sans-serif; background: rgba(255,255,255,.75); backdrop-filter: blur(10px); padding: 8px 14px; border-radius: 99px; color: #222; box-shadow: 0 6px 18px rgba(80,40,60,.12); }
@keyframes spin { from { transform: rotateX(-18deg) rotateY(-28deg); } to { transform: rotateX(-24deg) rotateY(-52deg); } }

.cover--films { background: #111; display: flex; flex-direction: column; justify-content: center; gap: 14px; }
.cover--films .reel { display: flex; gap: 10px; width: max-content; animation: marquee 22s linear infinite; }
.cover--films .reel:nth-child(2) { animation-direction: reverse; animation-duration: 28s; }
.cover--films .frame { width: 150px; aspect-ratio: 9 / 12; border-radius: 3px; position: relative; overflow: hidden; }
.cover--films .frame::after { content: attr(data-t); position: absolute; left: 8px; bottom: 7px; font: 10px "Geist Mono", monospace; color: rgba(255,255,255,.85); }

/* ---------- playground ---------- */
.playground { background: var(--band); padding: 96px 32px 120px; transition: background-color .3s; }
.playground__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 40px; }
.toy h3 { margin-top: 16px; font-weight: 500; font-size: 14px; }
.toy > p { margin-top: 10px; font-size: 14px; line-height: 1.4; color: var(--content-tertiary); max-width: 480px; }
.visit { display: inline-flex; gap: 6px; margin-top: 18px; font-size: 14px; font-weight: 500; }
.visit span { transition: transform .2s; }
.visit:hover span { transform: translate(2px, -2px); }
.visit.is-soon { color: var(--content-disabled); pointer-events: none; }
.toy__media { position: relative; aspect-ratio: 600 / 440; border-radius: 6px; overflow: hidden; }

.toy--stretch { background: #fff3ec; color: #1b1b1b; display: grid; grid-template-rows: auto 1fr auto; padding: 22px; gap: 14px; }
.stretch__holidays { display: flex; flex-wrap: wrap; gap: 6px; }
.stretch__holidays button { font: 500 12px "Geist", sans-serif; padding: 7px 11px; border-radius: 99px; background: rgba(0,0,0,.06); transition: .2s; }
.stretch__holidays button[aria-checked="true"] { background: #1b1b1b; color: #fff; }
.stretch__days { display: grid; grid-template-columns: repeat(var(--n, 11), 1fr); gap: 5px; align-content: center; }
.day { aspect-ratio: 3 / 4; border-radius: 8px; background: #fff; display: grid; place-content: center; text-align: center; gap: 2px; transition: background .3s, color .3s, transform .3s; box-shadow: inset 0 0 0 1px rgba(0,0,0,.06); }
.day small { font: 10px "Geist Mono", monospace; opacity: .6; text-transform: lowercase; }
.day b { font: 700 clamp(13px, 1.7vw, 22px) "Geist", sans-serif; letter-spacing: -.03em; }
.day.wkd { background: #ffe2d2; }
.day.hol { background: #e63b2e; color: #fff; }
.day.pto { background: #1b1b1b; color: #fff; }
.day.in { transform: translateY(-6px); }
.stretch__foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.stretch__pto { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.stretch__pto button { width: 30px; height: 30px; border-radius: 50%; background: #1b1b1b; color: #fff; font-size: 16px; display: grid; place-items: center; }
.stretch__pto button:disabled { opacity: .25; cursor: default; }
.stretch__result { font: 600 15px "Geist", sans-serif; letter-spacing: -.02em; }
.stretch__result em { font-style: normal; color: #e63b2e; }

.toy--deck { background: #15131a; display: grid; place-items: center; touch-action: none; }
.deck__count { position: absolute; top: 18px; left: 20px; font: 12px "Geist Mono", monospace; color: #9b95ab; z-index: 9; }
.deck__hint { position: absolute; bottom: 16px; font: 12px "Geist Mono", monospace; color: #6d6680; }
.dcard {
  position: absolute; width: min(62%, 320px); aspect-ratio: 3 / 2.1; border-radius: 18px; background: #fbfaf7; color: #111;
  padding: 20px; display: flex; flex-direction: column; justify-content: space-between;
  box-shadow: 0 18px 40px rgba(0,0,0,.35); cursor: grab; user-select: none;
  transition: transform .45s cubic-bezier(.2,.9,.3,1.1), opacity .3s;
}
.dcard.is-dragging { transition: none; cursor: grabbing; }
.dcard b { font: 600 12px "Geist Mono", monospace; color: #8a7f68; }
.dcard p { color: #111; font-weight: 650; font-size: clamp(15px, 1.7vw, 21px); line-height: 1.15; letter-spacing: -.025em; }
.dcard .stamp { position: absolute; top: 18px; right: 18px; font: 700 12px "Geist Mono", monospace; padding: 4px 8px; border-radius: 6px; border: 2px solid; opacity: 0; transform: rotate(8deg); }
.dcard .stamp.yes { color: #1f9d55; } .dcard .stamp.no { color: #c2391b; left: 18px; right: auto; transform: rotate(-8deg); }

/* ---------- archive ---------- */
.archive {
  display: grid; grid-template-columns: minmax(220px, 1fr) 2.6fr; gap: 64px;
  padding: 120px 32px 140px; background: var(--background-primary); transition: background-color .3s;
}
.archive__side { position: sticky; top: 104px; align-self: start; display: flex; flex-direction: column; justify-content: space-between; min-height: calc(100vh - 220px); }
.archive__tags h3 { font-size: 14px; color: var(--content-secondary); margin-bottom: 16px; }
.archive__tags ul { list-style: none; margin: 0; padding: 0; }
.archive__tags li { border-bottom: 1px solid var(--border-disabled); }
.archive__tags button { width: 100%; display: flex; justify-content: space-between; align-items: center; padding: 10px 0; font-size: 14px; color: var(--content-disabled); transition: color .2s; text-align: left; }
.archive__tags button:hover { color: var(--content-tertiary); }
.archive__tags button[aria-pressed="true"] { color: var(--content-primary); }
.archive__tags button svg { opacity: 0; transition: opacity .2s; }
.archive__tags button[aria-pressed="true"] svg { opacity: 1; }

.archive__list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--border-tertiary); }
.arow { border-bottom: 1px solid var(--border-tertiary); }
.arow[hidden] { display: none; }
.arow__btn {
  width: 100%; display: grid; grid-template-columns: 1fr 1fr 24px; align-items: center; gap: 16px;
  padding: 13px 0; font-size: 14px; text-align: left; color: var(--content-secondary); transition: color .2s, padding .3s;
}
.arow__btn:hover { color: var(--content-primary); padding-left: 6px; }
.arow__btn svg { justify-self: end; color: var(--content-tertiary); transition: transform .3s; }
.arow.is-open .arow__btn svg { transform: rotate(180deg); }
.arow__panel { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .35s cubic-bezier(.2,.8,.2,1); }
.arow.is-open .arow__panel { grid-template-rows: 1fr; }
.arow__inner { overflow: hidden; }
.arow__body { display: grid; grid-template-columns: 1fr 1fr 24px; gap: 16px; padding: 0 0 18px; font-size: 14px; line-height: 1.45; color: var(--content-tertiary); }
.arow__body a { color: var(--content-primary); font-weight: 500; }
.arow__body a:hover { text-decoration: underline; text-underline-offset: 3px; }
.arow__meta { display: grid; gap: 8px; align-content: start; }
.arow__meta span { font: 12px "Geist Mono", monospace; color: var(--content-disabled); }

/* ---------- footer ---------- */
.footer { background: var(--background-hover); border-top: 1px solid var(--border-tertiary); transition: background-color .3s; overflow: hidden; }
.footer__play { display: grid; grid-template-columns: 1fr minmax(280px, 400px); border-bottom: 1px solid var(--border-tertiary); }
.pile { position: relative; height: 380px; overflow: hidden; touch-action: pan-y; }
.pile__label { position: absolute; top: 28px; left: 24px; font-size: 12px; color: var(--content-tertiary); }
.plogo {
  position: absolute; left: 0; top: 0; width: 62px; height: 62px; display: grid; place-items: center;
  font: 700 18px "Geist", sans-serif; letter-spacing: -.04em; user-select: none; cursor: grab;
  box-shadow: 0 6px 14px rgba(0,0,0,.25), inset 0 1px 0 rgba(255,255,255,.35);
  will-change: transform; visibility: hidden;
}
.plogo.square { border-radius: 16px; }
.plogo.circle { border-radius: 50%; }
.plogo.ring { box-shadow: 0 0 0 3px #5ee38a inset, 0 6px 14px rgba(0,0,0,.25); }
.plogo svg { pointer-events: none; }
.plogo .emoji { font-size: 30px; line-height: 1; }
.plogo.small { font-size: 15px; line-height: .95; text-align: center; }

.ttt { border-left: 1px solid var(--border-tertiary); display: grid; grid-template-rows: auto 1fr auto; font-size: 12px; }
.ttt__score { text-align: center; padding: 14px; border-bottom: 1px solid var(--border-tertiary); color: var(--content-secondary); font-size: 13px; }
.ttt__score b { font-weight: 500; color: var(--content-primary); }
.ttt__board { display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); }
.ttt__cell { border-right: 1px solid var(--border-tertiary); border-bottom: 1px solid var(--border-tertiary); font: 300 40px "Geist Mono", monospace; color: var(--content-primary); transition: background .15s; min-height: 70px; }
.ttt__cell:nth-child(3n) { border-right: 0; }
@media (hover: hover) { .ttt__cell:hover:empty { background: var(--background-pressed); } }
.ttt__cell:active:empty { background: var(--background-pressed); }
.ttt__cell.win { color: #6c4cf5; }
.ttt__cell span { display: inline-block; animation: pop .25s cubic-bezier(.2,1.4,.4,1); }
@keyframes pop { from { transform: scale(.3); opacity: 0; } }
.ttt__status { padding: 16px 14px; color: var(--content-tertiary); }

.footer__meta { display: flex; gap: 14px; padding: 18px 24px; font-size: 13px; color: var(--content-secondary); border-bottom: 1px solid var(--border-tertiary); }
.footer__big {
  display: block; padding: 12px 18px 24px; font: 400 120px/1 "Geist", sans-serif; letter-spacing: -.05em; overflow: hidden;
  color: var(--big); white-space: nowrap; transition: color .3s;
}
.footer__big:hover { color: var(--content-primary); }

/* ---------- resume ---------- */
.topbar__nav a[aria-current="page"] { color: var(--content-primary); }
.resume-page { background: var(--background-hover); }
/* the resume keeps its own capitals; the site around it stays lowercase */
.resume { text-transform: none; max-width: 760px; margin: 0 auto; padding: 128px 24px 120px; font-size: 14px; line-height: 1.5; color: var(--content-tertiary); }
.resume a { color: var(--content-primary); }
.resume a:hover { text-decoration: underline; text-underline-offset: 3px; }
.resume__head { padding-bottom: 32px; border-bottom: 1px solid var(--border-tertiary); }
.resume h1 { font-weight: 600; font-size: 32px; letter-spacing: -.03em; color: var(--content-primary); line-height: 1.1; }
.resume__role { margin-top: 8px; font-size: 15px; }
.resume__links { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 6px 18px; font-family: "Geist Mono", monospace; font-size: 12px; }
.resume__links a { font-weight: 500; }
.resume__pdf { margin-left: auto; background: var(--content-primary); color: var(--content-primary-inverse) !important; padding: 6px 12px; border-radius: 99px; text-decoration: none !important; }
.resume section { padding: 32px 0 8px; border-bottom: 1px solid var(--border-disabled); }
.resume section:last-child { border-bottom: 0; }
.resume h2 { display: flex; align-items: center; gap: 8px; font-weight: 500; font-size: 16px; color: var(--content-primary); margin-bottom: 20px; }
.job { margin-bottom: 24px; }
.job__top { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.job h3 { font-weight: 500; font-size: 15px; color: var(--content-primary); }
.job h3 span { font-weight: 400; color: var(--content-tertiary); margin-left: 8px; }
.job time { flex: none; font-family: "Geist Mono", monospace; font-size: 12px; color: var(--content-tertiary); }
.job ul { margin: 8px 0 0; padding-left: 18px; display: grid; gap: 6px; }
.job li::marker { color: var(--content-disabled); }
.job li b { font-weight: 500; color: var(--content-primary); }
.rows { margin: 0 0 24px; display: grid; gap: 10px; }
.rows div { display: grid; grid-template-columns: 220px 1fr; gap: 16px; }
.rows dt { color: var(--content-primary); font-weight: 500; }
.rows dd { margin: 0; }

@media print {
  @page { size: letter; margin: 0.3in 0.45in; }
  :root, [data-theme] { --content-primary: #111; --content-tertiary: #3a3a3a; --content-disabled: #999; --border-tertiary: #ccc; --border-disabled: #e5e5e5; --background-hover: #fff; }
  .topbar, .resume__pdf { display: none !important; }
  .resume-page { background: #fff; }
  .resume { padding: 0; max-width: none; font-size: 8.8pt; line-height: 1.22; }
  .resume h1 { font-size: 18pt; }
  .resume__role { margin-top: 3px; font-size: 10pt; }
  .resume__links { margin-top: 6px; font-size: 8.5pt; }
  .resume__head { padding-bottom: 8px; }
  .resume section { padding: 8px 0 0; }
  .resume h2 { margin-bottom: 6px; font-size: 10.5pt; }
  .dot { box-shadow: none; width: 7px; height: 7px; }
  .job { margin-bottom: 7px; break-inside: avoid; }
  .job h3 { font-size: 9.5pt; }
  .job time { font-size: 8pt; }
  .job ul { gap: 1px; margin-top: 2px; }
  .rows { gap: 2px; margin-bottom: 6px; }
  .rows div { grid-template-columns: 170px 1fr; }
}

/* ---------- responsive ---------- */
/* touch: swipes over the collage and the deck scroll the page; sideways drags still move cards */
@media (pointer: coarse) {
  .ci, .toy--deck { touch-action: pan-y; }
  a, button { -webkit-tap-highlight-color: transparent; }
}
@media (max-width: 900px) {
  .topbar {
    display: flex; gap: 4px; height: calc(56px + env(safe-area-inset-top));
    padding: env(safe-area-inset-top) max(10px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left));
  }
  .topbar__left { gap: 6px; flex: 1; min-width: 0; }
  .topbar__nav a:not(.nav-resume) { display: none; }
  /* every header control gets a ~44px touch target without changing how it looks */
  .topbar__nav a, .theme-toggle button { display: inline-flex; align-items: center; min-height: 44px; padding: 0 8px; }
  .logo { min-height: 44px; }
  .theme-toggle { gap: 0; }
  .topbar__icons { gap: 0; }
  .topbar__icons a { width: 40px; height: 44px; }
  .topbar__icons a[data-link="resume"] { display: none; }
  .hero { padding-top: 112px; }
  .collage { margin-top: 64px; }
  .featured, .archive { grid-template-columns: 1fr; gap: 32px; padding: 80px 16px 96px; }
  .featured .section-head, .archive__side { position: static; min-height: 0; }
  .section-head p { max-width: 460px; }
  .archive__tags { margin-top: 28px; }
  .playground { padding: 72px 16px 88px; }
  .playground__grid { grid-template-columns: 1fr; gap: 48px; }
  .footer__play { grid-template-columns: 1fr; }
  .ttt { border-left: 0; border-top: 1px solid var(--border-tertiary); }
  .pile { height: 320px; }
}
@media (max-width: 600px) {
  .featured__grid { grid-template-columns: 1fr; }
  .featured__col { gap: 28px; }
  .featured__grid { gap: 28px; }
  .arow__btn, .arow__body { grid-template-columns: 1.1fr 1fr 20px; gap: 10px; }
  .toy--stretch { padding: 14px; aspect-ratio: auto; }
  .stretch__days { gap: 3px; }
  .day { border-radius: 6px; }
  .footer__meta { flex-wrap: wrap; gap: 6px; }
  .resume { padding: 104px 16px 80px; }
  .job__top { flex-direction: column; gap: 2px; }
  .job h3 span { display: block; margin: 2px 0 0; }
  .rows div { grid-template-columns: 1fr; gap: 2px; }
  .resume__pdf { margin-left: 0; }
  .footer__big { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
}
/* phones get their own collage arrangement on a narrower stage, so nothing is cut off */
@media (max-width: 700px) {
  .collage { height: calc(700px * var(--s, 1)); margin-top: 48px; }
  .collage__stage { width: 700px; height: 700px; }
  .ci { left: var(--mx, var(--x)); top: var(--my, var(--y)); width: var(--mw, var(--w)); }
}
@media (max-width: 380px) {
  .theme-toggle button { padding: 0 5px; }
  .topbar__icons a { width: 34px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  html { scroll-behavior: auto; }
}
