/* Diandra Kathyusha — a BIOS screen torn into a zine.
   Dark, messy, overlapping. Decoration is raster, pixel or ASCII: titles are drawn
   into a low-res canvas with ordered dithering (js/main.js), the sigil is ASCII art,
   the fog and shadows are dither patterns. Every colour below passed a WCAG AA check
   (see README). */

:root {
  --void: #07060A;          /* page */
  --panel: #100E16;         /* text blocks laid over images */
  --text: #ECEAF3;          /* 16.96:1 on void */
  --dim: #A9A6B8;           /* 8.50:1 on void */
  --nerv: #FF4A2E;          /* 6.03:1 on void: warnings, badges, pixel shadows */
  --eva: #B49CFF;           /* 8.79:1 on void: links */
  --phosphor: #7CFFB2;      /* 16.17:1 on void: labels, focus */
  --fog: #1B2550;           /* PS2 fog dither (decorative) */
  --sigil: #5E52AE;         /* ASCII sigil (decorative) */
  --panel-glass: rgba(16, 14, 22, 0.95);  /* panel laid over moving art */
  --line: rgba(169, 166, 184, 0.45);      /* dotted rules (dim at 45%) */
  --nerv-deep: #1C0D0C;     /* fill behind red badges */
  --glitch: #63E1FF;        /* cyan split in the title glitch */
  --scanline: rgba(0, 0, 0, 0.22);

  --f-goth: "Pirata One", "Old English Text MT", serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

  /* One scale for all non-display text */
  --fs-xs: 0.75rem;    /* labels, tags, nav: uppercase, tracked */
  --fs-sm: 0.86rem;    /* buttons, captions, small UI */
  --fs-base: 0.95rem;  /* body */
  --fs-lg: 1.1rem;     /* lead lines */
  --fs-xl: clamp(1.05rem, 3.4vw, 1.7rem);  /* the email address */

  /* Display scale (blackletter) */
  --fs-d1: clamp(5rem, 14vw, 9rem);         /* outcome numbers */
  --fs-d2: clamp(3rem, 9vw, 7.5rem);        /* page titles, the lead home card */
  --fs-d3: clamp(2.5rem, 5.5vw, 4.2rem);    /* home cards, next-project cards */
  --fs-d4: 2.5rem;                          /* section headings, wordmark */
  --fs-d5: 1.8rem;                          /* archive titles, ring name */

  /* Spacing: px steps for components; text rhythm inside prose stays in rem */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-5: 24px; --sp-6: 32px; --sp-7: 48px; --sp-8: 64px;

  /* Cut "pixel" corners */
  --cut-s: 4px;   /* buttons */
  --cut-m: 6px;   /* figures, cards, archive thumbs */
  --cut-l: 8px;   /* hero images, portrait */

  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-pop: cubic-bezier(0.34, 1.56, 0.64, 1);
  --t-fast: 0.15s;   /* hovers, presses */
  --t-med: 0.3s;     /* tilt */
  --t-fade: 0.6s;    /* reveal fades */
  --t-move: 0.8s;    /* reveal slides */

  /* Letter-spacing */
  --track: 0.05em;       /* uppercase labels */
  --track-wide: 0.08em;  /* buttons */

  --s: var(--cut-m);        /* pixel step for cut corners */
  --gutter: clamp(16px, 4vw, 48px);

  /* Pixel cursors (generated by tools/cursor.py) */
  --cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='32' shape-rendering='crispEdges'%3E%3Crect x='18' y='20' width='2' height='2' fill='%23FF4A2E'/%3E%3Crect x='6' y='24' width='2' height='2' fill='%23FF4A2E'/%3E%3Crect x='16' y='30' width='2' height='2' fill='%23FF4A2E'/%3E%3Crect x='4' y='26' width='2' height='2' fill='%23FF4A2E'/%3E%3Crect x='16' y='20' width='2' height='2' fill='%23FF4A2E'/%3E%3Crect x='20' y='20' width='2' height='2' fill='%23FF4A2E'/%3E%3Crect x='18' y='28' width='2' height='2' fill='%23FF4A2E'/%3E%3Crect x='16' y='24' width='2' height='2' fill='%23FF4A2E'/%3E%3Crect x='4' y='24' width='2' height='2' fill='%23FF4A2E'/%3E%3Crect x='6' y='22' width='2' height='2' fill='%23FF4A2E'/%3E%3Crect x='14' y='30' width='2' height='2' fill='%23FF4A2E'/%3E%3Crect x='16' y='28' width='2' height='2' fill='%23FF4A2E'/%3E%3Crect x='2' y='26' width='2' height='2' fill='%23FF4A2E'/%3E%3Crect x='14' y='20' width='2' height='2' fill='%23FF4A2E'/%3E%3Crect x='0' y='0' width='2' height='2' fill='%2307060A'/%3E%3Crect x='0' y='2' width='2' height='2' fill='%2307060A'/%3E%3Crect x='2' y='2' width='2' height='2' fill='%2307060A'/%3E%3Crect x='0' y='4' width='2' height='2' fill='%2307060A'/%3E%3Crect x='2' y='4' width='2' height='2' fill='%23F2F0FA'/%3E%3Crect x='4' y='4' width='2' height='2' fill='%2307060A'/%3E%3Crect x='0' y='6' width='2' height='2' fill='%2307060A'/%3E%3Crect x='2' y='6' width='2' height='2' fill='%23F2F0FA'/%3E%3Crect x='4' y='6' width='2' height='2' fill='%23F2F0FA'/%3E%3Crect x='6' y='6' width='2' height='2' fill='%2307060A'/%3E%3Crect x='0' y='8' width='2' height='2' fill='%2307060A'/%3E%3Crect x='2' y='8' width='2' height='2' fill='%23F2F0FA'/%3E%3Crect x='4' y='8' width='2' height='2' fill='%23F2F0FA'/%3E%3Crect x='6' y='8' width='2' height='2' fill='%23F2F0FA'/%3E%3Crect x='8' y='8' width='2' height='2' fill='%2307060A'/%3E%3Crect x='0' y='10' width='2' height='2' fill='%2307060A'/%3E%3Crect x='2' y='10' width='2' height='2' fill='%23F2F0FA'/%3E%3Crect x='4' y='10' width='2' height='2' fill='%23F2F0FA'/%3E%3Crect x='6' y='10' width='2' height='2' fill='%23F2F0FA'/%3E%3Crect x='8' y='10' width='2' height='2' fill='%23F2F0FA'/%3E%3Crect x='10' y='10' width='2' height='2' fill='%2307060A'/%3E%3Crect x='0' y='12' width='2' height='2' fill='%2307060A'/%3E%3Crect x='2' y='12' width='2' height='2' fill='%23C9C6D8'/%3E%3Crect x='4' y='12' width='2' height='2' fill='%23C9C6D8'/%3E%3Crect x='6' y='12' width='2' height='2' fill='%23C9C6D8'/%3E%3Crect x='8' y='12' width='2' height='2' fill='%23C9C6D8'/%3E%3Crect x='10' y='12' width='2' height='2' fill='%23C9C6D8'/%3E%3Crect x='12' y='12' width='2' height='2' fill='%2307060A'/%3E%3Crect x='0' y='14' width='2' height='2' fill='%2307060A'/%3E%3Crect x='2' y='14' width='2' height='2' fill='%23C9C6D8'/%3E%3Crect x='4' y='14' width='2' height='2' fill='%23C9C6D8'/%3E%3Crect x='6' y='14' width='2' height='2' fill='%23C9C6D8'/%3E%3Crect x='8' y='14' width='2' height='2' fill='%23C9C6D8'/%3E%3Crect x='10' y='14' width='2' height='2' fill='%23C9C6D8'/%3E%3Crect x='12' y='14' width='2' height='2' fill='%23C9C6D8'/%3E%3Crect x='14' y='14' width='2' height='2' fill='%2307060A'/%3E%3Crect x='0' y='16' width='2' height='2' fill='%2307060A'/%3E%3Crect x='2' y='16' width='2' height='2' fill='%23C9C6D8'/%3E%3Crect x='4' y='16' width='2' height='2' fill='%23C9C6D8'/%3E%3Crect x='6' y='16' width='2' height='2' fill='%23C9C6D8'/%3E%3Crect x='8' y='16' width='2' height='2' fill='%23C9C6D8'/%3E%3Crect x='10' y='16' width='2' height='2' fill='%23C9C6D8'/%3E%3Crect x='12' y='16' width='2' height='2' fill='%23C9C6D8'/%3E%3Crect x='14' y='16' width='2' height='2' fill='%23C9C6D8'/%3E%3Crect x='16' y='16' width='2' height='2' fill='%2307060A'/%3E%3Crect x='0' y='18' width='2' height='2' fill='%2307060A'/%3E%3Crect x='2' y='18' width='2' height='2' fill='%238F8BA3'/%3E%3Crect x='4' y='18' width='2' height='2' fill='%238F8BA3'/%3E%3Crect x='6' y='18' width='2' height='2' fill='%238F8BA3'/%3E%3Crect x='8' y='18' width='2' height='2' fill='%238F8BA3'/%3E%3Crect x='10' y='18' width='2' height='2' fill='%2307060A'/%3E%3Crect x='12' y='18' width='2' height='2' fill='%2307060A'/%3E%3Crect x='14' y='18' width='2' height='2' fill='%2307060A'/%3E%3Crect x='16' y='18' width='2' height='2' fill='%2307060A'/%3E%3Crect x='18' y='18' width='2' height='2' fill='%2307060A'/%3E%3Crect x='0' y='20' width='2' height='2' fill='%2307060A'/%3E%3Crect x='2' y='20' width='2' height='2' fill='%238F8BA3'/%3E%3Crect x='4' y='20' width='2' height='2' fill='%238F8BA3'/%3E%3Crect x='6' y='20' width='2' height='2' fill='%2307060A'/%3E%3Crect x='8' y='20' width='2' height='2' fill='%238F8BA3'/%3E%3Crect x='10' y='20' width='2' height='2' fill='%238F8BA3'/%3E%3Crect x='12' y='20' width='2' height='2' fill='%2307060A'/%3E%3Crect x='0' y='22' width='2' height='2' fill='%2307060A'/%3E%3Crect x='2' y='22' width='2' height='2' fill='%238F8BA3'/%3E%3Crect x='4' y='22' width='2' height='2' fill='%2307060A'/%3E%3Crect x='8' y='22' width='2' height='2' fill='%2307060A'/%3E%3Crect x='10' y='22' width='2' height='2' fill='%238F8BA3'/%3E%3Crect x='12' y='22' width='2' height='2' fill='%238F8BA3'/%3E%3Crect x='14' y='22' width='2' height='2' fill='%2307060A'/%3E%3Crect x='0' y='24' width='2' height='2' fill='%2307060A'/%3E%3Crect x='2' y='24' width='2' height='2' fill='%2307060A'/%3E%3Crect x='8' y='24' width='2' height='2' fill='%2307060A'/%3E%3Crect x='10' y='24' width='2' height='2' fill='%23C9C6D8'/%3E%3Crect x='12' y='24' width='2' height='2' fill='%23C9C6D8'/%3E%3Crect x='14' y='24' width='2' height='2' fill='%2307060A'/%3E%3Crect x='10' y='26' width='2' height='2' fill='%2307060A'/%3E%3Crect x='12' y='26' width='2' height='2' fill='%23C9C6D8'/%3E%3Crect x='14' y='26' width='2' height='2' fill='%23C9C6D8'/%3E%3Crect x='16' y='26' width='2' height='2' fill='%2307060A'/%3E%3Crect x='12' y='28' width='2' height='2' fill='%2307060A'/%3E%3Crect x='14' y='28' width='2' height='2' fill='%2307060A'/%3E%3C/svg%3E") 0 0, auto;
  --cursor-hot: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='32' shape-rendering='crispEdges'%3E%3Crect x='18' y='20' width='2' height='2' fill='%23ECEAF3'/%3E%3Crect x='6' y='24' width='2' height='2' fill='%23ECEAF3'/%3E%3Crect x='16' y='30' width='2' height='2' fill='%23ECEAF3'/%3E%3Crect x='4' y='26' width='2' height='2' fill='%23ECEAF3'/%3E%3Crect x='16' y='20' width='2' height='2' fill='%23ECEAF3'/%3E%3Crect x='20' y='20' width='2' height='2' fill='%23ECEAF3'/%3E%3Crect x='18' y='28' width='2' height='2' fill='%23ECEAF3'/%3E%3Crect x='16' y='24' width='2' height='2' fill='%23ECEAF3'/%3E%3Crect x='4' y='24' width='2' height='2' fill='%23ECEAF3'/%3E%3Crect x='6' y='22' width='2' height='2' fill='%23ECEAF3'/%3E%3Crect x='14' y='30' width='2' height='2' fill='%23ECEAF3'/%3E%3Crect x='16' y='28' width='2' height='2' fill='%23ECEAF3'/%3E%3Crect x='2' y='26' width='2' height='2' fill='%23ECEAF3'/%3E%3Crect x='14' y='20' width='2' height='2' fill='%23ECEAF3'/%3E%3Crect x='0' y='0' width='2' height='2' fill='%2307060A'/%3E%3Crect x='0' y='2' width='2' height='2' fill='%2307060A'/%3E%3Crect x='2' y='2' width='2' height='2' fill='%2307060A'/%3E%3Crect x='0' y='4' width='2' height='2' fill='%2307060A'/%3E%3Crect x='2' y='4' width='2' height='2' fill='%23FFB3A3'/%3E%3Crect x='4' y='4' width='2' height='2' fill='%2307060A'/%3E%3Crect x='0' y='6' width='2' height='2' fill='%2307060A'/%3E%3Crect x='2' y='6' width='2' height='2' fill='%23FF8A73'/%3E%3Crect x='4' y='6' width='2' height='2' fill='%23FF8A73'/%3E%3Crect x='6' y='6' width='2' height='2' fill='%2307060A'/%3E%3Crect x='0' y='8' width='2' height='2' fill='%2307060A'/%3E%3Crect x='2' y='8' width='2' height='2' fill='%23FF8A73'/%3E%3Crect x='4' y='8' width='2' height='2' fill='%23FF8A73'/%3E%3Crect x='6' y='8' width='2' height='2' fill='%23FF8A73'/%3E%3Crect x='8' y='8' width='2' height='2' fill='%2307060A'/%3E%3Crect x='0' y='10' width='2' height='2' fill='%2307060A'/%3E%3Crect x='2' y='10' width='2' height='2' fill='%23FF8A73'/%3E%3Crect x='4' y='10' width='2' height='2' fill='%23FF8A73'/%3E%3Crect x='6' y='10' width='2' height='2' fill='%23FF8A73'/%3E%3Crect x='8' y='10' width='2' height='2' fill='%23FF8A73'/%3E%3Crect x='10' y='10' width='2' height='2' fill='%2307060A'/%3E%3Crect x='0' y='12' width='2' height='2' fill='%2307060A'/%3E%3Crect x='2' y='12' width='2' height='2' fill='%23FF4A2E'/%3E%3Crect x='4' y='12' width='2' height='2' fill='%23FF4A2E'/%3E%3Crect x='6' y='12' width='2' height='2' fill='%23FF4A2E'/%3E%3Crect x='8' y='12' width='2' height='2' fill='%23FF4A2E'/%3E%3Crect x='10' y='12' width='2' height='2' fill='%23FF4A2E'/%3E%3Crect x='12' y='12' width='2' height='2' fill='%2307060A'/%3E%3Crect x='0' y='14' width='2' height='2' fill='%2307060A'/%3E%3Crect x='2' y='14' width='2' height='2' fill='%23FF4A2E'/%3E%3Crect x='4' y='14' width='2' height='2' fill='%23FF4A2E'/%3E%3Crect x='6' y='14' width='2' height='2' fill='%23FF4A2E'/%3E%3Crect x='8' y='14' width='2' height='2' fill='%23FF4A2E'/%3E%3Crect x='10' y='14' width='2' height='2' fill='%23FF4A2E'/%3E%3Crect x='12' y='14' width='2' height='2' fill='%23FF4A2E'/%3E%3Crect x='14' y='14' width='2' height='2' fill='%2307060A'/%3E%3Crect x='0' y='16' width='2' height='2' fill='%2307060A'/%3E%3Crect x='2' y='16' width='2' height='2' fill='%23FF4A2E'/%3E%3Crect x='4' y='16' width='2' height='2' fill='%23FF4A2E'/%3E%3Crect x='6' y='16' width='2' height='2' fill='%23FF4A2E'/%3E%3Crect x='8' y='16' width='2' height='2' fill='%23FF4A2E'/%3E%3Crect x='10' y='16' width='2' height='2' fill='%23FF4A2E'/%3E%3Crect x='12' y='16' width='2' height='2' fill='%23FF4A2E'/%3E%3Crect x='14' y='16' width='2' height='2' fill='%23FF4A2E'/%3E%3Crect x='16' y='16' width='2' height='2' fill='%2307060A'/%3E%3Crect x='0' y='18' width='2' height='2' fill='%2307060A'/%3E%3Crect x='2' y='18' width='2' height='2' fill='%23C2311B'/%3E%3Crect x='4' y='18' width='2' height='2' fill='%23C2311B'/%3E%3Crect x='6' y='18' width='2' height='2' fill='%23C2311B'/%3E%3Crect x='8' y='18' width='2' height='2' fill='%23C2311B'/%3E%3Crect x='10' y='18' width='2' height='2' fill='%2307060A'/%3E%3Crect x='12' y='18' width='2' height='2' fill='%2307060A'/%3E%3Crect x='14' y='18' width='2' height='2' fill='%2307060A'/%3E%3Crect x='16' y='18' width='2' height='2' fill='%2307060A'/%3E%3Crect x='18' y='18' width='2' height='2' fill='%2307060A'/%3E%3Crect x='0' y='20' width='2' height='2' fill='%2307060A'/%3E%3Crect x='2' y='20' width='2' height='2' fill='%23C2311B'/%3E%3Crect x='4' y='20' width='2' height='2' fill='%23C2311B'/%3E%3Crect x='6' y='20' width='2' height='2' fill='%2307060A'/%3E%3Crect x='8' y='20' width='2' height='2' fill='%23C2311B'/%3E%3Crect x='10' y='20' width='2' height='2' fill='%23C2311B'/%3E%3Crect x='12' y='20' width='2' height='2' fill='%2307060A'/%3E%3Crect x='0' y='22' width='2' height='2' fill='%2307060A'/%3E%3Crect x='2' y='22' width='2' height='2' fill='%23C2311B'/%3E%3Crect x='4' y='22' width='2' height='2' fill='%2307060A'/%3E%3Crect x='8' y='22' width='2' height='2' fill='%2307060A'/%3E%3Crect x='10' y='22' width='2' height='2' fill='%23C2311B'/%3E%3Crect x='12' y='22' width='2' height='2' fill='%23C2311B'/%3E%3Crect x='14' y='22' width='2' height='2' fill='%2307060A'/%3E%3Crect x='0' y='24' width='2' height='2' fill='%2307060A'/%3E%3Crect x='2' y='24' width='2' height='2' fill='%2307060A'/%3E%3Crect x='8' y='24' width='2' height='2' fill='%2307060A'/%3E%3Crect x='10' y='24' width='2' height='2' fill='%23FF4A2E'/%3E%3Crect x='12' y='24' width='2' height='2' fill='%23FF4A2E'/%3E%3Crect x='14' y='24' width='2' height='2' fill='%2307060A'/%3E%3Crect x='10' y='26' width='2' height='2' fill='%2307060A'/%3E%3Crect x='12' y='26' width='2' height='2' fill='%23FF4A2E'/%3E%3Crect x='14' y='26' width='2' height='2' fill='%23FF4A2E'/%3E%3Crect x='16' y='26' width='2' height='2' fill='%2307060A'/%3E%3Crect x='12' y='28' width='2' height='2' fill='%2307060A'/%3E%3Crect x='14' y='28' width='2' height='2' fill='%2307060A'/%3E%3C/svg%3E") 0 0, pointer;

  /* 2px checker dither, the building block for pixel shadows */
  --dither-nerv: conic-gradient(var(--nerv) 25%, transparent 0 50%, var(--nerv) 0 75%, transparent 0) 0 0 / 4px 4px;
  --dither-eva: conic-gradient(var(--eva) 25%, transparent 0 50%, var(--eva) 0 75%, transparent 0) 0 0 / 4px 4px;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 20px; color-scheme: dark; overflow-x: clip; }

