/* Videos page prototype v2. Geometry is copied from the approved boards (1440x900 stage, scaled to fit). */
:root {
  --ink: #04324f;
  --ink-on: #ffffff;
  --faint: rgba(4, 50, 79, 0.24);
  --accent: #04324f;
  --accent-ink: #aef9f5;
  --s: 1;            /* hero/intro stage scale, set by app.js */
  --sw: 1;           /* reel stage scale (width based) */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in: cubic-bezier(0.7, 0, 0.84, 0);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--ink);
  font-family: "Instrument Sans", system-ui, sans-serif;
  background: #0e0e10;
  -webkit-font-smoothing: antialiased;
}
body.locked { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }

/* Theme gradient layers (board values). */
.bg-layers { position: fixed; inset: 0; z-index: 0; }
.bg-layers > div { position: absolute; inset: 0; opacity: 0; will-change: opacity; }


main { position: relative; z-index: 1; }

/* Stage: a fixed 1440x900 coordinate space, scaled to fit the viewport. */
.stage {
  position: absolute; left: 50%; top: 50%; width: var(--stage-w, 1440px); height: var(--stage-h, 900px);
  transform: translate(-50%, -50%) scale(var(--s)); transform-origin: 50% 50%;
}

/* ---------- Hero ---------- */
.hero { position: relative; }               /* height set by app.js: 100vh + 4 steps */
.hero-pin { position: sticky; top: 0; height: 100vh; overflow: hidden; }
.snaps > i { position: absolute; left: 0; width: 1px; height: 1px; scroll-snap-align: start; }

.title-window {
  position: absolute; left: 24px; top: 110px; width: 310px; height: 680px; overflow: hidden; z-index: 5;
}
.title {
  all: unset; cursor: pointer; position: absolute; left: 0; top: 0; white-space: nowrap;
  font-family: "League Gothic", Impact, sans-serif; text-transform: uppercase; line-height: 0.9;
  will-change: transform; transform-origin: 0 0;
}
.title:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }

.strip { position: absolute; inset: 0; z-index: 2; }  /* own stacking layer, so .play (z 30) sits above every card */
.card {
  position: absolute; left: 0; top: 0; width: 990px; height: 557px; overflow: hidden;
  transform-origin: 0 0; will-change: transform, opacity; contain: layout paint;
  background: #15202a; border-radius: 26px;
  box-shadow: 0 40px 90px rgba(0, 0, 0, 0.2), 0 8px 24px rgba(0, 0, 0, 0.08);
}
/* Peeking cards are dimmed with a layer whose opacity changes (cheap), not a CSS filter (repaints). */
.card::after { content: ""; position: absolute; inset: 0; background: #0b0d12; opacity: var(--dim, 0); pointer-events: none; }
.card img, .card video, .reel img, .reel video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.card video, .reel video { opacity: 0; transition: opacity 320ms var(--ease-out); }
.card video.on, .reel video.on { opacity: 1; }
/* Speaker: muted hover playback; tap to hear it. */
.speaker {
  position: absolute; right: 24px; bottom: 24px; z-index: 3; width: 48px; height: 48px; padding: 0; border: 0; border-radius: 999px; cursor: pointer;
  display: grid; place-items: center; color: #fff; background: rgba(12, 14, 18, 0.45);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  opacity: 0; transform: scale(0.9); transition: opacity 240ms var(--ease-out), transform 240ms var(--ease-out), background 160ms;
}
.speaker svg { width: 22px; height: 22px; fill: currentColor; }
.speaker:hover { background: rgba(12, 14, 18, 0.65); }
.playing > .speaker { opacity: 1; transform: scale(1); }
.reel .speaker { right: 12px; bottom: 12px; width: 36px; height: 36px; }
.reel .speaker svg { width: 17px; height: 17px; }
.card.is-current { cursor: pointer; }


.meta-row {
  position: absolute; left: 424px; width: 990px; top: 800px; z-index: 5;
  display: flex; justify-content: space-between; align-items: flex-end;
}
.meta { display: flex; gap: 56px; }
.meta > span { display: flex; flex-direction: column; gap: 4px; }
.meta i { font-style: normal; opacity: 0.65; font-size: 12px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; }
.meta b { font-weight: 600; font-size: 22px; letter-spacing: -0.01em; line-height: 1.1; }
.counter { font-family: "League Gothic", Impact, sans-serif; font-size: 56px; line-height: 0.9; }
.roll { display: inline-block; will-change: transform, opacity; }

.scroll-prompt {
  position: absolute; left: 0; right: 0; top: 862px; z-index: 5;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase;
}
.ring { width: 44px; height: 44px; border-radius: 999px; border: 1.5px solid currentColor; display: grid; place-items: center; }
.ring svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }

