/* ============================================================================
   styles.css
   1. the login terminal and the "reality breaking" transition
   2. the site itself, in the same style as williamcain.net
   ========================================================================== */

@font-face { font-family: "Mona Sans"; src: url("../assets/fonts/mona-sans.woff2") format("woff2"); font-weight: 200 900; font-stretch: 75% 125%; font-display: swap; }
@font-face { font-family: "Source Serif 4"; src: url("../assets/fonts/source-serif-4-italic.woff2") format("woff2"); font-style: italic; font-weight: 200 900; font-display: swap; }
@font-face { font-family: "Gochi Hand"; src: url("../assets/fonts/gochi-hand.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "B612 Mono"; src: url("../assets/fonts/b612-mono-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "B612 Mono"; src: url("../assets/fonts/b612-mono-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  /* from williamcain.net */
  --ink: #15202b; --ink-2: #3c4753; --ink-3: #4b5560;
  --paper: #fffdf8; --line: rgb(21 32 43 / .14);
  --orange: #ff5a1f; --orange-deep: #9a2c06;
  --blue: #1f4fc4; --blue-ink: #2b4a9a; --green-ink: #13703a;
  --yellow: #ffc928;
  --c-web: #c8f0da; --c-games: #e4dbff; --c-hardware: #ffd9bf; --c-security: #ffd0d1; --c-ai: #cfe5ff; --c-creative: #fff0a6; --c-photo: #efe3cd;
  --mona: "Mona Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "Source Serif 4", Georgia, serif;
  --hand: "Gochi Hand", "Bradley Hand", "Segoe Print", cursive;
  --mono: "B612 Mono", ui-monospace, Menlo, Consolas, monospace;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --pop: cubic-bezier(.34, 1.56, .64, 1);
  --maxw: 1240px;
  --gutter: clamp(16px, 4.5vw, 64px);

  /* the terminal */
  --tty-bg: #0b0f14; --tty-fg: #d7dde4; --tty-dim: #7d8894; --tty-ok: #4ee07a; --tty-blue: #5aa7ff; --tty-red: #ff5f56;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; background: #fff2e8; }
html.locked { overflow: hidden; }
html:has(dialog[open]) { overflow: hidden; }
body {
  margin: 0; color: var(--ink); font: 400 1rem/1.55 var(--mona); overflow-x: clip;
  background: linear-gradient(180deg, #d9ecff 0, #eef6ff 700px, #fffaf3 1500px, #fff2e8 100%);
}
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
a { color: inherit; }
h1, h2, h3, p, figure { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
::selection { background: var(--yellow); color: var(--ink); }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; border-radius: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.soon { display: inline-block; vertical-align: middle; padding: 0 8px; border: 1.5px dashed var(--orange-deep); border-radius: 999px; color: var(--orange-deep); font: 400 .9375rem/1.5 var(--hand); white-space: nowrap; }

/* =========================================================================
   1. THE LOGIN TERMINAL
   ========================================================================= */
.gate { position: fixed; inset: 0; z-index: 100; background: var(--tty-bg); color: var(--tty-fg); overflow: hidden; }
html:not(.locked) .gate { display: none; }
.term { position: absolute; inset: 0; padding: clamp(18px, 4vw, 48px); padding-right: min(380px, 34vw); overflow: auto; font: 400 clamp(.8125rem, 1.25vw, 1.0625rem)/1.6 var(--mono); }
.term::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(0deg, rgb(0 0 0 / .18) 0 1px, transparent 1px 3px); }
.term-out p { min-height: 1.6em; white-space: pre-wrap; overflow-wrap: anywhere; }
.ok { color: var(--tty-ok); }
.dim { color: var(--tty-dim); }
.blue { color: var(--tty-blue); }
.red { color: var(--tty-red); }
.bold { font-weight: 700; color: #fff; }
.term-line { display: flex; align-items: baseline; gap: .6ch; }
.term-input {
  flex: 1; min-width: 4ch; padding: 0; border: 0; outline: 0; background: transparent; color: #fff;
  font: inherit; caret-color: var(--tty-ok);
}
.term-input:focus-visible { outline: 0; }
.bar-line { color: var(--tty-ok); }

/* the sticky note with the login on it */
.note {
  position: absolute; right: clamp(20px, 6vw, 90px); top: 50%; translate: 0 -50%; rotate: 4deg; z-index: 2;
  display: grid; gap: 6px; width: min(270px, 28vw); padding: 30px 24px 22px; border: 0; text-align: left; cursor: pointer;
  background: linear-gradient(180deg, #ffe680, #ffd84d); color: var(--ink);
  box-shadow: 0 2px 0 rgb(0 0 0 / .1), 0 24px 40px rgb(0 0 0 / .55);
  font-family: var(--hand); transition: rotate .3s var(--pop), scale .3s var(--pop);
}
.note-tape { position: absolute; left: 50%; top: -12px; width: 96px; height: 26px; margin-left: -48px; background: rgb(255 255 255 / .55); rotate: -4deg; }
.note-hand { font-size: 1.6rem; line-height: 1; color: var(--orange-deep); }
.note-row { font-size: 1.7rem; line-height: 1.15; }
.note-row b { display: inline-block; min-width: 2.6em; font: 700 .8125rem/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.note-small { margin-top: 6px; font-size: 1.05rem; color: var(--ink-3); }
@media (hover: hover) { .note:hover { rotate: 1deg; scale: 1.03; } }
.note.nudge { animation: nudge .6s var(--pop); }
@keyframes nudge { 25% { rotate: -3deg; scale: 1.08; } 60% { rotate: 7deg; } }
.skip-intro { position: absolute; left: clamp(18px, 4vw, 48px); bottom: 18px; z-index: 2; padding: 6px 10px; border: 1px solid #2b3440; border-radius: 6px; background: transparent; color: var(--tty-dim); cursor: pointer; font: 400 .75rem/1 var(--mono); }
@media (hover: hover) { .skip-intro:hover { color: #fff; border-color: var(--tty-dim); } }
@media (max-width: 760px) {
  .term { padding: 178px 16px 80px; }
  .note { top: 18px; right: 16px; translate: none; width: 200px; padding: 22px 18px 14px; rotate: 3deg; }
  .note-row { font-size: 1.35rem; }
  .note-hand { font-size: 1.3rem; }
  .note-small { display: none; }
}

/* ---- reality breaking ---- */
.gate.shake .term { animation: shake .4s steps(8) infinite; }
@keyframes shake {
  0% { translate: 0 0; text-shadow: 2px 0 var(--tty-red), -2px 0 var(--tty-blue); }
  25% { translate: -6px 2px; }
  50% { translate: 5px -3px; text-shadow: -3px 0 var(--tty-red), 3px 0 var(--tty-blue); }
  75% { translate: -2px 4px; }
  100% { translate: 3px 0; }
}
/* the terminal breaks into strips that fall away */
.shard { position: fixed; inset: 0; z-index: 101; overflow: hidden; pointer-events: none; background: var(--tty-bg); }
.shard .term { padding-right: min(360px, 34vw); }
@media (max-width: 760px) { .shard .term { padding: 178px 16px 80px; } }

/* the site comes through in stages: raw terminal text, then paper, then type, then colour */
html.s0 body { background: var(--tty-bg) !important; }
html.s0 #site *, html.s0 .nav *, html.s0 .nav, html.s0 .foot, html.s0 .foot *, html.s0 .table, html.s0 .table * {
  font-family: var(--mono) !important; font-weight: 400 !important; font-style: normal !important; letter-spacing: 0 !important;
  color: var(--tty-ok) !important; background: transparent !important; border-color: rgb(78 224 122 / .35) !important;
  box-shadow: none !important; text-shadow: none !important; rotate: 0deg !important; -webkit-text-stroke: 0 !important;
}
html.s0 #site img, html.s0 #site video, html.s0 .table img, html.s0 .table canvas { filter: grayscale(1) brightness(.35) contrast(2) sepia(1) hue-rotate(70deg) saturate(3); }
html.s0 #site *::before, html.s0 #site *::after, html.s1 #site *::before, html.s1 #site *::after,
html.s0 .table *::before, html.s0 .table *::after, html.s1 .table *::before, html.s1 .table *::after { opacity: 0 !important; }
html.s1 body { background: var(--paper) !important; }
html.s1 #site *, html.s1 .nav, html.s1 .nav *, html.s1 .table, html.s1 .table * {
  font-family: var(--mono) !important; font-weight: 400 !important; font-style: normal !important; letter-spacing: 0 !important;
  box-shadow: none !important; rotate: 0deg !important; background-color: transparent !important; text-shadow: none !important;
}
html.s1 #site img, html.s1 #site video, html.s1 .table img, html.s1 .table canvas { filter: grayscale(1) contrast(1.6) blur(1.5px); }
html.s2 #site img, html.s2 #site video, html.s2 .table img, html.s2 .table canvas { filter: grayscale(1); }
html.glitch #site, html.glitch .nav, html.glitch .table { animation: rgb .16s steps(2) 1; }
@keyframes rgb {
  0% { filter: drop-shadow(5px 0 0 rgb(255 0 60 / .8)) drop-shadow(-5px 0 0 rgb(0 200 255 / .8)); translate: -8px 0; }
  50% { filter: invert(1) drop-shadow(-4px 0 0 rgb(255 0 60 / .8)); translate: 6px 0; }
  100% { filter: none; translate: 0; }
}
.tear { position: fixed; z-index: 99; pointer-events: none; backdrop-filter: invert(1) hue-rotate(90deg); }

/* =========================================================================
   2. THE SITE
   ========================================================================= */

/* ---------- top bar, like the main site ---------- */
.nav {
  position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 18px;
  padding: 12px var(--gutter); background: rgb(255 253 248 / .82); backdrop-filter: blur(10px); border-bottom: 1.5px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; flex: none; }
.brand img { width: 40px; height: 40px; }
.brand span { font: 400 1.35rem/1 var(--hand); }
.nav-links { display: flex; gap: 4px; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.nav-links::-webkit-scrollbar { display: none; }
.nav-links a { padding: 8px 12px; border-radius: 999px; font-weight: 600; font-size: .9375rem; text-decoration: none; white-space: nowrap; }
.nav-links a[aria-current] { background: var(--ink); color: var(--paper); }
@media (hover: hover) { .nav-links a:not([aria-current]):hover { background: rgb(21 32 43 / .07); } }
.nav-main { flex: none; padding: 9px 14px; border: 2px solid var(--ink); border-radius: 999px; background: var(--orange); font-weight: 700; font-size: .875rem; text-decoration: none; }
@media (max-width: 980px) {
  .nav { flex-wrap: wrap; row-gap: 6px; padding-bottom: 8px; }
  .nav-links { order: 3; width: 100%; margin: 0 calc(-1 * var(--gutter)); padding: 0 var(--gutter); }
  .nav-main { margin-left: auto; }
}
@media (max-width: 420px) { .nav-main { font-size: .75rem; padding: 7px 10px; } .brand span { font-size: 1.15rem; } }

/* ---------- shared pieces from the main site ---------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }
.pol {
  position: relative; display: block; padding: 10px 10px 0; background: #fff; color: var(--ink);
  box-shadow: 0 2px 0 rgb(0 0 0 / .05), 0 20px 38px rgb(21 32 43 / .2); rotate: var(--tilt, -2deg);
  transition: rotate .4s var(--pop), scale .4s var(--pop);
}
.pol::before { content: ""; position: absolute; left: 50%; top: -12px; z-index: 2; width: 84px; height: 24px; margin-left: -42px; background: rgb(255 201 40 / .72); rotate: calc(var(--tilt, -2deg) * -2); }
.pol img, .pol video, .pol canvas { display: block; width: 100%; height: 100%; aspect-ratio: var(--ar, 4 / 3); object-fit: cover; background: #e9e4da; }
/* a clip: a short looping video in a polaroid, with a pause button in the corner */
.live-btn {
  position: absolute; right: 20px; top: 20px; z-index: 2; width: 38px; height: 38px; padding: 0;
  border: 2px solid var(--paper); border-radius: 50%; background: rgb(21 32 43 / .6); cursor: pointer;
}
.live-btn::before, .live-btn::after { content: ""; position: absolute; top: 11px; width: 4px; height: 12px; border-radius: 1px; background: var(--paper); }
.live-btn::before { left: 11px; } .live-btn::after { right: 11px; }
.held .live-btn::before { left: 13px; top: 10px; width: 0; height: 0; border-radius: 0; background: none; border-style: solid; border-width: 7px 0 7px 11px; border-color: transparent transparent transparent var(--paper); }
.held .live-btn::after { display: none; }
@media (hover: hover) { .live-btn:hover { background: var(--ink); } }
.pol figcaption { padding: 8px 4px 12px; text-align: center; font: 400 1.3rem/1.1 var(--hand); }
.pol a { display: block; }
.pol.blank { padding-bottom: 38px; }
.pet .pol.blank { padding-bottom: 0; }
@media (hover: hover) { .pol:hover { rotate: 0deg; scale: 1.025; z-index: 3; } }
.tall { --ar: 3 / 4; } .wide { --ar: 4 / 3; } .square { --ar: 1; } .story { --ar: 9 / 16; } .cine { --ar: 16 / 9; }
[data-zoom] { cursor: zoom-in; }
.btn { display: inline-flex; align-items: center; gap: 10px; padding: 13px 20px; border: 2px solid var(--ink); border-radius: 999px; background: var(--paper); color: var(--ink); font-weight: 700; text-decoration: none; cursor: pointer; }
.btn-orange { background: var(--orange); }
.btn svg { width: 20px; height: 20px; fill: currentColor; }
@media (hover: hover) { .btn:hover { background: var(--yellow); } }

/* ---------- hero ---------- */
.hero { padding: clamp(60px, 9vw, 120px) 0 clamp(70px, 9vw, 120px); }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 40px; align-items: center; }
.hello { font: 400 clamp(1.5rem, 2.6vw, 2.1rem)/1 var(--hand); color: var(--orange-deep); rotate: -3deg; width: fit-content; }
.hero h1 { margin-top: 10px; font: 800 clamp(3.2rem, 7.4vw, 7rem)/.9 var(--mona); font-stretch: 110%; letter-spacing: -.04em; }
.hero h1 span { display: block; color: var(--orange); }
.hero-sub { margin-top: 22px; max-width: 34ch; font-size: clamp(1.05rem, 1.5vw, 1.25rem); color: var(--ink-2); }
.hero-aside { margin-top: 16px; font: 400 1.3rem/1.2 var(--hand); color: var(--orange-deep); }
.hero-aside a { text-decoration: underline wavy var(--orange); text-underline-offset: .2em; }
.hero-photos { position: relative; height: clamp(360px, 44vw, 560px); }
.hero-photos .pol { position: absolute; }
.hero-photos .pol:nth-child(1) { left: 0; top: 6%; width: 40%; --tilt: -6deg; --ar: 3 / 4; z-index: 2; }
.hero-photos .pol:nth-child(2) { left: 30%; top: 0; width: 52%; --tilt: 3deg; --ar: 4 / 3; z-index: 1; }
.hero-photos .pol:nth-child(3) { right: 0; bottom: 0; width: 38%; --tilt: 5deg; --ar: 3 / 4; z-index: 3; }
@media (max-width: 860px) {
  .hero .wrap { grid-template-columns: minmax(0, 1fr); }
  .hero-photos { height: 92vw; max-height: 520px; }
}

/* ---------- sections, like the main site ---------- */
.sec { padding: clamp(70px, 9vw, 120px) 0; scroll-margin-top: 60px; }
.sec-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 22px; margin-bottom: clamp(34px, 5vw, 56px); }
.sec-head h2 { font: 800 clamp(2.8rem, 7vw, 6rem)/.9 var(--mona); letter-spacing: -.04em; }
.sec-head .note-line { font: 400 clamp(1.3rem, 2.2vw, 1.7rem)/1.15 var(--hand); color: var(--orange-deep); rotate: -2deg; }
.sec-head .note-line::after { content: " ↘"; }
.sub { font: 700 .75rem/1.2 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 18px; }

/* a photo mosaic: big photo on the left, the rest around it */
.mosaic { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: clamp(18px, 2.4vw, 34px); align-items: start; }
.mosaic .pol:nth-child(1) { grid-column: 1 / span 5; grid-row: span 2; --tilt: -2deg; }
.mosaic .pol:nth-child(2) { grid-column: 6 / span 3; --tilt: 3deg; margin-top: 20px; }
.mosaic .pol:nth-child(3) { grid-column: 9 / span 4; --tilt: -1.5deg; }
.mosaic .pol:nth-child(4) { grid-column: 6 / span 4; --tilt: 1.5deg; }
.mosaic .pol:nth-child(5) { grid-column: 10 / span 3; --tilt: -3deg; margin-top: 26px; }
@media (max-width: 760px) {
  .mosaic { grid-template-columns: 1fr 1fr; gap: 26px 16px; }
  .mosaic .pol:nth-child(n) { grid-column: auto; grid-row: auto; margin-top: 0; }
  .mosaic .pol:nth-child(1) { grid-column: 1 / -1; width: 86%; justify-self: center; }
}

/* racing */
.race-sum { margin-top: clamp(48px, 6vw, 72px); font: 400 clamp(1.3rem, 2.2vw, 1.7rem)/1.3 var(--hand); }
.race-sum b { font-weight: 400; color: var(--orange-deep); }
.plates { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 22px; margin-top: 30px; }
.plate-card {
  position: relative; padding-bottom: 14px; border: 2px solid var(--ink); border-radius: 12px 12px 16px 16px; background: var(--paper);
  rotate: var(--tilt); transform-origin: 50% 0; transition: rotate .5s var(--pop); box-shadow: 0 12px 24px rgb(21 32 43 / .14);
}
@media (hover: hover) { .plate:hover .plate-card { rotate: calc(var(--tilt) * -1.5); } }
.plate-card::before, .plate-card::after { content: ""; position: absolute; top: -13px; width: 7px; height: 26px; border-radius: 3px; background: var(--ink); }
.plate-card::before { left: 24%; } .plate-card::after { right: 24%; }
.plate-race { padding: 10px 12px 8px; border-bottom: 2px solid var(--ink); border-radius: 10px 10px 0 0; background: var(--orange); font: 800 1rem/1.15 var(--mona); overflow-wrap: anywhere; }
.champs .plate-race { background: var(--yellow); }
.plate-no { text-align: center; font: 900 clamp(2.4rem, 4.4vw, 3.4rem)/1.1 var(--mona); font-stretch: 115%; letter-spacing: -.03em; }
.plate-meta { text-align: center; font: 400 .75rem/1.3 var(--mono); color: var(--ink-3); }
.plate-tag { position: absolute; right: 10px; bottom: -15px; padding: 3px 10px; border: 2px solid var(--ink); border-radius: 999px; background: var(--c-web); font: 700 .6875rem/1.3 var(--mono); letter-spacing: .04em; white-space: nowrap; rotate: 4deg; }
.plate-tag.hot { background: var(--orange); }
@media (max-width: 1000px) {
  .plates { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(170px, 28%); overflow-x: auto; scroll-snap-type: x mandatory; padding: 22px 4px 26px; margin-inline: -4px; scrollbar-width: none; }
  .plates::-webkit-scrollbar { display: none; }
  .plate { scroll-snap-align: start; }
}
@media (max-width: 560px) { .plates { grid-auto-columns: 62%; } }
.sec-cta { margin-top: 44px; display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; }
.sec-cta .hand { font: 400 1.3rem/1.2 var(--hand); color: var(--orange-deep); }

/* music: record sleeves */
.records { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: clamp(16px, 2.4vw, 30px); }
.rec { display: grid; gap: 10px; }
.sleeve { position: relative; aspect-ratio: 1; border: 2px solid var(--ink); border-radius: 4px; overflow: hidden; background: var(--c, var(--ink)); box-shadow: 0 16px 30px rgb(21 32 43 / .18); rotate: var(--tilt); transition: rotate .4s var(--pop); }
.sleeve img { width: 100%; height: 100%; object-fit: cover; }
.sleeve-blank { position: absolute; inset: 0; display: grid; place-items: center; }
.sleeve-blank::before { content: ""; width: 58%; aspect-ratio: 1; border-radius: 50%; background: repeating-radial-gradient(circle, #111 0 2px, #222 2px 3px); box-shadow: 0 0 0 2px rgb(0 0 0 / .3); }
.sleeve-blank::after { content: ""; position: absolute; width: 18%; aspect-ratio: 1; border-radius: 50%; background: var(--paper); border: 2px solid var(--ink); }
@media (hover: hover) { .rec:hover .sleeve { rotate: 0deg; } }
.rec b { font-size: 1.05rem; line-height: 1.2; }
.rec span { font: 400 1.2rem/1.1 var(--hand); color: var(--ink-2); }
@media (max-width: 760px) { .records { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px 18px; } }

/* games: two photos and a list */
.split { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(30px, 5vw, 64px); align-items: center; }
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: start; }
.duo .pol:nth-child(1) { --tilt: -3deg; }
.duo .pol:nth-child(2) { --tilt: 2.5deg; margin-top: 40px; }
.list li { display: grid; gap: 2px; padding: 16px 0; border-top: 2px solid var(--ink); }
.list li:last-child { border-bottom: 2px solid var(--ink); }
.list b { font: 800 clamp(1.3rem, 2.2vw, 1.7rem)/1.1 var(--mona); letter-spacing: -.02em; }
.list span { font: 400 1.25rem/1.2 var(--hand); color: var(--blue-ink); }
.list a { font-weight: 700; font-size: .875rem; }
@media (max-width: 860px) { .split { grid-template-columns: minmax(0, 1fr); } }

/* shows: posters */
.posters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(16px, 2.4vw, 30px); }
.poster { display: grid; gap: 10px; }
.poster-img { position: relative; aspect-ratio: 2 / 3; border: 2px solid var(--ink); border-radius: 10px; overflow: hidden; background: var(--c, var(--c-ai)); box-shadow: 0 16px 30px rgb(21 32 43 / .16); display: grid; place-items: center; }
.poster-img img { width: 100%; height: 100%; object-fit: cover; }
.poster-img .ph { font: 400 1.6rem/1 var(--hand); color: var(--ink-3); }
.poster b { font-size: 1.05rem; }
.poster .meta { font: 400 .75rem/1.3 var(--mono); color: var(--ink-3); }
.poster .stars { color: var(--orange); letter-spacing: .06em; }
@media (max-width: 760px) { .posters { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px 18px; } }

/* range: paper targets and the rules */
.range { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: clamp(30px, 5vw, 64px); align-items: start; }
.targets { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(20px, 3vw, 40px); }
.tgt { rotate: var(--tilt); }
.tgt-paper { position: relative; padding: 14px; border: 2px solid var(--ink); background: var(--paper); box-shadow: 0 16px 28px rgb(21 32 43 / .18); }
.tgt-paper::before { content: ""; position: absolute; left: 50%; top: -9px; width: 16px; height: 16px; margin-left: -8px; border: 2px solid var(--ink); border-radius: 50%; background: var(--orange); }
.tgt-paper svg { display: block; width: 100%; height: auto; aspect-ratio: 1; }
.ring { fill: var(--paper); stroke: var(--ink); stroke-width: .06; }
.ring-in { fill: var(--ink); stroke: var(--paper); stroke-width: .06; }
.xring { fill: none; stroke: var(--paper); stroke-width: .06; }
.cross { stroke: rgb(255 90 31 / .6); stroke-width: .04; }
.hole-rim { fill: #fff; opacity: .9; }
.hole { fill: #3a2a1a; }
.tgt figcaption { margin-top: 12px; text-align: center; }
.tgt figcaption b { display: block; font-size: 1.1rem; }
.tgt figcaption span { font: 400 1.2rem/1.2 var(--hand); color: var(--blue-ink); }
.rules { padding: 22px 22px 24px; background: var(--yellow); border: 2px solid var(--ink); rotate: 2deg; box-shadow: 0 16px 28px rgb(21 32 43 / .18); }
.rules h3 { font: 800 1.1rem/1 var(--mona); letter-spacing: .04em; text-transform: uppercase; }
.rules ol { margin-top: 12px; display: grid; gap: 10px; counter-reset: r; }
.rules li { counter-increment: r; display: grid; grid-template-columns: 22px 1fr; font: 400 1.3rem/1.15 var(--hand); }
.rules li::before { content: counter(r) "."; font: 700 .875rem/1.6 var(--mono); }
@media (max-width: 860px) { .range { grid-template-columns: minmax(0, 1fr); } .rules { max-width: 420px; } }

/* electronics: the head unit photos, then the builds */
.trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(18px, 3vw, 40px); align-items: start; margin-bottom: clamp(44px, 6vw, 70px); }
.trio .pol { --ar: 3 / 4; }
.trio .pol:nth-child(1) { --tilt: -3deg; } .trio .pol:nth-child(2) { --tilt: 1.5deg; margin-top: 30px; } .trio .pol:nth-child(3) { --tilt: -1deg; }
.builds { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 clamp(18px, 3vw, 34px); }
.builds li { border-top: 2px solid var(--ink); padding-top: 14px; }
.builds b { font: 800 1.35rem/1.1 var(--mona); }
.builds p { margin-top: 6px; color: var(--ink-2); font-size: .9375rem; }
.builds a { display: inline-block; margin-top: 8px; font-weight: 700; font-size: .875rem; }
@media (max-width: 860px) { .builds { grid-template-columns: 1fr 1fr; gap: 26px 18px; } }
@media (max-width: 560px) { .trio { grid-template-columns: 1fr 1fr; } .trio .pol:nth-child(3) { grid-column: 1 / -1; width: 60%; justify-self: center; } }

/* pets: two big polaroids */
.pets { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(30px, 6vw, 90px); max-width: 980px; }
.pet .pol { --ar: 4 / 5; }
.pet:nth-child(1) .pol { --tilt: -3deg; } .pet:nth-child(2) .pol { --tilt: 2.5deg; margin-top: 40px; }
.pet-tag { margin-top: 18px; text-align: center; }
.pet-tag b { font: 800 1.6rem/1.1 var(--mona); }
.pet-tag p { font: 400 1.35rem/1.2 var(--hand); color: var(--blue-ink); }
@media (max-width: 560px) { .pets { gap: 20px; } .pet:nth-child(2) .pol { margin-top: 24px; } .pet-tag b { font-size: 1.2rem; } .pet-tag p { font-size: 1.1rem; } }

/* camera roll: a loose masonry of polaroids */
.roll { columns: 3 280px; column-gap: clamp(20px, 3vw, 40px); }
.roll .pol { display: inline-block; width: 100%; break-inside: avoid; margin: 14px 0 clamp(18px, 3vw, 34px); }
.roll .pol:nth-child(3n + 1) { --tilt: -2deg; } .roll .pol:nth-child(3n + 2) { --tilt: 1.8deg; } .roll .pol:nth-child(3n) { --tilt: -1deg; }

/* ---------- footer ---------- */
.foot { padding: clamp(80px, 10vw, 130px) 0 60px; background: var(--ink); color: var(--paper); }
.foot-sign { font: 400 clamp(2.6rem, 7vw, 5.4rem)/1 var(--hand); rotate: -2deg; }
.foot-links { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.foot .btn { border-color: var(--paper); }
.foot .btn-ghost { background: transparent; color: var(--paper); }
.foot-small { margin-top: 44px; font: 400 .75rem/1.6 var(--mono); color: rgb(255 253 248 / .65); }
.foot-small button { padding: 0; border: 0; background: none; color: inherit; text-decoration: underline; cursor: pointer; font: inherit; }

/* ---------- photo viewer ---------- */
.viewer { width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: transparent; place-items: center; }
.viewer[open] { display: grid; }
.viewer::backdrop { background: rgb(10 14 20 / .9); }
.viewer img { max-width: min(94vw, 1400px); max-height: 88vh; border: 8px solid #fff; object-fit: contain; }
.viewer-x { position: fixed; top: 14px; right: 14px; width: 44px; height: 44px; border: 2px solid var(--ink); border-radius: 50%; background: var(--paper); cursor: pointer; font-weight: 700; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