body {
  margin: 0;
  overflow-x: clip;
  color: var(--text);
  font-family: var(--f-mono);
  font-size: var(--fs-base);
  line-height: 1.75;
  background: var(--void);
  cursor: var(--cursor);
}

/* The divine-machinery background (js/divine.js) sits behind everything, with scanlines on top. */
.divine {
  position: fixed; inset: 0; z-index: -2; width: 100vw; height: 100vh;
  image-rendering: pixelated; image-rendering: crisp-edges; pointer-events: none;
}
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: repeating-linear-gradient(var(--scanline) 0 1px, transparent 1px 3px);
}

/* Clickable things get the red arrow. */
a, button, [role="button"], label, summary, .machine-canvas { cursor: var(--cursor-hot); }
.machine-canvas:active { cursor: var(--cursor-hot); }

/* Pixel ember trail and click bursts (js/divine.js): one half-resolution canvas over everything */
.fx { position: fixed; inset: 0; z-index: 1000; width: 100vw; height: 100vh; pointer-events: none; image-rendering: pixelated; image-rendering: crisp-edges; }

img { max-width: 100%; height: auto; display: block; }

a { color: var(--eva); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.22em; }
a:hover { color: var(--text); text-decoration-color: var(--nerv); }

:focus-visible { outline: 3px solid var(--phosphor); outline-offset: 3px; }

