/* ============ Tokens ============ */
:root {
  --bg: #0b0b0c;
  --text: #ecebe6;
  --muted: #8b8a85;
  --line: #242426;
  --orange: #ff5a1f;
  --yellow: #f5c400;
  --paper: #f3efe5;
  --paper-text: #2b2720;
  --ink: #22355e;
  --stamp: #b23a1a;
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --mono: 'DM Mono', ui-monospace, monospace;
  --hand: 'Caveat', cursive;
  --race: 'Racing Sans One', 'Inter', sans-serif;
  color-scheme: dark;
}

/* ============ Base ============ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
a { color: inherit; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.section-label {
  position: relative; z-index: 2;
  display: flex; align-items: center; gap: .8rem;
  margin: 0 0 2rem;
  font-family: var(--mono); font-size: .72rem; letter-spacing: .25em; text-transform: uppercase;
  color: var(--muted);
}
.section-label b { padding: .2rem .5rem; background: var(--orange); color: #111; font-weight: 500; letter-spacing: .15em; }

/* Carbon fibre weave, shared by the notebook covers and the contact card */
.carbon {
  background-color: #141414;
  background-image:
    linear-gradient(115deg, rgba(255,255,255,.09), transparent 35%, rgba(255,255,255,.035) 60%, transparent 80%),
    linear-gradient(27deg, #151515 5px, transparent 5px),
    linear-gradient(207deg, #151515 5px, transparent 5px),
    linear-gradient(27deg, #222 5px, transparent 5px),
    linear-gradient(207deg, #222 5px, transparent 5px),
    linear-gradient(90deg, #1b1b1b 10px, transparent 10px),
    linear-gradient(#1d1d1d 25%, #1a1a1a 25%, #1a1a1a 50%, transparent 50%, transparent 75%, #242424 75%, #242424);
  background-size: 100% 100%, 20px 20px, 20px 20px, 20px 20px, 20px 20px, 20px 20px, 20px 20px;
  background-position: 0 0, 0 5px, 10px 0, 0 10px, 10px 5px, 0 0, 0 0;
}

/* ============ Header ============ */
.top {
  position: fixed; inset: 0 0 auto; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px 22px;
  background: linear-gradient(var(--bg) 35%, transparent);
  pointer-events: none;
}
.top > * { pointer-events: auto; }
.brand { display: inline-flex; align-items: center; gap: .65rem; text-decoration: none; }
.badge {
  display: inline-grid; place-items: center; width: 2.1rem; height: 1.6rem;
  background: var(--orange); color: #111; border-radius: 4px;
  font-family: var(--race); font-size: 1rem; transform: skewX(-10deg);
}
.brand__name { font-family: var(--mono); font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; }
.top__nav { display: flex; gap: 1.6rem; font-family: var(--mono); font-size: .74rem; letter-spacing: .16em; text-transform: uppercase; }
.top__nav a { text-decoration: none; color: var(--muted); transition: color .2s; }
.top__nav a:hover { color: var(--orange); }
@media (max-width: 560px) {
  .top { padding: 12px 16px 20px; }
  .brand__name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .top__nav { gap: 1rem; font-size: .68rem; letter-spacing: .08em; }
}

/* ============ Hero ============ */
.hero {
  position: relative; isolation: isolate;
  min-height: 100svh; max-width: 1240px; margin: 0 auto;
  padding: 120px 24px 110px;
  display: flex; flex-direction: column; justify-content: center;
}

/* Five start lights: they come on red one by one, then all switch to green.
   Afterwards they're a button: the reaction game in js/lights.js */
.lights {
  display: flex; gap: 10px; align-self: flex-start; margin: 0 0 1rem; padding: 0;
  background: none; border: 0; border-radius: 10px; cursor: pointer;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.lights:disabled { cursor: default; }
.lights span {
  --d: .3s;
  display: flex; flex-direction: column; justify-content: space-evenly; align-items: center;
  width: 34px; height: 76px;
  background: #151517; border: 1px solid #2a2a2e; border-radius: 9px;
  box-shadow: inset 0 2px 6px rgba(0,0,0,.6);
}
.lights span::before, .lights span::after {
  content: ''; width: 20px; height: 20px; border-radius: 50%;
  background: #2b1513; box-shadow: inset 0 2px 4px rgba(0,0,0,.6);
  animation: lamp calc(2.9s - var(--d)) linear var(--d), lamp-go .15s ease-out 2.9s forwards;
}
.lights span:nth-child(2) { --d: .75s; }
.lights span:nth-child(3) { --d: 1.2s; }
.lights span:nth-child(4) { --d: 1.65s; }
.lights span:nth-child(5) { --d: 2.1s; }
.lights:not(:disabled):hover span { border-color: #3d3d42; }
/* Game states (the intro's forwards-filled green would override them, so drop it first) */
.lights.is-game span::before, .lights.is-game span::after { animation: none; }
.lights span.is-on::before, .lights span.is-on::after { background: #ff2a1a; box-shadow: 0 0 14px 3px rgba(255,42,26,.65), inset 0 -3px 5px rgba(0,0,0,.25); }
.lights.is-go span::before, .lights.is-go span::after { background: #2bdc4f; box-shadow: 0 0 14px 3px rgba(43,220,79,.6), inset 0 -3px 5px rgba(0,0,0,.25); }
.hero__go {
  margin: 0 0 1.4rem; min-height: 1.2em;
  font-family: var(--mono); font-size: .78rem; letter-spacing: .3em; text-transform: uppercase; color: var(--orange);
  opacity: 0; animation: rise .6s 2.95s forwards;
}

.hero__name {
  margin: 0;
  font-style: italic; font-weight: 800;
  font-size: clamp(3.1rem, 10vw, 8.6rem);
  line-height: .9; letter-spacing: -.04em;
}
.hero__name > span { display: block; }
.dot { color: var(--orange); }
.hero__lede { max-width: 34rem; margin: 1.8rem 0 2.4rem; font-size: clamp(1.05rem, 1.6vw, 1.25rem); color: #c9c8c2; }

/* Timing-screen strip */
.timing {
  display: flex; flex-wrap: wrap; margin: 0; max-width: 46rem;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  font-family: var(--mono);
}
.timing > div { padding: .8rem 1.6rem .8rem 0; margin-right: 1.6rem; border-right: 1px solid var(--line); }
.timing > div:last-child { border-right: 0; margin-right: 0; }
.timing dt { font-size: .62rem; letter-spacing: .25em; text-transform: uppercase; color: var(--muted); }
.timing dd { margin: .15rem 0 0; font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.timing .is-live { color: var(--orange); }

.hero__cue {
  position: absolute; left: 50%; bottom: 24px; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: .3rem;
  font-family: var(--mono); font-size: .7rem; letter-spacing: .25em; text-transform: uppercase;
  color: var(--muted); text-decoration: none; transition: color .2s;
}
.hero__cue:hover { color: var(--orange); }
.hero__cue svg { width: 22px; height: 46px; animation: bob 2.4s 2.6s ease-in-out infinite; }
.hero__cue path { stroke-dasharray: 90; stroke-dashoffset: 90; animation: draw 1.4s 1s ease forwards; }

.speed { position: absolute; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.speed i {
  position: absolute; left: 0; height: 1px; width: 28vw;
  background: linear-gradient(90deg, transparent, var(--orange));
  opacity: .5; transform: translateX(-40vw);
  animation: streak 3.4s cubic-bezier(.6,0,.2,1) infinite;
}
.speed i:nth-child(1) { top: 22%; animation-delay: .2s; }
.speed i:nth-child(2) { top: 38%; width: 40vw; opacity: .3; animation-delay: 1.2s; }
.speed i:nth-child(3) { top: 56%; animation-delay: 2.1s; }
.speed i:nth-child(4) { top: 69%; width: 16vw; opacity: .3; animation-delay: .8s; }
.speed i:nth-child(5) { top: 82%; width: 34vw; animation-delay: 2.7s; }

.hero__sketch {
  position: absolute; z-index: -1; right: 24px; top: 50%; width: min(46vw, 620px);
  transform: translateY(-40%); color: var(--text); opacity: .12; pointer-events: none;
}
.hero__sketch svg { width: 100%; }

.rise { opacity: 0; transform: translateY(28px); animation: rise .9s cubic-bezier(.2,.8,.2,1) forwards; animation-delay: var(--d, 0s); }
/* The name is the page's largest element: slide it in without hiding it, so it paints right away */
.hero__name .rise { opacity: 1; animation-name: slide-up; }

@media (max-width: 820px) {
  .hero { padding: 100px 16px 120px; }
  .hero__name { font-size: clamp(3.1rem, 16vw, 5.5rem); }
  .lights span { width: 28px; height: 62px; }
  .lights span::before, .lights span::after { width: 16px; height: 16px; }
  .timing { display: grid; grid-template-columns: 1fr 1fr; }
  .timing > div { padding: .7rem 0; margin: 0; border-right: 0; }
  .timing > div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .timing > div:first-child { display: none; }
  .timing > div:nth-child(n+2) { border-top: 0; }
  .timing > div:nth-child(n+4) { border-top: 1px solid var(--line); }
  .hero__sketch { display: none; }
}

/* ============ Desk ============ */
/* The notebook sits on a starting-grid slot painted on asphalt */
.desk {
  --pw: max(240px, min(400px, calc((100vw - 220px) / 2), calc((100svh - 250px) / 1.35)));
  position: relative; isolation: isolate; overflow: hidden;
  min-height: 100svh;
  padding: 96px 16px 64px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background-color: #141416;
  background-image:
    radial-gradient(ellipse 65% 55% at 50% 55%, rgba(255,255,255,.05), transparent 70%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .12 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.desk::after { /* fade into the page above and below */
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(var(--bg), transparent 14%, transparent 86%, var(--bg));
}

.grid-slot {
  position: absolute; z-index: -1; left: 50%; top: 53%;
  width: calc(var(--pw) * 2 + 170px);
  height: calc(var(--pw) * 1.35 + 110px);
  transform: translate(-50%, -50%) rotate(-2deg);
  border: 7px solid rgba(240,238,230,.62); border-bottom: 0;
  -webkit-mask-image: linear-gradient(#000 55%, transparent 92%);
          mask-image: linear-gradient(#000 55%, transparent 92%);
}
.grid-slot::before { /* worn paint */
  content: ''; position: absolute; inset: -7px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.4' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 .08 0 0 0 0 .08 0 0 0 0 .09 0 0 0 1.6 -.75'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.grid-slot__pos {
  position: absolute; left: .35em; top: .15em;
  font-family: var(--race); font-size: clamp(3rem, 7vw, 5.5rem); line-height: 1;
  color: rgba(240,238,230,.5);
}
.skid { position: absolute; z-index: -1; left: 50%; top: 50%; width: min(1500px, 140vw); transform: translate(-50%, -50%); opacity: .55; pointer-events: none; }

.desk .section-label { margin-bottom: 4.4rem; }

.prop { position: absolute; z-index: 0; pointer-events: none; filter: drop-shadow(10px 18px 14px rgba(0,0,0,.55)); }
.prop--watch { width: 118px; left: calc(50% - var(--pw) - 210px); top: calc(50% - 40px); transform: rotate(-14deg); }
.prop--key { width: 74px; left: calc(50% + var(--pw) + 80px); top: calc(50% + 30px); transform: rotate(-22deg); }

/* ============ Notebook ============ */
.nb {
  position: relative; z-index: 1;
  display: grid;
  grid-template-columns: auto auto auto;
  grid-template-areas: "prev stage next" ". bar ." ". foot .";
  align-items: center; justify-items: center;
  column-gap: 28px;
}
.nb__stage {
  grid-area: stage;
  width: calc(var(--pw) * 2); height: calc(var(--pw) * 1.35);
  perspective: 2000px;
  touch-action: pan-y;
}
.nb__tilt {
  width: 100%; height: 100%;
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform .5s cubic-bezier(.2,.8,.2,1);
}
.nb__book {
  position: relative;
  width: calc(var(--pw) * 2); height: 100%;
  font-size: calc(var(--pw) * .039); /* ~15.6px on a 400px page; everything inside scales with it */
  perspective: 2600px;
  transform: translateX(var(--bx, -25%));
  transition: transform .9s cubic-bezier(.645,.045,.355,1);
}
.leaf {
  position: absolute; top: 0; left: 50%;
  width: 50%; height: 100%;
  transform-origin: left center;
  transform-style: preserve-3d;
  transition: transform .9s cubic-bezier(.645,.045,.355,1);
}
.leaf.is-flipped { transform: rotateY(-180deg); }
.face {
  position: absolute; inset: 0; overflow: hidden;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
}
.face--back { transform: rotateY(180deg); }
/* Safari ignores backface-visibility for faces with transformed/filtered children
   (the stickers), so also hide the side facing away, swapping at the halfway point
   of the turn when the page is edge-on. */
.face { transition: visibility 0s .45s; }
.leaf.is-flipped > .face--front,
.leaf:not(.is-flipped) > .face--back { visibility: hidden; }
.no-anim, .no-anim * { transition: none !important; }

/* Shading that sweeps across a page while it turns */
.face::after { content: ''; position: absolute; inset: 0; z-index: 70; pointer-events: none; opacity: 0; }
.face--front::after { background: linear-gradient(90deg, rgba(0,0,0,.4), rgba(0,0,0,.05) 60%, rgba(255,255,255,.1)); }
.face--back::after { background: linear-gradient(270deg, rgba(0,0,0,.4), rgba(0,0,0,.05) 60%, rgba(255,255,255,.1)); }
.leaf.turning .face::after { animation: turnshade .9s ease; }

.nb__arrow {
  grid-area: prev;
  width: 56px; height: 56px; padding: 0;
  display: grid; place-items: center;
  background: none; border: 0; cursor: pointer;
  color: var(--text); opacity: .8;
  transition: opacity .2s, transform .2s, color .2s;
}
.nb__arrow--next { grid-area: next; }
.nb__arrow svg { width: 28px; height: 38px; }
.nb__arrow--prev svg { transform: scaleX(-1); }
.nb__arrow:hover:not(:disabled) { color: var(--orange); opacity: 1; transform: scale(1.12); }
.nb__arrow:disabled { opacity: .15; cursor: default; }

.nb__bar { grid-area: bar; display: flex; flex-direction: column; align-items: center; gap: .3rem; margin-top: 1.6rem; }
.nb__counter { font-family: var(--mono); font-size: .78rem; letter-spacing: .35em; color: var(--muted); }
.nb__close, .nb__reset {
  padding: 0; background: none; border: 0; cursor: pointer;
  font-family: var(--hand); font-size: 1.3rem; color: var(--text); opacity: .75;
  transition: color .2s, opacity .2s;
}
.nb__close:hover, .nb__reset:hover { color: var(--orange); opacity: 1; }
.nb.is-closed .nb__close { visibility: hidden; }
.nb__foot { grid-area: foot; display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: .2rem 1.2rem; text-align: center; }
.nb-static { grid-column: 1 / -1; max-width: 40rem; margin-top: 2rem; padding: 1.5rem; background: var(--paper); color: var(--paper-text); border-radius: 8px; text-align: left; }
.nb-static a { color: var(--ink); }
.nb__hint { margin: .4rem 0 0; font-family: var(--mono); font-size: .72rem; letter-spacing: .08em; color: var(--muted); }

@media (max-width: 819px) {
  .desk { --pw: min(400px, calc(100vw - 32px)); padding-top: 88px; }
  .desk .section-label { margin-bottom: 2rem; }
  .prop, .grid-slot { display: none; }
  .nb {
    grid-template-columns: auto 1fr auto;
    grid-template-areas: "stage stage stage" "prev bar next" "foot foot foot";
    column-gap: 4px;
    width: var(--pw);
  }
  .nb__stage { width: var(--pw); overflow: hidden; border-radius: .6em; }
  .nb__bar { margin-top: 0; }
  .nb__arrow { margin-top: .6rem; }
}

/* ----- Cover ----- */
.face--cover { color: #eee; cursor: pointer; user-select: none; -webkit-user-select: none; }
.face--front.face--cover {
  border-radius: .25em .9em .9em .25em;
  box-shadow: .12em .12em 0 #e6dfcf, .24em .24em 0 #d2c9b5, .5em 1.2em 2.4em rgba(0,0,0,.6);
}
.face--back.face--cover {
  border-radius: .9em .25em .25em .9em;
  box-shadow: -.12em .12em 0 #e6dfcf, -.24em .24em 0 #d2c9b5, -.5em 1.2em 2.4em rgba(0,0,0,.6);
}
.face--cover::before {
  content: ''; position: absolute; top: 0; bottom: 0; left: 0; width: 1.3em; z-index: 61; pointer-events: none;
  background: linear-gradient(90deg, rgba(0,0,0,.6), rgba(255,255,255,.07) 55%, rgba(0,0,0,.35));
}
.face--back.face--cover::before { left: auto; right: 0; transform: scaleX(-1); }
.band {
  position: absolute; top: 0; bottom: 0; right: 9%; width: 1.05em; z-index: 60; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(0,0,0,.4), transparent 30%, transparent 70%, rgba(0,0,0,.4)),
    repeating-linear-gradient(180deg, #ff5a1f 0 2px, #db4a13 2px 4px);
  box-shadow: 0 0 .5em rgba(0,0,0,.6);
}
.face--back .band { right: auto; left: 9%; }

.cover-title { position: absolute; left: 8%; top: 16.5%; z-index: 0; line-height: .85; pointer-events: none; }
.ct-gt2, .ct-rs { font-family: var(--race); font-size: 5.2em; }
.ct-gt2 { color: transparent; -webkit-text-stroke: .03em #f1f1f1; }
.ct-rs { color: var(--orange); }
.cover-title small {
  display: block; margin-top: .9em;
  font-family: var(--mono); font-size: .62em; letter-spacing: .22em; text-transform: uppercase; color: #bdbdbd;
}

.open-tape {
  position: absolute; left: 23%; top: 60.5%; z-index: 50;
  padding: .05em 1em .12em; border: 0; cursor: pointer;
  font-family: var(--hand); font-weight: 700; font-size: 1.75em; color: #1b1b1b;
  background: rgba(232,222,196,.94);
  clip-path: polygon(2% 8%, 98% 0, 100% 40%, 97% 70%, 100% 100%, 1% 94%, 3% 60%, 0 30%);
  transform: rotate(-4deg);
  animation: wiggle 4.5s ease-in-out infinite;
}

/* Stickers */
.stk {
  position: absolute; z-index: var(--z, 1);
  transform: rotate(var(--r));
  filter: drop-shadow(0 .15em .25em rgba(0,0,0,.45));
  transition: transform .2s, filter .2s;
}
@media (hover: hover) and (pointer: fine) {
  .nb.is-closed .stk { cursor: grab; }
  .nb.is-closed .stk:hover { transform: rotate(var(--r)) scale(1.04); filter: drop-shadow(0 .5em .6em rgba(0,0,0,.5)); }
}
.stk.is-dragging { cursor: grabbing !important; transition: none; transform: rotate(var(--r)) scale(1.08); filter: drop-shadow(0 .9em 1em rgba(0,0,0,.55)); }
.stk--diecut,
.nb.is-closed .stk--diecut:hover,
.stk--diecut.is-dragging {
  filter: drop-shadow(.13em 0 0 #fff) drop-shadow(-.13em 0 0 #fff) drop-shadow(0 .13em 0 #fff) drop-shadow(0 -.13em 0 #fff) drop-shadow(0 .3em .35em rgba(0,0,0,.55));
}
.stk svg { width: 100%; height: auto; }

.stk-label { position: relative; padding: .55em .9em .5em; border-radius: .15em; background: #f7f5ef; color: #1d1d1d; }
.stk-label b { display: block; font-family: var(--hand); font-weight: 700; font-size: 2em; line-height: 1; }
.stk-label small { display: block; margin-top: .3em; font-family: var(--mono); font-size: .55em; letter-spacing: .15em; text-transform: uppercase; color: #666; }
.stk-checker {
  aspect-ratio: 2.4; border: .25em solid #f5f5f5; border-radius: .2em;
  background: conic-gradient(#111 90deg, #f5f5f5 90deg 180deg, #111 180deg 270deg, #f5f5f5 270deg) 0 0 / 1.1em 1.1em;
}
.stk-roundel {
  aspect-ratio: 1; border-radius: 50%;
  display: grid; place-items: center;
  background: #f5f5f5; border: .3em solid #111; box-shadow: 0 0 0 .2em #f5f5f5;
  font-family: var(--race); font-size: 1.5em; color: #111;
}
.stk-oval {
  aspect-ratio: 1.9; border-radius: 50%;
  display: grid; place-items: center;
  background: #fafafa; border: .22em solid #111; box-shadow: 0 0 0 .25em #fafafa;
  font-family: var(--race); font-size: 1.35em; color: #111;
}
.stk-hazard {
  height: 1.9em; display: grid; place-items: center;
  background: repeating-linear-gradient(-45deg, #f5c400 0 .7em, #111 .7em 1.4em);
}
.stk-hazard span { padding: .2em .6em; background: #f5c400; color: #111; font-family: var(--mono); font-weight: 500; font-size: .7em; letter-spacing: .35em; }

/* Revving: hover the closed cover */
.needle { transform-box: view-box; transform-origin: 50px 50px; transform: rotate(177deg); transition: transform .9s cubic-bezier(.25,1.5,.45,1); }
.face--cover:hover .needle { transform: rotate(366deg); }
.face--cover:hover .spokes { animation: spin .32s linear infinite; }
.face--cover:hover .stk--car .car { animation: rumble .1s linear infinite; }

/* Back cover */
.found {
  position: absolute; left: 16%; right: 16%; top: 34%;
  padding: 1em 1.2em; text-align: center;
  background: #f7f5ef; color: #1d1d1d; border-radius: .2em;
  transform: rotate(-4deg); box-shadow: 0 .3em .6em rgba(0,0,0,.5);
}
.found b { display: block; margin: .15em 0; font-family: var(--hand); font-size: 2em; line-height: 1.05; }
.found small { display: block; font-family: var(--mono); font-size: .58em; letter-spacing: .14em; text-transform: uppercase; color: #666; }
.stk-barcode {
  position: absolute; right: 18%; bottom: 9%; width: 30%;
  padding: .5em .6em .35em; background: #fff; color: #111; text-align: center;
  transform: rotate(3deg); box-shadow: 0 .2em .4em rgba(0,0,0,.4);
}
.stk-barcode svg { width: 100%; height: 2.4em; }
.stk-barcode small { font-family: var(--mono); font-size: .5em; letter-spacing: .2em; }

/* ----- Paper pages ----- */
.paper {
  padding: 2.3em 2.1em 2.4em;
  background-color: var(--paper); color: var(--paper-text); line-height: 1.45;
  background-image: radial-gradient(circle, rgba(60,45,25,.18) .055em, transparent .07em);
  background-size: 1.25em 1.25em; background-position: .4em .4em;
}
.paper::before { content: ''; position: absolute; inset: 0; z-index: 60; pointer-events: none; }
.face--front.paper {
  border-radius: .15em .6em .6em .15em;
  box-shadow: .1em .1em 0 #e2dbcb, .2em .2em 0 #d3cab6, .3em .3em 0 #c4baa4, .6em 1.2em 2.2em rgba(0,0,0,.5);
}
.face--front.paper::before { background: linear-gradient(90deg, rgba(0,0,0,.22), rgba(0,0,0,.06) 5%, transparent 13%); }
.face--back.paper {
  border-radius: .6em .15em .15em .6em;
  box-shadow: -.1em .1em 0 #e2dbcb, -.2em .2em 0 #d3cab6, -.3em .3em 0 #c4baa4, -.6em 1.2em 2.2em rgba(0,0,0,.5);
}
.face--back.paper::before { background: linear-gradient(270deg, rgba(0,0,0,.22), rgba(0,0,0,.06) 5%, transparent 13%); }
.paper a { color: var(--ink); }

.page-no { position: absolute; bottom: 1.2em; font-family: var(--mono); font-size: .6em; letter-spacing: .25em; color: #a29a89; }
.face--front .page-no { right: 3.4em; }
.face--back .page-no { left: 3.4em; }

.p-kicker { margin: 0; font-family: var(--mono); font-size: .62em; letter-spacing: .25em; text-transform: uppercase; color: #8a8272; }
.p-title { margin: .12em 0 .3em; font-family: var(--hand); font-weight: 700; font-size: 2.5em; line-height: 1; color: var(--ink); }
.p-text { margin: 0 0 .8em; font-size: .86em; color: #3a352d; }
.p-links { margin: 0; }
.p-links a {
  margin-right: 1em;
  font-family: var(--hand); font-size: 1.35em; color: var(--ink);
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .15em;
}
.p-links a:hover { color: var(--stamp); }

.tape {
  position: absolute; z-index: 2; width: 5.5em; height: 1.6em;
  background: rgba(236,224,190,.8); box-shadow: 0 1px 2px rgba(0,0,0,.12);
  clip-path: polygon(3% 0, 97% 4%, 100% 30%, 96% 55%, 100% 80%, 97% 100%, 2% 96%, 0 70%, 4% 45%, 0 18%);
}
.tape--l { left: -1.3em; top: -.5em; transform: rotate(-35deg); }
.tape--r { right: -1.3em; top: -.5em; transform: rotate(35deg); }

.hi { margin: .1em 0 .25em; font-family: var(--hand); font-weight: 700; font-size: 3.2em; line-height: 1; color: var(--ink); transform: rotate(-3deg); transform-origin: left; }
.sig { margin: .3em 0 0; font-family: var(--hand); font-size: 1.8em; color: var(--ink); transform: rotate(-4deg); transform-origin: left; }

/* Boarding pass */
.ticket {
  position: relative;
  display: grid; grid-template-columns: 1fr 4.4em; grid-template-rows: auto 1fr;
  margin: .2em 0 1.3em;
  background: #fdfcf8; color: #222; border-radius: .5em;
  box-shadow: 0 .2em .6em rgba(0,0,0,.18);
  font-family: var(--mono);
  transform: rotate(-2deg);
}
.ticket__head {
  grid-column: 1 / -1;
  display: flex; justify-content: space-between;
  padding: .55em 1.3em; border-radius: .5em .5em 0 0;
  background: var(--orange); color: #111;
  font-size: .55em; letter-spacing: .2em;
}
.ticket__main { padding: .6em .9em .7em; border-right: 2px dashed #d8d2c4; }
.ticket__route { display: flex; align-items: center; justify-content: space-between; gap: .4em; }
.ticket__route small, .ticket__meta small { display: block; font-size: .78em; letter-spacing: .2em; color: #9a9a9a; }
.ticket__route small { font-size: .45em; }
.ticket__route b { display: block; font-family: var(--font); font-weight: 800; font-size: 1.9em; line-height: 1; letter-spacing: -.02em; }
.ticket__route em { font-style: normal; font-size: .52em; color: #666; }
.ticket__arrow { font-size: 1.3em; color: var(--orange); }
.ticket__meta { display: flex; gap: 1.1em; margin-top: .5em; font-size: .6em; }
.ticket__stub { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .35em; padding: .4em; }
.ticket__stub svg { width: 2.6em; height: 3.2em; color: #222; }
.ticket__stub b { font-family: var(--font); font-weight: 800; font-size: 1.1em; }

/* About, right page */
.about-grid { display: grid; grid-template-columns: 10.5em 1fr; gap: 1.5em; align-items: start; margin-top: .6em; }
.polaroid { position: relative; margin: 0; padding: .55em .55em 2.3em; background: #fff; box-shadow: 0 .25em .7em rgba(0,0,0,.25); transform: rotate(3deg); }
.polaroid img, .polaroid__ph { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; }
.polaroid img { filter: grayscale(.15) contrast(1.05); }
.polaroid__ph { display: grid; place-items: center; background: #e9e3d6; font-family: var(--race); font-size: 3em; color: #c7bda6; }
.polaroid figcaption { position: absolute; left: 0; right: 0; bottom: .3em; text-align: center; font-family: var(--hand); font-size: 1.3em; color: var(--ink); }
.polaroid .tape { left: 50%; top: -.8em; transform: translateX(-50%) rotate(-4deg); }

.checklist { list-style: none; margin: .25em 0 0; padding: 0; font-family: var(--hand); font-size: 1.3em; line-height: 1.22; color: var(--ink); }
.checklist li { display: flex; align-items: center; gap: .4em; }
.checklist li::before {
  content: ''; flex: none; width: .6em; height: .6em;
  border: .08em solid currentColor; border-radius: .12em;
  background: no-repeat center / 100% url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M1.5 5.5 4 8 9 1' fill='none' stroke='%23b23a1a' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E");
}
.checklist--todo { font-size: 1.55em; line-height: 1.35; }
.checklist--todo li::before { background-image: none; }
.checklist--todo li.done::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M1.5 5.5 4 8 9 1' fill='none' stroke='%23b23a1a' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E"); }
.checklist--todo li.done span { text-decoration: line-through; text-decoration-color: rgba(178,58,26,.75); }

.doodle { margin-top: 1.3em; }
.doodle svg { width: 100%; color: var(--ink); opacity: .78; }
.doodle__note { margin: .1em 0 0; text-align: right; font-family: var(--hand); font-size: 1.3em; line-height: 1.05; color: var(--stamp); transform: rotate(-3deg); }
.doodle--tilt { margin-top: 2.6em; transform: rotate(-7deg); }

/* Project pages */
.shot { position: relative; margin: .5em 0 1em; padding: .45em; background: #fff; box-shadow: 0 .2em .6em rgba(0,0,0,.22); transform: rotate(-1.2deg); }
/* height: auto lets the CSS aspect ratio win over the width/height attributes (which are only there to reserve space) */
.shot img, .shot__ph { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; }
.shot__ph {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: repeating-linear-gradient(-45deg, #efe9dc 0 .7em, #e7e0d0 .7em 1.4em);
}
.shot__ph span { font-family: var(--race); font-size: 3.4em; line-height: 1; color: #c9bfa7; }
.shot__ph small { font-family: var(--hand); font-size: 1.2em; color: #a2977e; }
.sticky {
  position: absolute; right: -.8em; bottom: -.5em; z-index: 3;
  width: 7.6em; padding: .55em .7em .7em;
  background: #ffe36e; color: #3d3300;
  font-family: var(--hand); font-size: 1.15em; line-height: 1.1;
  box-shadow: 0 .35em .6em rgba(0,0,0,.22);
  transform: rotate(4deg);
}
.stamps { display: flex; flex-wrap: wrap; gap: .45em; margin: .1em 0 .9em; padding: 0; list-style: none; }
.stamps li {
  padding: .25em .6em; border: 1.5px solid currentColor; border-radius: .2em;
  font-family: var(--mono); font-size: .6em; letter-spacing: .12em; text-transform: uppercase;
  color: var(--stamp); opacity: .85; transform: rotate(var(--r, -2deg));
}
.stamps li:nth-child(even) { color: var(--ink); }

/* Repos page */
.repos { margin: .3em 0 .9em; }
.repo { display: block; padding: .5em 0 .55em; border-bottom: 1px dashed #cdc3ad; color: inherit; text-decoration: none; }
.repo__top { display: flex; justify-content: space-between; align-items: baseline; gap: .6em; }
.repo b { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-family: var(--mono); font-weight: 500; font-size: .8em; color: var(--ink); }
.repo i { flex: none; font-style: normal; font-family: var(--mono); font-size: .58em; letter-spacing: .1em; text-transform: uppercase; color: #8a8170; }
.repo p { margin: .1em 0 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: .72em; color: #6c6455; }
.repo:hover b { color: var(--stamp); }

/* Contact page */
.c-links { margin: 1em 0; padding: 0; list-style: none; font-family: var(--mono); font-size: .78em; }
.c-links li { display: flex; gap: .8em; padding: .4em 0; border-bottom: 1px dashed #cdc3ad; }
.c-links span { width: 5.5em; flex: none; color: #8a8170; font-size: .8em; letter-spacing: .15em; text-transform: uppercase; }
.flag {
  position: absolute; right: 2.6em; bottom: 3.6em;
  width: 5em; height: 3.2em;
  background: conic-gradient(#222 90deg, #f8f8f8 90deg 180deg, #222 180deg 270deg, #f8f8f8 270deg) 0 0 / .8em .8em;
  border: 1px solid #222;
  transform: rotate(-8deg) skewY(-8deg);
}
.flag::before { content: ''; position: absolute; left: -.35em; top: -.3em; width: .2em; height: 7em; background: #6b5a3a; border-radius: .1em; }

/* ============ Contact: paddock pass ============ */
.contact { padding: 0 16px 120px; display: flex; flex-direction: column; align-items: center; text-align: center; }
.contact .section-label { margin: 110px 0 0; }
.pass { width: min(340px, 88vw); transform-origin: 50% 0; animation: swing 6s ease-in-out infinite; }
.pass:hover, .pass:focus-within { animation-play-state: paused; }
.pass__lanyard {
  position: relative; width: 30px; height: 90px; margin: 0 auto;
  background: repeating-linear-gradient(180deg, #ff5a1f 0 3px, #e14d16 3px 6px);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.25);
}
.pass__lanyard::after { /* clip */
  content: ''; position: absolute; left: 50%; bottom: -14px; width: 22px; height: 26px; transform: translateX(-50%);
  border-radius: 4px 4px 9px 9px;
  background: linear-gradient(90deg, #6b6b6b, #f2f2f2 45%, #bdbdbd 60%, #5a5a5a);
}
.pass__card {
  position: relative; margin-top: 6px; overflow: hidden; text-align: left;
  background: #f6f4ee; color: #1b1b1b; border-radius: 14px;
  box-shadow: 0 30px 60px rgba(0,0,0,.6);
}
.pass__hole { position: absolute; left: 50%; top: 10px; width: 46px; height: 9px; transform: translateX(-50%); border-radius: 9px; background: var(--bg); box-shadow: inset 0 1px 2px rgba(0,0,0,.6); }
.pass__top {
  display: flex; justify-content: space-between; align-items: flex-end;
  padding: 30px 20px 12px; background: var(--orange); color: #111;
  font-family: var(--mono); font-size: .66rem; letter-spacing: .22em;
}
.pass__top b { font-family: var(--race); font-weight: 400; font-size: 1.7rem; letter-spacing: 0; line-height: .8; }
.pass__id { display: flex; gap: 14px; align-items: center; padding: 18px 20px 6px; }
.pass__photo { width: 74px; height: 74px; flex: none; border-radius: 8px; object-fit: cover; background: #ddd; }
.pass__name { margin: 0; font-style: italic; font-weight: 800; font-size: 1.45rem; line-height: 1; letter-spacing: -.02em; }
.pass__role { margin: .35rem 0 0; font-family: var(--mono); font-size: .66rem; letter-spacing: .14em; text-transform: uppercase; color: #6b6b6b; }
.pass__title { margin: 14px 20px 6px; font-size: 1.05rem; font-weight: 600; }
.pass__links { padding: 0 20px 6px; }
.pass__links a {
  display: grid; grid-template-columns: 5.2rem 1fr; align-items: baseline;
  padding: .55rem 0; border-top: 1px dashed #d4d0c6;
  color: inherit; text-decoration: none; font-family: var(--mono); font-size: .8rem;
}
.pass__links a span { font-size: .62rem; letter-spacing: .2em; text-transform: uppercase; color: #66625a; }
.pass__links a:hover b { color: var(--orange); }
.pass__links b { font-weight: 500; overflow-wrap: anywhere; }
.pass__foot {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  margin-top: 8px; padding: 12px 20px 16px; border-top: 2px dashed #d4d0c6;
  font-family: var(--mono); font-size: .6rem; letter-spacing: .2em; color: #66625a;
}
.pass__foot svg { width: 110px; height: 30px; color: #1b1b1b; }

/* ============ Footer ============ */
.foot { border-top: 1px solid var(--line); }
.foot__inner {
  max-width: 1240px; margin: 0 auto; padding: 28px 24px 24px;
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 1.2rem 2rem;
}
.foot__links { display: flex; flex-wrap: wrap; gap: .5rem 1.8rem; font-family: var(--mono); font-size: .74rem; letter-spacing: .16em; text-transform: uppercase; }
.foot__links a { color: var(--muted); text-decoration: none; }
.foot__links a:hover { color: var(--orange); }
.foot__legal { grid-column: 1 / -1; margin: 0; font-family: var(--mono); font-size: .68rem; color: var(--muted); }
.foot__legal a { color: inherit; text-underline-offset: .25em; }
.foot__legal a:hover { color: var(--orange); }
@media (max-width: 560px) { .foot__inner { grid-template-columns: 1fr; } }

/* ============ Motion ============ */
@keyframes rise { to { opacity: 1; transform: none; } }
@keyframes slide-up { to { transform: none; } }
@keyframes lamp { 0.5%, 99.5% { background: #ff2a1a; box-shadow: 0 0 14px 3px rgba(255,42,26,.65), inset 0 -3px 5px rgba(0,0,0,.25); } }
@keyframes lamp-go { to { background: #2bdc4f; box-shadow: 0 0 14px 3px rgba(43,220,79,.6), inset 0 -3px 5px rgba(0,0,0,.25); } }
@keyframes swing { 0%, 100% { transform: rotate(-1.4deg); } 50% { transform: rotate(1.4deg); } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes bob { 50% { transform: translateY(6px); } }
@keyframes streak { 0% { transform: translateX(-40vw); } 60%, 100% { transform: translateX(140vw); } }
@keyframes turnshade { 50% { opacity: 1; } }
@keyframes spin { to { transform: rotate(-360deg); } }
@keyframes rumble {
  25% { transform: translate(.4px, -.4px); }
  50% { transform: translate(-.3px, .3px); }
  75% { transform: translate(.3px, .4px); }
}
@keyframes wiggle {
  0%, 84%, 100% { transform: rotate(-4deg); }
  88% { transform: rotate(-1deg) scale(1.05); }
  92% { transform: rotate(-6deg) scale(1.05); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001s !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001s !important;
  }
  .face { transition-delay: 0s !important; }
  .pass { animation: none; }
  .speed { display: none; }
}
