/* Brand option: a (Lit pixel), b (Bookmark) or c (Play). Change the letter here, then run
   tools/brand.mjs with the same letter so the logo files in /brand/ match. */
@import url("brand-a.css");

@font-face {
  font-family: "Plaug Pixel";
  src: url("../fonts/pixel.woff2") format("woff2");
  font-display: swap;
}

/* Colours from Avoria's own UI: the menu's obsidian, panel blue-black, parchment text, the title's gold,
   the emerald of its buttons and the mint of the Glyphmote Wand. */
:root, .theme-dark {
  --bg: #0B0A0E;
  --bg-2: #10131A;
  --bg-3: #171B24;
  --ink: #EEE4CE;
  --ink-2: #BDB4A0;
  --ink-3: #8F8878;
  --line: rgba(238, 228, 206, 0.11);
  --line-2: rgba(238, 228, 206, 0.24);
  --accent: #FFD45E;
  --accent-ink: #0B0A0E;
  --accent-text: #FFD45E;
  --accent-rgb: 255, 212, 94;
  --emerald: #3CEC96;
  --emerald-text: #3CEC96;
  --mint-rgb: 115, 255, 153;
  --bronze: #78562C;
  --focus: #FFD45E;
  --scene-tile: #1B231D;
  --scene-side: #0F1411;
  --shadow: rgba(0, 0, 0, 0.6);
}
.theme-dark { color-scheme: dark; color: var(--ink); }
@media (prefers-color-scheme: light) {
  :root {
    --bg: #F2EBDD;
    --bg-2: #E9E0CD;
    --bg-3: #FBF7EE;
    --ink: #15120E;
    --ink-2: #4A4336;
    --ink-3: #6A6152;
    --line: rgba(21, 18, 14, 0.12);
    --line-2: rgba(21, 18, 14, 0.26);
    --accent: #FFD45E;
    --accent-ink: #15120E;
    --accent-text: #7A5418;
    --accent-rgb: 205, 150, 40;
    --emerald: #3CEC96;
    --emerald-text: #17744A;
    --focus: #15120E;
    --scene-tile: #DDD3BD;
    --scene-side: #C6BAA0;
    --shadow: rgba(60, 45, 20, 0.2);
  }
}

:root {
  color-scheme: dark light;
  --pixel: "Plaug Pixel", ui-monospace, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SFMono-Regular", Menlo, Consolas, monospace;
  --pad: clamp(16px, 4.2vw, 48px);
  --max: 1160px;
  --header-h: 64px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}
img, svg, canvas { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; }
p { margin: 0 0 1em; }
h1, h2, h3 { margin: 0; font-weight: var(--display-weight); }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 4px; }

.skip {
  position: absolute; left: 12px; top: -80px; z-index: 100;
  background: var(--accent); color: var(--accent-ink);
  padding: 12px 16px; border-radius: 6px; font-weight: 600; text-decoration: none;
}
.skip:focus { top: 12px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.wrap { width: 100%; max-width: var(--max); margin-inline: auto; }

.display {
  font-family: var(--display);
  font-weight: var(--display-weight);
  letter-spacing: var(--display-tracking);
  line-height: 1.02;
}
.kicker {
  display: inline-flex; align-items: center; gap: 10px;
  font: 400 0.8125rem/1.2 var(--pixel);
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-2);
  margin: 0 0 20px;
}
.kicker::before {
  content: ""; width: 8px; height: 8px; flex: none;
  background: var(--accent);
  box-shadow: 0 0 14px rgba(var(--accent-rgb), 0.7);
}

/* Header */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding-inline: var(--pad);
  transition: background-color 0.35s var(--ease), border-color 0.35s var(--ease);
  border-bottom: 1px solid transparent;
}
.site-header.is-solid, .site-header.is-scrolled {
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  backdrop-filter: blur(16px) saturate(1.4);
  border-bottom-color: var(--line);
}
.brand-link {
  display: inline-flex; align-items: center;
  min-height: 44px; padding-block: 10px;
  border-radius: 4px; flex: none;
}
.brand-link img { height: 21px; width: auto; }
.site-nav ul { display: flex; gap: 2px; margin: 0; padding: 0; list-style: none; }
.site-nav a {
  position: relative;
  display: inline-flex; align-items: center;
  min-height: 44px; padding: 0 10px;
  font-size: 0.9375rem; font-weight: 500;
  color: var(--ink-2); text-decoration: none;
  transition: color 0.2s;
}
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--ink); }
.site-nav a[aria-current="page"]::after {
  content: ""; position: absolute; left: 50%; bottom: 6px;
  width: 6px; height: 6px; margin-left: -3px;
  background: var(--accent);
}
@media (max-width: 400px) {
  .brand-link img { height: 17px; }
  .site-nav a { padding: 0 7px; font-size: 0.875rem; }
}

.progress {
  position: fixed; inset: 0 0 auto 0; z-index: 60;
  height: 2px; transform-origin: 0 50%;
  transform: scaleX(var(--progress, 0));
  background: var(--accent);
  pointer-events: none;
}
@media (min-width: 1200px) { .progress { display: none; } }