::selection { background: var(--phosphor); color: var(--void); }

.visually-hidden, .is-pixel > :not(canvas) {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 16px; top: -100px; z-index: 100;
  padding: 0.5rem 1rem; background: var(--text); color: var(--void);
  font: 700 var(--fs-sm) var(--f-mono); text-decoration: none;
}
.skip-link:focus { top: 12px; }

h1, h2, h3, h4 { margin: 0; font-weight: 400; }

/* ---------- Shared pieces ---------- */

.term { font-family: var(--f-mono); font-size: var(--fs-sm); line-height: 1.3; letter-spacing: var(--track); }
.eyebrow { margin: 0; font: 400 var(--fs-xs)/1.2 var(--f-mono); letter-spacing: var(--track); text-transform: uppercase; color: var(--dim); }

.ascii { margin: 0; font-family: var(--f-mono); line-height: 1; white-space: pre; color: var(--sigil); user-select: none; }

/* Pixel titles: js/main.js draws these into a canvas. Without JS they fall back to blackletter. */
.pixel-title { font: 400 var(--fs-d2)/0.95 var(--f-goth); color: var(--text); text-shadow: 4px 4px 0 var(--nerv); }
.pixel-title canvas { display: block; width: 100%; height: auto; image-rendering: pixelated; image-rendering: crisp-edges; }
.pixel-title span { display: block; }

