/* =========================================================
   Staack Games - site styles

   Two full themes, both first-class:
     Day   (default)  soft blue-grey canvas, white frosted glass, navy type, blue accents
     Night            deep navy canvas, tinted glass, sky type, yellow accents
   Set via <html data-theme="light|dark"> (js/theme.js). Switching crossfades.

   Shape rule: cards 24px, buttons / chips pill, inputs 14px.
   Glass is a web approximation (backdrop-filter + layered borders), not an
   official Apple material. Solid fallback under prefers-reduced-transparency.
   ========================================================= */

/* ---------- Self-hosted fonts (assets/fonts, OFL) ---------- */
@font-face { font-family: "Russo One"; src: url("../assets/fonts/russo-one-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Lilita One"; src: url("../assets/fonts/lilita-one-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Inter"; src: url("../assets/fonts/inter-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Inter"; src: url("../assets/fonts/inter-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Inter"; src: url("../assets/fonts/inter-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Inter"; src: url("../assets/fonts/inter-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }

/* ---------- Brand constants (sampled from the logo files) ---------- */
:root {
  --blue: #035ab3;
  --bright: #158ffe;
  --sky: #c1effe;
  --yellow: #fdd504;
  --yellow-deep: #e9b800;
  --on-yellow: #032d6b;

  --r-card: 24px;
  --r-input: 14px;
  --r-pill: 999px;

  /* TT Octosquares / QBOne are commercial. To use the real thing, add an @font-face and put it first here. */
  --font-display: "Russo One", "TT Octosquares", "Inter", system-ui, sans-serif;
  /* Sticker lettering, same family of shapes as the Staack wordmark. */
  --font-sticker: "Lilita One", "Russo One", "Inter", system-ui, sans-serif;
  /* Apple UI font first (SF Pro on macOS / iOS), Inter as the free look-alike elsewhere. */
  --font-body: "SF Pro Display", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", system-ui, sans-serif;

  /* Duotone icon pack: two fills split on a diagonal plus an outline and a 1px drop.
     Brand colours on glass by default; tiles and the hero sparks override these. */
  --ico-upper: var(--bright);
  --ico-lower: var(--yellow);
  --ico-stroke: #0a1f55;

  --container: 1200px;
  --gutter: clamp(1rem, 4vw, 2rem);
  --nav-h: 68px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- Day theme (default) ---------- */
:root, :root[data-theme="light"] {
  color-scheme: light;
  --bg: #edf3f9;
  --bg-image:
    radial-gradient(110% 70% at 50% -20%, #d6ecff 0%, transparent 60%),
    linear-gradient(180deg, #eaf3fb 0%, #edf3f9 50%, #e9eff6 100%);

  --text: #0a2b5c;
  --text-muted: rgba(10, 43, 92, 0.72);
  --text-dim: rgba(10, 43, 92, 0.5);
  --accent: var(--blue);                  /* eyebrows, links, figures, icons */
  --accent-soft: rgba(3, 90, 179, 0.12);

  --glass-bg: linear-gradient(135deg, rgba(255,255,255,0.78), rgba(255,255,255,0.42)), rgba(255,255,255,0.2);
  --glass-border: rgba(255,255,255,0.9);
  --glass-inner: rgba(255,255,255,0.55);
  --glass-highlight: rgba(255,255,255,1);
  --glass-sheen: rgba(255,255,255,0.75);
  --glass-shadow: 0 24px 70px rgba(3, 60, 140, 0.14);
  --glass-hover-bg: linear-gradient(135deg, rgba(255,255,255,0.9), rgba(255,255,255,0.55)), rgba(255,255,255,0.3);
  --glass-rim-top: rgba(255,255,255,1);          /* lit top edge */
  --glass-rim-bottom: rgba(255,255,255,0.85);    /* light bending through the bottom edge */
  --glass-lens: rgba(255,255,255,0.35);          /* soft inner glow (thickness) */
  --glass-gloss: rgba(255,255,255,0.55);         /* specular band */

  --surface-2: rgba(3, 90, 179, 0.06);
  --surface-2-border: rgba(3, 90, 179, 0.12);
  --hairline: rgba(10, 43, 92, 0.1);
  --nav-menu-bg: rgba(255,255,255,0.94);
  --nav-menu-solid: #f4f8fc;
  --footer-bg: rgba(255,255,255,0.5);

  --input-bg: rgba(255,255,255,0.8);
  --input-border: rgba(10, 43, 92, 0.16);
  --input-focus-ring: rgba(3, 90, 179, 0.2);
  --input-focus-border: var(--blue);

  --icon-chip-bg: rgba(3, 90, 179, 0.08);
  --icon-chip-border: rgba(3, 90, 179, 0.16);

  --blob-a-o: .55; --blob-b-o: .9; --blob-c-o: .45; --blob-d-o: .4;
  --grain-opacity: .07; --grain-blend: multiply;
  --shadow-tile: 0 30px 80px rgba(3, 60, 140, 0.22);
  --primary-shadow: 0 10px 30px rgba(233, 184, 0, 0.35);

  --sticker-ink: #0a2b5c;          /* outline + hard offset shadow on buttons */
  --sticker-fill: var(--yellow);   /* hero accent word */
  --sticker-stroke: #0a2b5c;
  --sticker-shadow: #0a2b5c;
}

/* ---------- Night theme ---------- */
:root[data-theme="dark"] {
  --ico-stroke: #040c24;
  color-scheme: dark;
  --bg: #021b44;
  --bg-image:
    radial-gradient(120% 80% at 50% -10%, #0a4ea3 0%, transparent 60%),
    linear-gradient(180deg, #03306f 0%, #021b44 45%, #021338 100%);

  --text: #f4fbff;
  --text-muted: rgba(193, 239, 254, 0.78);
  --text-dim: rgba(193, 239, 254, 0.55);
  --accent: var(--yellow);
  --accent-soft: rgba(253, 213, 4, 0.16);

  --glass-bg: linear-gradient(135deg, rgba(255,255,255,0.16), rgba(255,255,255,0.05)), rgba(5, 46, 110, 0.28);
  --glass-border: rgba(255,255,255,0.26);
  --glass-inner: rgba(255,255,255,0.1);
  --glass-highlight: rgba(255,255,255,0.45);
  --glass-sheen: rgba(255,255,255,0.26);
  --glass-shadow: 0 24px 70px rgba(1, 16, 46, 0.45);
  --glass-hover-bg: linear-gradient(135deg, rgba(255,255,255,0.26), rgba(255,255,255,0.1)), rgba(5, 46, 110, 0.28);
  --glass-rim-top: rgba(255,255,255,0.6);
  --glass-rim-bottom: rgba(193,239,254,0.45);
  --glass-lens: rgba(255,255,255,0.12);
  --glass-gloss: rgba(255,255,255,0.22);

  --surface-2: rgba(2, 27, 68, 0.35);
  --surface-2-border: rgba(255,255,255,0.14);
  --hairline: rgba(255,255,255,0.1);
  --nav-menu-bg: rgba(3, 38, 92, 0.94);
  --nav-menu-solid: #06306f;
  --footer-bg: rgba(1, 14, 38, 0.72);

  --input-bg: rgba(2, 27, 68, 0.45);
  --input-border: rgba(255,255,255,0.22);
  --input-focus-ring: rgba(253, 213, 4, 0.22);
  --input-focus-border: var(--yellow);

  --icon-chip-bg: rgba(255,255,255,0.14);
  --icon-chip-border: rgba(255,255,255,0.3);

  --blob-a-o: .85; --blob-b-o: .55; --blob-c-o: .5; --blob-d-o: .85;
  --grain-opacity: .055; --grain-blend: overlay;
  --shadow-tile: 0 30px 80px rgba(1, 16, 46, 0.5);
  --primary-shadow: 0 10px 30px rgba(253, 213, 4, 0.28);

  --sticker-ink: #f4fbff;
  --sticker-fill: #ffffff;
  --sticker-stroke: var(--blue);
  --sticker-shadow: var(--blue);
}

/* ---------- Theme switch choreography ---------- */
/* View Transitions API: a slow crossfade of the whole page. */
::view-transition-old(root), ::view-transition-new(root) {
  animation-duration: .75s;
  animation-timing-function: var(--ease);
  mix-blend-mode: normal;
}
/* Fallback when startViewTransition is missing: tween the colour properties for a moment. */
html.theme-tween, html.theme-tween *, html.theme-tween *::before, html.theme-tween *::after {
  transition: background-color .6s var(--ease), color .6s var(--ease), border-color .6s var(--ease), box-shadow .6s var(--ease), opacity .6s var(--ease) !important;
}

/* ---------- Reset-ish ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg);
  background-image: var(--bg-image);
  background-attachment: fixed;
  overflow-x: clip;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4, p, dl, dd, figure, blockquote { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.skip-link {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  padding: .6rem 1rem; border-radius: var(--r-pill);
  background: var(--yellow); color: var(--on-yellow); font-weight: 600;
}
.skip-link:focus { top: 1rem; }

.container { width: min(100% - 2 * var(--gutter), var(--container)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.field input::placeholder { color: var(--text-dim); }

/* ---------- Lenis smooth scroll ---------- */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }

/* ---------- Film grain ---------- */
.grain {
  position: fixed; inset: -50%; z-index: 60; pointer-events: none;
  opacity: var(--grain-opacity); mix-blend-mode: var(--grain-blend);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .9 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  background-size: 240px 240px;
}

/* ---------- Type ---------- */
h1, h2, h3, .display {
  font-family: var(--font-display);
  font-weight: 400;              /* Russo One ships a single weight */
  text-transform: uppercase;
  letter-spacing: 0.01em;
  line-height: 1.12;
  text-wrap: balance;
}
h4 { font-family: var(--font-body); font-weight: 700; }
h1 { font-size: clamp(1.9rem, 3.7vw, 3.2rem); }
h2 { font-size: clamp(1.45rem, 2.7vw, 2.25rem); }
h3 { font-size: 1.05rem; letter-spacing: 0.02em; }

/* Sticker lettering: chunky face, thick outline, hard offset shadow (like the wordmark) */
.sticker {
  font-family: var(--font-sticker); font-weight: 400; font-style: normal;
  text-transform: none; letter-spacing: .01em;
  color: var(--sticker-fill);
  -webkit-text-stroke: .12em var(--sticker-stroke);
  paint-order: stroke fill;
}
h1 .sticker {
  display: inline-block; font-size: 1.12em; line-height: 1;
  transform: rotate(-2.5deg); transform-origin: left bottom;
  margin-top: .08em;
}
h1 .sticker:not(:has(.w)), h1 .sticker .wi { filter: drop-shadow(.11em .11em 0 var(--sticker-shadow)); }

.lede { font-size: clamp(1.1rem, 1.5vw, 1.3rem); color: var(--text-muted); max-width: 46ch; line-height: 1.5; }
.muted { color: var(--text-muted); }
.eyebrow {
  font-size: .8rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent); margin-bottom: .9rem;
}

/* ---------- Glass ---------- */
.glass {
  position: relative;
  isolation: isolate;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(24px) saturate(180%) brightness(1.04);
  backdrop-filter: blur(24px) saturate(180%) brightness(1.04);
  box-shadow:
    inset 0 1.5px 0 var(--glass-rim-top),                 /* lit top edge */
    inset 0 -1.5px 0 var(--glass-rim-bottom),             /* light leaking through the bottom edge */
    inset 1px 0 0 rgba(255,255,255,0.25),
    inset -1px 0 0 rgba(255,255,255,0.12),
    inset 0 0 28px var(--glass-lens),                     /* thickness glow */
    inset 0 -14px 24px -18px rgba(255,255,255,0.6),       /* refracted bottom band */
    var(--glass-shadow);
}
.glass::before {
  /* specular: a soft diagonal gloss band plus a top-left sheen, drifts on hover */
  content: "";
  position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none;
  background:
    radial-gradient(60% 50% at 15% 0%, var(--glass-sheen), transparent 60%),
    linear-gradient(115deg, transparent 32%, var(--glass-gloss) 44%, transparent 54%),
    linear-gradient(100deg, rgba(255,255,255,0.1), transparent 45%, rgba(255,255,255,0.08));
  background-size: 100% 100%, 240% 100%, 100% 100%;
  background-position: 0 0, 100% 0, 0 0;
  transition: background-position 1.4s var(--ease);
}
.glass:hover::before { background-position: 0 0, 0 0, 0 0; }
.glass::after {
  /* prism edge: a faint spectral rim like light caught on a glass bevel */
  content: "";
  position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  padding: 1px;
  background: conic-gradient(from 200deg,
    rgba(255,255,255,0) 0deg, rgba(193,239,254,0.9) 60deg, rgba(255,255,255,0.95) 110deg,
    rgba(253,213,4,0.55) 160deg, rgba(255,255,255,0) 210deg, rgba(21,143,254,0.6) 280deg,
    rgba(255,255,255,0.9) 330deg, rgba(255,255,255,0) 360deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: .55;
}
/* Small glass pill: labels, tags, marquee items */
.glass-pill, .glass-label {
  display: inline-flex; align-items: center; gap: .55rem;
  padding: .45rem .95rem; border-radius: var(--r-pill);
  background: var(--glass-bg); border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(16px) saturate(170%); backdrop-filter: blur(16px) saturate(170%);
  box-shadow: inset 0 1px 0 var(--glass-rim-top), inset 0 -1px 0 var(--glass-rim-bottom), inset 0 0 14px var(--glass-lens), 0 8px 24px rgba(3,60,140,0.08);
}
.glass-label { padding: .35rem .85rem; margin-bottom: 1rem; }
.glass-label svg { width: 18px; height: 18px; overflow: visible; flex: 0 0 auto; margin-left: -.15rem; }

/* Iridescent glass ring (step markers, toggle halo) */
.ring {
  position: relative; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  font-family: var(--font-sticker); font-size: 1.05rem; color: var(--text);
  background: var(--glass-bg);
  box-shadow: inset 0 1px 0 var(--glass-rim-top), inset 0 -1px 0 var(--glass-rim-bottom), inset 0 0 12px var(--glass-lens), 0 10px 24px rgba(3,60,140,0.12);
}
.ring::before {
  content: ""; position: absolute; inset: -3px; border-radius: inherit; padding: 3px; pointer-events: none;
  background: conic-gradient(from 0deg, rgba(21,143,254,0.9), rgba(193,239,254,0.9), rgba(253,213,4,0.8), rgba(255,120,200,0.7), rgba(21,143,254,0.9));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: .7;
}
@media (prefers-reduced-motion: no-preference) { .ring::before { animation: spin 9s linear infinite; } }
@keyframes spin { to { transform: rotate(360deg); } }

/* Glossy coloured surface tiles (icon chips in the services grid) */
.cell-icon { position: relative; overflow: hidden; }
.cell-icon::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(255,255,255,0.55) 0%, rgba(255,255,255,0.12) 45%, rgba(255,255,255,0) 50%);
}
.cell-icon.tile-blue, .mega-ico.tile-blue, .ptile.tile-blue   { background: linear-gradient(160deg, #6fc3ff, var(--blue)); border-color: rgba(255,255,255,0.45); }
.cell-icon.tile-navy, .mega-ico.tile-navy, .ptile.tile-navy   { background: linear-gradient(160deg, #2d4f9a, #0a1f55); border-color: rgba(255,255,255,0.35); }
.cell-icon.tile-pink, .mega-ico.tile-pink, .ptile.tile-pink   { background: linear-gradient(160deg, #ff9ad0, #ff3f9e); border-color: rgba(255,255,255,0.45); }
.cell-icon.tile-green, .mega-ico.tile-green, .ptile.tile-green  { background: linear-gradient(160deg, #8ff0c0, #19b86f); border-color: rgba(255,255,255,0.45); }
.cell-icon.tile-yellow, .mega-ico.tile-yellow, .ptile.tile-yellow { background: linear-gradient(160deg, #ffe97a, var(--yellow-deep)); border-color: rgba(255,255,255,0.5); }
.cell-icon.tile-sky, .mega-ico.tile-sky, .ptile.tile-sky    { background: linear-gradient(160deg, #e6f8ff, #74c9f5); border-color: rgba(255,255,255,0.6); }
.cell-icon[class*="tile-"] { box-shadow: inset 0 1px 0 rgba(255,255,255,0.7), inset 0 -2px 6px rgba(0,0,0,0.12), 0 8px 18px rgba(3,45,107,0.18); }
.cell-icon[class*="tile-"] svg { position: relative; color: #fff; filter: drop-shadow(0 1px 0 rgba(0,0,0,0.25)); }
.cell-icon.tile-yellow, .mega-ico.tile-yellow, .ptile.tile-yellow svg, .cell-icon.tile-sky, .mega-ico.tile-sky, .ptile.tile-sky svg { color: var(--on-yellow); filter: none; }
.cell-icon[class*="tile-"], .mega-ico, .ptile { --ico-upper: #fff; --ico-lower: rgba(255,255,255,0.78); --ico-stroke: rgba(4,18,56,0.42); }
.mega-ico.tile-yellow, .mega-ico.tile-sky, .ptile.tile-yellow, .ptile.tile-sky { --ico-stroke: rgba(3,45,107,0.55); }

/* Floating glass cube (CSS 3D). Faces are translucent so edges and the back faces show through. */
.cube-wrap {
  position: absolute; z-index: 4; right: 3%; bottom: 7%; width: 84px; height: 84px;
  perspective: 520px; pointer-events: none;
  transform: translate3d(var(--tx, 0px), calc(var(--ty, 0px) + var(--sy, 0px)), 0);
  filter: drop-shadow(0 24px 30px rgba(3, 45, 107, 0.25));   /* on the wrapper: a filter on the cube itself would flatten its 3D */
}
.cube { position: absolute; inset: 0; transform-style: preserve-3d; }
.cube .f {
  position: absolute; inset: 0; border-radius: 12px;
  background: linear-gradient(135deg, rgba(255,255,255,0.42), rgba(255,255,255,0.08) 50%, rgba(193,239,254,0.3));
  border: 1.5px solid rgba(255,255,255,0.85);
  box-shadow: inset 0 0 22px rgba(255,255,255,0.35), inset 0 1px 0 rgba(255,255,255,0.9);
}
.cube .f::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; opacity: .7; mix-blend-mode: screen;
  background: conic-gradient(from 120deg, rgba(255,80,160,0.55), rgba(253,213,4,0.55), rgba(80,255,200,0.55), rgba(21,143,254,0.7), rgba(255,80,160,0.55));
  -webkit-mask: radial-gradient(circle at 30% 20%, #000, transparent 70%); mask: radial-gradient(circle at 30% 20%, #000, transparent 70%);
}
.cube .f1 { transform: translateZ(42px); background: linear-gradient(135deg, rgba(255,255,255,0.55), rgba(255,255,255,0.15) 55%, rgba(193,239,254,0.35)); }
.cube .f2 { transform: rotateY(180deg) translateZ(42px); }
.cube .f3 { transform: rotateY(90deg) translateZ(42px); background: linear-gradient(135deg, rgba(21,143,254,0.35), rgba(255,255,255,0.1)); }
.cube .f4 { transform: rotateY(-90deg) translateZ(42px); background: linear-gradient(135deg, rgba(21,143,254,0.35), rgba(255,255,255,0.1)); }
.cube .f5 { transform: rotateX(90deg) translateZ(42px); background: linear-gradient(135deg, rgba(255,255,255,0.7), rgba(255,255,255,0.25)); }
.cube .f6 { transform: rotateX(-90deg) translateZ(42px); background: linear-gradient(135deg, rgba(3,90,179,0.35), rgba(255,255,255,0.05)); }
@media (prefers-reduced-motion: no-preference) { .cube { animation: cube-float 14s ease-in-out infinite; } }
@keyframes cube-float {
  0%   { rotate: 1 1 0 25deg;  translate: 0 0; }
  50%  { rotate: 1 1 0 205deg; translate: 0 -16px; }
  100% { rotate: 1 1 0 385deg; translate: 0 0; }
}
@media (prefers-reduced-motion: reduce) { .cube { rotate: 1 1 0 35deg; } }
:root[data-theme="dark"] .cube .f { border-color: rgba(255,255,255,0.6); box-shadow: inset 0 0 22px rgba(193,239,254,0.25), inset 0 1px 0 rgba(255,255,255,0.7); }
@media (max-width: 900px) { .cube-wrap { width: 60px; height: 60px; right: 0; bottom: 14%; } .cube .f { border-radius: 9px; } .cube .f1 { transform: translateZ(30px); } .cube .f2 { transform: rotateY(180deg) translateZ(30px); } .cube .f3 { transform: rotateY(90deg) translateZ(30px); } .cube .f4 { transform: rotateY(-90deg) translateZ(30px); } .cube .f5 { transform: rotateX(90deg) translateZ(30px); } .cube .f6 { transform: rotateX(-90deg) translateZ(30px); } }

@media (prefers-reduced-transparency: reduce) {
  .glass, .glass-pill, .glass-label, .ring { -webkit-backdrop-filter: none; backdrop-filter: none; }
  :root:not([data-theme="dark"]) .glass { background: rgba(255,255,255,0.96); }
  :root[data-theme="dark"] .glass { background: rgba(5, 46, 110, 0.96); }
}

/* ---------- Ambient colour field (what the glass refracts) ---------- */
.ambient { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.blob { position: absolute; border-radius: 50%; filter: blur(70px); will-change: transform; }
.blob-a { width: 60vw; height: 60vw; left: -18vw; top: -22vw; opacity: var(--blob-a-o); background: radial-gradient(circle, var(--bright) 0%, rgba(21,143,254,0) 65%); }
.blob-b { width: 46vw; height: 46vw; right: -12vw; top: 6vh;  opacity: var(--blob-b-o); background: radial-gradient(circle, var(--sky) 0%, rgba(193,239,254,0) 62%); }
.blob-c { width: 36vw; height: 36vw; right: 14vw; top: 52vh;  opacity: var(--blob-c-o); background: radial-gradient(circle, var(--yellow) 0%, rgba(253,213,4,0) 64%); }
.blob-d { width: 50vw; height: 50vw; left: 8vw;  bottom: -24vw; opacity: var(--blob-d-o); background: radial-gradient(circle, var(--blue) 0%, rgba(3,90,179,0) 65%); }
@media (prefers-reduced-motion: no-preference) {
  .blob-a { animation: drift-a 26s ease-in-out infinite alternate; }
  .blob-b { animation: drift-b 32s ease-in-out infinite alternate; }
  .blob-c { animation: drift-c 22s ease-in-out infinite alternate; }
  .blob-d { animation: drift-b 38s ease-in-out infinite alternate-reverse; }
}
@keyframes drift-a { to { transform: translate(14vw, 10vh) scale(1.12); } }
@keyframes drift-b { to { transform: translate(-10vw, 12vh) scale(0.94); } }
@keyframes drift-c { to { transform: translate(-16vw, -14vh) scale(1.18); } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 52px; padding: 0 1.6rem; border-radius: var(--r-pill);
  font-weight: 600; font-size: 1rem; white-space: nowrap;
  transform: translate3d(var(--mx, 0px), var(--my, 0px), 0);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), background-color .25s var(--ease);
}
.btn:active { transform: translate3d(var(--mx, 0px), var(--my, 0px), 0) scale(.97); }
.btn-sm { min-height: 44px; padding: 0 1.2rem; font-size: .95rem; }
.btn-block { width: 100%; }

.btn-primary {
  position: relative; overflow: hidden; isolation: isolate;
  background: linear-gradient(180deg, #ffe453 0%, var(--yellow) 100%);
  color: var(--on-yellow);
  border: 2px solid var(--sticker-ink);
  box-shadow: 4px 4px 0 var(--sticker-ink);
  font-family: var(--font-sticker); font-weight: 400; font-size: 1.08rem; letter-spacing: .02em;
}
.btn-primary.btn-sm { font-size: 1rem; }
.btn-primary::after {
  content: ""; position: absolute; top: -20%; bottom: -20%; left: -60%; width: 40%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,0.55), transparent);
  transform: skewX(-18deg); opacity: 0; pointer-events: none;
}
.btn-primary:hover { box-shadow: 6px 6px 0 var(--sticker-ink); }
.btn-primary:active { transform: translate3d(calc(var(--mx, 0px) + 3px), calc(var(--my, 0px) + 3px), 0); box-shadow: 1px 1px 0 var(--sticker-ink); }
@media (prefers-reduced-motion: no-preference) {
  .btn-primary:hover::after { opacity: 1; animation: sweep .9s var(--ease) forwards; }
}
@keyframes sweep { to { transform: skewX(-18deg) translateX(420%); } }

.btn-glass {
  color: var(--text);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  backdrop-filter: blur(16px) saturate(160%);
  box-shadow: inset 0 1px 0 var(--glass-highlight), var(--glass-shadow);
}
.btn-glass:hover { background: var(--glass-hover-bg); }

.text-link {
  display: inline-flex; align-items: center; gap: .4rem; font-weight: 600; color: var(--accent);
  border-bottom: 1px solid var(--accent-soft); padding-bottom: 2px;
}
.text-link::after { content: "→"; transition: transform .25s var(--ease); }
.text-link:hover::after { transform: translateX(4px); }

/* ---------- Nav ---------- */
.nav-wrap {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  padding: .9rem var(--gutter) 0;
  transition: transform .55s var(--ease);
  will-change: transform;
}
.nav-wrap.hidden { transform: translateY(-130%); }
.nav {
  width: min(100%, var(--container)); margin-inline: auto;
  height: var(--nav-h); padding: 0 .6rem 0 1rem;
  border-radius: 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  transition: height .35s var(--ease), box-shadow .35s var(--ease);
}
.nav-wrap.scrolled .nav { height: 60px; }
.brand img { height: 42px; width: auto; transition: height .35s var(--ease); }
.nav-wrap.scrolled .brand img { height: 36px; }
.nav-links { position: relative; display: flex; gap: .25rem; }
.nav-links a {
  position: relative; z-index: 1;
  display: inline-block; padding: .5rem .85rem; border-radius: var(--r-pill);
  font-weight: 500; color: var(--text-muted); transition: color .2s;
}
.nav-links a:hover { color: var(--text); }
/* glass pill that slides under whichever link is hovered (positioned by js) */
.nav-pill {
  position: absolute; top: 0; left: 0; height: 100%; width: 0; border-radius: var(--r-pill); opacity: 0;
  background: var(--glass-hover-bg); border: 1px solid var(--glass-border);
  box-shadow: inset 0 1px 0 var(--glass-rim-top), inset 0 -1px 0 var(--glass-rim-bottom), 0 6px 16px rgba(3,60,140,0.1);
  transform: translateX(var(--x, 0px)); width: var(--w, 0px);
  transition: transform .45s var(--ease), width .45s var(--ease), opacity .25s var(--ease);
  pointer-events: none;
}
.nav-links.pill-on .nav-pill { opacity: 1; }

/* Products mega menu */
.has-menu { position: relative; }
.menu-btn {
  position: relative; z-index: 1; display: inline-flex; align-items: center; gap: .35rem;
  padding: .5rem .85rem; border-radius: var(--r-pill); font-weight: 500; color: var(--text-muted); transition: color .2s;
}
.menu-btn svg { width: 11px; height: 11px; opacity: .8; transition: transform .35s var(--ease); }   /* block chevron from the pack, kept small */
.menu-btn:hover, .has-menu.open .menu-btn { color: var(--text); }
.has-menu.open .menu-btn svg { transform: rotate(180deg); }
.mega {
  position: absolute; left: 50%; top: calc(100% + 1rem); width: min(680px, calc(100vw - 2rem));
  padding: .6rem; border-radius: 22px; z-index: 30;
  transform: translateX(-50%) translateY(-8px) scale(.98); transform-origin: top center;
  opacity: 0; pointer-events: none; transition: opacity .25s var(--ease), transform .4s var(--ease);
  background: var(--nav-menu-bg);
}
.has-menu.open .mega { opacity: 1; pointer-events: auto; transform: translateX(-50%) translateY(0) scale(1); }
.mega-list { display: grid; grid-template-columns: 1fr 1fr; gap: .2rem; }
.mega-list a {
  display: flex; align-items: center; gap: .8rem; padding: .6rem .7rem; border-radius: 14px;
  color: var(--text); transition: background-color .2s;
}
.mega-list a:hover { background: var(--accent-soft); }
.mega-list a > span:last-child { display: grid; line-height: 1.25; }
.mega-list strong { font-size: .95rem; font-weight: 600; }
.mega-list small { font-size: .8rem; color: var(--text-dim); }
.mega-list em { font-style: normal; font-size: .6rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); border: 1.5px solid var(--accent); padding: .05rem .35rem; border-radius: 5px; margin-left: .35rem; vertical-align: 1px; }
.mega-ico {
  flex: 0 0 auto; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; position: relative; overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.7), inset 0 -2px 6px rgba(0,0,0,0.12), 0 6px 14px rgba(3,45,107,0.15);
}
.mega-ico::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(255,255,255,0.55) 0%, rgba(255,255,255,0.12) 45%, rgba(255,255,255,0) 50%); }
.mega-ico svg { position: relative; width: 22px; height: 22px; color: #fff; overflow: visible; }
.mega-ico.tile-yellow svg, .mega-ico.tile-sky svg { color: var(--on-yellow); filter: none; }
@media (max-width: 900px) {
  .has-menu { display: grid; }
  .menu-btn { width: 100%; justify-content: space-between; padding: .8rem 1rem; color: var(--text); }
  .mega { position: static; width: auto; transform: none; opacity: 1; pointer-events: auto; background: transparent; padding: 0 .4rem .4rem; box-shadow: none; border: 0; -webkit-backdrop-filter: none; backdrop-filter: none; display: none; }
  .mega::before, .mega::after { display: none; }
  .has-menu.open .mega { display: block; transform: none; }
  .nav-links .mega-list a { display: flex; padding: .55rem .6rem; }
  .mega-list { grid-template-columns: 1fr; }
}
.nav-actions { display: flex; align-items: center; gap: .5rem; }

/* Day / night switch */
.theme-toggle {
  position: relative; width: 64px; height: 36px; border-radius: var(--r-pill);
  background: var(--surface-2); border: 1px solid var(--surface-2-border);
  display: inline-flex; align-items: center; flex: 0 0 auto;
  transition: background-color .3s var(--ease);
}
.theme-toggle::before {
  content: ""; position: absolute; inset: -2px; border-radius: inherit; padding: 2px; pointer-events: none; opacity: .55;
  background: conic-gradient(from 0deg, rgba(21,143,254,0.8), rgba(193,239,254,0.9), rgba(253,213,4,0.7), rgba(255,120,200,0.6), rgba(21,143,254,0.8));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}
.theme-toggle .knob {
  position: absolute; top: 3px; left: 3px; width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(180deg, #ffe14d, var(--yellow));
  color: var(--on-yellow);
  box-shadow: 0 2px 8px rgba(3, 45, 107, 0.25), inset 0 1px 0 rgba(255,255,255,0.6);
  transition: transform .5s var(--ease), background .4s var(--ease), color .4s var(--ease);
}
.theme-toggle svg { width: 16px; height: 16px; position: absolute; transition: opacity .3s var(--ease), transform .5s var(--ease); }
.theme-toggle .i-moon { opacity: 0; transform: rotate(-60deg) scale(.6); }
:root[data-theme="dark"] .theme-toggle::before { opacity: .8; }
:root[data-theme="dark"] .theme-toggle .knob { transform: translateX(28px); background: linear-gradient(180deg, #1e9bff, var(--blue)); color: #fff; }
:root[data-theme="dark"] .theme-toggle .i-sun { opacity: 0; transform: rotate(60deg) scale(.6); }
:root[data-theme="dark"] .theme-toggle .i-moon { opacity: 1; transform: none; }

.nav-toggle {
  display: none; width: 44px; height: 44px; border-radius: 12px;
  flex-direction: column; align-items: center; justify-content: center; gap: 6px;
}
.nav-toggle span { width: 20px; height: 2px; background: var(--text); border-radius: 2px; transition: transform .3s var(--ease), opacity .2s; }
.nav-toggle[aria-expanded="true"] span:first-child { transform: translateY(4px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:last-child { transform: translateY(-4px) rotate(-45deg); }

@media (max-width: 900px) {
  .nav-toggle { display: inline-flex; }
  .nav-links {
    position: absolute; left: 0; right: 0; top: calc(100% + .6rem);
    flex-direction: column; gap: .25rem; padding: .6rem;
    border-radius: 20px;
    background: var(--nav-menu-solid);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    max-height: calc(100dvh - 110px); overflow-y: auto; overscroll-behavior: contain;
    opacity: 0; transform: translateY(-8px); pointer-events: none;
    transition: opacity .25s var(--ease), transform .25s var(--ease);
  }
  .nav-links.open { opacity: 1; transform: none; pointer-events: auto; }
  .nav-links a { display: block; padding: .8rem 1rem; color: var(--text); }
}
@media (max-width: 480px) { .nav-actions .btn { display: none; } }
html.menu-open, html.menu-open body { overflow: hidden; }                   /* page frozen while the mobile sheet is open */
@media (max-width: 900px) { .nav-links { -webkit-overflow-scrolling: touch; } .nav-links .mega-list { padding-bottom: .4rem; } }

/* ---------- Sections ---------- */
.section { padding-block: clamp(4.5rem, 9vw, 7.5rem); }
.section-head { max-width: 38ch; margin-bottom: clamp(2rem, 4vw, 3.25rem); }
.section-head-row { max-width: none; display: flex; align-items: end; justify-content: space-between; gap: 1rem; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100dvh;
  padding-top: calc(var(--nav-h) + 4.5rem);
  padding-bottom: 3rem;
  display: flex; align-items: center;
}
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; align-items: center; gap: clamp(2rem, 5vw, 4rem); }
.hero-copy { display: grid; gap: 1.5rem; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: .5rem; }

.hero-visual { position: relative; aspect-ratio: 1 / 1; max-width: 560px; margin-inline: auto; width: 100%; perspective: 1200px; }
.tile {
  position: absolute; width: 46%; aspect-ratio: 3 / 4;
  padding: 10px; border-radius: var(--r-card);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow: inset 0 1px 0 var(--glass-highlight), var(--shadow-tile);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  will-change: transform;
  transition: transform .6s var(--ease);
  color: #fff;
}
.tile img { width: 100%; height: 100%; object-fit: cover; border-radius: calc(var(--r-card) - 8px); filter: saturate(1.15) contrast(1.05); }
.tile::after {
  content: ""; position: absolute; inset: 10px; border-radius: calc(var(--r-card) - 8px);
  background: linear-gradient(180deg, rgba(3,90,179,0) 40%, rgba(2,27,68,0.85) 100%);
  pointer-events: none;
}
.tile figcaption { position: absolute; left: 22px; right: 22px; bottom: 20px; z-index: 1; display: grid; gap: 2px; font-family: var(--font-display); }
.tile figcaption span { font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--sky); font-family: var(--font-body); font-weight: 600; }
.tile figcaption strong { font-size: 1rem; font-weight: 400; letter-spacing: .02em; text-transform: uppercase; }
.tile-back  { left: 2%;  top: 12%; --rz: -12deg; z-index: 1; }
.tile-mid   { left: 27%; top: 4%;  --rz: -3deg;  z-index: 2; }
.tile-front { left: 52%; top: 16%; --rz: 8deg;   z-index: 3; }
.tile { transform: rotate(var(--rz)) translate3d(var(--tx, 0px), calc(var(--ty, 0px) + var(--sy, 0px)), 0); }

.chip {
  position: absolute; z-index: 4;
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .55rem .95rem; border-radius: var(--r-pill);
  font-size: .9rem; font-weight: 600; white-space: nowrap;
  transform: translate3d(var(--tx, 0px), calc(var(--ty, 0px) + var(--sy, 0px)), 0);
  transition: transform .6s var(--ease);
  will-change: transform;
}
.chip svg { color: var(--accent); width: 20px; height: 20px; overflow: visible; }
.chip { box-shadow: inset 0 1.5px 0 var(--glass-rim-top), inset 0 -1.5px 0 var(--glass-rim-bottom), inset 0 0 14px var(--glass-lens), 0 14px 34px rgba(3,60,140,0.16); }
.chip-a { left: -4%; top: 42%; }
.chip-b { right: -2%; top: 8%; }
.chip-c { left: 30%; bottom: 2%; }
@keyframes float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -10px; } }

.spark { position: absolute; z-index: 5; pointer-events: none; overflow: visible; --ico-upper: var(--yellow); --ico-lower: #ffe97a; --ico-stroke: rgba(10,43,92,0.6); }
.spark-a { width: 34px; left: 6%; top: 4%; }
.spark-b { width: 22px; right: 4%; top: 46%; --ico-upper: var(--bright); --ico-lower: #8fd3ff; }
.spark-c { width: 28px; left: 18%; bottom: 10%; }
@media (prefers-reduced-motion: no-preference) {
  .spark { animation: twinkle 3.6s ease-in-out infinite; transform-origin: center; }
  .spark-b { animation-delay: 1.2s; } .spark-c { animation-delay: 2.1s; }
}
@keyframes twinkle { 0%, 100% { transform: scale(.75) rotate(0deg); opacity: .55; } 50% { transform: scale(1.1) rotate(25deg); opacity: 1; } }

/* Hero entrance: headline words are revealed by js (see .w / .wi), the rest rises in after */
@media (prefers-reduced-motion: no-preference) {
  .hero-copy > :not(h1) { opacity: 0; animation: rise 1s var(--ease) forwards; }
  .hero-copy > :nth-child(2) { animation-delay: .55s; }
  .hero-copy > :nth-child(3) { animation-delay: .7s; }
  .tile, .chip { opacity: 0; animation: pop .9s var(--ease) forwards; }
  .tile-back { animation-delay: .2s; } .tile-mid { animation-delay: .32s; } .tile-front { animation-delay: .44s; }
  .chip-a { animation: pop .9s var(--ease) .6s forwards, float 7s ease-in-out 1.5s infinite; }
  .chip-b { animation: pop .9s var(--ease) .7s forwards, float 8.5s ease-in-out 1.6s infinite; }
  .chip-c { animation: pop .9s var(--ease) .8s forwards, float 7.5s ease-in-out 1.7s infinite; }
  /* After the entrance, js adds .settled so --tx / --ty / --sy drive transform again. */
  .tile.settled { animation: none; opacity: 1; }
  .chip-a.settled { animation: float 7s ease-in-out infinite; opacity: 1; }
  .chip-b.settled { animation: float 8.5s ease-in-out 1s infinite; opacity: 1; }
  .chip-c.settled { animation: float 7.5s ease-in-out .5s infinite; opacity: 1; }
}
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes pop {
  from { opacity: 0; transform: rotate(var(--rz, 0deg)) translate3d(0, 30px, 0) scale(.94); }
  to   { opacity: 1; transform: rotate(var(--rz, 0deg)) translate3d(0, 0, 0) scale(1); }
}

@media (max-width: 900px) {
  .hero { padding-top: calc(var(--nav-h) + 3rem); min-height: 0; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual { max-width: 440px; margin-top: 1rem; }
  .chip-a { left: 0; }
  .chip-b { right: 0; }
}
@media (max-width: 480px) {
  .chip { font-size: .8rem; padding: .45rem .8rem; }
  .tile figcaption strong { font-size: .85rem; }
}

/* ---------- Hero stage (real work) ---------- */
.hero-stage { aspect-ratio: 1.08 / 1; max-width: 620px; }
.hero-device {
  position: absolute; right: -4%; top: 8%; width: 94%; z-index: 2; --rz: 0deg;
  filter: drop-shadow(0 40px 60px rgba(2, 20, 60, 0.35));
  transform: translate3d(var(--tx, 0px), calc(var(--ty, 0px) + var(--sy, 0px)), 0);
  transition: transform .6s var(--ease); will-change: transform;
}
.hero-device img { width: 100%; height: auto; }
.hero-stage .tile { width: 33%; }
.hero-stage .tile-a { left: -3%; top: auto; bottom: 6%; --rz: -7deg; z-index: 3; }
.hero-stage .tile-b { left: auto; right: -5%; top: auto; bottom: -3%; --rz: 6deg; z-index: 4; width: 28%; }
.hero-stage .chip-a { left: -6%; top: 16%; }
.hero-stage .chip-b { right: 2%; top: -3%; }
.hero-stage .chip-c { left: 34%; bottom: -8%; }
.hero-stage .cube-wrap { right: auto; left: 10%; bottom: auto; top: -2%; }
.hero-stage .spark-a { left: 2%; top: 38%; }
.hero-stage .spark-b { right: 10%; top: 60%; }
.hero-stage .spark-c { left: 46%; top: 2%; }
@media (prefers-reduced-motion: no-preference) {
  .hero-device { opacity: 0; animation: pop .9s var(--ease) .1s forwards; }
  .hero-device.settled { animation: none; opacity: 1; }
}
@media (max-width: 900px) {
  .hero-stage { max-width: 480px; }
  .hero-stage .chip-a { left: 0; } .hero-stage .chip-b { right: 0; }
}

/* ---------- Selected work (bento) ---------- */
.work { position: relative; }
.work-grid { display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: 230px; gap: 1rem; }
.work-card {
  position: relative; display: block; overflow: hidden; border-radius: var(--r-card); padding: 6px; color: #fff;
  transition: transform .5s var(--ease);
}
.work-card:hover { transform: translateY(-5px); }
.work-card.span-2 { grid-column: span 2; }
.work-card.tall { grid-row: span 2; }
.work-card img { width: 100%; height: 100%; object-fit: cover; border-radius: calc(var(--r-card) - 5px); transition: transform 1.2s var(--ease); display: block; }
.work-card:hover img { transform: scale(1.04); }
.work-cap {
  position: absolute; left: 18px; bottom: 18px; right: 18px; display: grid; gap: .1rem;
  padding: .7rem .95rem; border-radius: 14px; width: max-content; max-width: calc(100% - 36px);
  background: rgba(5, 20, 55, 0.62); border: 1px solid rgba(255,255,255,0.28);
  -webkit-backdrop-filter: blur(14px) saturate(160%); backdrop-filter: blur(14px) saturate(160%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.45);
  transform: translateY(0); transition: transform .5s var(--ease);
}
.work-cap strong { font-family: var(--font-display); text-transform: uppercase; letter-spacing: .03em; font-size: .95rem; }
.work-cap span { font-size: .78rem; color: rgba(193,239,254,0.85); }
.work-grid .reveal:nth-child(2) { transition-delay: .06s; } .work-grid .reveal:nth-child(3) { transition-delay: .12s; } .work-grid .reveal:nth-child(4) { transition-delay: .18s; }
.work-grid .reveal:nth-child(5) { transition-delay: .24s; } .work-grid .reveal:nth-child(6) { transition-delay: .30s; } .work-grid .reveal:nth-child(7) { transition-delay: .36s; }
@media (max-width: 1000px) {
  .work-grid { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 220px; }
  .work-card.tall { grid-row: span 1; }
}
@media (max-width: 640px) {
  .work-grid { grid-template-columns: 1fr; grid-auto-rows: 220px; }
  .work-card.span-2 { grid-column: span 1; }
}

/* ---------- Free-form characters (accents, never inside cards) ---------- */
.float-char { position: absolute; pointer-events: none; user-select: none; z-index: 1; filter: drop-shadow(0 22px 28px rgba(3,20,60,0.3)); }
@media (prefers-reduced-motion: no-preference) { .float-char { animation: mascot-float 8s ease-in-out infinite; } }
.work-char { right: 14rem; top: -2.4rem; height: 150px; transform: rotate(8deg); z-index: 0; }
.deck-char { bottom: -2%; height: clamp(180px, 20vw, 300px); z-index: 0; }
.deck-char-l { left: 3%; } .deck-char-r { right: 3%; animation-delay: 1.5s; }
.sticky-char { position: static; height: 300px; width: auto; margin-top: 1.4rem; justify-self: start; }
@media (max-width: 1200px) { .deck-char { display: none; } .work-char { right: 12rem; height: 120px; } }
@media (max-width: 900px) { .work-char, .sticky-char { display: none; } }

/* ---------- We use (static pill row) ---------- */
.builtwith { padding-block: 1.5rem 3rem; }
.builtwith-label { text-align: center; font-size: .85rem; color: var(--text-dim); margin-bottom: 1.1rem; }
.pill-list { display: flex; flex-wrap: wrap; justify-content: center; gap: .6rem; width: min(100% - 2 * var(--gutter), var(--container)); margin-inline: auto; }
.pill-list li { color: var(--text-muted); font-weight: 500; font-size: .95rem; }
.pill-list svg { width: 22px; height: 22px; fill: currentColor; color: var(--accent); flex: 0 0 auto; opacity: .85; }

/* ---------- Providers rail (the one marquee on the page) ---------- */
.providers .section-head { margin-bottom: 1.5rem; }
.rail {
  overflow: hidden; padding-block: .5rem;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.rail-track { display: flex; gap: .8rem; width: max-content; padding-inline: .4rem; }
.provider {
  display: flex; align-items: center; justify-content: center; gap: .6rem;
  min-width: 196px; height: 84px; padding: 0 1.4rem; border-radius: 18px;
  background: var(--glass-bg); border: 1px solid var(--glass-border);
  box-shadow: inset 0 1px 0 var(--glass-rim-top), inset 0 -1px 0 var(--glass-rim-bottom), inset 0 0 14px var(--glass-lens), 0 10px 26px rgba(3,60,140,0.08);
  -webkit-backdrop-filter: blur(14px) saturate(160%); backdrop-filter: blur(14px) saturate(160%);
  transition: transform .4s var(--ease);
}
.provider:hover { transform: translateY(-3px); }
.provider { position: relative; }
.provider img { max-height: 34px; max-width: 150px; width: auto; object-fit: contain; position: absolute; opacity: 0; pointer-events: none; }
.provider .provider-name { font-family: var(--font-display); text-transform: uppercase; letter-spacing: .04em; font-size: .88rem; color: var(--text-muted); white-space: nowrap; }
.provider.has-logo img { position: static; opacity: 1; }
.provider.has-logo .provider-name { display: none; }
.provider img { max-height: 44px; max-width: 150px; transition: filter .4s var(--ease), opacity .4s var(--ease); }
:root:not([data-theme="dark"]) .provider img { filter: saturate(.9); }                           /* original colours on the white glass by day */
/* Night: logos keep their colour on a frosted light plate. Inverting them turned any logo with a filled
   backplate (plates, badges, dark wordmarks on shapes) into a white blob. */
:root[data-theme="dark"] .provider { background: linear-gradient(135deg, rgba(255,255,255,0.90), rgba(236,243,252,0.84)); border-color: rgba(255,255,255,0.55); box-shadow: inset 0 1px 0 rgba(255,255,255,0.9), 0 10px 26px rgba(0,0,0,0.25); }
:root[data-theme="dark"] .provider img { filter: none; opacity: .92; }
:root[data-theme="dark"] .provider:hover { background: linear-gradient(135deg, #fff, #f1f6ff); }
:root[data-theme="dark"] .provider:hover img { opacity: 1; }
:root[data-theme="dark"] .provider .provider-name { color: #1b2d55; }
@media (prefers-reduced-motion: no-preference) {
  .rail-track { animation: scroll-x 60s linear infinite; }
  .rail-reverse .rail-track { animation-direction: reverse; }
  .rail:hover .rail-track { animation-play-state: paused; }
}
@keyframes scroll-x { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .rail-track { flex-wrap: wrap; justify-content: center; width: auto; } }
.providers-note { text-align: center; max-width: 60ch; margin: 2rem auto 0; color: var(--text-muted); text-wrap: balance; }

/* Providers page */
.provider-search { position: relative; display: flex; align-items: center; gap: .6rem; max-width: 420px; margin-bottom: 1.5rem; }
.field.provider-search input { flex: 1; padding-left: 2.9rem; }
.provider-search-ico { position: absolute; z-index: 1; left: 1rem; top: 50%; width: 20px; height: 20px; transform: translateY(-50%); color: var(--accent); pointer-events: none; }
.provider-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .8rem; }
.provider-grid .provider { min-width: 0; }
.provider-empty { color: var(--text-dim); padding: 2rem 0; }

/* ---------- Games: 3D trading-card deck ---------- */
.games-sub { margin-top: .4rem; font-size: .95rem; }
.carousel-nav { display: flex; gap: .5rem; }
.icon-btn {
  width: 48px; height: 48px; border-radius: var(--r-pill); display: grid; place-items: center;
  transform: translate3d(var(--mx, 0px), var(--my, 0px), 0);
  transition: transform .25s var(--ease), background-color .25s;
}
.icon-btn svg { width: 15px; height: 15px; }
.icon-btn:hover { background: var(--glass-hover-bg); }
.icon-btn:active { transform: translate3d(var(--mx, 0px), var(--my, 0px), 0) scale(.94); }

.deck-stage { position: relative; --card-w: 300px; --card-h: 450px; }
.deck-glow {
  position: absolute; left: 50%; top: 50%; width: min(90vw, 900px); height: 70%; pointer-events: none;
  transform: translate(-50%, -50%);
  background: radial-gradient(50% 50% at 50% 50%, color-mix(in srgb, var(--deck-c, var(--bright)) 28%, transparent), transparent 70%);
  filter: blur(30px); transition: background 1s var(--ease);
}
.deck {
  position: relative; height: calc(var(--card-h) + 80px); margin: 0 auto;
  perspective: 1600px; perspective-origin: 50% 40%;
  outline: none; touch-action: pan-y; user-select: none; cursor: grab;
}
.deck:focus-visible { outline: none; }
.deck:focus-visible .tcard[aria-current="true"] .tcard-inner { outline: 3px solid var(--accent); outline-offset: 6px; }
.deck.dragging { cursor: grabbing; }
.tcard {
  position: absolute; left: calc(50% - var(--card-w) / 2); top: 30px;
  width: var(--card-w); height: var(--card-h);
  transform-style: preserve-3d;
  transition: transform .9s var(--ease), opacity .6s var(--ease), filter .9s var(--ease);
  will-change: transform;
}
.tcard:not([aria-current="true"]) { cursor: pointer; }

/* The card itself: a dark frame like a physical trading card, same in both themes */
.tcard-inner {
  position: relative; width: 100%; height: 100%; border-radius: 22px; overflow: hidden;
  background: linear-gradient(165deg, #122a5e 0%, #0a1a3f 55%, #071432 100%);
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.25),
    0 0 0 2px color-mix(in srgb, var(--c) 70%, transparent),
    0 0 40px color-mix(in srgb, var(--c) 35%, transparent),
    0 30px 70px rgba(2, 15, 45, 0.5);
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform .5s var(--ease);
  color: #fff; display: flex; flex-direction: column;
}
.tcard.tilting .tcard-inner { transition: none; }
.tcard-tab {
  position: absolute; top: 0; left: 50%; transform: translateX(-50%); z-index: 3;
  padding: .3rem .9rem .35rem; border-radius: 0 0 12px 12px;
  background: var(--c); color: #071432;
  font-family: var(--font-sticker); font-size: .8rem; letter-spacing: .04em; text-transform: uppercase;
  box-shadow: 0 6px 16px color-mix(in srgb, var(--c) 45%, transparent);
}
.tcard-art {
  position: relative; margin: 10px 10px 0; height: 54%; flex: 0 0 auto;
  clip-path: polygon(7% 0, 93% 0, 100% 5%, 100% 95%, 93% 100%, 7% 100%, 0 95%, 0 5%);
  background: var(--c);
}
.tcard-art img { width: 100%; height: 100%; object-fit: cover; filter: saturate(1.15); }
.tcard-art::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(7,20,50,0) 55%, rgba(7,20,50,0.75) 100%),
              linear-gradient(135deg, rgba(255,255,255,0.18), transparent 45%);
}
.tcard-type {
  position: absolute; left: 12px; bottom: 10px; z-index: 1;
  font-size: .68rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--c);
}
.tcard-badge {
  position: absolute; right: 10px; top: 10px; z-index: 1; width: 36px; height: 36px; border-radius: 12px;
  display: grid; place-items: center;
  background: rgba(7,20,50,0.7); border: 1px solid rgba(255,255,255,0.25);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.tcard-badge { box-shadow: inset 0 1px 0 rgba(255,255,255,0.5), inset 0 -1px 0 rgba(255,255,255,0.15); }
.tcard-badge svg { width: 20px; height: 20px; color: var(--c); overflow: visible; }
.tcard-body { padding: .85rem 1rem 1rem; display: grid; gap: .45rem; flex: 1 1 auto; align-content: start; }
.tcard-body h3 {
  font-family: var(--font-sticker); text-transform: none; font-size: 1.25rem; line-height: 1.05; letter-spacing: .01em;
  color: #fff; -webkit-text-stroke: .08em #071432; paint-order: stroke fill;
  filter: drop-shadow(2px 2px 0 var(--c));
}
.tcard-body p { font-size: .8rem; line-height: 1.4; color: rgba(193,239,254,0.78); min-height: 2.8em; }
.tcard-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin-top: .2rem;
  background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.1); border-radius: 12px; overflow: hidden;
}
.tcard-stats div { background: rgba(7,20,50,0.75); padding: .45rem .5rem; text-align: center; }
.tcard-stats dt { font-size: .6rem; letter-spacing: .1em; text-transform: uppercase; color: rgba(193,239,254,0.6); }
.tcard-stats dd { font-family: var(--font-sticker); font-size: .86rem; color: var(--c); line-height: 1.2; }
.tcard-play {
  margin-top: auto; align-self: start; justify-self: start;
  display: inline-flex; align-items: center; min-height: 36px; padding: 0 1rem; border-radius: var(--r-pill);
  background: var(--c); color: #071432; font-family: var(--font-sticker); font-size: .9rem; letter-spacing: .03em;
  border: 2px solid #071432; box-shadow: 3px 3px 0 #071432;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.tcard-play:hover { box-shadow: 4px 4px 0 #071432; transform: translate(-1px, -1px); }
.tcard-play:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 #071432; }
/* holographic foil that follows the pointer on the featured card */
.tcard-foil {
  position: absolute; inset: 0; pointer-events: none; opacity: 0; mix-blend-mode: color-dodge;
  background:
    radial-gradient(60% 50% at var(--gx, 50%) var(--gy, 50%), rgba(255,255,255,0.45), transparent 70%),
    linear-gradient(115deg, transparent 20%, rgba(255,80,160,0.35) 35%, rgba(255,230,0,0.35) 45%, rgba(0,230,180,0.35) 55%, rgba(80,120,255,0.35) 65%, transparent 80%);
  background-size: 100% 100%, 300% 300%;
  background-position: 0 0, calc(var(--gx, 50%) * 1) calc(var(--gy, 50%) * 1);
  transition: opacity .4s var(--ease);
}
.tcard.tilting .tcard-foil { opacity: .9; }

.deck-dots { display: flex; justify-content: center; gap: .45rem; margin-top: 1rem; }
.deck-dots button { width: 10px; height: 10px; border-radius: var(--r-pill); background: var(--accent-soft); border: 1px solid var(--surface-2-border); transition: width .4s var(--ease), background-color .3s; }
.deck-dots button[aria-current="true"] { width: 28px; background: var(--accent); }

@media (max-width: 1100px) { .deck-stage { --card-w: 272px; --card-h: 444px; } }
@media (max-width: 760px) {
  /* Phones keep the 3D deck, just smaller; the side cards peek in from the edges and a swipe turns the deck */
  .deck-stage { --card-w: min(72vw, 300px); --card-h: calc(min(72vw, 300px) * 1.56); }
  .deck { touch-action: pan-y; }
  .deck-glow { opacity: .7; }
}
}

/* ---------- Process ---------- */
.process-grid { display: grid; grid-template-columns: 1fr 1.25fr; gap: clamp(2rem, 6vw, 5rem); align-items: stretch; }
.process-side { position: relative; }
.process-sticky { position: sticky; top: calc(var(--nav-h) + 2.5rem); display: grid; gap: 1rem; }
.process-sticky .eyebrow { margin-bottom: 0; justify-self: start; }
.steps { display: grid; gap: 1rem; }
.step {
  border-radius: var(--r-card); padding: 1.5rem 1.6rem 1.5rem 1.4rem;
  display: grid; grid-template-columns: 44px 1fr; column-gap: 1.1rem; row-gap: .35rem; align-items: start;
  transition: transform .5s var(--ease);
}
.step .ring { grid-row: 1 / span 2; margin-top: .1rem; }
.step > h3 { align-self: center; padding-top: .55rem; }
.step p { color: var(--text-muted); grid-column: 2; }
.step:hover { transform: translateX(6px); }
@media (max-width: 860px) {
  .process-grid { grid-template-columns: 1fr; }
  .process-sticky { position: static; }
}

/* ---------- Studio band ---------- */
.studio-band {
  border-radius: var(--r-card); padding: clamp(1.6rem, 4vw, 3.2rem);
  display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(2rem, 4vw, 3.5rem); align-items: center;
  overflow: hidden;
}
.studio-copy { display: grid; gap: 1.2rem; justify-items: start; }
.studio-copy p { color: var(--text-muted); max-width: 52ch; }
.figures { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; position: relative; z-index: 1; padding-top: 9rem; }
.figures div {
  padding: 1.1rem 1.2rem; border-radius: 18px;
  background: var(--glass-bg); border: 1px solid var(--glass-border);
  box-shadow: inset 0 1px 0 var(--glass-rim-top), inset 0 -1px 0 var(--glass-rim-bottom), inset 0 0 16px var(--glass-lens), 0 10px 26px rgba(3,60,140,0.08);
}
.figures dt { font-size: .82rem; color: var(--text-dim); font-weight: 500; }
.figures dd { font-family: var(--font-sticker); font-size: clamp(2rem, 3.2vw, 2.7rem); line-height: 1.1; color: var(--accent); }
.figures dd span { font-variant-numeric: tabular-nums; }
.studio-mark {
  position: absolute; right: -50px; top: -70px; width: 210px; border-radius: 36px; transform: rotate(10deg);
  box-shadow: var(--shadow-tile); pointer-events: none;
}
@media (max-width: 900px) {
  .studio-band { grid-template-columns: 1fr; }
  .studio-mark { display: none; }
  .figures { padding-top: 0; }
}

/* ---------- Reviews ---------- */
.review-grid { columns: 3; column-gap: 1rem; }
.review {
  break-inside: avoid; margin-bottom: 1rem; border-radius: var(--r-card); padding: 1.5rem 1.5rem 1.4rem;
  display: grid; gap: .9rem;
  transition: transform .5s var(--ease);
}
.review:hover { transform: translateY(-4px); }
.review .stars { display: flex; gap: 2px; color: var(--yellow); filter: drop-shadow(0 1px 0 rgba(10,43,92,0.35)); }
.review .stars svg { width: 18px; height: 18px; }
.review p { font-size: 1rem; line-height: 1.5; text-wrap: pretty; }
.review footer { display: flex; align-items: center; gap: .8rem; }
.review footer div { display: grid; line-height: 1.3; }
.review footer strong { font-size: .95rem; }
.review footer span { font-size: .82rem; color: var(--text-dim); }
.avatar {
  flex: 0 0 auto; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--font-sticker); font-size: .95rem; color: #fff;
  background: linear-gradient(160deg, color-mix(in srgb, var(--c) 70%, #fff), var(--c));
  border: 2px solid rgba(255,255,255,0.8);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.7), 0 6px 14px color-mix(in srgb, var(--c) 40%, transparent);
  text-shadow: 0 1px 0 rgba(0,0,0,0.25);
}
.review-grid .reveal:nth-child(2) { transition-delay: .06s; }
.review-grid .reveal:nth-child(3) { transition-delay: .12s; }
.review-grid .reveal:nth-child(4) { transition-delay: .18s; }
.review-grid .reveal:nth-child(5) { transition-delay: .24s; }
.review-grid .reveal:nth-child(6) { transition-delay: .30s; }
@media (max-width: 1000px) { .review-grid { columns: 2; } }
@media (max-width: 640px)  { .review-grid { columns: 1; } }

/* ---------- FAQ ---------- */
.faq-grid { display: grid; grid-template-columns: 1fr 1.6fr; gap: clamp(2rem, 5vw, 4rem); align-items: start; }
.faq-grid .section-head { margin-bottom: 0; }
.accordion { display: grid; gap: .8rem; }
.acc { border-radius: 20px; overflow: hidden; }
.acc summary {
  list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: 1.2rem 1.4rem; font-weight: 600; font-size: 1.05rem;
}
.acc summary::-webkit-details-marker { display: none; }
.acc summary::after {
  content: ""; flex: 0 0 auto; width: 34px; height: 34px; border-radius: var(--r-pill);
  background: var(--glass-bg); border: 1px solid var(--glass-border);
  box-shadow: inset 0 1px 0 var(--glass-rim-top), inset 0 -1px 0 var(--glass-rim-bottom), inset 0 0 10px var(--glass-lens);
  /* a plus drawn from two 2px bars, which rotates into a perfectly centred cross */
  background-image: linear-gradient(var(--accent), var(--accent)), linear-gradient(var(--accent), var(--accent));
  background-size: 12px 2px, 2px 12px; background-position: center; background-repeat: no-repeat;
  transition: transform .4s var(--ease), background-color .25s;
}
.acc[open] summary::after { transform: rotate(45deg); background-color: var(--accent-soft); }
.acc-body { padding: 0 1.4rem 1.3rem; color: var(--text-muted); max-width: 62ch; }
.acc-body p { font-size: .98rem; }
@media (max-width: 860px) { .faq-grid { grid-template-columns: 1fr; } }

/* ---------- Contact ---------- */
.contact { position: relative; }
.contact::before {
  /* diagonal pop stripes behind the panel */
  content: ""; position: absolute; inset: 12% 0 12% 0; z-index: -1; pointer-events: none;
  background: repeating-linear-gradient(135deg, var(--accent-soft) 0 18px, transparent 18px 44px);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent);
  opacity: .7;
}
.contact-panel {
  border-radius: var(--r-card); padding: clamp(1.6rem, 4vw, 3.2rem);
  display: grid; grid-template-columns: 1fr 1.1fr; gap: clamp(2rem, 5vw, 4rem); align-items: start;
}
.contact-copy { display: grid; gap: 1.2rem; }
.contact-copy p { color: var(--text-muted); max-width: 44ch; }
.contact-list { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .5rem; }
.contact-list li { display: contents; }
.contact-list a { display: inline-flex; align-items: center; gap: .45rem; color: var(--text); font-weight: 500; font-size: .92rem; padding: .5rem .9rem .5rem .65rem; border-radius: 999px; border: 1px solid var(--glass-border); background: var(--surface-2); transition: transform .4s var(--ease), border-color .25s; }
.contact-list a svg { width: 18px; height: 18px; color: var(--accent); flex: 0 0 auto; }
.contact-list a:hover { transform: translateY(-2px); border-color: var(--accent); }
.contact-list .is-mail { grid-column: 1 / -1; }

.contact-form { display: grid; gap: 1.1rem; }
.field { display: grid; gap: .45rem; }
.field label { font-size: .9rem; font-weight: 600; color: var(--text); }
.field input, .field select, .field textarea {
  width: 100%; padding: .85rem 1rem; border-radius: var(--r-input);
  background: var(--input-bg); border: 1px solid var(--input-border); color: var(--text);
  box-shadow: inset 0 1px 0 var(--glass-rim-top), inset 0 -1px 0 rgba(255,255,255,0.25), inset 0 0 12px var(--glass-lens);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  transition: border-color .2s, box-shadow .2s, background-color .2s;
}
.field textarea { resize: vertical; min-height: 120px; }
.field select {
  appearance: none; -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--accent) 50%), linear-gradient(135deg, var(--accent) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat;
}
/* Custom dropdown (glass listbox) */
.dropdown { position: relative; }
.dropdown-btn {
  width: 100%; display: flex; align-items: center; gap: .7rem; text-align: left;
  padding: .85rem 1rem; border-radius: var(--r-input);
  background: var(--input-bg); border: 1px solid var(--input-border); color: var(--text);
  box-shadow: inset 0 1px 0 var(--glass-rim-top), inset 0 -1px 0 rgba(255,255,255,0.25), inset 0 0 12px var(--glass-lens);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  transition: border-color .2s, box-shadow .2s;
}
.dropdown-btn:focus-visible, .dropdown-btn[aria-expanded="true"] { outline: none; border-color: var(--input-focus-border); box-shadow: inset 0 1px 0 var(--glass-rim-top), 0 0 0 4px var(--input-focus-ring); }
.dropdown-value { flex: 1 1 auto; }
.dropdown-chev { width: 13px; height: 13px; margin-right: .15rem; color: var(--accent); transition: transform .35s var(--ease); }
.dropdown-btn[aria-expanded="true"] .dropdown-chev { transform: rotate(180deg); }
.opt-dot { flex: 0 0 auto; width: 10px; height: 10px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 22%, transparent); }
.dropdown-list {
  position: absolute; left: 0; right: 0; top: calc(100% + .5rem); z-index: 20;
  margin: 0; padding: .45rem; border-radius: 18px; list-style: none;
  transform-origin: top center;
  opacity: 0; transform: translateY(-6px) scale(.98); pointer-events: none;
  transition: opacity .25s var(--ease), transform .35s var(--ease);
}
.dropdown-list { background: var(--nav-menu-bg); }   /* near-opaque so content behind it does not bleed through */
.dropdown-list[hidden] { display: block; }
.dropdown-list.open { opacity: 1; transform: none; pointer-events: auto; }
.dropdown-list [role="option"] {
  display: flex; align-items: center; gap: .7rem; padding: .6rem .8rem; border-radius: 12px; cursor: pointer;
  font-size: .95rem; color: var(--text); transition: background-color .15s;
}
.dropdown-list [role="option"]:hover, .dropdown-list [role="option"].focus { background: var(--accent-soft); }
.dropdown-list [role="option"][aria-selected="true"] { font-weight: 600; }
.opt-check { width: 16px; height: 16px; margin-left: auto; color: var(--accent); opacity: 0; transition: opacity .2s; }
.dropdown-list [role="option"][aria-selected="true"] .opt-check { opacity: 1; }

.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--input-focus-border); box-shadow: inset 0 1px 0 var(--glass-rim-top), 0 0 0 4px var(--input-focus-ring); }
.field.invalid input, .field.invalid textarea { border-color: #e5484d; box-shadow: 0 0 0 4px rgba(229,72,77,0.16); }
.field-error { font-size: .85rem; color: #e5484d; margin: 0; }
:root[data-theme="dark"] .field-error { color: #ffb3b3; }
.form-status { font-size: .95rem; color: var(--text-muted); min-height: 1.4em; margin: 0; }
.form-status.ok { color: var(--accent); font-weight: 600; }
.contact-form.sent .field, .contact-form.sent .btn { opacity: .55; pointer-events: none; }
@media (max-width: 860px) { .contact { position: relative; }
.contact::before {
  /* diagonal pop stripes behind the panel */
  content: ""; position: absolute; inset: 12% 0 12% 0; z-index: -1; pointer-events: none;
  background: repeating-linear-gradient(135deg, var(--accent-soft) 0 18px, transparent 18px 44px);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent);
  opacity: .7;
}
.contact-panel { grid-template-columns: 1fr; } }

/* ---------- Product pages ---------- */
.phero { padding-top: calc(var(--nav-h) + 4rem); padding-bottom: clamp(3rem, 6vw, 5rem); }
.phero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.phero-copy { display: grid; gap: 1.4rem; justify-items: start; }
.phero-copy .glass-label { margin-bottom: 0; }
.phero-copy h1 { font-size: clamp(1.8rem, 3.4vw, 3rem); }
.phero-copy h1 .sticker { display: inline-block; font-size: 1.1em; line-height: 1; transform: rotate(-2deg); transform-origin: left bottom; }
.phero-copy h1 .sticker:not(:has(.w)), .phero-copy h1 .sticker .wi { filter: drop-shadow(.1em .1em 0 var(--sticker-shadow)); }
.pstats { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; padding: 1rem; border-radius: var(--r-card); }
.pstats div { padding: 1.2rem 1.2rem 1.1rem; border-radius: 18px; background: var(--surface-2); border: 1px solid var(--surface-2-border); display: grid; gap: .2rem; }
.pstats dt { font-size: .8rem; color: var(--text-dim); font-weight: 500; order: 2; }
.pstats dd { font-family: var(--font-sticker); font-size: clamp(1.7rem, 2.6vw, 2.3rem); line-height: 1.05; color: var(--accent); }
.pstat-tag {
  position: absolute; right: -12px; top: -16px; z-index: 2; transform: rotate(6deg);
  padding: .35rem .9rem .4rem; border-radius: 12px; background: var(--c, var(--yellow)); color: #071432;
  font-family: var(--font-sticker); font-size: .8rem; letter-spacing: .04em; text-transform: uppercase;
  box-shadow: 0 8px 18px color-mix(in srgb, var(--c, var(--yellow)) 45%, transparent), inset 0 1px 0 rgba(255,255,255,0.5);
}
/* Mascots: one character per product page, standing against the stats panel */
.phero-visual { position: relative; }
.mascot {
  position: absolute; left: -9%; bottom: -8%; z-index: 2; height: clamp(240px, 24vw, 400px); width: auto;
  pointer-events: none; user-select: none;
  filter: drop-shadow(0 26px 30px rgba(3, 20, 60, 0.32));
  opacity: 0; animation: mascot-in 1s var(--ease) .45s forwards;
}
.mascot.mascot-prop { height: clamp(170px, 16vw, 260px); left: -6%; bottom: -10%; }
.mascot.mascot-right { left: auto; right: -8%; }
@keyframes mascot-in { from { opacity: 0; transform: translateY(26px) scale(.96); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: no-preference) {
  .mascot { animation: mascot-in 1s var(--ease) .45s forwards, mascot-float 7s ease-in-out 1.6s infinite; }
}
@keyframes mascot-float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -8px; } }
@media (max-width: 900px) {
  .phero-visual { margin-top: 3.5rem; }
  .mascot { height: 170px; left: auto; right: 4%; bottom: auto; top: -120px; }
  .mascot.mascot-prop { height: 130px; top: -90px; }
}
/* small character accents elsewhere */
.peek { position: absolute; right: 2.5rem; top: -118px; height: 150px; width: auto; pointer-events: none; filter: drop-shadow(0 16px 22px rgba(3,20,60,0.3)); transform: rotate(4deg); z-index: 2; }
.faq-prop { width: min(240px, 60%); height: auto; margin-top: 2rem; filter: drop-shadow(0 20px 24px rgba(3,20,60,0.25)); }
.page { position: relative; }
.page-mascot { position: absolute; right: var(--gutter); top: calc(var(--nav-h) + 2.6rem); height: 220px; width: auto; pointer-events: none; filter: drop-shadow(0 20px 26px rgba(3,20,60,0.3)); }
@media (max-width: 1000px) { .page-mascot { display: none; } }
@media (max-width: 760px) { .peek { height: 110px; top: -88px; right: 1.2rem; } .faq-prop { display: none; } }
@media (prefers-reduced-motion: reduce) { .mascot { animation: none; opacity: 1; } }

.ptile {
  width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; position: relative; overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.7), inset 0 -2px 6px rgba(0,0,0,0.12), 0 8px 18px rgba(3,45,107,0.18);
}
.ptile::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(255,255,255,0.55) 0%, rgba(255,255,255,0.12) 45%, rgba(255,255,255,0) 50%); }
.ptile svg { position: relative; width: 26px; height: 26px; color: #fff; overflow: visible; }
.ptile.tile-yellow svg, .ptile.tile-sky svg { color: var(--on-yellow); filter: none; }

.feat-grid { display: grid; gap: 1rem; grid-template-columns: repeat(3, 1fr); }
.feat-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.feat-grid.lead > :first-child { grid-column: span 2; }
.feat { border-radius: var(--r-card); padding: 1.6rem; display: grid; gap: .8rem; align-content: start; transition: transform .5s var(--ease); }
.feat:hover { transform: translateY(-4px); }
.feat h3 { margin-top: .4rem; }
.feat p { color: var(--text-muted); font-size: .98rem; line-height: 1.55; }
.feat-grid.lead > :first-child p { max-width: 56ch; }
.feat-grid .reveal:nth-child(2) { transition-delay: .06s; } .feat-grid .reveal:nth-child(3) { transition-delay: .12s; }
.feat-grid .reveal:nth-child(4) { transition-delay: .18s; } .feat-grid .reveal:nth-child(5) { transition-delay: .24s; } .feat-grid .reveal:nth-child(6) { transition-delay: .30s; }

.steps-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; counter-reset: s; }
.steps-row.cols-3 { grid-template-columns: repeat(3, 1fr); }
.steps-row .step { grid-template-columns: 44px 1fr; }
.steps-row .reveal:nth-child(2) { transition-delay: .08s; } .steps-row .reveal:nth-child(3) { transition-delay: .16s; } .steps-row .reveal:nth-child(4) { transition-delay: .24s; }

.band { border-radius: var(--r-card); padding: clamp(1.8rem, 4vw, 3rem); display: grid; grid-template-columns: 1.1fr .9fr; gap: 2rem; align-items: center; overflow: hidden; position: relative; color: #fff; }
.band.band-blue { background: linear-gradient(135deg, #1e9bff 0%, var(--bright) 45%, var(--blue) 100%); border: 1px solid rgba(255,255,255,0.4); box-shadow: inset 0 1px 0 rgba(255,255,255,0.5), 0 24px 60px rgba(21,143,254,0.3); }
.band.band-yellow { background: linear-gradient(135deg, #ffe453 0%, var(--yellow) 50%, #f3b800 100%); color: var(--on-yellow); border: 1px solid rgba(255,255,255,0.5); box-shadow: inset 0 1px 0 rgba(255,255,255,0.6), 0 24px 60px rgba(233,184,0,0.22); }
.band::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .3; background-image: linear-gradient(rgba(255,255,255,0.18) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.18) 1px, transparent 1px); background-size: 28px 28px; -webkit-mask-image: radial-gradient(70% 90% at 100% 0%, #000, transparent); mask-image: radial-gradient(70% 90% at 100% 0%, #000, transparent); }
.band h2 { font-size: clamp(1.4rem, 2.4vw, 2rem); }
.band p { opacity: .9; max-width: 50ch; margin-top: .6rem; }
.band ul { position: relative; display: grid; gap: .6rem; }
.band li { display: flex; gap: .7rem; align-items: start; padding: .8rem 1rem; border-radius: 14px; background: rgba(255,255,255,0.16); border: 1px solid rgba(255,255,255,0.35); box-shadow: inset 0 1px 0 rgba(255,255,255,0.5); font-size: .95rem; }
.band li svg { flex: 0 0 auto; width: 20px; height: 20px; margin-top: .1rem; }
.band.band-yellow li { background: rgba(255,255,255,0.3); }

.cmp { border-radius: var(--r-card); overflow: hidden; }
.cmp table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.cmp th, .cmp td { padding: .95rem 1.2rem; text-align: left; border-top: 1px solid var(--hairline); vertical-align: top; }
.cmp thead th { border-top: 0; font-family: var(--font-display); text-transform: uppercase; letter-spacing: .04em; font-size: .85rem; }
.cmp thead th:not(:first-child) { color: var(--accent); }
.cmp td:first-child { color: var(--text-muted); width: 32%; }
.cmp td { color: var(--text); }
.cmp .yes { color: var(--accent); font-weight: 600; }

.cta-panel { border-radius: var(--r-card); padding: clamp(1.8rem, 4vw, 3rem); display: grid; grid-template-columns: 1fr auto; gap: 1.5rem; align-items: center; }
.cta-panel h2 { font-size: clamp(1.4rem, 2.4vw, 2rem); }
.cta-panel p { color: var(--text-muted); max-width: 52ch; margin-top: .5rem; }
.cta-panel .hero-ctas { margin: 0; }

.product-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.pcard { border-radius: var(--r-card); padding: 1.6rem; display: grid; gap: .8rem; align-content: start; color: inherit; transition: transform .5s var(--ease); }
.pcard:hover { transform: translateY(-5px); }
.pcard h3 { margin-top: .5rem; }
.pcard p { color: var(--text-muted); font-size: .95rem; }
.pcard .text-link { margin-top: .3rem; }
/* "Soon" as a stamped corner mark: display type, slight tilt, inked double edge */
.pcard.is-soon { overflow: hidden; }
.pcard.is-soon .ptile { opacity: .75; }
.soon-stamp {
  position: absolute; right: 1.1rem; top: 1.1rem; display: grid; justify-items: center; line-height: 1;
  padding: .35rem .7rem .4rem; border: 2px solid var(--accent); border-radius: 8px; color: var(--accent);
  transform: rotate(6deg); background: var(--glass-bg); box-shadow: inset 0 0 0 2px var(--bg), 0 4px 14px rgba(3,60,140,0.12);
}
.soon-stamp b { font-family: var(--font-display); font-weight: 400; font-size: .95rem; letter-spacing: .08em; text-transform: uppercase; }
.soon-stamp small { font-size: .55rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; margin-top: .15rem; opacity: .8; }
.pcard.is-soon .text-link { color: var(--text-muted); }

@media (max-width: 1000px) {
  .feat-grid, .product-grid { grid-template-columns: repeat(2, 1fr); }
  .steps-row, .steps-row.cols-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .phero-grid, .band, .cta-panel { grid-template-columns: 1fr; }
  .pstats .pstat-tag { right: 0; top: -14px; }
}
@media (max-width: 640px) {
  .feat-grid, .feat-grid.cols-2, .product-grid, .steps-row, .steps-row.cols-3 { grid-template-columns: 1fr; }
  .feat-grid.lead > :first-child { grid-column: span 1; }
  .pstats { grid-template-columns: 1fr 1fr; }
  .cmp { overflow-x: auto; }
  .cmp table { min-width: 560px; }
}

/* ---------- Simple inner pages (legal) ---------- */
.page { padding-top: calc(var(--nav-h) + 4rem); }
.page-head { max-width: 60ch; margin-bottom: 2rem; display: grid; gap: .8rem; }
.page-head .muted { font-size: .95rem; }
.page-body { border-radius: var(--r-card); padding: clamp(1.6rem, 4vw, 3rem); max-width: 860px; display: grid; gap: 1.1rem; }
.page-body h2 { font-size: 1.05rem; margin-top: 1.2rem; }
.page-body h2:first-child { margin-top: 0; }
.page-body p, .page-body li { color: var(--text-muted); font-size: 1rem; line-height: 1.65; }
.page-body ul { list-style: disc; padding-left: 1.3rem; display: grid; gap: .35rem; }
.page-body a { color: var(--accent); border-bottom: 1px solid var(--accent-soft); }
.page-note { border-radius: 16px; padding: .9rem 1.1rem; background: var(--accent-soft); border: 1px solid var(--surface-2-border); font-size: .9rem; color: var(--text-muted); }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--hairline); padding-top: 3.5rem; margin-top: 2rem; background: var(--footer-bg); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr .9fr; gap: 2rem; padding-bottom: 2.5rem; }
.footer-brand img { height: 48px; width: auto; margin-bottom: 1rem; }
.footer-brand p { color: var(--text-dim); font-size: .95rem; max-width: 34ch; }
.footer nav { display: grid; gap: .5rem; align-content: start; }
.footer h4 { font-size: .85rem; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin-bottom: .4rem; font-weight: 700; }
.footer nav a { color: var(--text-muted); font-size: .95rem; transition: color .2s; }
.footer nav a:hover { color: var(--text); }
.footer-bottom {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem;
  padding-block: 1.25rem 1.75rem; border-top: 1px solid var(--hairline);
  font-size: .85rem; color: var(--text-dim);
}
@media (max-width: 1000px) { .footer-grid { grid-template-columns: 1fr 1fr 1fr; } .footer-brand { grid-column: 1 / -1; } }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .footer-grid { grid-template-columns: 1fr; } }

/* ---------- Scroll reveal ---------- */
.reveal { opacity: 0; transform: translateY(28px) scale(.985); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.bento .reveal:nth-child(2) { transition-delay: .06s; }
.bento .reveal:nth-child(3) { transition-delay: .12s; }
.bento .reveal:nth-child(4) { transition-delay: .18s; }
.bento .reveal:nth-child(5) { transition-delay: .24s; }
.bento .reveal:nth-child(6) { transition-delay: .30s; }
.steps .reveal:nth-child(2) { transition-delay: .08s; }
.steps .reveal:nth-child(3) { transition-delay: .16s; }
.steps .reveal:nth-child(4) { transition-delay: .24s; }
.steps .reveal:nth-child(5) { transition-delay: .32s; }

/* Word-level masked reveal for headlines (spans injected by js/main.js) */
.w { display: inline-block; overflow: hidden; vertical-align: bottom; padding: .08em .16em .18em .08em; margin: 0 -.16em -.18em -.08em; }
.wi { display: inline-block; transform: translateY(115%); transition: transform 1s var(--ease); transition-delay: calc(var(--i, 0) * 55ms); will-change: transform; }
h1.in .wi, .reveal.in .wi, .in .wi { transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .wi { transform: none; transition: none; }
  .tile, .chip, .hero-copy > * { opacity: 1; animation: none; }
  .spark, .cube, .ring::before { animation: none; }
  .btn, .bento-cell, .game-card, .step, .icon-btn, .nav-wrap { transition: none; }
  .grain { display: none; }
}

/* ---------- Product page hero visual: real work + compact stats ---------- */
.phero-visual { position: relative; padding-bottom: 4.5rem; }
.phero-shot { display: block; width: 100%; height: auto; }
.phero-shot.device { filter: drop-shadow(0 36px 50px rgba(2,20,60,0.32)); }
.phero-shot.board { border-radius: var(--r-card); border: 1px solid var(--glass-border); box-shadow: 0 30px 70px rgba(2,20,60,0.3), inset 0 1px 0 var(--glass-rim-top); }
.phero-visual .pstats { position: absolute; left: -6%; bottom: 0; width: 64%; padding: .6rem; gap: .6rem; z-index: 3; }
.phero-visual .pstats div { padding: .8rem .9rem .7rem; border-radius: 14px; }
.phero-visual .pstats dd { font-size: clamp(1.3rem, 1.9vw, 1.7rem); }
.phero-visual .pstats dt { font-size: .72rem; }
.phero-visual .mascot { left: auto; right: -8%; bottom: -2%; height: clamp(200px, 19vw, 320px); z-index: 4; }
.phero-visual .mascot.mascot-prop { height: clamp(150px, 13vw, 210px); left: auto; right: -4%; bottom: 0; }
@media (max-width: 900px) {
  .phero-visual { padding-bottom: 0; margin-top: 3rem; }
  .phero-visual .pstats { position: static; width: 100%; margin-top: 1rem; }
  .phero-visual .mascot { right: 2%; top: -110px; bottom: auto; height: 160px; }
  .phero-visual .mascot.mascot-prop { height: 120px; top: -80px; }
}


/* ---------- Icon rail (sports in the feed, game types): glass pills with duotone pack icons ---------- */
.section-tight { padding-top: 0; }
.section-tight .section-head { margin-bottom: 1.5rem; }
.icon-rail { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .7rem; }
.icon-rail li {
  display: inline-flex; align-items: center; gap: .65rem;
  padding: .55rem 1.1rem .55rem .7rem; border-radius: var(--r-pill);
  font-weight: 600; font-size: .95rem; color: var(--text);
  transition: transform .5s var(--ease), box-shadow .5s var(--ease);
}
.icon-rail li:hover { transform: translateY(-3px) rotate(-1deg); }
.icon-rail li:nth-child(even):hover { transform: translateY(-3px) rotate(1deg); }
.icon-rail svg { width: 30px; height: 30px; overflow: visible; flex: 0 0 auto; }
@media (max-width: 640px) { .icon-rail li { font-size: .88rem; padding: .5rem .9rem .5rem .6rem; } .icon-rail svg { width: 26px; height: 26px; } }

/* ---------- Sportsbook hero: illustrative odds board (HTML, so it stays crisp and themed) ---------- */
.sb-board {
  position: relative; z-index: 2; width: min(100%, 500px); margin-left: auto; margin-right: 8%;
  padding: 1rem 1rem 1rem; border-radius: var(--r-card);
  transform: rotate(-2deg); transform-origin: 50% 100%;
}
.sb-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .1rem .35rem .85rem; }
.sb-title { font-family: var(--font-display); text-transform: uppercase; letter-spacing: .04em; font-size: .95rem; color: var(--text); }
.sb-filters { display: flex; gap: .3rem; }
.sb-filters i { font-style: normal; font-size: .72rem; font-weight: 600; padding: .28rem .6rem; border-radius: 999px; color: var(--text-dim); background: var(--surface-2); border: 1px solid var(--surface-2-border); }
.sb-filters i.on { color: var(--on-yellow); background: var(--yellow); border-color: transparent; }
.sb-matches { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.sb-matches li {
  display: grid; grid-template-columns: 38px 1fr auto; align-items: center; gap: .7rem;
  padding: .6rem .7rem .6rem .55rem; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--surface-2-border);
}
.sb-sport { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: var(--glass-bg); box-shadow: inset 0 1px 0 var(--glass-rim-top); }
.sb-sport svg { width: 24px; height: 24px; overflow: visible; }
.sb-teams { min-width: 0; }
.sb-teams strong { display: block; font-size: .92rem; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-vs { margin: 0 .4em; font-weight: 500; color: var(--text-dim); font-size: .8em; }
.sb-teams small { display: flex; align-items: center; gap: .45rem; font-size: .74rem; color: var(--text-dim); }
.sb-live { font-style: normal; font-size: .62rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #fff; background: #e5484d; padding: .1rem .4rem .12rem; border-radius: 6px; }
.sb-live::before { content: ""; display: inline-block; width: 5px; height: 5px; margin-right: .3rem; border-radius: 50%; background: #fff; vertical-align: 1px; }
@media (prefers-reduced-motion: no-preference) { .sb-live::before { animation: blink 1.4s ease-in-out infinite; } }
@keyframes blink { 50% { opacity: .25; } }
.sb-odds { display: flex; gap: .35rem; }
.sb-odds b { min-width: 46px; text-align: center; padding: .45rem .45rem; border-radius: 10px; font-family: var(--font-sticker); font-weight: 400; font-size: .95rem; letter-spacing: .02em; color: var(--text); background: var(--glass-bg); border: 1px solid var(--glass-border); }
.sb-odds b.pick { color: var(--on-yellow); background: var(--yellow); border-color: transparent; box-shadow: 0 3px 0 var(--yellow-deep); }
.sb-slip { display: flex; align-items: center; gap: .8rem; margin-top: .7rem; padding: .7rem .8rem .7rem 1rem; border-radius: 16px; color: #fff; background: linear-gradient(135deg, #1e9bff, var(--blue)); box-shadow: inset 0 1px 0 rgba(255,255,255,0.35); }
.sb-slip strong { display: block; font-size: .9rem; }
.sb-slip small { font-size: .74rem; opacity: .85; }
.sb-total { margin-left: auto; font-family: var(--font-sticker); font-size: 1.3rem; }
.sb-place { font-size: .82rem; font-weight: 700; padding: .5rem .9rem; border-radius: 999px; background: var(--yellow); color: var(--on-yellow); box-shadow: 0 3px 0 var(--yellow-deep); }
.sb-chip { position: absolute; z-index: 3; display: inline-flex; align-items: center; gap: .45rem; padding: .5rem .95rem .5rem .6rem; font-size: .85rem; font-weight: 700; color: var(--text); }
.sb-chip svg { width: 22px; height: 22px; overflow: visible; }
.sb-chip-a { top: -6%; left: 2%; transform: rotate(-6deg); }
.sb-chip-b { top: 26%; right: -3%; transform: rotate(5deg); }
@media (prefers-reduced-motion: no-preference) {
  .sb-chip-a { animation: float 7s ease-in-out 1s infinite; }
  .sb-chip-b { animation: float 8s ease-in-out 1.6s infinite; }
}
.phero-visual:has(.sb-board) { padding-bottom: 11.5rem; }
.phero-visual:has(.sb-board) .pstats { width: 58%; left: -4%; }
.phero-visual:has(.sb-board) .mascot { right: -9%; bottom: -3%; height: clamp(170px, 15vw, 250px); }
@media (max-width: 900px) { .phero-visual:has(.sb-board) .pstats { width: 100%; left: 0; } }
@media (max-width: 900px) {
  .sb-board { margin: 0 auto; transform: none; }
  .sb-chip-a { top: -4%; left: -2%; } .sb-chip-b { right: -2%; }
  .sb-filters i:nth-child(n+3) { display: none; }
}

/* ---------- Legal pages: sticky contents + article ---------- */
.legal .page-head { max-width: 68ch; }
.legal .page-head .lede { font-size: 1.05rem; color: var(--text-muted); }
.legal-grid { display: grid; grid-template-columns: 260px minmax(0, 860px); gap: 1.5rem; align-items: start; }
.legal-toc { position: sticky; top: calc(var(--nav-h) + 1.25rem); border-radius: var(--r-card); padding: 1.1rem 1rem 1.2rem; max-height: calc(100vh - var(--nav-h) - 2.5rem); overflow: auto; }
.legal-toc > strong, .legal-more strong { display: block; font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--text-dim); margin: 0 .5rem .6rem; }
.legal-toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; counter-reset: toc; }
.legal-toc li a {
  display: flex; gap: .55rem; align-items: baseline; padding: .42rem .6rem; border-radius: 10px;
  font-size: .9rem; font-weight: 500; color: var(--text-muted); counter-increment: toc; transition: background-color .25s, color .25s;
}
.legal-toc li a::before { content: counter(toc, decimal-leading-zero); font-family: var(--font-sticker); font-size: .78rem; color: var(--text-dim); min-width: 1.6em; }
.legal-toc li a:hover { background: var(--surface-2); color: var(--text); }
.legal-toc li a.is-active { background: var(--accent-soft); color: var(--text); }
.legal-toc li a.is-active::before { color: var(--accent); }
.legal-more { margin-top: 1.1rem; padding-top: 1rem; border-top: 1px solid var(--glass-border); display: grid; gap: 2px; }
.legal-more a { padding: .35rem .6rem; border-radius: 10px; font-size: .86rem; color: var(--text-muted); }
.legal-more a:hover { background: var(--surface-2); color: var(--text); }
.legal .page-body { gap: 0; }
.legal .page-body section { padding: 1.4rem 0; border-top: 1px solid var(--glass-border); scroll-margin-top: calc(var(--nav-h) + 1.5rem); display: grid; gap: .8rem; }
.legal .page-body section:first-child { border-top: 0; padding-top: 0; }
.legal .page-body section:last-child { padding-bottom: 0; }
.legal .page-body h2 { font-size: 1.15rem; margin: 0; }
.legal .page-body p + ul, .legal .page-body ul + p { margin-top: .1rem; }
.legal-dl { display: grid; gap: .6rem; margin: 0; }
.legal-dl div { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: 1rem; padding: .8rem 1rem; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--surface-2-border); }
.legal-dl dt { font-weight: 600; color: var(--text); font-size: .95rem; }
.legal-dl dd { color: var(--text-muted); font-size: .95rem; line-height: 1.55; }
.legal-dl code { font-size: .88em; padding: .1em .4em; border-radius: 6px; background: var(--accent-soft); }
@media (max-width: 900px) {
  .legal-grid { grid-template-columns: 1fr; }
  .legal-toc { position: static; max-height: none; }
  .legal-toc ol { display: flex; flex-wrap: wrap; gap: .3rem; }
  .legal-toc li a::before { display: none; }
  .legal-toc li a { padding: .4rem .75rem; border-radius: 999px; background: var(--surface-2); font-size: .84rem; }
  .legal-more { display: none; }
  .legal-dl div { grid-template-columns: 1fr; gap: .3rem; }
}

/* ---------- About page ---------- */
.about-why { padding-top: 0; }
.why-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(1.5rem, 4vw, 4rem); align-items: start; }
.why-grid .section-head { margin-bottom: 0; max-width: none; }
.why-copy { display: grid; gap: 1rem; }
.why-copy p { color: var(--text-muted); font-size: 1.05rem; line-height: 1.7; }
.why-note { padding: 1.1rem 1.3rem; border-radius: 18px; background: var(--accent-soft); border: 1px solid var(--surface-2-border); color: var(--text) !important; font-weight: 500; }
.about-links { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.about-link { position: relative; display: grid; gap: .25rem; padding: 1.2rem 3rem 1.2rem 1.3rem; border-radius: 20px; color: var(--text); transition: transform .5s var(--ease); }
.about-link strong { font-family: var(--font-display); text-transform: uppercase; letter-spacing: .03em; font-size: .9rem; }
.about-link span { font-size: .88rem; color: var(--text-muted); }
.about-link svg { position: absolute; right: 1rem; top: 1.1rem; width: 24px; height: 24px; overflow: visible; transition: transform .5s var(--ease); }
.about-link:hover { transform: translateY(-4px); }
.about-link:hover svg { transform: translate(3px, -3px); }
@media (max-width: 900px) { .why-grid { grid-template-columns: 1fr; } .about-links { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .about-links { grid-template-columns: 1fr; } }

/* ---------- Knight queen: draws her sword when the process section scrolls in ----------
   Two layers from the same 583x931 canvas: body (sword removed, filled) and forearm + sword.
   The arm pivots at the elbow (290,345 in canvas px). */
.sticky-char.knight { position: relative; height: 300px; aspect-ratio: 583 / 931; width: auto; margin-top: 4.5rem; justify-self: start; overflow: visible; }
.knight img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 18px 22px rgba(3,20,60,0.28)); }
.knight-arm { transform-origin: 49.74% 37.06%; will-change: transform; }
.knight-body { transform-origin: 50% 100%; }
.knight-spark { position: absolute; width: 26px; height: 26px; opacity: 0; overflow: visible; --ico-upper: var(--yellow); --ico-lower: #ffe97a; --ico-stroke: rgba(10,43,92,0.6); pointer-events: none; }
.knight-spark-a { left: 38%; top: -24%; }
.knight-spark-b { left: 12%; top: 6%; width: 18px; height: 18px; }
@media (prefers-reduced-motion: no-preference) {
  .knight.draw .knight-arm { animation: sword-draw 2.8s cubic-bezier(.22,1,.36,1) both; }
  .knight.draw .knight-body { animation: sword-body 2.8s cubic-bezier(.22,1,.36,1) both; }
  .knight.draw .knight-spark-a { animation: sword-spark 2.8s ease-out both; }
  .knight.draw .knight-spark-b { animation: sword-spark 2.8s ease-out .12s both; }
}
@keyframes sword-draw {
  0%   { transform: rotate(0deg); }
  12%  { transform: rotate(9deg); }                 /* anticipation: a small dip */
  38%  { transform: rotate(-178deg); }              /* swing up, slight overshoot */
  46%, 68% { transform: rotate(-170deg); }          /* hold it high */
  100% { transform: rotate(0deg); }                 /* and back to rest */
}
@keyframes sword-body {
  0%, 100% { transform: none; }
  12%  { transform: translateY(4px) scale(1.01, .985); }
  40%  { transform: translateY(-6px) rotate(-2.5deg) scale(.99, 1.015); }
  46%, 68% { transform: translateY(-4px) rotate(-2deg); }
}
@keyframes sword-spark {
  0%, 36% { opacity: 0; transform: scale(.3) rotate(-30deg); }
  44%  { opacity: 1; transform: scale(1.15) rotate(0deg); }
  62%  { opacity: 1; transform: scale(.9) rotate(20deg); }
  72%, 100% { opacity: 0; transform: scale(.4) rotate(40deg); }
}

/* ---------- Cookie notice ---------- */
.consent {
  position: fixed; z-index: 90; left: max(1rem, env(safe-area-inset-left)); bottom: max(1rem, env(safe-area-inset-bottom));
  width: min(420px, calc(100vw - 2rem)); padding: 1.1rem 1.2rem 1.2rem; border-radius: 20px;
  display: grid; gap: .9rem; background: var(--nav-menu-bg);
  transform: translateY(16px) scale(.98); opacity: 0; transition: transform .45s var(--ease), opacity .35s;
}
.consent.in { transform: none; opacity: 1; }
.consent p { font-size: .9rem; line-height: 1.55; color: var(--text-muted); }
.consent p strong { color: var(--text); }
.consent p a { color: var(--accent); border-bottom: 1px solid var(--accent-soft); }
.consent-actions { display: flex; gap: .6rem; }
.consent-actions .btn { padding: .6rem 1.1rem; font-size: .88rem; }

/* ======================================================================
   Character moments (scroll-triggered, replay on re-entry, skipped under reduced motion)
   ====================================================================== */

/* ---- Treasure chest (FAQ): a jackpot moment. The chest hops with squash and stretch, the lid rattles on its
   hinge, coins and a money bag burst out of the pile and fall around it, sparkles pop at the top of the hop. ---- */
.faq-prop.chest { position: relative; aspect-ratio: 689 / 691; width: min(240px, 60%); height: auto; margin-top: 2rem; filter: none; }
.chest-body { position: absolute; inset: 0; transform-origin: 50% 96%; z-index: 1; }
.chest img { position: absolute; inset: 0; width: 100%; height: 100%; filter: drop-shadow(0 20px 24px rgba(3,20,60,0.25)); }
.chest-lid { transform-origin: 50% 48%; }
.chest-glow { position: absolute; left: 50%; top: 40%; width: 120%; aspect-ratio: 1; border-radius: 50%; transform: translate(-50%, -50%) scale(.6); opacity: 0; pointer-events: none; background: radial-gradient(circle, rgba(253,213,4,.55) 0%, rgba(253,213,4,.18) 38%, transparent 62%); }
.coin { position: absolute; left: 50%; top: 34%; width: 16px; height: 16px; border-radius: 50%; opacity: 0; pointer-events: none; z-index: 3;
  background: radial-gradient(circle at 35% 30%, #fff6b0 0 12%, #ffd84a 14% 55%, #d99a00 58% 100%); box-shadow: inset 0 0 0 2px rgba(180,120,0,.45), 0 2px 0 rgba(120,80,0,.35); transform: translate(-50%, -50%) scale(.3); }
.coin-s { width: 11px; height: 11px; }
.coin-ico { width: 24px; height: 24px; background: none; box-shadow: none; border-radius: 0; overflow: visible; --ico-upper: var(--yellow); --ico-lower: #ffe97a; --ico-stroke: rgba(10,43,92,0.6); }
.chest-glint { position: absolute; width: 22px; height: 22px; opacity: 0; overflow: visible; z-index: 4; --ico-upper: var(--yellow); --ico-lower: #ffe97a; --ico-stroke: rgba(10,43,92,0.6); }
.chest-glint-a { left: 24%; top: 22%; }
.chest-glint-b { left: 74%; top: 16%; width: 16px; height: 16px; }
.chest-glint-c { left: 50%; top: -6%; width: 26px; height: 26px; }
@media (prefers-reduced-motion: no-preference) {
  .chest.play .chest-body { animation: chest-hop 2.6s cubic-bezier(.3,.9,.3,1) both; }
  .chest.play .chest-lid { animation: lid-rattle 2.6s ease-in-out both; }
  .chest.play .chest-glow { animation: chest-glow 2.6s ease-out both; }
  .chest.play .coin { animation: coin-burst 1.9s cubic-bezier(.2,.6,.35,1) .22s both; }
  .chest.play .coin:nth-child(odd) { animation-delay: .3s; }
  .chest.play .coin:nth-child(3n) { animation-delay: .38s; }
  .chest.play .coin-ico { animation-delay: .34s; }
  .chest.play .chest-glint { animation: chest-glint 2.6s ease-out both; }
  .chest.play .chest-glint-b { animation-delay: .1s; } .chest.play .chest-glint-c { animation-delay: .05s; }
}
@keyframes chest-hop {
  0%   { transform: none; }
  10%  { transform: scale(1.08, .9) translateY(3%); }              /* crouch */
  26%  { transform: scale(.95, 1.07) translateY(-13%); }           /* jump */
  40%  { transform: scale(1.06, .93) translateY(0); }              /* land */
  52%  { transform: scale(.98, 1.03) translateY(-6%); }            /* little second hop */
  64%  { transform: scale(1.03, .97) translateY(0); }
  76%  { transform: translateY(-2%); }
  100% { transform: none; }
}
@keyframes lid-rattle {
  0%, 8% { rotate: 0deg; }
  18%  { rotate: -7deg; }
  30%  { rotate: 5deg; }
  42%  { rotate: -4deg; }
  54%  { rotate: 3deg; }
  66%  { rotate: -1.5deg; }
  78%, 100% { rotate: 0deg; }
}
@keyframes chest-glow {
  0%, 10% { opacity: 0; transform: translate(-50%, -50%) scale(.6); }
  30%  { opacity: 1; transform: translate(-50%, -50%) scale(1.05); }
  70%  { opacity: .55; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(.8); }
}
@keyframes coin-burst {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(.3) rotate(0deg); }
  8%   { opacity: 1; }
  45%  { opacity: 1; transform: translate(calc(-50% + var(--dx) * .8), calc(-50% + var(--dy))) scale(1) rotate(calc(var(--r) * .5)); }   /* top of the arc */
  85%  { opacity: 1; }
  100% { opacity: 0; transform: translate(calc(-50% + var(--dx) * 1.25), calc(-50% + 40px)) scale(.85) rotate(var(--r)); }            /* fall past the chest */
}
@keyframes chest-glint {
  0%, 20% { opacity: 0; transform: scale(.2) rotate(-20deg); }
  30%  { opacity: 1; transform: scale(1.2) rotate(0deg); }
  48%  { opacity: 1; transform: scale(.9) rotate(15deg) translateY(-6px); }
  62%, 100% { opacity: 0; transform: scale(.4) rotate(30deg) translateY(-14px); }
}

/* ---- Deck pair (Services): both cheer at the same time ---- */
.deck-char.cheer { --d: 1; }
.deck-char.cheer-r { --d: -1; }
.cheer img { display: block; height: 100%; width: auto; transform-origin: 50% 100%; }
.cheer .burst { position: absolute; width: 24px; height: 24px; opacity: 0; overflow: visible; pointer-events: none; --ico-upper: var(--yellow); --ico-lower: #ffe97a; --ico-stroke: rgba(10,43,92,0.6); }
.cheer .burst-1 { left: 12%; top: 12%; --bx: -40px; --by: -46px; }
.cheer .burst-2 { left: 48%; top: -2%;  --bx: 0px;   --by: -60px; width: 28px; height: 28px; }
.cheer .burst-3 { left: 80%; top: 10%;  --bx: 44px;  --by: -44px; }
.cheer .burst-4 { left: 2%;  top: 42%;  --bx: -52px; --by: -10px; width: 18px; height: 18px; }
.cheer .burst-5 { left: 88%; top: 40%;  --bx: 50px;  --by: -14px; }
@media (prefers-reduced-motion: no-preference) {
  .cheer.play img { animation: cheer-jump 2s cubic-bezier(.3,.9,.3,1) both; }
  .cheer.play .burst { animation: burst-pop 1.6s cubic-bezier(.2,.7,.3,1) .25s both; }
  .cheer.play .burst-2 { animation-delay: .32s; } .cheer.play .burst-3 { animation-delay: .4s; }
  .cheer.play .burst-4 { animation-delay: .5s; } .cheer.play .burst-5 { animation-delay: .58s; }
}
@keyframes cheer-jump {
  0%   { transform: none; }
  10%  { transform: scale(1.06, .92) translateY(3%); }
  28%  { transform: scale(.96, 1.06) translateY(-16%) rotate(calc(var(--d) * -5deg)); }
  46%  { transform: scale(1.05, .94) translateY(0); }
  60%  { transform: scale(.98, 1.03) translateY(-9%) rotate(calc(var(--d) * 4deg)); }
  74%  { transform: scale(1.02, .97) translateY(0); }
  86%  { transform: translateY(-3%); }
  100% { transform: none; }
}
@keyframes burst-pop {
  0%   { opacity: 0; transform: translate(0, 0) scale(.3) rotate(0deg); }
  25%  { opacity: 1; transform: translate(calc(var(--bx) * .7), calc(var(--by) * .7)) scale(1.2) rotate(20deg); }
  70%  { opacity: 1; transform: translate(var(--bx), var(--by)) scale(1) rotate(40deg); }
  100% { opacity: 0; transform: translate(var(--bx), calc(var(--by) + 24px)) scale(.5) rotate(60deg); }
}

/* ---- Parrot (contact): fires the flintlock ---- */
.peek.parrot { pointer-events: auto; cursor: pointer; }
.parrot img { display: block; height: 100%; width: auto; transform-origin: 72% 62%; }
.muzzle {
  position: absolute; left: 87%; top: 2%; width: 54px; height: 54px; opacity: 0; pointer-events: none; z-index: 3;
  transform: translate(-50%, -50%) scale(.2);
  background: radial-gradient(circle, #fff 0 16%, #ffe97a 18% 42%, rgba(255,150,30,.95) 44% 58%, transparent 60%);
  clip-path: polygon(50% 0%, 61% 32%, 95% 20%, 72% 46%, 100% 60%, 66% 64%, 74% 98%, 50% 74%, 26% 98%, 34% 64%, 0% 60%, 28% 46%, 5% 20%, 39% 32%);
}
.smoke { position: absolute; left: 87%; top: 2%; width: 14px; height: 14px; border-radius: 50%; opacity: 0; pointer-events: none; z-index: 2; background: radial-gradient(circle, rgba(255,255,255,.95), rgba(200,210,230,.6) 60%, transparent 70%); transform: translate(-50%, -50%); }
@media (prefers-reduced-motion: no-preference) {
  .parrot.play img { animation: gun-recoil 1.1s cubic-bezier(.2,.8,.3,1) both; }
  .parrot.play .muzzle { animation: muzzle 1.1s ease-out both; }
  .parrot.play .smoke-1 { animation: smoke 1.3s ease-out .05s both; --sx: -6px; }
  .parrot.play .smoke-2 { animation: smoke 1.5s ease-out .14s both; --sx: 10px; }
  .parrot.play .smoke-3 { animation: smoke 1.7s ease-out .26s both; --sx: 2px; }
}
@keyframes gun-recoil {
  0%   { transform: none; }
  7%   { transform: rotate(-8deg) translate(-5px, 6px); }
  26%  { transform: rotate(3deg) translate(1px, -1px); }
  48%  { transform: rotate(-1.5deg); }
  100% { transform: none; }
}
@keyframes muzzle {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(.2) rotate(0deg); }
  5%   { opacity: 1; transform: translate(-50%, -50%) scale(1.35) rotate(12deg); }
  14%  { opacity: .9; transform: translate(-50%, -50%) scale(.85) rotate(28deg); }
  22%, 100% { opacity: 0; transform: translate(-50%, -50%) scale(.2) rotate(40deg); }
}
@keyframes smoke {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(.4); }
  12%  { opacity: .9; }
  100% { opacity: 0; transform: translate(calc(-50% + var(--sx)), calc(-50% - 70px)) scale(2.6); }
}

/* ---- Piñata (Selected work): hangs on a string, swings, gets whacked ---- */
.work-char.pinata { display: block; height: 150px; aspect-ratio: 492 / 454; width: auto; transform-origin: 50% -64px; pointer-events: auto; cursor: pointer; transform: none; }
.pinata img { display: block; width: 100%; height: 100%; }
.pinata-string { position: absolute; left: 51%; bottom: 90%; width: 2px; height: 78px; background: linear-gradient(to top, var(--text-dim), transparent); opacity: .75; z-index: -1; }
.candy { position: absolute; left: 50%; top: 58%; width: 9px; height: 13px; border-radius: 3px; background: var(--c, var(--yellow)); opacity: 0; pointer-events: none; transform: translate(-50%, -50%) scale(.4); }
.candy-ico { width: 18px; height: 18px; background: none; border-radius: 0; overflow: visible; }
@media (prefers-reduced-motion: no-preference) {
  .work-char.pinata { animation: pinata-swing 4.6s ease-in-out infinite; }
  .pinata.play { animation: pinata-whack 1.8s cubic-bezier(.25,.9,.3,1) both; }
  .pinata.play .candy { animation: candy-fly 1.5s cubic-bezier(.2,.75,.35,1) .12s both; }
  .pinata.play .candy:nth-child(odd) { animation-delay: .18s; }
  .pinata.play .candy-ico { animation-delay: .24s; }
}
@keyframes pinata-swing { 0%, 100% { transform: rotate(6deg); } 50% { transform: rotate(-5deg); } }
@keyframes pinata-whack {
  0%   { transform: rotate(6deg); }
  8%   { transform: rotate(-26deg) scale(1.08, .94); }
  24%  { transform: rotate(20deg) scale(.96, 1.05); }
  40%  { transform: rotate(-13deg); }
  56%  { transform: rotate(9deg); }
  72%  { transform: rotate(-5deg); }
  86%  { transform: rotate(3deg); }
  100% { transform: rotate(6deg); }
}
@keyframes candy-fly {
  0%   { opacity: 1; transform: translate(-50%, -50%) scale(.5) rotate(0deg); }
  55%  { opacity: 1; }
  100% { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy) + 50px)) scale(1) rotate(var(--r)); }
}

/* ======================================================================
   Responsive pass: phones (320–430), foldables (cover 280–360 / open 600–900), tablets (768–1180)
   Rules here override the component rules above; keep them together so the breakpoints stay legible.
   ====================================================================== */

/* Nothing decorative may add horizontal scroll (floating characters, hero tiles, mascots). `clip` does not
   create a scroll container, so sticky columns keep working. */
html, body { overflow-x: clip; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }   /* no font boosting on Android: card copy must keep its size */
.tcard-body { min-height: 0; }
.tcard-play { margin-top: auto; }
.hero, .work, .deck-stage, .phero, .footer { overflow-x: clip; }
img, svg, video { max-width: 100%; }
.container { padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }

/* ---- Tablets and large foldables open (901–1180): keep the desktop nav, anchor the mega menu to the bar ---- */
@media (max-width: 1200px) and (min-width: 901px) {
  /* Anchor the mega menu to the trigger's left edge instead of centring it (centring pushed it off-screen).
     The pill slider uses offsetLeft inside .nav-links, which stays position: relative. */
  .mega { left: 0; width: min(680px, calc(100vw - 2rem)); transform: translateY(-8px) scale(.98); }
  .has-menu.open .mega { transform: none; }
  .mega-list a > span:last-child small { white-space: normal; }
  .nav { gap: .6rem; }
  .nav-links { gap: .1rem; }
  .nav-links > li > a, .nav-links > li > .menu-btn { padding-inline: .7rem; }
}
@media (max-width: 1180px) {
  .hero-grid { gap: clamp(1.5rem, 4vw, 3rem); }
  .work-grid { grid-auto-rows: clamp(170px, 19vw, 230px); }
  .process-grid { gap: 2rem; }
  .phero-visual .mascot { right: -2%; }
}

/* ---- Foldables open / small tablets (600–900): one column, but two-up where cards are small ---- */
@media (max-width: 900px) {
  .nav { padding: 0 .5rem 0 .9rem; }
  .hero-visual, .hero-stage { margin-inline: auto; }
  .hero-stage { max-width: min(480px, 100%); }
  .hero-stage .tile-a { left: 0; }
  .hero-stage .tile-b { right: 0; }
  .hero-stage .chip-c { left: 30%; bottom: -4%; }
  .hero-ctas { justify-content: flex-start; }
  .work-char.pinata { right: 1.5rem; top: -1.6rem; height: 96px; }
  .section-head-row { flex-wrap: wrap; align-items: start; }
  /* Product heroes stack: copy, then the shot with the mascot peeking over its top-right corner, then the stats.
     The visual's top margin reserves the room the mascot's head takes, so it never sits on the buttons. */
  .phero-visual, .phero-visual:has(.sb-board) { padding-bottom: 0; margin-top: 5rem; max-width: 560px; margin-inline: auto; }
  .phero-visual .pstats, .phero-visual:has(.sb-board) .pstats { position: static; width: 100%; margin-top: 1rem; left: auto; }
  .phero-visual .mascot, .phero-visual:has(.sb-board) .mascot { left: auto; right: 0; bottom: auto; top: -66px; height: 150px; }
  .phero-visual .mascot.mascot-prop { right: 0; top: -50px; height: 112px; }
  .sb-board { width: 100%; }
  .sb-chip-a { top: -1.4rem; left: 0; }
  .figures { padding-top: 0; }
  .legal .page-head .lede { font-size: 1rem; }
  .about-links { grid-template-columns: 1fr 1fr; }
  .steps-row, .steps-row.cols-3, .feat-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { gap: 2rem 1.5rem; }
}

/* ---- Phones (≤640): single column everywhere, tighter type and spacing ---- */
@media (max-width: 640px) {
  :root { --gutter: 1rem; --nav-h: 60px; }
  .section { padding-block: clamp(3.25rem, 12vw, 4.5rem); }
  .section-head { margin-bottom: 1.5rem; }
  h1 { font-size: clamp(1.75rem, 8.4vw, 2.4rem); }
  h2 { font-size: clamp(1.35rem, 6.2vw, 1.8rem); }
  .lede { font-size: 1.02rem; }
  .brand img { height: 36px; }
  .nav { height: 60px; }
  .hero { padding-top: calc(var(--nav-h) + 2.25rem); }
  .hero-copy { text-align: left; }
  .hero-ctas .btn { padding: .85rem 1.3rem; }
  .hero-stage { aspect-ratio: 1 / 1; }
  .hero-device { width: 92%; right: -2%; top: 10%; }
  .hero-stage .tile { width: 30%; }
  .hero-stage .tile-a { left: 0; bottom: 8%; }
  .hero-stage .tile-b { right: 0; bottom: 0; width: 25%; }
  .hero-stage .chip-a { top: 14%; }
  .hero-stage .chip-b { top: -2%; right: 0; }
  .hero-stage .chip-c { left: 28%; bottom: -2%; }
  .hero-stage .cube-wrap { left: 4%; top: 0; width: 64px; height: 64px; }
  .work-char.pinata { display: none; }
  .work-grid { grid-auto-rows: 200px; }
  .work-card.tall { grid-row: span 1; }
  .carousel-nav .icon-btn { width: 44px; height: 44px; }
  .provider-grid { grid-template-columns: repeat(2, 1fr); }
  .process-sticky { gap: .75rem; }
  .figures { grid-template-columns: 1fr 1fr; gap: .75rem; }
  .figures dd { font-size: 1.7rem; }
  .pstats { gap: .6rem; padding: .6rem; }
  .pstats div { padding: .9rem .9rem .8rem; }
  .pstats dd { font-size: 1.5rem; }
  .phero-visual, .phero-visual:has(.sb-board) { margin-top: 4.5rem; }
  .phero-visual .mascot, .phero-visual:has(.sb-board) .mascot { top: -58px; height: 132px; }
  .phero-visual .mascot.mascot-prop { top: -44px; height: 100px; }
  .sb-board { padding: .8rem; }
  .sb-matches li { grid-template-columns: 32px 1fr auto; gap: .5rem; padding: .5rem .55rem; }
  .sb-sport { width: 32px; height: 32px; } .sb-sport svg { width: 20px; height: 20px; }
  .sb-odds b { min-width: 40px; padding: .4rem .35rem; font-size: .88rem; }
  .sb-odds b:nth-child(3) { display: none; }                         /* two-way prices on narrow screens */
  .sb-slip { gap: .5rem; padding: .6rem .7rem; } .sb-total { font-size: 1.1rem; } .sb-place { padding: .45rem .7rem; }
  .steps-row, .steps-row.cols-3, .feat-grid, .about-links { grid-template-columns: 1fr; }
  .feat { padding: 1.3rem; }
  .band { padding: 1.5rem 1.3rem; }
  .cta-panel { padding: 1.6rem 1.3rem; }
  .legal-toc { padding: .9rem .75rem 1rem; }
  .legal .page-body { padding: 1.3rem 1.1rem; }
  .legal .page-body section { padding: 1.1rem 0; }
  .contact-panel, .contact-form { padding: 1.3rem; }
  .form-grid { grid-template-columns: 1fr; }
  .footer-grid { gap: 1.75rem 1rem; }
  .footer-bottom { flex-direction: column; gap: .4rem; text-align: center; }
  .consent { width: calc(100vw - 2rem); }
}

/* ---- Fold cover screens and the smallest phones (≤360) ---- */
@media (max-width: 360px) {
  :root { --gutter: .85rem; }
  h1 { font-size: clamp(1.6rem, 8.8vw, 2rem); }
  .lede { font-size: .98rem; }
  .brand img { height: 32px; }
  .nav { padding: 0 .4rem 0 .7rem; gap: .35rem; }
  .theme-toggle { transform: scale(.9); transform-origin: right center; }
  .hero-ctas { gap: .6rem; }
  .hero-ctas .btn { flex: 1 1 auto; justify-content: center; text-align: center; }
  .hero-stage .tile-a { width: 28%; }
  .hero-stage .tile-b { width: 23%; }
  .chip { font-size: .72rem; padding: .4rem .65rem; gap: .35rem; }
  .chip svg { width: 16px; height: 16px; }
  .work-grid { grid-auto-rows: 180px; }
  .icon-rail li { font-size: .82rem; }
  .figures { grid-template-columns: 1fr 1fr; }
  .pstats { grid-template-columns: 1fr 1fr; }
  .sb-filters { display: none; }
  .btn { padding-inline: 1.1rem; }
  .footer-grid { grid-template-columns: 1fr; }
}

/* ---- Short landscape phones: don't let the hero or menus demand more height than exists ---- */
@media (max-height: 520px) and (orientation: landscape) {
  .hero { min-height: 0; padding-top: calc(var(--nav-h) + 1.5rem); }
  .hero-stage { max-width: 360px; }
  .nav-links { max-height: calc(100dvh - 90px); }
}

/* ---- Touch devices: no hover-only affordances, comfortable targets ---- */
@media (hover: none) {
  .work-card:hover img, .icon-rail li:hover, .about-link:hover { transform: none; }
  .nav-links a, .footer nav a, .legal-toc li a { min-height: 44px; display: flex; align-items: center; }
  .footer nav a { min-height: 40px; }
  .provider { min-height: 64px; }
}

/* ---- Hero tile captions scale with the tile itself (phones shrink the tiles to ~100px).
   The tile has 10px of glass padding around the image, so the caption's offsets stay inside that. ---- */
.tile { container-type: inline-size; }
@container (max-width: 190px) {
  .tile figcaption { left: 18px; right: 18px; bottom: 17px; gap: 1px; }
  .tile figcaption span { font-size: .58rem; letter-spacing: .05em; }
  .tile figcaption strong { font-size: .74rem; letter-spacing: 0; line-height: 1.15; }
}
@container (max-width: 130px) {
  .tile figcaption { left: 16px; right: 14px; bottom: 15px; }
  .tile figcaption span { display: none; }
  .tile figcaption strong { font-size: .64rem; }
}
@container (max-width: 100px) {
  .tile figcaption strong { font-size: .56rem; }
}

/* ---- Phones: no scroll parallax in the hero. The layers would drift down into the "We use" row. ---- */
@media (max-width: 900px) {
  .hero-device, .hero-stage .tile, .hero-stage .chip, .cube-wrap, .spark { --sy: 0px !important; --tx: 0px !important; --ty: 0px !important; }
  .hero-stage .chip-c { left: 22%; bottom: -6%; }
}

/* ---- Work tiles on phones: smaller, more transparent caption so the artwork stays visible ---- */
@media (max-width: 640px) {
  .work-cap { left: 12px; bottom: 12px; right: auto; max-width: calc(100% - 24px); padding: .42rem .7rem; border-radius: 11px; background: rgba(5, 20, 55, 0.42); -webkit-backdrop-filter: blur(10px) saturate(140%); backdrop-filter: blur(10px) saturate(140%); }
  .work-cap strong { font-size: .78rem; }
  .work-cap span { font-size: .68rem; }
  .work-card:hover .work-cap { transform: none; }
}

/* ---- "How we work" on phones: compact timeline instead of five tall cards ---- */
@media (max-width: 640px) {
  .steps { gap: 0; position: relative; }
  .steps::before { content: ""; position: absolute; left: 17px; top: 20px; bottom: 20px; width: 2px; background: linear-gradient(to bottom, var(--bright), var(--yellow)); opacity: .35; border-radius: 2px; }
  .step { padding: .75rem 0 .75rem 0; grid-template-columns: 36px 1fr; column-gap: .9rem; row-gap: .15rem; background: none; border: 0; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; border-radius: 0; }
  .step .ring { width: 36px; height: 36px; font-size: .9rem; margin-top: 0; }
  .step > h3 { padding-top: .35rem; font-size: .92rem; }
  .step p { font-size: .9rem; line-height: 1.45; }
  .step:hover { transform: none; }
  .process-sticky .lede, .process-sticky > p { font-size: .98rem; }
}

/* ---- Reviews on phones: one swipeable row instead of a stack ---- */
@media (max-width: 640px) {
  .reviews { overflow-x: clip; }
  .review-grid { columns: auto; display: flex; gap: .85rem; overflow-x: auto; overflow-y: visible; scroll-snap-type: x mandatory; scrollbar-width: none; padding: .6rem var(--gutter) 2.6rem; margin: -.6rem calc(-1 * var(--gutter)) -1.4rem; -webkit-overflow-scrolling: touch; }
  .review-grid::-webkit-scrollbar { display: none; }
  .review { flex: 0 0 min(76vw, 300px); margin: 0; scroll-snap-align: center; padding: 1.25rem 1.25rem 1.15rem; align-content: start; }
  .review:hover { transform: none; }
  .review p { font-size: .95rem; }
  /* the row fades at the right edge so it reads as scrollable */
  .reviews .container { position: relative; }
  .reviews .container::after { content: ""; position: absolute; right: calc(-1 * var(--gutter)); top: 0; bottom: 0; width: 2.5rem; pointer-events: none; background: linear-gradient(to right, transparent, var(--bg)); }
}

/* ---- FAQ and contact on phones: tighter, flatter, less vertical space ---- */
@media (max-width: 640px) {
  .faq-grid { gap: 1.25rem; }
  .accordion { gap: .5rem; }
  .acc { border-radius: 14px; }
  .acc summary { padding: .85rem 1rem; font-size: .95rem; gap: .75rem; }
  .acc summary::after { width: 26px; height: 26px; flex: 0 0 26px; }
  .acc-body { padding: 0 1rem .95rem; }
  .acc-body p { font-size: .92rem; line-height: 1.5; }

  .contact { padding-top: 3rem; }
  .contact-panel { padding: 1.25rem 1.1rem 1.35rem; gap: 1.1rem; border-radius: 20px; }
  .contact-copy { gap: .6rem; }
  .contact-copy h2 { font-size: 1.3rem; }
  .contact-copy p { font-size: .95rem; }
  .contact-list { gap: .4rem .45rem; margin-top: .2rem; }
  .contact-list a { font-size: .84rem; padding: .4rem .7rem .4rem .55rem; }
  .contact-list a svg { width: 16px; height: 16px; }
  .contact-form { gap: .7rem; padding-top: .25rem; border-top: 1px solid var(--glass-border); margin-top: .25rem; }
  .field { gap: .3rem; }
  .field label { font-size: .82rem; }
  .field input, .field select, .field textarea { padding: .72rem .9rem; font-size: 16px; }   /* 16px stops iOS zooming into inputs */
  .field textarea { min-height: 92px; }
  .dropdown-btn { padding: .72rem .9rem; font-size: .95rem; }
  .contact-form .btn-primary { width: 100%; justify-content: center; }
  .form-status { font-size: .85rem; }
  .peek.parrot { height: 96px; top: -74px; right: .9rem; }
}

/* ---- Provider tiles are links to the studio's own site ---- */
.provider-link { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: .6rem; padding: 0 1.4rem; border-radius: inherit; color: inherit; }
.provider-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.provider:has(.provider-link):hover { box-shadow: inset 0 1px 0 var(--glass-rim-top), inset 0 -1px 0 var(--glass-rim-bottom), inset 0 0 14px var(--glass-lens), 0 14px 30px rgba(3,60,140,0.16); }
.provider:has(.provider-link)::after {
  /* small "opens elsewhere" arrow in the corner on hover */
  content: "\2197"; position: absolute; right: .55rem; top: .35rem; font-size: .7rem; font-weight: 700; color: var(--accent); opacity: 0; transition: opacity .25s;
}
.provider:has(.provider-link):hover::after { opacity: .9; }
.rail-track .provider:has(.provider-link)::after { display: none; }

/* ---- Inner pages: the section padding rule for phones must not swallow the nav clearance ---- */
@media (max-width: 640px) {
  .section.page { padding-top: calc(var(--nav-h) + 2.75rem); }
  .provider-grid { grid-template-columns: repeat(2, 1fr); gap: .6rem; }
  .provider-grid .provider { height: 72px; padding: 0 .8rem; min-width: 0; }
  .provider-grid .provider img { max-width: 110px; max-height: 36px; }
  .provider-grid .provider .provider-name { font-size: .72rem; white-space: normal; text-align: center; line-height: 1.2; }
  .provider-search { max-width: none; }
}

/* ---- Footer columns: plain headings on desktop, tap-to-expand on phones ---- */
.footer-toggle { all: unset; display: flex; align-items: center; justify-content: space-between; gap: .6rem; width: 100%; cursor: default; font: inherit; color: inherit; letter-spacing: inherit; text-transform: inherit; }
.footer-toggle svg { display: none; width: 11px; height: 11px; opacity: .8; transition: transform .35s var(--ease); }
.footer-links { display: grid; }
.footer-links-in { display: grid; gap: .5rem; min-height: 0; }
@media (max-width: 640px) {
  .footer { padding-top: 2.25rem; }
  .footer-grid { gap: 0; padding-bottom: 1.25rem; }
  .footer-brand { padding-bottom: 1.25rem; }
  .footer-col { border-top: 1px solid var(--hairline); }
  .footer-col h4 { margin: 0; }
  .footer-toggle { cursor: pointer; padding: .95rem 0; min-height: 48px; }
  .footer-toggle svg { display: block; }
  .footer-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
  .footer-links { grid-template-rows: 0fr; transition: grid-template-rows .4s var(--ease), padding .4s var(--ease); }
  .footer-links-in { overflow: hidden; gap: .15rem; }
  .footer-links a { padding: .3rem 0; }
  h4:has(.footer-toggle[aria-expanded="true"]) + .footer-links { grid-template-rows: 1fr; padding-bottom: .9rem; }
  .footer-bottom { padding-top: 1rem; }
}

/* ---- Comparison tables: scroll sideways on phones instead of squeezing four columns ---- */
.muted.small { font-size: .85rem; max-width: 70ch; margin-top: 1rem; }
@media (max-width: 760px) {
  .cmp { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
  .cmp table { min-width: 640px; font-size: .9rem; }
  .cmp th, .cmp td { padding: .8rem .9rem; }
  .cmp td:first-child { width: auto; min-width: 120px; position: sticky; left: 0; background: var(--nav-menu-bg); }
  .cmp thead th:first-child { position: sticky; left: 0; background: var(--nav-menu-bg); }
}

/* ---- Footer social row ---- */
.footer-bottom { align-items: center; }
.footer-social { list-style: none; margin: 0; padding: 0; display: flex; gap: .45rem; }
.footer-social a {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; color: var(--text-muted);
  background: var(--glass-bg); border: 1px solid var(--glass-border);
  box-shadow: inset 0 1px 0 var(--glass-rim-top), inset 0 -1px 0 var(--glass-rim-bottom);
  transition: transform .4s var(--ease), color .25s, border-color .25s;
}
.footer-social a svg { width: 17px; height: 17px; }
.footer-social a:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-3px); }
@media (max-width: 640px) {
  .footer-bottom { flex-direction: column; gap: .9rem; }
  .footer-social { order: -1; gap: .6rem; }
  .footer-social a { width: 42px; height: 42px; }
}

/* ---- Footer brand block: tagline, proof points, CTA ---- */
.footer-brand { display: grid; gap: .7rem; align-content: start; justify-items: start; }
.footer-brand img { margin-bottom: .2rem; }
.footer-tag { font-family: var(--font-display); text-transform: uppercase; letter-spacing: .04em; font-size: .95rem; color: var(--text); }
.footer-brand > p:not(.footer-tag) { font-size: .92rem; line-height: 1.6; max-width: 36ch; }
.footer-proof { list-style: none; margin: .2rem 0 0; padding: 0; display: grid; gap: .4rem; }
.footer-proof li { display: flex; align-items: center; gap: .5rem; font-size: .88rem; color: var(--text-muted); }
.footer-proof svg { width: 16px; height: 16px; color: var(--accent); flex: 0 0 auto; }
.footer-cta { margin-top: .5rem; padding: .7rem 1.3rem; font-size: .92rem; }
@media (max-width: 640px) {
  .footer-brand { gap: .55rem; }
  .footer-brand > p:not(.footer-tag) { max-width: none; }
  .footer-cta { width: 100%; justify-content: center; text-align: center; }
}

/* ---- Replica reference wall: brand logos when the file exists, name chips otherwise ---- */
.replica-rail li.replica { min-height: 56px; padding: .55rem 1.1rem; }
.replica-logo { display: none; height: 26px; width: auto; }
.replica-logo img { height: 100%; width: auto; max-width: 140px; object-fit: contain; display: block; }
.replica.has-logo .replica-logo { display: block; }
.replica.has-logo .replica-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }   /* keep the name for screen readers */
:root[data-theme="dark"] .replica.has-logo .replica-logo img { filter: brightness(0) invert(1); }
:root[data-theme="dark"] .replica.has-logo:hover .replica-logo img { filter: none; }
@media (max-width: 640px) { .replica-logo { height: 22px; } .replica-logo img { max-width: 110px; } }

/* ======================================================================
   Characters on phones and small tablets. The desktop placements are hidden below 900/1200px;
   these bring one character per section back at a size that decorates without crowding.
   Their animations (whack, cheer, sword draw, jackpot, pistol) are the same keyframes.
   ====================================================================== */
@media (max-width: 1200px) {
  /* Services: Caishen alone, perched top-right of the deck; the pirate stays desktop-only */
  .deck-char.deck-char-l { display: block; left: auto; right: 0; bottom: auto; top: -7.5rem; height: 128px; z-index: 2; }
  #services .section-head { padding-right: 120px; }
  .deck-char.deck-char-r { display: none; }
  .deck-stage { overflow: visible; }
}
@media (max-width: 1000px) {
  /* Inner pages: mascot tucked into the page head's top-right corner */
  .page-mascot { display: block; height: 128px; top: calc(var(--nav-h) + 1.4rem); }
  .page .page-head { padding-right: 130px; }
}
@media (max-width: 900px) {
  /* Selected work: a small piñata on the header */
  .work-char.pinata { display: block; right: .25rem; top: -1.1rem; height: 84px; z-index: 2; }
  .work-char.pinata .pinata-string { height: 56px; }
  /* Process: the knight stands beside the intro, sword ready */
  .sticky-char.knight { display: block; height: 180px; margin: 0; justify-self: end; margin-top: -.5rem; }
  .process-sticky { grid-template-columns: 1fr auto; align-items: end; }
  .process-sticky > :not(.knight) { grid-column: 1; }
  .process-sticky .knight { grid-column: 2; grid-row: 1 / span 3; }
}
@media (max-width: 760px) {
  /* FAQ: the treasure chest sits at the end of the heading */
  .faq-grid .section-head { position: relative; padding-right: 124px; min-height: 96px; }
  .faq-prop.chest { display: block; position: absolute; right: -.5rem; top: -1.6rem; width: 118px; margin: 0; }
}
@media (max-width: 640px) {
  .deck-char.deck-char-l { height: 108px; top: -7rem; right: -.25rem; }
  #services .section-head { padding-right: 100px; }
  .work-char.pinata { height: 74px; top: -.9rem; }
  .sticky-char.knight { height: 150px; }
  .process-sticky { grid-template-columns: minmax(0, 1fr) auto; column-gap: .25rem; }
  .page-mascot { height: 92px; top: calc(var(--nav-h) + 1rem); }
  .page .page-head { padding-right: 100px; }
  .faq-grid .section-head { padding-right: 112px; }
  .faq-prop.chest { width: 104px; top: -1.2rem; }
}
@media (max-width: 360px) {
  .deck-char.deck-char-l { height: 92px; }
  .sticky-char.knight { height: 128px; }
  .faq-prop.chest { width: 92px; }
  .page-mascot { height: 80px; }
}
