/* THE 1O1 / ROTO
 * Tokens first. Everything below references them.
 * Type roles: display = Anybody 800 (variable width), body = Hanken Grotesk 400/600, mono = Spline Sans Mono 400.
 * Palette: graphite on paper, plus non-photo blue for construction lines only.
 */
:root {
  --paper: #ecedea;
  --paper-2: #dfe1dc;
  --lead: #14151a;
  --lead-70: #4a4c53;
  --lead-40: #8c8f96;
  --npb: #7fa9cf;

  --f-display: 'Anybody', 'Arial Narrow', 'Helvetica Neue', Arial, sans-serif;
  --f-body: 'Hanken Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --f-mono: 'Spline Sans Mono', ui-monospace, 'SFMono-Regular', Consolas, monospace;

  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px; --s9: 96px;
  --gutter: clamp(16px, 3vw, 44px);
  --hud-h: 68px;

  --t-label: 0.75rem;
  --t-small: 0.9375rem;
  --t-body: 1.125rem;
  --t-h3: clamp(2.2rem, 4.6vw, 4.2rem);
  --t-h2: clamp(2.6rem, 6.4vw, 6.4rem);
  --t-hero: clamp(3.2rem, 9.2vw, 9.6rem);
  --t-xl: clamp(3.4rem, 11vw, 11rem);

  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --dur-1: 160ms;
  --dur-2: 340ms;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--paper); -webkit-text-size-adjust: 100%; scrollbar-width: thin; scrollbar-color: var(--lead) var(--paper); }