/* Cut "pixel" corners: one shape for everything, sized by --s */
.px, .cs-hero img, .cs-hero .video, .shot .panel, .card-media { clip-path: polygon(0 var(--s), var(--s) var(--s), var(--s) 0, calc(100% - var(--s)) 0, calc(100% - var(--s)) var(--s), 100% var(--s), 100% calc(100% - var(--s)), calc(100% - var(--s)) calc(100% - var(--s)), calc(100% - var(--s)) 100%, var(--s) 100%, var(--s) calc(100% - var(--s)), 0 calc(100% - var(--s))); }

/* An image with a dithered drop shadow behind it */
.shadowed { position: relative; isolation: isolate; }
.shadowed::before { content: ""; position: absolute; inset: 0; transform: translate(12px, 12px); z-index: -1; background: var(--dither-nerv); }
.shadowed--eva::before { background: var(--dither-eva); }

/* Red text never sits on the animated background directly (3.93:1), so notes get a solid backing. */
.note { position: absolute; z-index: 4; padding: 3px 7px 2px; font: 400 var(--fs-xs)/1 var(--f-mono); letter-spacing: var(--track); color: var(--nerv); background: var(--void); white-space: nowrap; pointer-events: none; }

.btn {
  --s: var(--cut-s);
  display: inline-flex; align-items: center; gap: var(--sp-2);
  min-height: 46px; padding: 0.55rem 1.2rem;
  font: 600 var(--fs-sm)/1 var(--f-mono); letter-spacing: var(--track-wide); text-transform: uppercase;
  color: var(--text); text-decoration: none; cursor: pointer;
  background: var(--panel); border: 2px solid var(--text);
}
.btn:hover { color: var(--void); background: var(--eva); border-color: var(--eva); }
.btn--select { color: var(--void); background: var(--text); }
.btn--select:hover { background: var(--phosphor); border-color: var(--phosphor); }
.btn:focus-visible, .btn88:focus-visible { outline: none; box-shadow: inset 0 0 0 3px var(--phosphor); }