/* ---------- Reels ---------- */
.reels { position: relative; overflow: hidden; }   /* height set by app.js */
.reels-stage { top: 0; height: 900px; transform: translate(-50%, 0) scale(var(--sw)); transform-origin: 50% 0; }
.reels-head { position: absolute; left: 56px; top: 60px; display: flex; flex-direction: column; gap: 10px; z-index: 5; }
.eyebrow { font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.8; }
.reels-head h2 { margin: 0; font-family: "League Gothic", Impact, sans-serif; font-weight: 400; font-size: 120px; line-height: 0.85; text-transform: uppercase; }
.reels-copy { position: absolute; right: 56px; top: 88px; width: 300px; margin: 0; font-size: 16px; line-height: 1.5; z-index: 5; }
.wheel { position: absolute; left: 0; right: 0; top: 0; height: var(--reel-h, 900px); cursor: grab; touch-action: pan-y; }
.wheel.dragging { cursor: grabbing; }
.reel {
  all: unset; cursor: pointer; position: absolute; left: 0; top: 0; width: 230px; height: 409px; border-radius: 18px; overflow: hidden;
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.28); will-change: transform; transform-origin: 50% 50%; background: #15202a; contain: layout paint;
}
.reel img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.reels-foot {
  position: absolute; left: 56px; right: 56px; bottom: 36px; z-index: 45;
  display: flex; justify-content: space-between; align-items: flex-end;
  font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
}
.reels-foot div { display: flex; flex-direction: column; gap: 4px; }
.reels-foot strong { font-family: "League Gothic", Impact, sans-serif; font-weight: 400; font-size: 40px; line-height: 0.9; letter-spacing: 0; }
.reels-foot span { opacity: 0.8; }