body {
  margin: 0; color: var(--lead); font-family: var(--f-body); font-size: var(--t-body); line-height: 1.55;
  overflow-x: clip; -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p, ul, ol { margin: 0; padding: 0; }
ul, ol { list-style: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; }
svg { display: block; }
:focus-visible { outline: 2px solid var(--lead); outline-offset: 3px; box-shadow: 0 0 0 5px var(--paper); }

.mono { font-family: var(--f-mono); font-size: var(--t-label); letter-spacing: 0.08em; text-transform: uppercase; line-height: 1.4; }
.display {
  font-family: var(--f-display); font-weight: 800; text-transform: uppercase; letter-spacing: -0.02em; line-height: 0.88;
  font-variation-settings: 'wdth' 70;
}
.skip { position: fixed; left: var(--s4); top: -80px; z-index: 100; padding: var(--s3) var(--s4); background: var(--lead); color: var(--paper); }
.skip:focus { top: var(--s4); }
.noscript { position: fixed; inset: auto var(--s4) var(--s4); z-index: 100; padding: var(--s4); background: var(--paper); border: 1px solid var(--lead); }

/* ---------- layers ---------- */
#stage { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1; display: block; }
.no-gl #stage { display: none; }
.no-gl body { background: repeating-linear-gradient(45deg, var(--paper) 0 7px, var(--paper-2) 7px 8px); }
.grain {
  position: fixed; inset: -80px; z-index: 55; pointer-events: none; mix-blend-mode: multiply; opacity: 0.4;
  background-size: 256px 256px;
}
#ink { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 60; pointer-events: none; mix-blend-mode: difference; }
#cursor { position: fixed; left: 0; top: 0; z-index: 70; pointer-events: none; mix-blend-mode: difference; display: none; will-change: transform; }
.has-cursor #cursor { display: block; }
.has-cursor, .has-cursor a, .has-cursor button, .has-cursor .tl { cursor: none; }
.cursor__ring {
  display: block; width: 46px; height: 46px; margin: -23px 0 0 -23px; border: 1.5px solid #fff; border-radius: 50%;
  transform: scale(var(--cs, 0.5)); transition: transform var(--dur-2) var(--ease), opacity var(--dur-1);
}
.cursor__ring::before, .cursor__ring::after { content: ''; position: absolute; background: #fff; }
.cursor__ring::before { left: 50%; top: -8px; bottom: -8px; width: 1px; margin-left: -0.5px; }
.cursor__ring::after { top: 50%; left: -8px; right: -8px; height: 1px; margin-top: -0.5px; }
.cursor__label { position: absolute; left: 0; top: 0; transform: translate(20px, 20px); color: #fff; white-space: nowrap; opacity: 0; transition: opacity var(--dur-1); }
#cursor.has-label .cursor__label { opacity: 1; }
#cursor.is-down .cursor__ring { transform: scale(0.34); }

/* ---------- hud ---------- */
.hud {
  position: fixed; inset: 0 0 auto 0; z-index: 50; height: var(--hud-h); padding: 0 var(--gutter);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: var(--s5);
}
.hud::before { content: ''; position: absolute; inset: 0 0 -28px; z-index: -1; pointer-events: none; background: linear-gradient(var(--paper) 35%, rgba(236, 237, 234, 0)); opacity: 0.94; }
.mark { display: inline-flex; align-items: baseline; gap: var(--s3); justify-self: start; min-height: 44px; align-items: center; }
.mark__name { font-family: var(--f-display); font-weight: 800; font-size: 1.6rem; letter-spacing: -0.01em; font-variation-settings: 'wdth' 90; line-height: 1; filter: url(#boil); }
.mark__tag { padding: 2px 6px; border: 1px solid var(--lead); }
.pegs { display: flex; gap: var(--s5); }
.pegs a { position: relative; display: inline-flex; gap: var(--s2); align-items: baseline; padding: var(--s3) 0; font-weight: 600; font-size: var(--t-small); }
.pegs a .mono { color: var(--lead-70); }
.pegs a::after { content: ''; position: absolute; left: 0; right: 0; bottom: 6px; height: 2px; background: var(--lead); transform: scaleX(0); transform-origin: left; transition: transform var(--dur-2) var(--ease); }
.pegs a:hover::after, .pegs a.is-on::after { transform: scaleX(1); }
.ctrl { display: flex; gap: var(--s3); justify-self: end; align-items: center; }
.seg { display: flex; align-items: stretch; border: 1px solid var(--lead); background: var(--paper); }
.seg__l { padding: 0 var(--s3); display: flex; align-items: center; color: var(--lead-70); border-right: 1px solid var(--lead); }
.seg__b { min-width: 40px; min-height: 40px; display: grid; place-items: center; transition: background var(--dur-1), color var(--dur-1); }
.seg__b + .seg__b { border-left: 1px solid var(--lead); }
.seg__b:hover { background: var(--paper-2); }
.seg__b[aria-pressed='true'] { background: var(--lead); color: var(--paper); }
.cam { display: inline-flex; align-items: center; gap: var(--s2); min-height: 42px; padding: 0 var(--s4); border: 1px solid var(--lead); background: var(--paper); transition: background var(--dur-1), color var(--dur-1); }
.cam:hover { background: var(--paper-2); }
.cam__dot { width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid currentColor; }
.cam[aria-pressed='true'] { background: var(--lead); color: var(--paper); }
.cam[aria-pressed='true'] .cam__dot { background: var(--paper); border-color: var(--paper); animation: rec 1.2s steps(2, jump-none) infinite; }
@keyframes rec { 50% { opacity: 0.2; } }

/* ---------- buttons ---------- */
.btn {
  position: relative; display: inline-flex; align-items: center; gap: var(--s3); min-height: 52px; padding: 0 var(--s6);
  font-weight: 600; font-size: 1rem; letter-spacing: 0.01em; transition: transform var(--dur-2) var(--ease), background var(--dur-1), color var(--dur-1);
  will-change: transform;
}
.btn .ar { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform var(--dur-2) var(--ease); }
.btn:hover .ar { transform: translate(2px, -2px); }
.btn--solid { background: var(--lead); color: var(--paper); }
.btn--solid::after { content: ''; position: absolute; inset: 0; border: 1.5px solid var(--lead); transform: translate(5px, 5px); pointer-events: none; transition: transform var(--dur-2) var(--ease); }
.btn--solid:hover::after { transform: translate(8px, 8px); }
.btn--ghost { background: var(--paper); border: 1.5px solid var(--lead); }
.btn--ghost:hover { background: var(--lead); color: var(--paper); }
.btn--lg { min-height: 64px; padding: 0 var(--s7); font-size: 1.125rem; }

/* ---------- cels: hand-cut paper with a redrawn border ---------- */
.cel { position: relative; isolation: isolate; padding: var(--s5); }
.cel::before { content: ''; position: absolute; inset: 0; z-index: -1; background: var(--paper); border: 1.5px solid var(--lead); filter: url(#boil); }
.cel::after {
  content: ''; position: absolute; z-index: -2; inset: 8px -8px -8px 8px; pointer-events: none;
  background: repeating-linear-gradient(135deg, var(--lead) 0 1px, transparent 1px 5px); opacity: 0.55;
}
.cel-flat { background: var(--paper); border: 1.5px solid var(--lead); }

.kicker { color: var(--lead-70); }
.fx { filter: url(#boil-big); paint-order: stroke fill; -webkit-text-stroke: 0.07em var(--paper); }
.fx .w { display: inline-block; white-space: nowrap; }
.fx .l { display: inline-block; font-variation-settings: 'wdth' var(--w, 70); transform: translate3d(0, var(--y, 0px), 0) rotate(var(--r, 0deg)); will-change: transform; }
.lede { max-width: 38ch; font-size: var(--t-body); }
.cta-row { display: flex; flex-wrap: wrap; gap: var(--s5) var(--s5); align-items: center; }

/* ---------- chapters ---------- */
.ch { position: relative; }
.pin { height: var(--len); }
.pin__stick { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: clip; }

.hero { height: 100vh; height: 100svh; min-height: 620px; display: grid; align-items: end; padding: calc(var(--hud-h) + var(--s5)) var(--gutter) 92px; }
.hero__inner { display: grid; gap: var(--s5); max-width: 46rem; justify-items: start; }
.hero__title { font-size: var(--t-hero); line-height: 0.84; margin: var(--s2) 0 var(--s2) -0.04em; }
.hero .lede { font-weight: 400; }
.hint { color: var(--lead-70); }
.hint__k { color: var(--lead); font-weight: 400; border-bottom: 1.5px solid var(--lead); }

.h2 { font-size: var(--t-h2); line-height: 0.86; margin-top: var(--s3); }
.h2--sm { font-size: clamp(2.2rem, 4.4vw, 4.2rem); }
.h2--xl { font-size: var(--t-xl); line-height: 0.82; }
.h3 { font-size: var(--t-h3); line-height: 0.88; font-variation-settings: 'wdth' 78; }

/* trace */
.trace__stick { display: grid; grid-template-columns: repeat(12, 1fr); grid-template-rows: auto 1fr auto; column-gap: var(--s5); padding: calc(var(--hud-h) + var(--s6)) var(--gutter) 108px; }
.trace__head { grid-column: 1 / 8; grid-row: 1; max-width: 46rem; }
.steps { grid-column: 1 / 6; grid-row: 3; align-self: end; padding: var(--s3) var(--s5); }
.step { padding: var(--s4) 0; border-top: 1.5px dashed var(--lead-40); opacity: 0.42; transition: opacity var(--dur-2) var(--ease); }
.step:first-child { border-top: 0; }
.step.is-on { opacity: 1; }
.step__top { display: flex; justify-content: space-between; align-items: center; color: var(--lead-70); }
.step__peg { width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid var(--lead); transition: background var(--dur-1); }
.step.is-on .step__peg { background: var(--lead); }
.step__h { font-family: var(--f-display); font-weight: 800; font-variation-settings: 'wdth' 82; font-size: clamp(1.7rem, 2.8vw, 2.4rem); line-height: 1; letter-spacing: -0.01em; text-transform: uppercase; margin-top: var(--s2); }
.step__body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.55s var(--ease); }
.step.is-on .step__body { grid-template-rows: 1fr; }
.step__body > p { overflow: hidden; min-height: 0; padding-top: 0; font-size: var(--t-small); max-width: 42ch; }
.step.is-on .step__body > p { padding-top: var(--s3); }
.stagebadge { grid-column: 8 / 13; grid-row: 3; align-self: end; justify-self: end; display: grid; gap: var(--s1); text-align: right; padding: var(--s3) var(--s4); background: var(--paper); border: 1.5px solid var(--lead); }
.stagebadge__n { color: var(--lead-70); }

/* practice */
.practice__stick { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: var(--s5); align-items: center; padding: calc(var(--hud-h) + var(--s5)) var(--gutter) 96px; }
.practice__head { grid-column: 1 / 6; grid-row: 1; align-self: start; max-width: 28rem; }
.pad { grid-column: 6 / 13; grid-row: 1; position: relative; width: 100%; max-width: 780px; justify-self: center; aspect-ratio: 1.3; perspective: 2200px; perspective-origin: 50% 20%; }
.pad__bar { position: absolute; z-index: 20; left: -3%; right: -3%; top: -12px; height: 14px; background: var(--lead); display: flex; justify-content: space-around; padding: 0 20%; }
.pad__bar i { display: block; width: 22px; height: 22px; margin-top: -6px; background: var(--lead-70); border-radius: 3px 3px 0 0; }
.pad__stack { position: absolute; inset: 0; transform-style: preserve-3d; transform: rotateX(var(--pad-rx, 6deg)) rotateY(var(--pad-ry, -9deg)); }
.sheet { position: absolute; inset: 0; transform-origin: 50% 0; transform-style: preserve-3d; will-change: transform; }
.sheet[data-i="0"] { z-index: 10; }
.sheet[data-i="1"] { z-index: 8; }
.sheet[data-i="2"] { z-index: 6; }
.sheet--base { z-index: 2; transform: translateZ(-20px); }
.sheet__face, .sheet__back { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.sheet__face { display: grid; grid-template-columns: 1fr 1fr; overflow: hidden; }
.sheet__face::after {
  content: ''; position: absolute; left: 0; right: 0; top: 0; height: 22px; pointer-events: none;
  background:
    linear-gradient(var(--lead), var(--lead)) 20% 8px / 26px 5px no-repeat,
    linear-gradient(var(--lead), var(--lead)) 50% 8px / 26px 5px no-repeat,
    linear-gradient(var(--lead), var(--lead)) 80% 8px / 26px 5px no-repeat;
  transform: translateX(-13px);
}
.sheet__back { transform: rotateX(180deg); background: var(--paper-2); border: 1.5px solid var(--lead); display: grid; place-items: center; color: var(--lead-40); }
.sheet__art { width: 100%; height: 100%; min-height: 0; object-fit: contain; padding: var(--s5) 0 var(--s5) var(--s3); }
.sheet__copy { display: grid; align-content: center; gap: var(--s3); padding: var(--s7) var(--s6) var(--s6) var(--s4); }
.sheet__copy p { font-size: var(--t-small); max-width: 36ch; }
.sheet__copy .kicker { font-size: 0.6875rem; }
.sheet__fine { color: var(--lead-70); padding-top: var(--s2); border-top: 1.5px dashed var(--lead-40); }
.sheet__copy--wide { grid-column: 1 / -1; padding: var(--s8) var(--s8) var(--s7); max-width: 44rem; align-content: center; }
.sheet__copy--wide p { max-width: 50ch; }

/* evidence */
.evidence__stick { display: grid; grid-template-columns: repeat(12, 1fr); grid-template-rows: auto 1fr auto; column-gap: var(--s5); padding: calc(var(--hud-h) + var(--s5)) var(--gutter) 96px; }
.evidence__head { grid-column: 1 / 6; grid-row: 1; align-self: start; max-width: 28rem; }
.evidence__intro { margin-top: var(--s4); font-size: var(--t-small); max-width: 34ch; }
.drum-wrap { grid-column: 5 / 13; grid-row: 1 / 4; display: grid; place-items: center; perspective: 1800px; perspective-origin: 50% 30%; }
.drum {
  --pw: clamp(180px, 20vw, 290px); --ph: calc(var(--pw) * 1.3); --R: calc(var(--pw) * 1.42);
  position: relative; width: var(--pw); height: var(--ph); transform-style: preserve-3d;
  transform: translateZ(calc(var(--R) * -1)) rotateX(var(--tilt, -8deg)) rotateY(var(--ry, 0deg));
}
.drum__ring {
  position: absolute; left: 50%; top: -22px; width: calc(var(--R) * 2.5); height: calc(var(--R) * 2.5); margin: calc(var(--R) * -1.25) 0 0 calc(var(--R) * -1.25); border-radius: 50%;
  background: repeating-conic-gradient(var(--lead) 0 2deg, transparent 2deg 9deg);
  -webkit-mask: radial-gradient(circle, transparent 0 78%, #000 79% 92%, transparent 93%); mask: radial-gradient(circle, transparent 0 78%, #000 79% 92%, transparent 93%);
  transform: rotateX(90deg); pointer-events: none;
}
.panel {
  position: absolute; left: 0; top: 0; width: var(--pw); height: var(--ph); display: flex; flex-direction: column;
  background: var(--paper); border: 1.5px solid var(--lead); backface-visibility: hidden; -webkit-backface-visibility: hidden;
  transform: rotateY(calc(var(--i) * 40deg)) translateZ(var(--R));
}
.panel canvas { width: 100%; flex: 1; min-height: 0; object-fit: contain; }
.panel__t { padding: var(--s2) var(--s3); border-top: 1.5px solid var(--lead); background: var(--paper); }
.panel--proj .panel__t { background: var(--lead); color: var(--paper); }
.projects { grid-column: 1 / 6; grid-row: 3; align-self: end; padding: var(--s2) var(--s5); }
.proj + .proj { border-top: 1.5px dashed var(--lead-40); }
.proj a { display: grid; gap: var(--s1); padding: var(--s4) 0; opacity: 0.45; transition: opacity var(--dur-2) var(--ease); }
.proj.is-on a, .proj a:hover, .proj a:focus-visible { opacity: 1; }
.proj__no { color: var(--lead-70); }
.proj__h { display: inline-flex; align-items: center; gap: var(--s2); font-family: var(--f-display); font-weight: 800; font-variation-settings: 'wdth' 82; font-size: clamp(1.4rem, 2.2vw, 1.9rem); text-transform: uppercase; letter-spacing: -0.01em; line-height: 1.05; }
.proj__h .ar { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform var(--dur-2) var(--ease); }
.proj a:hover .ar { transform: translate(3px, -3px); }
.proj__d { display: grid; grid-template-rows: 0fr; font-size: var(--t-small); max-width: 42ch; overflow: hidden; max-height: 0; transition: max-height 0.5s var(--ease); }
.proj.is-on .proj__d, .proj a:hover .proj__d, .proj a:focus-visible .proj__d { max-height: 6em; }

/* contact */
.contact { min-height: 135vh; min-height: 135svh; display: grid; align-content: end; padding: 28vh var(--gutter) 140px; }
.contact__inner { display: grid; gap: var(--s6); max-width: 72rem; justify-items: start; }
.contact .lede { max-width: 44ch; }
.links { display: flex; flex-wrap: wrap; gap: var(--s3) var(--s6); }
.scribble { position: relative; display: inline-block; padding: var(--s2) 0; }
.scribble::after { content: ''; position: absolute; left: -2px; right: -2px; bottom: 4px; height: 8px; background: repeating-linear-gradient(-8deg, var(--lead) 0 1.5px, transparent 1.5px 4px); clip-path: inset(0 100% 0 0); transition: clip-path var(--dur-2) var(--ease); opacity: 0.8; }
.scribble:hover::after, .scribble:focus-visible::after { clip-path: inset(0 0 0 0); }
.colophon { display: grid; gap: var(--s3); max-width: 52rem; margin-top: var(--s6); font-size: var(--t-small); }
.colophon .mono { color: var(--lead-70); text-transform: none; letter-spacing: 0.02em; font-size: 0.8125rem; line-height: 1.55; }

/* ---------- scrubber ---------- */
.tl { position: fixed; z-index: 45; left: var(--gutter); bottom: var(--s5); width: min(540px, calc(100% - var(--gutter) * 2)); padding: var(--s2) 0 0; touch-action: none; user-select: none; }
.tl__track {
  position: relative; height: 26px; border-bottom: 1.5px solid var(--lead);
  background:
    repeating-linear-gradient(90deg, var(--lead) 0 1px, transparent 1px 12px) bottom / 100% 8px no-repeat,
    repeating-linear-gradient(90deg, var(--lead) 0 1.5px, transparent 1.5px 60px) bottom / 100% 16px no-repeat;
}
.tl__pegs i { position: absolute; bottom: -1px; width: 0; height: 0; border: 5px solid transparent; border-bottom: 9px solid var(--npb); transform: translateX(-5px); }
.tl__head { position: absolute; bottom: -4px; top: -6px; width: 2px; left: 0; background: var(--lead); transform: translateX(var(--x, 0px)); }
.tl__head::before { content: ''; position: absolute; top: -2px; left: -6px; width: 14px; height: 14px; background: var(--paper); border: 2px solid var(--lead); border-radius: 50%; }
.tl:focus-visible { outline-offset: 8px; }
.tl__read { display: flex; justify-content: space-between; gap: var(--s4); padding-top: var(--s2); background: transparent; }
.tl__read span { background: var(--paper); padding: 1px 6px 1px 0; }
.tl__read span:last-child { padding: 1px 0 1px 6px; color: var(--lead-70); }

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  .pegs { display: none; }
  .hud { grid-template-columns: 1fr auto; }
}
@media (max-width: 860px) {
  :root { --hud-h: 60px; }
  .seg__l { display: none; }
  .cam #cam-l { display: none; }
  .cam { padding: 0 var(--s3); }
  .hero { padding-bottom: 96px; }
  .hero__inner { max-width: 30rem; }
  .trace__stick, .practice__stick, .evidence__stick { display: flex; flex-direction: column; justify-content: space-between; gap: var(--s4); }
  .trace__head { max-width: none; }
  .steps { width: 100%; }
  .stagebadge { display: none; }
  .practice__stick { justify-content: flex-start; }
  .pad { max-width: none; aspect-ratio: auto; height: min(62svh, 520px); flex: none; margin-top: var(--s4); }
  .sheet__face { grid-template-columns: 1fr; grid-template-rows: 38% 1fr; }
  .sheet__art { padding: var(--s7) var(--s4) 0; }
  .sheet__copy { padding: var(--s3) var(--s4) var(--s4); gap: var(--s2); }
  .sheet__copy--wide { padding: var(--s6) var(--s4); grid-row: 1 / -1; }
  .h3 { font-size: clamp(2rem, 9vw, 3rem); }
  .drum-wrap { position: absolute; inset: 0; padding-top: 12svh; }
  .evidence__stick { justify-content: space-between; padding-top: calc(var(--hud-h) + var(--s3)); padding-bottom: 96px; }
  .evidence__head { position: relative; z-index: 2; max-width: none; }
  .evidence__intro { display: none; }
  .projects { position: relative; z-index: 2; padding: var(--s2) var(--s4); }
  .proj a { padding: var(--s2) 0; }
  .proj__d { font-size: 0.875rem; }
  .contact { padding-top: 18vh; padding-bottom: 160px; }
  .tl { bottom: var(--s3); }
}
@media (pointer: coarse) {
  .btn, .seg__b, .cam { min-height: 48px; }
}
@media (prefers-reduced-motion: reduce) {
  .fx, .mark__name, .cel::before { filter: none; }
  .step__body, .proj__d, .btn, .btn .ar, .btn--solid::after { transition: none; }
  .cam[aria-pressed='true'] .cam__dot { animation: none; }
}