.badge {
  display: inline-block; padding: 1px var(--sp-2) 0;
  font: 400 var(--fs-xs)/1.25 var(--f-mono); letter-spacing: var(--track); text-transform: uppercase;
  color: var(--nerv); background: var(--nerv-deep); border: 2px solid var(--nerv);
}

.btn88-list { display: flex; flex-wrap: wrap; gap: var(--sp-3); list-style: none; margin: 0; padding: 0; }
.btn88 {
  --s: var(--cut-s);
  display: grid; place-items: center; text-align: center;
  width: 112px; height: 46px; padding: 2px 4px;
  font: 400 var(--fs-xs)/0.95 var(--f-mono); letter-spacing: var(--track); text-transform: uppercase; color: var(--text); text-decoration: none;
  border: 2px solid var(--text);
}
.btn88:hover { color: var(--void); background: var(--text); }
.btn88 small { display: block; font-size: var(--fs-sm); color: inherit; text-transform: lowercase; opacity: 0.85; }
/* Each 88x31 button is a dark tint of one palette colour */
.btn88--steam { background: color-mix(in srgb, var(--fog) 55%, var(--void)); }
.btn88--itch { background: color-mix(in srgb, var(--nerv) 14%, var(--void)); }
.btn88--in { background: color-mix(in srgb, var(--eva) 14%, var(--void)); }
.btn88--mail { background: color-mix(in srgb, var(--phosphor) 10%, var(--void)); }

kbd { display: inline-grid; place-items: center; min-width: 2.2em; height: 1.6em; padding: 0 0.4em; font: 400 var(--fs-xs) var(--f-mono); color: var(--void); background: var(--text); }

/* ---------- Masthead ---------- */

.masthead {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-2) var(--sp-5);
  padding: var(--sp-4) var(--gutter);
}
.masthead .term { margin: 0; color: var(--phosphor); }
.caret { animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.topnav ul { display: flex; flex-wrap: wrap; gap: 2px var(--sp-4); margin: 0; padding: 0; list-style: none; }
.topnav a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 2px;
  font: 400 var(--fs-xs) var(--f-mono); letter-spacing: var(--track); text-transform: uppercase; color: var(--text); text-decoration: none;
}
.topnav a::before { content: "["; color: var(--dim); }
.topnav a::after { content: "]"; color: var(--dim); }
.topnav a:hover, .topnav a[aria-current="page"] { color: var(--phosphor); }

/* ---------- Hero: the divine machine ----------
   An interactive pixel reliquary (js/machine.js), the pixel name laid across its base
   like an inscription, and a terminal boot readout. */

.hero {
  position: relative; max-width: 1440px; margin-inline: auto;
  padding: clamp(20px, 3vw, 40px) var(--gutter) clamp(80px, 10vw, 140px);
  display: flex; flex-direction: column; align-items: center;
}
.hero .sigil {
  position: absolute; left: 50%; top: 34%; z-index: 0; transform: translate(-50%, -50%);
  font-size: clamp(3px, 0.9vw, 11px);
  text-shadow: 0 0 10px color-mix(in srgb, var(--sigil) 80%, transparent);
}

.machine { position: relative; z-index: 1; width: min(820px, 100%); aspect-ratio: 4 / 3; }
.machine-canvas {
  display: block; width: 100%; height: 100%;
  image-rendering: pixelated; image-rendering: crisp-edges;
  touch-action: pan-y;
  transition: filter var(--t-fade) ease;
}
.machine-canvas:focus-visible { outline: 3px solid var(--phosphor); outline-offset: 6px; }
.machine-canvas.ascended { filter: drop-shadow(0 0 26px color-mix(in srgb, var(--eva) 55%, transparent)); }
.machine-log {
  position: absolute; left: 50%; top: 4%; z-index: 2; transform: translateX(-50%);
  max-width: 92%; margin: 0; padding: var(--sp-1) var(--sp-3);
  font: 400 var(--fs-sm)/1.4 var(--f-mono); letter-spacing: var(--track); text-align: center;
  color: var(--phosphor); background: var(--void);
  pointer-events: none;
}

.hero-name { position: relative; z-index: 2; width: min(860px, 94%); margin: clamp(-130px, -10vw, -40px) auto 0; pointer-events: none; }

/* Terminal boot readout, straight on the background */
.boot { position: relative; z-index: 2; width: min(680px, 100%); margin: clamp(30px, 4vw, 54px) auto 0; }
.boot dl { margin: 0; font: 400 var(--fs-base)/1.6 var(--f-mono); }
.boot-line { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: 0 0.9rem; padding: 3px 0; }
.boot dt { display: flex; align-items: baseline; gap: var(--sp-2); color: var(--dim); text-transform: uppercase; letter-spacing: var(--track); font-size: var(--fs-xs); }
.boot dt::after { content: ""; flex: 1; border-bottom: 2px dotted var(--line); transform: translateY(-4px); }
.boot dd { margin: 0; color: var(--text); }
.boot .ok { color: var(--phosphor); }
.hero-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--sp-3); margin-top: var(--sp-6); }

/* Typed-out reveal, one line after another */
.reveal-ready .boot-line { clip-path: inset(0 100% 0 0); animation: type 0.7s steps(28) forwards; animation-delay: calc(1.1s + var(--n) * 0.45s); }
@keyframes type { to { clip-path: inset(0 0 0 0); } }

@media (max-width: 860px) {
  .hero .sigil { top: 24%; font-size: clamp(2.5px, 0.9vw, 6px); }
  .machine { aspect-ratio: 1 / 1; }
  .hero-name { width: 100%; margin-top: -50px; }
  .boot-line { grid-template-columns: 5.6rem minmax(0, 1fr); }
}

/* ---------- Sections ---------- */

.section { position: relative; max-width: 1440px; margin-inline: auto; padding: clamp(90px, 13vw, 200px) var(--gutter); }
.section-title { width: min(720px, 82%); margin-bottom: var(--sp-4); }
.section-title--right { margin-left: auto; }
.section-sub { margin: 0 0 clamp(60px, 8vw, 110px); max-width: 52ch; color: var(--dim); }
.section-sub--right { margin-left: auto; text-align: right; }