/* Buttons */
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  --mx: 0px; --my: 0px;
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 50px; padding: 0 22px;
  border-radius: 6px; border: 1px solid transparent;
  font: 600 1rem/1 var(--sans);
  text-decoration: none; white-space: nowrap;
  transform: translate3d(var(--mx), var(--my), 0);
  transition: transform 0.45s var(--ease-out), background-color 0.2s, border-color 0.2s, box-shadow 0.3s;
}
.btn.is-magnet { transition: transform 0.12s linear, background-color 0.2s, border-color 0.2s, box-shadow 0.3s; }
.btn svg { width: 16px; height: 16px; flex: none; transition: transform 0.3s var(--ease-out); }
.btn:hover svg { transform: translateX(3px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { box-shadow: 0 10px 40px -10px rgba(var(--accent-rgb), 0.75); }
.btn-ghost {
  color: var(--ink); border-color: var(--line-2);
  background: color-mix(in srgb, var(--bg) 55%, transparent);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.btn-ghost:hover { border-color: var(--ink-2); }

/* Hero */
.hero {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: 100vh; min-height: 100svh;
  display: grid; align-items: end;
  padding: calc(var(--header-h) + 32px) var(--pad) clamp(48px, 10vh, 112px);
}
.hero-stage { position: absolute; inset: 0; z-index: -2; }
.hero-stage canvas {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; transition: opacity 1.2s var(--ease);
}
.hero-stage canvas.is-live { opacity: 1; }
/* Painted before any script runs: a receding floor of hairlines, so first paint already has depth. */
.hero-floor {
  position: absolute; left: -40%; right: -40%; bottom: -10%; height: 70%;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 56px 56px;
  transform: perspective(520px) rotateX(62deg);
  transform-origin: 50% 100%;
  -webkit-mask-image: linear-gradient(to top, #000 10%, transparent 85%);
  mask-image: linear-gradient(to top, #000 10%, transparent 85%);
  transition: opacity 1.2s var(--ease);
}
.hero.is-live .hero-floor { opacity: 0; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(90% 70% at 18% 92%, color-mix(in srgb, var(--bg) 88%, transparent) 0%, transparent 62%),
    linear-gradient(to top, var(--bg) 0%, color-mix(in srgb, var(--bg) 40%, transparent) 26%, transparent 48%),
    linear-gradient(to bottom, color-mix(in srgb, var(--bg) 70%, transparent) 0%, transparent 22%);
}
.hero-inner { width: 100%; max-width: var(--max); margin-inline: auto; }
.hero-title { margin: 0 0 clamp(20px, 3vh, 32px); }
.hero-title img { width: min(880px, 92%); }
@media (max-width: 600px) { .hero-title img { width: min(300px, 78%); } }
.hero-line {
  font-family: var(--display); font-weight: 500; letter-spacing: -0.01em;
  font-size: clamp(1.15rem, 2.3vw, 1.7rem); line-height: 1.3;
  max-width: 30ch; margin: 0 0 clamp(28px, 4vh, 40px);
}
.hero-foot {
  display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 24px;
}
.scroll-cue {
  display: inline-flex; align-items: center; gap: 12px;
  font: 400 0.8125rem/1 var(--pixel); letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-2); text-decoration: none; min-height: 44px;
}
.scroll-cue span { position: relative; width: 1px; height: 40px; background: var(--line-2); overflow: hidden; }
.scroll-cue span::after {
  content: ""; position: absolute; left: -2px; top: 0; width: 5px; height: 5px; background: var(--accent);
}
@media (prefers-reduced-motion: no-preference) {
  .scroll-cue span::after { animation: cue 2.4s var(--ease) infinite; }
}
@keyframes cue { 0% { transform: translateY(-6px); } 70%, 100% { transform: translateY(44px); } }
@media (max-width: 640px) { .scroll-cue { display: none; } }

/* Reveal on scroll. Only hidden once the script has said it will show them again. */
.js-motion [data-reveal] {
  opacity: 0; transform: translate3d(0, 28px, 0);
  transition: opacity 0.9s var(--ease-out), transform 1.1s var(--ease-out);
  transition-delay: var(--delay, 0ms);
}
.js-motion [data-reveal].is-in { opacity: 1; transform: none; }

/* Sections */
.section { position: relative; padding: clamp(88px, 15vh, 168px) var(--pad); }
.section-head { margin-bottom: clamp(32px, 6vh, 64px); }
.section-title { font-size: clamp(2.1rem, 6.2vw, 4.75rem); max-width: 16ch; }
.section-lead { color: var(--ink-2); font-size: 1.125rem; max-width: 46ch; margin-top: 20px; }

/* Studio statement */
.statement {
  font-family: var(--display); font-weight: 500;
  letter-spacing: -0.02em; line-height: 1.22;
  font-size: clamp(1.45rem, 3.5vw, 2.85rem);
  max-width: 30ch; margin: 0;
}
.words-ready .statement .w { color: var(--ink-3); transition: color 0.5s var(--ease); }
.words-ready .statement .w.on { color: var(--ink); }

.stats {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0; margin: clamp(56px, 9vh, 96px) 0 0; padding: 0;
}
@media (min-width: 900px) { .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.stat { position: relative; display: flex; flex-direction: column-reverse; justify-content: flex-end; padding: 24px 20px 16px 0; margin: 0; }
.stat[hidden] { display: none; }
.stat::before {
  content: ""; position: absolute; left: 0; right: 16px; top: 0; height: 1px; background: var(--line-2);
  transform-origin: 0 50%;
}
.js-motion .stat::before { transform: scaleX(0); transition: transform 1.2s var(--ease-out) var(--delay, 0ms); }
.js-motion .stat.is-in::before { transform: scaleX(1); }
.stat dt { font: 500 0.875rem/1.45 var(--sans); color: var(--ink-2); max-width: 22ch; }
.stat dd {
  margin: 0 0 10px;
  font-family: var(--display); font-weight: var(--display-weight);
  font-size: clamp(2.6rem, 6vw, 4.6rem); line-height: 1; letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.stat dd small { font-size: 0.5em; color: var(--accent-text); margin-right: 2px; vertical-align: 0.5em; }

/* Avoria */
.avoria {
  overflow: hidden; isolation: isolate;
  min-height: 92vh; display: grid; align-content: center;
  border-block: 1px solid var(--line);
}
.avoria-bg {
  position: absolute; inset: -12% 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(42% 46% at 74% 58%, rgba(var(--accent-rgb), 0.17), transparent 70%),
    radial-gradient(30% 30% at 74% 58%, rgba(var(--accent-rgb), 0.1), transparent 70%);
}
.avoria-grid {
  position: absolute; inset: -20% -10%; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask-image: radial-gradient(50% 50% at 70% 55%, #000, transparent 75%);
  mask-image: radial-gradient(50% 50% at 70% 55%, #000, transparent 75%);
}
.avoria-pixels { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.avoria-pixels i {
  position: absolute; width: 10px; height: 10px; background: var(--accent);
  box-shadow: 0 0 22px rgba(var(--accent-rgb), 0.9);
}
.avoria-pixels i:nth-child(1) { left: 66%; top: 34%; }
.avoria-pixels i:nth-child(2) { left: 81%; top: 61%; width: 7px; height: 7px; opacity: 0.8; }
.avoria-pixels i:nth-child(3) { left: 72%; top: 77%; width: 5px; height: 5px; opacity: 0.6; }
.avoria-pixels i:nth-child(4) { left: 90%; top: 28%; width: 5px; height: 5px; opacity: 0.5; }
@media (prefers-reduced-motion: no-preference) {
  .avoria-pixels i { animation: breathe 5s ease-in-out infinite; }
  .avoria-pixels i:nth-child(2) { animation-delay: -1.7s; }
  .avoria-pixels i:nth-child(3) { animation-delay: -3.1s; }
  .avoria-pixels i:nth-child(4) { animation-delay: -0.8s; }
}
@keyframes breathe { 50% { opacity: 0.25; transform: scale(0.8); } }
.avoria-door {
  position: absolute; z-index: -1; pointer-events: none;
  right: max(var(--pad), calc((100vw - var(--max)) / 2 - 24px)); top: 56%;
  width: min(28vw, 360px); height: auto; margin-top: calc(min(28vw, 360px) * -0.65);
}
.door-frame { fill: var(--ink); }
.door-leaf { fill: var(--ink); }
.door-seal { fill: var(--accent); filter: drop-shadow(0 0 8px rgba(var(--accent-rgb), 0.9)); }
@media (prefers-reduced-motion: no-preference) {
  .door-seal { animation: breathe 3.2s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
  .door-seal:nth-of-type(2n) { animation-delay: -1.1s; }
}
@media (max-width: 899px) { .avoria-door { display: none; } }
.avoria-title {
  font-size: clamp(3.6rem, 16vw, 13rem); line-height: 0.9; letter-spacing: -0.045em;
  margin: 0 0 clamp(24px, 4vh, 40px) -0.04em;
}
.avoria-line { font-size: clamp(1.15rem, 2vw, 1.45rem); line-height: 1.5; max-width: 34ch; color: var(--ink); }
.spec {
  display: grid; gap: 0; margin: clamp(32px, 6vh, 56px) 0 0; max-width: 760px;
  border: 1px solid var(--line-2); border-radius: 10px; overflow: hidden;
  background: color-mix(in srgb, var(--bg-2) 72%, transparent);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
@media (min-width: 720px) { .spec { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.spec div { padding: 18px 20px; border-bottom: 1px solid var(--line); }
@media (min-width: 720px) {
  .spec div:nth-child(odd) { border-right: 1px solid var(--line); }
  .spec div:nth-last-child(-n+2) { border-bottom: 0; }
}
.spec div:last-child { border-bottom: 0; }
.spec dt { font: 400 0.8125rem/1.3 var(--pixel); letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 6px; }
.spec dd { margin: 0; }
.status-dot { display: inline-block; width: 8px; height: 8px; margin-right: 8px; background: var(--accent); vertical-align: 0.1em; }
@media (prefers-reduced-motion: no-preference) { .status-dot { animation: breathe 2.6s ease-in-out infinite; } }

/* Products */
.work { padding-bottom: clamp(40px, 8vh, 96px); }
.product {
  display: grid; gap: clamp(32px, 5vw, 72px); align-items: center;
  padding-block: clamp(64px, 11vh, 128px);
  border-top: 1px solid var(--line);
}
.product > * { min-width: 0; }
@media (min-width: 1024px) {
  .product { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
  .product.flip { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
  .product.flip .product-media { order: -1; }
}
.product-meta {
  display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: baseline;
  font: 400 0.8125rem/1.3 var(--pixel); letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-2);
  margin: 0 0 18px;
}
.product-meta b { color: var(--accent-text); font-weight: 600; }
.product-name { font-size: clamp(2.4rem, 6vw, 4.6rem); margin-bottom: 20px; }
.product-line { font-size: 1.125rem; color: var(--ink-2); max-width: 44ch; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px 24px; margin: 28px 0 32px; padding: 20px 0 0; border-top: 1px solid var(--line); }
.facts div { margin: 0; }
.facts dt { font: 400 0.8125rem/1.3 var(--pixel); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 4px; }
.facts dd { margin: 0; font-size: 0.975rem; }

.product-media { position: relative; }
.frame {
  --mx: 50%; --my: 50%;
  position: relative; overflow: hidden;
  border-radius: 12px; border: 1px solid var(--line-2);
  background: var(--bg-2);
  box-shadow: 0 50px 100px -50px var(--shadow), 0 30px 60px -40px var(--shadow);
}
.frame-bar {
  display: flex; align-items: center; gap: 10px;
  height: 38px; padding: 0 14px;
  border-bottom: 1px solid var(--line);
  font: 400 0.8125rem/1 var(--pixel); color: var(--ink-2);
}
.frame-bar::before { content: ""; width: 7px; height: 7px; background: var(--accent); flex: none; }
.frame img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top center; }
.frame::after, .bz-board::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(520px circle at var(--mx) var(--my), rgba(var(--accent-rgb), 0.13), transparent 62%);
  opacity: 0; transition: opacity 0.4s;
}
.frame.is-lit::after, .bz-board.is-lit::after { opacity: 1; }

/* Beamzag: the phone shot with today's board drawn live beside it */
.bz-stage { position: relative; aspect-ratio: 5 / 4; }
.bz-phone {
  position: absolute; left: 4%; top: 0; width: 44%;
  border-radius: 28px; border: 1px solid var(--line-2); overflow: hidden;
  background: #0F172A;
  box-shadow: 0 50px 100px -40px var(--shadow);
}
.bz-phone img { width: 100%; aspect-ratio: 430 / 720; }
.bz-board {
  --mx: 50%; --my: 50%;
  position: absolute; right: 2%; bottom: 0; width: 56%; margin: 0;
  border-radius: 16px; border: 1px solid var(--line-2); overflow: hidden;
  background: var(--bg-2);
  box-shadow: 0 50px 100px -40px var(--shadow);
}
.bz-board figcaption {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px;
  padding: 12px 14px; border-bottom: 1px solid var(--line);
  font: 400 0.8125rem/1.3 var(--pixel); letter-spacing: 0.06em; color: var(--ink-2);
}
.bz-board figcaption b { color: var(--ink); font-weight: 600; white-space: nowrap; }
.bz-board figcaption span { white-space: nowrap; }
.bz-board svg { width: 100%; height: auto; }
.bz-board[hidden] { display: none; }
.bz-stage.no-board .bz-phone { left: 28%; }

/* Product rail, wide screens only */
.rail {
  position: fixed; right: 14px; top: 50%; z-index: 40;
  transform: translate3d(12px, -50%, 0); opacity: 0; visibility: hidden;
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease), visibility 0.4s;
}
.rail.is-on { opacity: 1; transform: translate3d(0, -50%, 0); visibility: visible; }
.rail ol { position: relative; margin: 0; padding: 0; list-style: none; }
.rail ol::before, .rail ol::after {
  content: ""; position: absolute; right: 22px; top: 22px; bottom: 22px; width: 1px; background: var(--line-2);
}
.rail ol::after { background: var(--accent); transform-origin: 50% 0; transform: scaleY(var(--rail, 0)); }
.rail a {
  position: relative; display: flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; margin-left: auto; text-decoration: none;
}
.rail a i { position: relative; z-index: 1; width: 7px; height: 7px; background: var(--ink-3); transition: transform 0.3s var(--ease-out), background-color 0.3s; }
.rail a[aria-current="true"] i { background: var(--accent); transform: scale(1.45); box-shadow: 0 0 14px rgba(var(--accent-rgb), 0.8); }
.rail a span {
  position: absolute; right: 46px; white-space: nowrap;
  padding: 6px 10px; border-radius: 6px;
  background: var(--bg-3); border: 1px solid var(--line-2); color: var(--ink);
  font-size: 0.8125rem; font-weight: 500;
  opacity: 0; transform: translateX(6px); pointer-events: none;
  transition: opacity 0.25s, transform 0.25s var(--ease-out);
}
.rail a:hover span, .rail a:focus-visible span { opacity: 1; transform: none; }
@media (max-width: 1199px) { .rail { display: none; } }

/* Contact */
.contact { border-top: 1px solid var(--line); }
.mail {
  display: inline-block; margin: 8px 0 0;
  font-family: var(--display); font-weight: var(--display-weight); letter-spacing: -0.03em;
  font-size: clamp(1.2rem, 4.1vw, 3.2rem); line-height: 1.15;
  text-decoration: none;
  background-image: linear-gradient(var(--accent), var(--accent));
  background-size: 0% 3px; background-position: 0 100%; background-repeat: no-repeat;
  transition: background-size 0.6s var(--ease-out);
  padding-bottom: 6px; max-width: 100%;
}
.mail:hover, .mail:focus-visible { background-size: 100% 3px; }
.tiles { display: grid; gap: 14px; margin-top: clamp(48px, 8vh, 80px); }
@media (min-width: 760px) { .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.tile {
  --mx: 50%; --my: 50%;
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; gap: 6px; justify-content: space-between;
  min-height: 150px; padding: 22px;
  border-radius: 10px; border: 1px solid var(--line-2);
  background: var(--bg-2); text-decoration: none;
  transition: border-color 0.3s;
}
.tile::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(380px circle at var(--mx) var(--my), rgba(var(--accent-rgb), 0.16), transparent 60%);
  opacity: 0; transition: opacity 0.35s;
}
.tile:hover { border-color: var(--ink-3); }
.tile.is-lit::after { opacity: 1; }
.tile strong { font-family: var(--display); font-weight: var(--display-weight); font-size: 1.35rem; letter-spacing: -0.015em; }
.tile span { color: var(--ink-2); font-size: 0.95rem; }
.tile svg { width: 20px; height: 20px; align-self: flex-end; color: var(--accent-text); transition: transform 0.4s var(--ease-out); }
.tile:hover svg { transform: translate(3px, -3px); }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 40px var(--pad) 48px; color: var(--ink-2); font-size: 0.9375rem; }
.footer-inner { display: grid; gap: 20px; align-items: center; }
@media (min-width: 900px) { .footer-inner { grid-template-columns: auto 1fr auto; gap: 24px; } }
.footer-inner .brand-link img { height: 20px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 0 4px; margin: 0; padding: 0; list-style: none; }
@media (min-width: 900px) { .footer-links { justify-content: center; } }
.footer-links a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 10px; text-decoration: none; color: var(--ink-2); }
.footer-links li:first-child a { padding-left: 0; }
@media (min-width: 900px) { .footer-links li:first-child a { padding-left: 10px; } }
.footer-links a:hover { color: var(--ink); }
.footer-note { margin: 0; font-size: 0.875rem; }

/* Inner pages */
.page-hero {
  position: relative; isolation: isolate; overflow: hidden;
  padding: calc(var(--header-h) + clamp(64px, 12vh, 128px)) var(--pad) clamp(56px, 9vh, 96px);
  border-bottom: 1px solid var(--line);
}
.page-hero canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -2; opacity: 0; transition: opacity 1s var(--ease); }
.page-hero canvas.is-live { opacity: 1; }
.page-hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(to right, var(--bg) 0%, color-mix(in srgb, var(--bg) 80%, transparent) 45%, transparent 100%),
              linear-gradient(to top, var(--bg) 0%, transparent 40%);
}
@media (max-width: 760px) {
  .page-hero canvas.is-live { opacity: 0.55; }
  .page-hero::before {
    background: linear-gradient(to top, var(--bg) 0%, color-mix(in srgb, var(--bg) 82%, transparent) 55%, color-mix(in srgb, var(--bg) 35%, transparent) 100%);
  }
}
.page-title { font-size: clamp(2.5rem, 8vw, 6.2rem); max-width: 14ch; }
.page-lead { font-size: clamp(1.1rem, 1.8vw, 1.35rem); color: var(--ink-2); max-width: 44ch; margin: 24px 0 0; }
.page-actions { margin-top: 32px; }
.page-body { padding: clamp(56px, 10vh, 112px) var(--pad); }
.prose { max-width: 680px; min-width: 0; }
.prose h2 { font-family: var(--display); font-weight: var(--display-weight); letter-spacing: -0.02em; font-size: clamp(1.5rem, 3vw, 2.1rem); line-height: 1.15; margin: 64px 0 18px; }
.prose h2:first-child { margin-top: 0; }
.prose p, .prose li { color: var(--ink-2); }
.prose strong { color: var(--ink); font-weight: 600; }
.prose a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 4px; overflow-wrap: anywhere; }
.prose a:hover { text-decoration-color: currentColor; }
.prose ul { padding-left: 0; list-style: none; }
.prose ul li { position: relative; padding-left: 22px; margin: 10px 0; }
.prose ul li::before { content: ""; position: absolute; left: 0; top: 0.62em; width: 7px; height: 7px; background: var(--accent); }
.columns { display: grid; gap: 48px; }
@media (min-width: 960px) { .columns { grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: 80px; } }
.aside-card { border: 1px solid var(--line-2); border-radius: 10px; padding: 22px; background: var(--bg-2); align-self: start; min-width: 0; }
.aside-card h2 { font: 400 0.8125rem/1.3 var(--pixel); letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-2); margin: 0 0 14px; }
.aside-card dl { margin: 0; }
.aside-card dt { font-size: 0.8125rem; color: var(--ink-2); }
.aside-card dd { margin: 0 0 14px; }
.aside-card dd:last-child { margin-bottom: 0; }
.aside-card a { display: inline-block; padding-block: 11px; margin-block: -11px; text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; overflow-wrap: anywhere; }

.logo-grid { display: grid; gap: 14px; margin: 28px 0; }
@media (min-width: 720px) { .logo-grid { grid-template-columns: 1fr 1fr; } }
.logo-swatch { display: grid; place-items: center; min-height: 180px; padding: 28px; border-radius: 10px; border: 1px solid var(--line-2); }
.logo-swatch.dark { background: #0E0E10; }
.logo-swatch.light { background: #F1EEE6; }
.logo-swatch img { max-height: 72px; width: auto; }
.logo-swatch.wide { grid-column: 1 / -1; }
.swatches { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin: 20px 0; padding: 0; list-style: none; }
.prose .swatches li { border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; padding: 0; margin: 0; }
.prose .swatches li::before { display: none; }
.swatches i { display: block; height: 64px; }
.swatches span { display: block; padding: 10px 12px; font: 500 0.8125rem/1.4 var(--mono); color: var(--ink); }
.sw-1 { background: #0E0E10; }
.sw-2 { background: #F1EEE6; }
.sw-3 { background: #FFA62B; }
.prose .copy-block { border-left: 3px solid var(--accent); padding: 4px 0 4px 18px; color: var(--ink); }
.table-scroll { overflow-x: auto; }
.file-table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; margin: 16px 0 8px; }
.file-table th, .file-table td { text-align: left; padding: 10px 12px 10px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.file-table th { font: 400 0.8125rem/1.3 var(--pixel); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-2); }
.file-table td { color: var(--ink-2); }
.file-table td:first-child { color: var(--ink); font-family: var(--mono); font-size: 0.8125rem; overflow-wrap: anywhere; }

.not-found { min-height: 100vh; min-height: 100svh; display: grid; align-items: center; border: 0; }
.not-found .page-title { font-size: clamp(5rem, 26vw, 16rem); line-height: 0.85; letter-spacing: -0.05em; }

/* Depth: scroll-linked parallax. Pure CSS where the browser has scroll timelines, script elsewhere. */
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .depth-1, .depth-2, .depth-3 { animation: depth linear both; animation-timeline: view(); animation-range: cover; }
    .depth-1 { --d: 24px; }
    .depth-2 { --d: 52px; }
    .depth-3 { --d: 90px; }
    .hero-inner { animation: hero-out linear both; animation-timeline: scroll(root); animation-range: 0 90vh; }
  }
}
@keyframes depth { from { transform: translate3d(0, var(--d), 0); } to { transform: translate3d(0, calc(var(--d) * -1), 0); } }
@keyframes hero-out { to { opacity: 0; transform: translate3d(0, -10vh, 0) scale(0.97); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
  .hero-inner, .depth-1, .depth-2, .depth-3 { animation: none !important; transform: none !important; }
}

/* Cursor spotlight on dark sections, and a sweep of light across headings as they arrive. */
.spot { --sx: 50%; --sy: 30%; }
.spot::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(600px circle at var(--sx) var(--sy), rgba(var(--accent-rgb), 0.07), transparent 60%);
  opacity: 0; transition: opacity 0.5s;
}
.spot.is-lit::after { opacity: 1; }
/* The sweep is a background on the heading itself, so it can never reach past the edge of the page. */
.js-motion .sweep.is-in {
  background-image: linear-gradient(100deg, transparent 38%, rgba(var(--accent-rgb), 0.2) 50%, transparent 62%);
  background-size: 260% 100%; background-repeat: no-repeat; background-position: 130% 0;
  animation: sweep 1.8s var(--ease-out) 0.2s both;
}
@keyframes sweep { from { background-position: 130% 0; } to { background-position: -30% 0; } }

/* Interactive panels share one frame. */
.panel {
  --mx: 50%; --my: 50%;
  position: relative; overflow: hidden;
  border-radius: 14px; border: 1px solid var(--line-2);
  background: var(--bg-2);
  box-shadow: 0 50px 100px -50px var(--shadow);
}
.panel::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(420px circle at var(--mx) var(--my), rgba(var(--accent-rgb), 0.1), transparent 62%);
  opacity: 0; transition: opacity 0.4s;
}
.panel.is-lit::after { opacity: 1; }
.panel-head {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 4px 12px;
  padding: 12px 16px; border-bottom: 1px solid var(--line);
  font: 400 0.8125rem/1.3 var(--pixel); letter-spacing: 0.06em; color: var(--ink-2);
}
.panel-head b { color: var(--ink); font-weight: 600; }
.panel-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 10px 16px 14px; }
.chip {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 16px; border-radius: 6px;
  border: 1px solid var(--line-2); background: transparent; color: var(--ink);
  font: 600 0.9375rem/1 var(--sans); cursor: pointer; text-decoration: none;
}
.chip:hover { border-color: var(--ink-2); }

/* Beamzag mini-board, drawn in Beamzag's own colours so it reads as the game. */
.bz-mini { --bz-bg: #0F172A; --bz-cell: #1E293B; --bz-line: #26324B; --bz-wall: #475569; --bz-gem: #22D3EE; --bz-lit: #FDE047; --bz-beam: #FF7A5C; --bz-socket: #4ADE80; --bz-mirror: #A5B4FC; }
@media (prefers-color-scheme: light) {
  .bz-mini { --bz-bg: #FFF8EC; --bz-cell: #FFFDF7; --bz-line: #E8E0CF; --bz-wall: #3D4A5C; --bz-gem: #1BC8C0; --bz-lit: #FFD23F; --bz-beam: #FF5A36; --bz-socket: #22C55E; --bz-mirror: #4F46E5; }
}
.mini-grid {
  position: relative; display: grid;
  grid-template-columns: 0.6fr repeat(5, minmax(0, 1fr)) 0.6fr; grid-template-rows: 0.6fr repeat(5, minmax(0, 1fr)) 0.6fr;
  aspect-ratio: 1; background: var(--bz-bg); padding: 1%;
}
.mini-row { display: contents; }
.mini-cell {
  position: relative; margin: 3%; border-radius: 18%;
  border: 1.5px solid var(--bz-line); background: var(--bz-cell);
  cursor: pointer; padding: 0; color: inherit;
}
.mini-cell:focus-visible { outline: 3px solid var(--bz-mirror); outline-offset: 1px; }
.mini-cell.is-wall {
  border-color: transparent; cursor: default;
  background:
    linear-gradient(var(--bz-bg), var(--bz-bg)) 50% 50% / 100% 3px no-repeat,
    linear-gradient(var(--bz-bg), var(--bz-bg)) 50% 25% / 3px 50% no-repeat,
    var(--bz-wall);
}
.mini-cell.is-gem { cursor: default; }
.mini-cell.is-gem::before {
  content: ""; position: absolute; inset: 30%; background: var(--bz-gem); transform: rotate(45deg); border-radius: 2px;
}
.mini-cell.is-gem.is-lit::before { background: var(--bz-lit); box-shadow: 0 0 0 3px var(--bz-bg), 0 0 0 6px var(--bz-lit); }
.mini-cell[data-mirror="slash"]::after, .mini-cell[data-mirror="back"]::after {
  content: ""; position: absolute; left: 50%; top: 12%; width: 14%; height: 76%; margin-left: -7%;
  background: var(--bz-mirror); border-radius: 4px; transform: rotate(45deg);
}
.mini-cell[data-mirror="back"]::after { transform: rotate(-45deg); }
.mini-beam { position: absolute; left: 1%; top: 1%; width: 98%; height: 98%; pointer-events: none; overflow: visible; }
.mini-glow { fill: none; stroke: var(--bz-beam); stroke-opacity: 0.3; stroke-width: 0.28; stroke-linecap: round; stroke-linejoin: round; }
.mini-core { fill: none; stroke: var(--bz-beam); stroke-width: 0.09; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 0.18 0.1; }
@media (prefers-reduced-motion: no-preference) { .mini-core { animation: march 0.8s linear infinite; } }
@keyframes march { to { stroke-dashoffset: -0.56; } }
.mini-core.is-won { stroke-dasharray: none; }
.mini-emitter { fill: var(--bz-beam); }
.mini-socket { fill: none; stroke: var(--bz-socket); stroke-width: 0.12; stroke-linecap: round; stroke-linejoin: round; opacity: 0.85; }
.bz-mini.is-won .panel-head b { color: var(--accent-text); }

/* Slideback print stack */
.prints-stack {
  position: relative; aspect-ratio: 3 / 2; margin: 28px 28px 34px; touch-action: none; cursor: grab;
  outline-offset: 10px;
}
.prints-stack.is-dragging { cursor: grabbing; }
.prints-stack figure {
  position: absolute; inset: 0; margin: 0; padding: 3.2%; background: #F4EFE3;
  border-radius: 3px; box-shadow: 0 18px 40px -16px rgba(0, 0, 0, 0.55), 0 2px 6px rgba(0, 0, 0, 0.25);
  will-change: transform; user-select: none;
}
.prints-stack img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; -webkit-user-drag: none; }
.prints-caption { margin: 0; padding: 0 16px; font-size: 0.875rem; color: var(--ink-2); min-height: 2.8em; }

/* FrameDB live counts */
.fdb[hidden] { display: none; }
.fdb-counts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0; padding: 18px 16px 8px; }
.fdb-counts div { padding-right: 12px; }
.fdb-counts dt { font: 400 0.8125rem/1.3 var(--pixel); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-2); }
.fdb-counts dd { min-height: 1em; margin: 4px 0 0; font-family: var(--display); font-weight: var(--display-weight); font-size: clamp(2rem, 5vw, 3.4rem); line-height: 1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.fdb-bar { display: flex; height: 10px; margin: 14px 16px 4px; border-radius: 3px; overflow: hidden; background: var(--bg-3); }
.fdb-bar i { display: block; height: 100%; width: calc(var(--share, 0) * 100%); transition: width 1.4s var(--ease-out); }
.fdb:not(.is-live) .fdb-bar i { width: 0; }
.fdb-bar i[data-bar="verified"] { background: #2FBF71; }
.fdb-bar i[data-bar="playable"] { background: #E8B92E; }
.fdb-bar i[data-bar="unsupported"] { background: #E5534B; }
.fdb-note { margin: 0; padding: 8px 16px 16px; font-size: 0.8125rem; color: var(--ink-2); }

/* Playlist Exporter CSV */
.csv-out {
  margin: 0; padding: 16px; min-height: 7.5em;
  font: 500 0.8125rem/1.6 var(--mono); color: var(--ink);
  white-space: pre-wrap; overflow-wrap: anywhere;
}
.csv-out::after { content: ""; display: inline-block; width: 0.6em; height: 1.1em; margin-left: 1px; vertical-align: -0.2em; background: var(--accent); }
@media (prefers-reduced-motion: no-preference) { .csv-out::after { animation: blink 1s steps(1) infinite; } }
@keyframes blink { 50% { opacity: 0; } }
.csv.is-done .csv-out::after { display: none; }
.csv-table-wrap { overflow-x: auto; padding: 0 16px 4px; }
.csv-table { width: 100%; border-collapse: collapse; font-size: 0.8125rem; }
.csv-table th, .csv-table td { border: 1px solid var(--line-2); padding: 6px 8px; text-align: left; vertical-align: top; }
.csv-table th { background: var(--bg-3); font-weight: 600; }
.csv-table td { overflow-wrap: anywhere; }

/* The lab */
.lab { display: grid; gap: 28px; align-items: center; }
@media (min-width: 860px) { .lab { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); } }
.lab canvas { width: min(100%, 420px); aspect-ratio: 1; border-radius: 10px; border: 1px solid var(--line-2); cursor: crosshair; touch-action: none; }
.lab canvas:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }

/* Hero, Avoria edition: the stage stays pinned while the camera flies forward, then the page moves on. */
.hero { display: block; padding: 0; min-height: 0; height: 150vh; overflow: visible; isolation: auto; }
.hero::before { content: none; }
.hero-sticky {
  position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; isolation: isolate;
  display: grid; align-items: end;
  padding: calc(var(--header-h) + 32px) var(--pad) clamp(40px, 9vh, 104px);
}
.hero-sticky::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(85% 65% at 16% 96%, rgba(11, 10, 14, 0.92) 0%, transparent 62%),
    linear-gradient(to top, rgba(11, 10, 14, 0.95) 0%, rgba(11, 10, 14, 0.35) 28%, transparent 50%),
    linear-gradient(to bottom, rgba(11, 10, 14, 0.75) 0%, transparent 20%);
}
/* The sky from Avoria's title screen: a warm glow low on the left, teal haze above, gold dust. */
.hero-stage {
  position: absolute; inset: 0; z-index: -2;
  background:
    radial-gradient(55% 45% at 18% 88%, rgba(255, 140, 40, 0.28), transparent 70%),
    radial-gradient(60% 50% at 78% 8%, rgba(40, 150, 135, 0.3), transparent 70%),
    radial-gradient(45% 35% at 52% 40%, rgba(60, 236, 150, 0.08), transparent 70%),
    #0B0A0E;
}
.hero-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity 1.2s var(--ease); }
.hero-stage canvas.is-live { opacity: 1; }
.hero.is-open .hero-stage { box-shadow: inset 0 0 180px rgba(255, 212, 94, 0.18); transition: box-shadow 0.6s; }
.hero .kicker { color: var(--emerald-text); }
.hero .kicker::before { background: var(--emerald); box-shadow: 0 0 14px rgba(60, 236, 150, 0.8); }
.hero-line { max-width: 34ch; }
.hero-toy { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; max-width: 460px; }
.hero-toy[hidden] { display: none; }
.toy-cast { border-color: rgba(60, 236, 150, 0.5); color: #D6FFE2; background: rgba(11, 10, 14, 0.5); }
.toy-cast:hover { border-color: var(--emerald); }
.toy-note { margin: 0; font-size: 0.875rem; color: var(--ink-2); flex: 1 1 220px; }
.toy-count { font: 400 0.875rem/1 var(--pixel); color: var(--accent); margin-right: 6px; white-space: nowrap; }
@media (max-width: 640px) { .toy-hint { display: block; margin-top: 4px; } .hero-sticky { padding-top: calc(var(--header-h) + 120px); } }
@media (prefers-reduced-motion: reduce) { .hero { height: auto; } .hero-sticky { position: relative; } }

/* Avoria */
.avoria { min-height: 0; display: block; background: #0B0A0E; overflow: hidden; border-top: 0; padding-top: clamp(48px, 9vh, 104px); }
.avoria-bg {
  position: absolute; inset: -10% 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(40% 35% at 30% 12%, rgba(255, 140, 40, 0.16), transparent 70%),
    radial-gradient(45% 40% at 85% 50%, rgba(40, 150, 135, 0.14), transparent 70%);
}
.avoria-head { text-align: left; }
.avoria-title { margin: 0 0 18px -1%; }
.avoria-title img {
  width: min(560px, 86vw); image-rendering: pixelated;
  -webkit-mask-image: radial-gradient(70% 70% at 50% 50%, #000 58%, transparent 100%);
  mask-image: radial-gradient(70% 70% at 50% 50%, #000 58%, transparent 100%);
}
.avoria-line { font-family: var(--display); font-weight: 500; letter-spacing: -0.01em; font-size: clamp(1.25rem, 2.6vw, 2rem); line-height: 1.25; max-width: 26ch; margin: 0 0 clamp(36px, 6vh, 64px); }
.avoria-grid-2 { display: grid; gap: 40px; align-items: start; margin-bottom: clamp(40px, 7vh, 72px); }
@media (min-width: 960px) { .avoria-grid-2 { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 64px; } }
.avoria-copy p { color: var(--ink-2); font-size: 1.0625rem; max-width: 56ch; }
.codex { margin: 0 0 24px; padding: 18px 22px; border-left: 3px solid var(--accent); background: rgba(255, 212, 94, 0.05); border-radius: 0 8px 8px 0; }
.codex p { color: var(--ink); font-size: 1.125rem; margin: 0 0 8px; }
.codex footer { font: 400 0.8125rem/1.3 var(--pixel); color: var(--accent); }
.av-numbers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 28px 0 0; padding-top: 18px; border-top: 1px solid var(--line-2); }
.av-numbers div { display: flex; flex-direction: column-reverse; justify-content: flex-end; padding-right: 12px; }
.av-numbers dd { margin: 0 0 6px; font-family: var(--display); font-weight: var(--display-weight); font-size: clamp(2.2rem, 5vw, 3.6rem); line-height: 1; color: var(--accent); letter-spacing: -0.03em; }
.av-numbers dt { font-size: 0.875rem; color: var(--ink-2); }
.avoria .spec { margin-top: 0; max-width: none; grid-template-columns: 1fr; }
.avoria .spec div, .avoria .spec div:nth-child(odd) { border-right: 0; border-bottom: 1px solid var(--line); }
.avoria .spec div:last-child { border-bottom: 0; }
.status-dot { background: var(--emerald); }

.gallery { display: grid; gap: 14px; }
@media (min-width: 760px) { .gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); } .shot-lead { grid-column: 1 / -1; } }
.shot { margin: 0; }
.shot-open {
  --mx: 50%; --my: 50%;
  display: block; width: 100%; padding: 0; border: 1px solid var(--line-2); border-radius: 10px; overflow: hidden;
  background: #000; cursor: zoom-in; position: relative;
}
.shot-open img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; image-rendering: auto; transition: transform 0.8s var(--ease-out); }
.shot-open:hover img { transform: scale(1.025); }
.shot figcaption { margin-top: 10px; font-size: 0.9375rem; color: var(--ink-2); }
.gallery-note { margin: 16px 0 0; font-size: 0.875rem; color: var(--ink-3); }
.lightbox { width: min(1400px, 94vw); max-height: 94vh; padding: 14px; border: 1px solid var(--line-2); border-radius: 12px; background: #10131A; color: var(--ink); }
.lightbox::backdrop { background: rgba(5, 5, 8, 0.82); }
.lightbox img { width: 100%; height: auto; max-height: 76vh; object-fit: contain; border-radius: 6px; }
.lightbox p { margin: 10px 0; color: var(--ink-2); }

/* Product media: the live site's screen behind, the working panel in front. */
.media-stack { position: relative; }
.media-back { display: none; }
@media (min-width: 1024px) {
  .media-stack { padding: 40px 0 0 0; }
  .media-back { display: block; position: absolute; top: 0; right: 0; width: 78%; opacity: 0.55; }
  .flip .media-back { right: auto; left: 0; }
  .media-front { position: relative; width: 82%; margin-left: 0; margin-top: 70px; }
  .flip .media-front { margin-left: auto; }
  .media-back .phone-shot { width: 300px; aspect-ratio: 430 / 720; object-fit: cover; }
  #beamzag .media-back { width: auto; }
  #beamzag .media-front { width: 64%; }
}
.media-front.bz-mini { max-width: 460px; }
.prints .prints-stack { max-width: 520px; margin-inline: auto; }

/* Studio */
.studio .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 640px) { .studio .stats { grid-template-columns: 1fr; } }

/* Lab */
.lab-section { border-top: 1px solid var(--line); }