/* ---------- Opening ---------- */
.intro { position: fixed; inset: 0; z-index: 100; overflow: hidden; cursor: pointer; }
.intro.done { display: none; }
.intro-bg { position: absolute; inset: 0; background: #E5EEF6; }
.intro-stage { color: #061d57; }
.intro-line {
  position: absolute; left: 0; top: 0; white-space: nowrap; will-change: transform;
  font-family: "League Gothic", Impact, sans-serif; font-size: 330px; line-height: 0.85;
  text-transform: uppercase; color: #0345EF;
}
.intro-copy {
  position: absolute; left: 40px; top: 96px; width: 240px; margin: 0; will-change: transform, opacity;
  font-size: 11px; font-weight: 600; line-height: 1.5; letter-spacing: 0.08em; text-transform: uppercase;
}
.ribbon { position: absolute; inset: 0; perspective: 1400px; perspective-origin: 50% 40%; transform-style: preserve-3d; }
.rcard {
  position: absolute; left: 0; top: 0; width: 360px; height: 203px; margin: -101.5px 0 0 -180px;
  object-fit: cover; border-radius: 12px; backface-visibility: hidden; will-change: transform, opacity;
  box-shadow: 0 24px 48px rgba(6, 29, 87, 0.24); opacity: 0;
}
.grid-head {
  position: absolute; left: 150px; top: 128px; opacity: 0; will-change: transform, opacity;
  font-family: "League Gothic", Impact, sans-serif; font-size: 64px; line-height: 0.9; text-transform: uppercase; color: #0345EF;
}
.grid-count { position: absolute; right: 150px; top: 150px; opacity: 0; font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: #3f5687; }
.grid { position: absolute; inset: 0; perspective: 1600px; }
.gcard {
  position: absolute; left: 0; top: 0; overflow: hidden; opacity: 0; transform-origin: 0 0;
  will-change: transform, opacity; background: #15202a;
}
.gcard img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gcard .label {
  position: absolute; left: 24px; bottom: 20px; font-family: "League Gothic", Impact, sans-serif;
  font-size: 48px; line-height: 0.9; text-transform: uppercase; color: #04324f; transform-origin: 0 100%;
}
.grid-scroll {
  position: absolute; left: 50%; top: 700px; transform: translateX(-50%); opacity: 0;
  font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: #04324f;
}
.intro-foot {
  position: absolute; left: 40px; right: 40px; bottom: 32px; display: flex; justify-content: space-between;
  font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: #3f5687;
}


/* Prev/next arrows beside the counter (also: arrow keys, one swipe = one video). */
.pager { display: flex; align-items: center; gap: 12px; }
.pager .counter { margin-right: 8px; }
.arrow {
  width: 44px; height: 44px; padding: 0; border-radius: 999px; cursor: pointer; display: grid; place-items: center;
  border: 1.5px solid currentColor; background: transparent; color: var(--ink);
  transition: background 160ms var(--ease-out), color 160ms var(--ease-out), opacity 200ms, transform 160ms var(--ease-out);
}
.arrow svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }
.arrow:hover:not(:disabled) { background: var(--ink); color: var(--ink-on); }
.arrow:active:not(:disabled) { transform: scale(0.94); }
.arrow:disabled { opacity: 0.3; cursor: default; }
.arrow:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

/* Ambient colour taken from the playing video (like YouTube's ambient mode). */
#ambient { position: absolute; inset: 0; opacity: 0; background-color: #222; transition: background-color 700ms linear; will-change: opacity; }
#ambient::after { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse 70% 80% at 68% 45%, rgba(255,255,255,0.28), transparent 70%), linear-gradient(100deg, rgba(255,255,255,0.18), transparent 45%); }

/* ---------- Header: same markup and styling as sanedevs.com (blue bar, white links, green Contact) ---------- */
.site-header {
  position: fixed; z-index: 50; top: 8px; left: 12px; right: 12px;
  display: flex; align-items: center; gap: 28px; min-height: 72px; padding: 0 clamp(24px, 4vw, 64px);
  border-radius: 24px; background: linear-gradient(180deg, #1747c9 0%, #2456d8 100%);
  box-shadow: 0 16px 40px rgba(23, 71, 201, 0.22);
  font-family: "Figtree", system-ui, sans-serif; color: #fff;
}
.site-header .brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; color: #fff; }
.site-header .brand img { object-fit: contain; transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1); }
.site-header .brand:hover img { transform: rotate(-12deg) scale(1.08); }
.site-header nav { display: flex; gap: clamp(18px, 2.7vw, 42px); margin: auto; font-size: 14px; font-weight: 600; }
.site-header nav a { position: relative; padding: 6px 0; color: #fff; }
.site-header nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; border-radius: 2px; background: #46d883; transform: scaleX(0); transform-origin: right; transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1); }
.site-header nav a:hover::after, .site-header nav a:focus-visible::after { transform: scaleX(1); transform-origin: left; }
.site-header .nav-cta { display: inline-flex; align-items: center; justify-content: center; height: 42px; padding: 0 22px; border-radius: 99px; background: #46d883; color: #0b1d44; font-weight: 700; font-size: 14px; white-space: nowrap; transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.25s; }
.site-header .nav-cta:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(6, 30, 90, 0.3); }

/* ---------- Contact: same as sanedevs.com ---------- */
#contact { --green: #46d883; --ink-site: #0b1d44; --blue: #1747c9; position: relative; isolation: isolate; z-index: 2;
  max-width: 1400px; margin: 40px auto 28px; padding: clamp(40px, 6vw, 84px) clamp(24px, 6vw, 80px) clamp(90px, 9vw, 130px);
  border-radius: 32px; overflow: hidden; color: #fff; font-family: "Figtree", system-ui, sans-serif;
  background: linear-gradient(180deg, #1747c9 0%, #2f6ee6 45%, #9cc6f4 100%); box-shadow: 0 30px 70px rgba(23, 71, 201, 0.35); }
#contact::before { content: ""; position: absolute; z-index: -1; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 38% 26% at 14% 112%, #fff, transparent 74%), radial-gradient(ellipse 38% 26% at 70% 112%, rgba(255,255,255,0.93), transparent 74%), radial-gradient(ellipse 28% 14% at 92% 10%, rgba(255,255,255,0.45), transparent 76%), radial-gradient(ellipse 24% 12% at 6% 22%, rgba(255,255,255,0.28), transparent 76%); }
#contact .contact-content { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: clamp(32px, 6vw, 90px); align-items: start; }
#contact .eyebrow { margin: 0 0 15px; color: #d6e6ff; font: 500 11px "Geist Mono", ui-monospace, monospace; letter-spacing: 0.14em; text-transform: uppercase; opacity: 1; }
#contact h2 { margin: 0; color: #fff; font-size: clamp(42px, 5.6vw, 76px); line-height: 1.02; letter-spacing: -0.055em; font-weight: 600; }
#contact h2 em { display: inline-block; color: var(--green); font: 400 0.9em "Permanent Marker", cursive; letter-spacing: 0; transform: rotate(-3deg); }
#contact .contact-content > div > p:not(.eyebrow) { max-width: 400px; margin-top: 22px; color: #f0f6ff; line-height: 1.55; }
#contact .social-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 26px; }
#contact .social-links a { padding: 11px 16px; border: 1px solid rgba(255,255,255,0.55); border-radius: 99px; background: rgba(255,255,255,0.2); color: #fff; font-size: 12px; font-weight: 700; transition: transform 0.25s cubic-bezier(0.2,0.8,0.2,1), background-color 0.25s, color 0.25s; }
#contact .social-links a:hover { transform: translateY(-3px); background: #fff; color: var(--blue); }
#contact .contact-form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: clamp(18px, 2.4vw, 28px); border: 1px solid rgba(255,255,255,0.28); border-radius: 24px; background: rgba(12,44,150,0.34); }
#contact .contact-form label { display: grid; grid-template-columns: auto 1fr; justify-content: start; align-items: baseline; column-gap: 6px; row-gap: 7px; color: #fff; font-size: 12px; font-weight: 700; }
#contact .contact-form label span { color: #d6e6ff; font-weight: 400; }
#contact .contact-form .field-wide, #contact .contact-form button, #contact .form-status, #contact .form-delivery-note { grid-column: 1 / -1; }
#contact .contact-form input, #contact .contact-form textarea, #contact .contact-form select { width: 100%; min-height: 46px; padding: 12px 13px; border: 1px solid rgba(255,255,255,0.8); border-radius: 12px; background: rgba(255,255,255,0.92); color: #0e1f45; outline: none; font: inherit; font-weight: 500; transition: box-shadow 0.25s, background-color 0.25s; }
#contact .contact-form label > input, #contact .contact-form label > textarea, #contact .contact-form label > select { grid-column: 1 / -1; }
#contact .contact-form input:focus, #contact .contact-form textarea:focus, #contact .contact-form select:focus { background: #fff; box-shadow: 0 0 0 3px rgba(70,216,131,0.65); }
#contact .contact-form textarea { resize: vertical; }
#contact .pill { display: inline-flex; align-items: center; justify-content: center; gap: 12px; min-height: 50px; padding: 0 7px 0 24px; border: 0; border-radius: 99px; font: 700 13px "Figtree", sans-serif; letter-spacing: 0.03em; line-height: 1; white-space: nowrap; cursor: pointer; background: var(--green); color: var(--ink-site); justify-self: start; transition: transform 0.28s cubic-bezier(0.2,0.8,0.2,1), box-shadow 0.28s, background-color 0.25s; }
#contact .pill:hover { transform: translateY(-3px); box-shadow: 0 14px 28px rgba(8,32,100,0.28); background: #5be696; }
#contact .arrow-disc { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; background: var(--ink-site); color: #fff; }
#contact .arrow-disc svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.3s cubic-bezier(0.2,0.8,0.2,1); }
#contact .pill:hover .arrow-disc svg { transform: translate(2px, -2px); }
#contact .form-honeypot { display: none !important; }
#contact .form-delivery-note, #contact .form-status { margin: 0; font-size: 13px; line-height: 1.6; }
#contact .form-delivery-note a { font-weight: 600; text-decoration: underline; }
.reels { margin-bottom: 0; }

/* ---------- Video controls: play/pause + sound ---------- */
.vctl { position: absolute; right: 24px; bottom: 24px; z-index: 3; display: flex; gap: 10px; opacity: 0; transform: translateY(6px); transition: opacity 240ms var(--ease-out), transform 240ms var(--ease-out); }
.card.is-current:hover .vctl, .playing > .vctl, .paused-by-user > .vctl, .reel:hover .vctl { opacity: 1; transform: none; }
.vctl .speaker, .vctl .toggle { position: static; opacity: 1; transform: none; }
.toggle { width: 48px; height: 48px; padding: 0; border: 0; border-radius: 999px; cursor: pointer; display: grid; place-items: center; color: #fff; background: rgba(12,14,18,0.45); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); transition: background 160ms; }
.toggle:hover { background: rgba(12,14,18,0.65); }
.toggle svg { width: 20px; height: 20px; fill: currentColor; }
.reel .vctl { right: 12px; bottom: 12px; gap: 8px; }
.reel .toggle { width: 36px; height: 36px; }
.reel .toggle svg { width: 15px; height: 15px; }
.card.is-current { cursor: pointer; }

/* ---------- Opening: "Sane Devs" with the pixel logo ---------- */
.intro-line { display: flex; align-items: center; gap: 0.12em; }
.intro-mark { display: inline-block; width: 1.5em; height: 0.75em; margin: 0 0.16em; transform: translateY(-0.02em); }
.intro-mark svg { width: 100%; height: 100%; overflow: visible; }
.intro-mark rect { transform-box: fill-box; transform-origin: 50% 50%; }

/* ---------- Header + contact follow the page theme (one colour across the whole page) ----------
   Same layout as sanedevs.com, but every colour comes from the live theme variables
   (--ink, --ink-on, --accent, --faint), which follow the chosen video and the playing footage. */
.site-header {
  background: color-mix(in srgb, var(--ink) 7%, rgba(255, 255, 255, 0.34));
  border: 1px solid color-mix(in srgb, var(--ink) 14%, rgba(255, 255, 255, 0.55));
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(18px) saturate(140%); -webkit-backdrop-filter: blur(18px) saturate(140%);
  color: var(--ink);
}
.site-header .brand, .site-header nav a { color: var(--ink); }
.site-header nav a::after { background: var(--accent); }
.site-header .mark { width: 32px; height: 32px; background: currentColor; -webkit-mask: url(/assets/sanedevs-mark-white.svg) center / contain no-repeat; mask: url(/assets/sanedevs-mark-white.svg) center / contain no-repeat; transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1); }
.site-header .brand:hover .mark { transform: rotate(-12deg) scale(1.08); }
.site-header .nav-cta { background: var(--ink); color: var(--ink-on); }

#contact {
  color: var(--ink);
  background: color-mix(in srgb, var(--ink) 6%, rgba(255, 255, 255, 0.22));
  border: 1px solid color-mix(in srgb, var(--ink) 14%, rgba(255, 255, 255, 0.5));
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
}
#contact::before { opacity: 0.35; }
#contact .eyebrow { color: var(--ink); opacity: 0.7; }
#contact h2 { color: var(--ink); }
#contact h2 em { color: var(--accent); }
#contact .contact-content > div > p:not(.eyebrow) { color: var(--ink); opacity: 0.85; }
#contact .social-links a { color: var(--ink); border-color: color-mix(in srgb, var(--ink) 35%, transparent); background: color-mix(in srgb, var(--ink) 6%, transparent); }
#contact .social-links a:hover { background: var(--ink); color: var(--ink-on); }
#contact .contact-form { background: color-mix(in srgb, var(--ink) 8%, rgba(255, 255, 255, 0.25)); border-color: color-mix(in srgb, var(--ink) 16%, transparent); }
#contact .contact-form label { color: var(--ink); }
#contact .contact-form label span { color: var(--ink); opacity: 0.65; }
#contact .contact-form input:focus, #contact .contact-form textarea:focus, #contact .contact-form select:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 55%, transparent); }
#contact .pill, #contact .pill:hover { background: var(--ink); color: var(--ink-on); }
#contact .pill:hover { box-shadow: 0 14px 28px rgba(0, 0, 0, 0.2); }
#contact .arrow-disc { background: var(--ink-on); color: var(--ink); }
#contact .form-delivery-note { color: var(--ink); opacity: 0.8; }

/* ---------- Buttons, refined ---------- */
/* Header CTA: ink pill with an accent disc that nudges on hover. */
.site-header .nav-cta { height: 46px; gap: 10px; padding: 0 6px 0 20px; font-size: 14px; letter-spacing: 0.01em; }
.site-header .nav-cta .cta-disc { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: var(--ink-on); transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1); }
.site-header .nav-cta .cta-disc svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.site-header .nav-cta:hover .cta-disc { transform: rotate(45deg); }

/* Send button: larger, full-width, label left and disc right, with a sliding fill on hover. */
#contact .pill {
  position: relative; overflow: hidden; isolation: isolate; width: 100%; justify-self: stretch; justify-content: space-between;
  min-height: 60px; padding: 0 8px 0 28px; border-radius: 18px; font-size: 15px; letter-spacing: 0.01em;
  background: var(--ink); color: var(--ink-on); box-shadow: 0 12px 30px rgba(0, 0, 0, 0.14);
}
#contact .pill::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--accent); transform: translateX(-101%); transition: transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1); }
#contact .pill:hover { transform: translateY(-2px); background: var(--ink); color: var(--ink-on); box-shadow: 0 18px 36px rgba(0, 0, 0, 0.2); }
#contact .pill:hover::before { transform: translateX(0); }
#contact .pill:active { transform: translateY(0) scale(0.99); }
#contact .arrow-disc { width: 44px; height: 44px; border-radius: 14px; background: var(--ink-on); color: var(--ink); }
#contact .pill:hover .arrow-disc svg { transform: translate(3px, -3px); }

/* Selects: custom chevron, same height and radius as the inputs. */
#contact .contact-form select {
  appearance: none; -webkit-appearance: none; padding-right: 40px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230e1f45' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; background-size: 16px;
}
#contact .contact-form input, #contact .contact-form textarea, #contact .contact-form select { border-radius: 14px; border-color: color-mix(in srgb, var(--ink) 14%, rgba(255, 255, 255, 0.8)); }
/* Glass made from the theme's own contrast colour: white glass on light themes, dark glass on dark ones. */
.site-header { background: color-mix(in srgb, var(--ink-on) 38%, transparent); border-color: color-mix(in srgb, var(--ink) 14%, transparent); }
#contact { background: color-mix(in srgb, var(--ink-on) 22%, transparent); border-color: color-mix(in srgb, var(--ink) 14%, transparent); }
#contact .contact-form { background: color-mix(in srgb, var(--ink-on) 30%, transparent); }