/* ---------- Work: overlapping spreads ---------- */

.spread { position: relative; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); align-items: center; margin-bottom: clamp(130px, 16vw, 240px); }
.spread-media { position: relative; z-index: 1; display: block; grid-row: 1; }
.spread-media img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.spread-text {
  position: relative; z-index: 2; grid-row: 1;
  padding: var(--sp-5) var(--sp-6); background: var(--panel-glass);
}
.spread-text .eyebrow { color: var(--phosphor); margin-bottom: var(--sp-1); }
.spread-title { font: 400 var(--fs-d3)/0.92 var(--f-goth); text-shadow: 4px 4px 0 var(--nerv); margin-bottom: var(--sp-3); }
.spread-title a { color: var(--text); text-decoration: none; }
.spread-title a:hover, .spread-text:hover .spread-title a { color: var(--eva); }
.spread-text { cursor: pointer; }
.spread-line { margin: 0 0 var(--sp-4); color: var(--dim); max-width: 46ch; }
.spread-foot { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3) var(--sp-4); }
.open { font: 400 var(--fs-xs) var(--f-mono); letter-spacing: var(--track); text-transform: uppercase; }
.spread .note { z-index: 4; }

/* Picture and text sit side by side in their own columns, so the text never covers the thumbnail. */
.spread { column-gap: var(--sp-5); }
.spread--a .spread-media { grid-column: 1 / 8; }
.spread--a .spread-text { grid-column: 8 / 13; }
.spread--b .spread-media { grid-column: 6 / 13; }
.spread--b .spread-text { grid-column: 1 / 6; }
.spread--b .shadowed::before { transform: translate(-12px, 12px); }
.spread--big .spread-media { grid-column: 1 / 8; }
.spread--big .spread-title { font-size: var(--fs-d2); }
.spread--big .note { right: 8%; top: -26px; padding: 2px var(--sp-2); background: var(--void); border: 2px solid var(--nerv); }

@media (max-width: 700px) {
  .spread { display: block; }
  .spread-text, .spread--a .spread-text, .spread--b .spread-text { margin: var(--sp-4) 0 0; }
  .spread--big .note { right: 6px; top: -22px; }
}

/* ---------- Archive: scattered scraps ---------- */

.scatter { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 80px 40px; align-items: start; }
.scrap { position: relative; display: block; color: var(--text); text-decoration: none; transition: transform var(--t-fast) ease; }
.scrap img { --s: var(--cut-m); width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.scrap-title { display: block; margin-top: var(--sp-3); font: 400 var(--fs-d5)/0.95 var(--f-goth); color: var(--text); text-shadow: 3px 3px 0 var(--nerv); }
.scrap-line { display: block; margin-top: var(--sp-1); font-size: var(--fs-sm); line-height: 1.4; color: var(--dim); }
.scrap .badge { margin-top: var(--sp-2); }
a.scrap:hover { z-index: 3; transform: scale(1.04); }
a.scrap:hover .scrap-title { color: var(--eva); }
.ext::after { content: " ↗"; font-family: var(--f-mono); font-size: 0.55em; color: var(--eva); text-shadow: none; }

.scatter { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 70px clamp(24px, 3vw, 44px); }
.scrap:nth-child(3n + 2) { margin-top: 60px; }
@media (max-width: 700px) {
  .scatter { grid-template-columns: 1fr 1fr; gap: 50px 18px; }
  .scrap:nth-child(3n + 2) { margin-top: 0; }
  .scrap:nth-child(even) { margin-top: 40px; }
}
@media (max-width: 440px) { .scatter { grid-template-columns: 1fr; } .scrap:nth-child(even) { margin-top: 0; } }

/* ---------- About ---------- */

.about-grid { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: 60px clamp(50px, 7vw, 110px); align-items: start; margin-top: 50px; }
.about-photo { position: relative; margin: 20px 0 0; }
.about-photo img { --s: var(--cut-l); width: 100%; height: auto; }
.about-photo .note { left: 0; bottom: -32px; }

.currently {
  position: relative; z-index: 2; width: min(300px, 92%); margin: var(--sp-8) 0 0 auto; padding: var(--sp-4);
  font-size: var(--fs-sm); background: var(--panel); border: 2px dashed var(--phosphor);
}
.currently h3 { margin: 0 0 var(--sp-2); font: 400 var(--fs-xs) var(--f-mono); letter-spacing: var(--track); color: var(--phosphor); text-transform: uppercase; }
.currently dl { margin: 0; display: grid; gap: var(--sp-2); }
.currently dt { font: 400 var(--fs-xs) var(--f-mono); letter-spacing: var(--track); text-transform: uppercase; color: var(--dim); }
.currently dd { margin: 0; line-height: 1.45; }

.about-copy p { margin: 0 0 1rem; max-width: 62ch; }
.about-copy .lead { font-size: var(--fs-lg); }
.hi { font: 400 var(--fs-lg)/1.3 var(--f-mono); color: var(--phosphor); margin: 0 0 var(--sp-3); }

.log-title { margin: var(--sp-7) 0 var(--sp-3); font: 400 var(--fs-xs) var(--f-mono); letter-spacing: var(--track); text-transform: uppercase; }
.log-title::before { content: "> "; color: var(--phosphor); }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 7rem 1fr; gap: var(--sp-4); padding: var(--sp-3) 0; font-size: var(--fs-sm); line-height: 1.45; border-bottom: 1px dotted var(--line); }
.timeline .when { font: 400 var(--fs-xs) var(--f-mono); color: var(--phosphor); }
.timeline strong { display: block; }
.timeline .where { color: var(--dim); }

.about-links { margin-top: var(--sp-6); }

@media (max-width: 860px) {
  .about-grid { grid-template-columns: 1fr; }
  .about-photo { max-width: 360px; }
  .currently { margin: var(--sp-7) 0 0 auto; }
}
@media (max-width: 440px) { .timeline li { grid-template-columns: 1fr; gap: 0; } }

/* ---------- Contact ---------- */

.contact { padding-bottom: clamp(40px, 7vw, 80px); }
.contact p { max-width: 50ch; }
.email-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3) var(--sp-4); margin: var(--sp-4) 0 var(--sp-5); }
.email { display: inline-block; padding-block: 0.3rem; font: 600 var(--fs-xl)/1.2 var(--f-mono); letter-spacing: 0; color: var(--text); overflow-wrap: anywhere; text-decoration-color: var(--nerv); }

/* ---------- Footer ---------- */

.site-footer { padding: var(--sp-3) var(--gutter) var(--sp-7); text-align: center; font: 400 var(--fs-xs)/1.6 var(--f-mono); letter-spacing: var(--track); text-transform: uppercase; color: var(--dim); }
.site-footer .ascii { color: var(--sigil); font-size: var(--fs-xs); overflow: hidden; margin-bottom: var(--sp-3); }
.site-footer ul { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px var(--sp-4); list-style: none; margin: 0 0 var(--sp-2); padding: 0; }
.site-footer p { margin: 0; }
.site-footer .ring-name { margin: 0 0 var(--sp-1); }
.site-footer a { display: inline-grid; place-items: center; min-height: 44px; }
.ring-name { font: 400 var(--fs-d5)/1 var(--f-goth); text-transform: none; color: var(--text); text-shadow: 2px 2px 0 var(--nerv); }

/* ---------- Case study pages ---------- */

.site { width: 100%; }
.topbar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-2) var(--sp-5);
  padding: var(--sp-4) var(--gutter) 0;
}
.topbar .wordmark { font: 400 var(--fs-d4)/1 var(--f-goth); color: var(--text); text-decoration: none; text-shadow: 3px 3px 0 var(--nerv); }
.topbar .wordmark .w, .topbar .wordmark .l { display: inline; }
.topbar ul { display: flex; flex-wrap: wrap; gap: 2px var(--sp-4); margin: 0; padding: 0; list-style: none; }
.topbar ul a { display: inline-flex; align-items: center; min-height: 44px; font: 400 var(--fs-xs) var(--f-mono); letter-spacing: var(--track); text-transform: uppercase; color: var(--text); text-decoration: none; }
.topbar ul a::before { content: "["; color: var(--dim); }
.topbar ul a::after { content: "]"; color: var(--dim); }
.topbar ul a:hover, .topbar ul a[aria-current="page"] { color: var(--phosphor); }

.case-window { display: block; max-width: 1340px; margin-inline: auto; }
.case-window .wrap { padding-inline: var(--gutter); }

.cs-head { position: relative; padding-block: var(--sp-4) var(--sp-3); }
.back { display: inline-flex; align-items: center; gap: var(--sp-3); min-height: 44px; font: 400 var(--fs-xs) var(--f-mono); text-transform: uppercase; letter-spacing: var(--track); color: var(--text); text-decoration: none; }
.back:hover { color: var(--phosphor); }
.cs-title { width: min(1000px, 100%); margin: var(--sp-5) 0 var(--sp-4); transform-origin: left center; }
.cs-tagline { position: relative; z-index: 1; font-size: var(--fs-lg); max-width: 56ch; margin: 0 0 var(--sp-4); padding-left: var(--sp-4); border-left: 4px solid var(--nerv); }
.cs-head .badge { margin: 0 var(--sp-2) var(--sp-2) 0; }
.cs-actions { display: flex; flex-wrap: wrap; gap: var(--sp-3); margin-top: var(--sp-5); }

/* Facts as a terminal readout */
.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 var(--sp-5); margin: var(--sp-5) 0 0; padding: var(--sp-3) 0 0; border-top: 2px solid var(--text); }
.facts div { padding: var(--sp-2) 0 var(--sp-3); border-bottom: 1px dotted var(--line); }
.facts dt { font: 400 var(--fs-xs) var(--f-mono); letter-spacing: var(--track); text-transform: uppercase; color: var(--dim); }
.facts dd { margin: 0; font-weight: 700; font-size: var(--fs-sm); line-height: 1.35; }
@media (max-width: 700px) { .facts { grid-template-columns: 1fr 1fr; } }

.cs-hero { position: relative; isolation: isolate; margin: var(--sp-7) 0 0; }
.cs-hero::before { content: ""; position: absolute; inset: 0; transform: translate(14px, 14px); z-index: -1; background: var(--dither-nerv); }
.cs-hero img, .cs-hero .video { --s: var(--cut-l); }
.cs-hero img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.cs-hero--natural img { aspect-ratio: auto; }

.cs-body { padding-block: clamp(70px, 9vw, 130px) 40px; }
.cs-section { display: grid; grid-template-columns: 13rem minmax(0, 1fr); gap: 1rem clamp(2.5rem, 5vw, 5rem); padding-block: clamp(44px, 6vw, 80px); }
.cs-section h2 { align-self: start; font: 400 var(--fs-d4)/0.95 var(--f-goth); color: var(--text); text-shadow: 3px 3px 0 var(--nerv); }
.prose > :first-child { margin-top: 0; }
.prose p, .prose ul { max-width: 66ch; }
.prose ul { padding-left: 1.2rem; }
.prose li { margin-bottom: 0.45rem; }
.prose li::marker { content: "† "; color: var(--nerv); }
.prose h3 { margin: 2.6rem 0 0.6rem; font: 600 var(--fs-base) var(--f-mono); color: var(--phosphor); }
.prose h3::before { content: "> "; color: var(--nerv); }
@media (max-width: 860px) { .cs-section { grid-template-columns: 1fr; } }

.shot { margin: 2.6rem 0 0; }
.shot .panel { --s: var(--cut-m); overflow: hidden; background: var(--void); }
.shot img, .shot video { display: block; width: 100%; height: auto; }
.shot video { object-fit: contain; }  /* ratio comes from each video's width and height */
/* Tall images (portrait sketches): image on the left, caption beside it */
.shot--side { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1fr); gap: var(--sp-5); align-items: end; }
.shot--side figcaption { margin-top: 0; }
@media (max-width: 700px) { .shot--side { grid-template-columns: minmax(0, 1fr); } .shot--side .panel { max-width: 360px; } }
.shot figcaption { margin-top: var(--sp-3); max-width: 66ch; font-size: var(--fs-sm); color: var(--dim); }
.shot figcaption strong { display: block; font: 400 var(--fs-xs) var(--f-mono); letter-spacing: var(--track); text-transform: uppercase; color: var(--text); margin-bottom: 2px; }
.shot .panel--narrow { max-width: 460px; }
.shots-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-5); }
.shots-2 .shot:nth-child(2) { margin-top: 3rem; }
@media (max-width: 700px) { .shots-2 { grid-template-columns: 1fr; } .shots-2 .shot:nth-child(2) { margin-top: 1.8rem; } }