/* The opening scene is always the 1440x900 composition; on phones it is scaled to fill the height. */
.intro-stage { width: 1440px; height: 900px; transform: translate(-50%, -50%) scale(var(--si, var(--s))); }
.reels-stage { width: var(--reel-w, 1440px); height: var(--reel-h, 900px); }
.menu-toggle { display: none; }

/* ---------- Phone layout (<= 760px) ---------- */
@media (max-width: 760px) {
  /* Header: logo, Contact, menu button; links drop down (as on sanedevs.com). */
  .site-header { top: 6px; left: 6px; right: 6px; min-height: 58px; padding: 0 8px 0 14px; gap: 8px; border-radius: 18px; }
  .site-header .brand { font-size: 17px; gap: 7px; }
  .site-header .mark { width: 26px; height: 26px; }
  .site-header .nav-cta { margin-left: auto; height: 40px; font-size: 13px; padding: 0 5px 0 14px; }
  .site-header .nav-cta .cta-disc { width: 30px; height: 30px; }
  .menu-toggle { display: flex; order: 3; flex-direction: column; justify-content: center; gap: 5px; width: 40px; height: 40px; padding: 0; border: 1px solid color-mix(in srgb, var(--ink) 30%, transparent); border-radius: 50%; background: color-mix(in srgb, var(--ink-on) 30%, transparent); color: var(--ink); cursor: pointer; }
  .menu-toggle span { width: 15px; height: 2px; margin: 0 auto; background: currentColor; }
  .site-header nav { display: none; position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; gap: 0; padding: 8px; border-radius: 18px; background: color-mix(in srgb, var(--ink-on) 92%, transparent); border: 1px solid color-mix(in srgb, var(--ink) 14%, transparent); box-shadow: 0 18px 40px rgba(0, 0, 0, 0.16); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
  .site-header nav.open { display: flex; }
  .site-header nav a { padding: 13px; font-size: 15px; }
  .site-header nav a::after { left: 13px; right: 13px; bottom: 7px; }

  /* Hero (390x844 stage): titles on top, card below, info and arrows under it. */
  .title-window { left: 20px; top: 84px; width: 350px; height: 236px; }
  .meta-row { left: 16px; width: 358px; top: 632px; flex-direction: column; align-items: stretch; gap: 18px; }
  .meta { gap: 22px; }
  .meta i { font-size: 11px; }
  .meta b { font-size: 16px; }
  .pager { justify-content: space-between; }
  .pager .counter { font-size: 44px; margin-right: auto; }
  .scroll-prompt { top: 778px; }
  .vctl { right: 12px; bottom: 12px; gap: 8px; }
  .vctl .speaker, .vctl .toggle { width: 38px; height: 38px; }
  .vctl svg { width: 16px !important; height: 16px !important; }

  /* Reels (390 wide stage): smaller cards on a gentler hill, swipe to scroll. */
  .reels-head { left: 20px; top: 28px; }
  .reels-head h2 { font-size: 58px; }
  .reels-copy { left: 20px; right: 20px; top: 120px; width: auto; font-size: 14px; }
  .reels-foot { left: 20px; right: 20px; bottom: 22px; }
  .reels-foot strong { font-size: 26px; }
  #themeNote { display: none; }
  .reel { border-radius: 14px; }
  .reel .vctl { right: 8px; bottom: 8px; }
  .reel .speaker, .reel .toggle { width: 32px; height: 32px; }

  /* Opening: the scene is cropped to the middle; side texts and the grid hand-off are dropped. */
  .intro-copy, .intro-foot, .grid, .grid-head, .grid-count, .grid-scroll { display: none; }

  /* Contact (same values as the site's phone layout). */
  #contact { margin: 48px 6px 15px; padding: 34px 17px 60px; border-radius: 22px; }
  #contact .contact-content { grid-template-columns: 1fr; gap: 30px; }
  #contact h2 { font-size: clamp(40px, 11vw, 55px); }
  #contact .contact-form { grid-template-columns: 1fr; gap: 11px; padding: 16px; }
  #contact .contact-form > * { min-width: 0; }
}