.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.steps > li { counter-increment: step; }
.steps .shot figcaption strong::before { content: "step " counter(step) " ▸ "; color: var(--nerv); }

.outcome { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-5); align-items: center; }
.outcome p { margin: 0; }
.outcome-number { font: 400 var(--fs-d1)/0.9 var(--f-goth); color: var(--text); text-shadow: 6px 6px 0 var(--nerv); }

/* Click-to-load YouTube player */
.video { position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; padding: 0; overflow: hidden; cursor: pointer; background: var(--void); border: 0; }
.video img { width: 100%; height: 100%; object-fit: cover; }
.video .play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); padding: var(--sp-3) var(--sp-5); font: 600 var(--fs-sm) var(--f-mono); letter-spacing: var(--track-wide); text-transform: uppercase; color: var(--void); background: var(--text); }
.video:hover .play { background: var(--phosphor); }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.trim-bars { scale: 1.2; }

/* "Next case study" */
.next { padding-block: var(--sp-3) var(--sp-6); }
.card { position: relative; display: grid; grid-template-columns: 1fr 1.2fr; align-items: center; gap: 0; color: var(--text); text-decoration: none; }
.card:hover { color: var(--text); }
.card-media { --s: var(--cut-m); overflow: hidden; }
.card-media img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.card-body { position: relative; z-index: 1; margin-left: -40px; padding: var(--sp-4) var(--sp-5); background: var(--panel-glass); }
.card .eyebrow { color: var(--phosphor); }
.card-title { font: 400 var(--fs-d3)/0.95 var(--f-goth); text-shadow: 3px 3px 0 var(--nerv); }
.card:hover .card-title { color: var(--eva); }
.card-role { margin: var(--sp-1) 0 var(--sp-2); font-size: var(--fs-sm); color: var(--dim); }
.card-cta { font: 400 var(--fs-xs) var(--f-mono); letter-spacing: var(--track); text-transform: uppercase; color: var(--eva); }
.card-cta::after { content: " →"; }
@media (max-width: 700px) {
  .card { display: block; }
  .card-body { margin: -24px 10px 0 18px; }
}

/* Webring (built by main.js on case pages) */
.webring {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: var(--sp-1) var(--sp-4);
  margin: var(--sp-5) auto 0; padding: 0 var(--gutter);
  font: 400 var(--fs-xs) var(--f-mono); text-transform: uppercase; letter-spacing: var(--track);
}
.webring .ring-name { margin: 0; }
.webring a { display: inline-grid; place-items: center; min-height: 44px; }

/* ---------- Juice: reveals, glitch, tilt (js/divine.js adds .reveal-ready unless motion is reduced) ---------- */

.reveal-ready .spread .spread-media { opacity: 0; translate: -90px 30px; transition: opacity var(--t-fade) ease, translate var(--t-move) var(--ease-out); }
.reveal-ready .spread .spread-text { opacity: 0; translate: 90px 50px; transition: opacity var(--t-fade) ease 0.12s, translate var(--t-move) var(--ease-out) 0.12s; }
.reveal-ready .spread--b .spread-media { translate: 90px 30px; }
.reveal-ready .spread--b .spread-text { translate: -90px 50px; }
.reveal-ready .spread.in .spread-media, .reveal-ready .spread.in .spread-text { opacity: 1; translate: 0 0; }
.reveal-ready .spread .note { opacity: 0; scale: 1.6; transition: opacity 0.2s steps(2) 0.7s, scale 0.35s steps(3) 0.7s; }
.reveal-ready .spread.in .note { opacity: 1; scale: 1; }

.reveal-ready .scrap { opacity: 0; scale: 0.7; translate: 0 40px; transition: opacity var(--t-fade) ease calc(var(--i) * 70ms), scale var(--t-move) var(--ease-pop) calc(var(--i) * 70ms), translate var(--t-move) var(--ease-out) calc(var(--i) * 70ms); }
.reveal-ready .scrap.in { opacity: 1; scale: 1; translate: 0 0; }

.reveal-ready .shot, .reveal-ready .card, .reveal-ready .cs-section { opacity: 0; translate: 0 50px; transition: opacity var(--t-fade) ease, translate var(--t-move) var(--ease-out); }
.reveal-ready .shot.in, .reveal-ready .card.in, .reveal-ready .cs-section.in { opacity: 1; translate: 0 0; }

/* Tilt: the image leans toward the cursor while its dither shadow stays put */
.spread-media img, .about-photo img, .cs-hero img, .cs-hero .video { transition: transform var(--t-med) var(--ease-out); will-change: transform; }
.shadowed::before, .cs-hero::before { transition: transform var(--t-med) var(--ease-out); }
.shadowed.tilting::before { transform: translate(20px, 20px); }
.spread--b .shadowed.tilting::before { transform: translate(-20px, 20px); }
.cs-hero.tilting::before { transform: translate(22px, 22px); }

/* Glitch on hover for big titles */
.spread-title a, .scrap-title, .card-title { display: inline-block; }
.spread-title a:hover, a.scrap:hover .scrap-title, .card:hover .card-title { animation: glitch 0.42s steps(2) 1; }
@keyframes glitch {
  0% { transform: none; }
  20% { transform: translate(-4px, 1px) skewX(-8deg); text-shadow: -4px 0 0 var(--glitch), 4px 4px 0 var(--nerv); clip-path: inset(0 0 55% 0); }
  40% { transform: translate(4px, -1px); text-shadow: 4px 0 0 var(--glitch), -3px 3px 0 var(--nerv); clip-path: inset(45% 0 0 0); }
  60% { transform: translate(-2px, 2px) skewX(6deg); clip-path: inset(20% 0 30% 0); }
  80% { transform: translate(2px, 0); clip-path: none; }
  100% { transform: none; }
}

/* Buttons: a pixel "press" */
.btn, .btn88 { transition: transform var(--t-fast) steps(2), background-color var(--t-fast) ease, color var(--t-fast) ease; }
.btn:hover, .btn88:hover { transform: translate(-2px, -2px); }
.btn:active, .btn88:active { transform: translate(2px, 2px); }

/* ---------- Motion preferences ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation: none !important; }
}
