/* ============================================================
   AF DEVS — Visual Enhancements v2 (Production)
   Additive layer over index.html inline styles.
   ============================================================ */

/* ─── BRANDED LOADER ─── */
body[data-loaded] .loader {
  opacity: 1 !important;
  visibility: visible !important;
  transition: none !important;
}
body[data-loaded] .loader.exit-split {
  animation: loader-split-exit 0.42s 0.04s cubic-bezier(0.65,0,0.35,1) forwards;
}
.loader .l-inner {
  display: flex !important;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}
/* ── Logo loader: the ACTUAL AF DEVS mark wipes in, a teal scan line
   (the brand signature strip) sweeps the reveal edge, soft brand glow. ── */
.loader .loader-logo-wrap {
  position: relative; display: inline-flex;
  align-items: center; justify-content: center;
  overflow: hidden;
}
.loader .loader-logo {
  width: clamp(170px, 24vw, 230px); height: auto; display: block;
  clip-path: inset(0 100% 0 0);
  opacity: 0;
  animation: loader-logo-reveal 0.68s cubic-bezier(0.65,0,0.35,1) forwards;
  filter: drop-shadow(0 0 18px rgba(107,63,212,0.40)) drop-shadow(0 0 40px rgba(45,212,191,0.16));
}
@keyframes loader-logo-reveal {
  0%   { clip-path: inset(0 100% 0 0); opacity: 0; }
  10%  { opacity: 1; }
  100% { clip-path: inset(0 0 0 0); opacity: 1; }
}
.loader .loader-scan {
  position: absolute; top: 6%; bottom: 6%; width: 3px;
  left: 0;
  background: var(--teal);
  box-shadow: 0 0 16px var(--teal), 0 0 34px rgba(45,212,191,0.45);
  opacity: 0; pointer-events: none;
  animation: loader-scan-move 0.68s cubic-bezier(0.65,0,0.35,1) forwards;
}
@keyframes loader-scan-move {
  0%   { left: 0%;   opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 1; }
  100% { left: 100%; opacity: 0; }
}
@keyframes loader-split-exit {
  0%   { clip-path: inset(0 0 0 0); opacity: 1; }
  100% { clip-path: inset(0 50% 0 50%); opacity: 0; }
}

/* ─── STAT COUNTERS ─── */
.stat { position: relative; }
.stat::after {
  content: ''; position: absolute; inset: -8px;
  border-radius: 16px; opacity: 0; filter: blur(18px);
  background: conic-gradient(from 180deg, transparent, var(--teal), transparent);
  z-index: -1; pointer-events: none;
}
.stat.revealed::after { animation: stat-glow 1s ease forwards; }
@keyframes stat-glow {
  0%  { opacity: 0; transform: scale(0.85); }
  40% { opacity: 0.5; }
  100%{ opacity: 0; transform: scale(1.15); }
}
.stat-value {
  opacity: 0; transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.stat.revealed .stat-value { opacity: 1; transform: translateY(0); }
.stat-label {
  opacity: 0; transform: translateY(8px);
  transition: opacity 0.5s 0.3s ease, transform 0.5s 0.3s ease;
}
.stat.revealed .stat-label { opacity: 1; transform: translateY(0); }

/* ─── 3D SERVICE TILT ─── */
.service { transform-style: preserve-3d; position: relative; overflow: hidden; }
.service .service-glow {
  position: absolute; width: 180px; height: 180px; border-radius: 50%;
  background: radial-gradient(circle, var(--purple) 0%, transparent 70%);
  opacity: 0; pointer-events: none; transform: translate(-50%,-50%);
  filter: blur(35px); z-index: 0; transition: opacity 0.3s;
}
@media (hover: hover) and (pointer: fine) {
  .service:hover .service-glow { opacity: 0.12; }
  .service:hover .service-arrow {
    opacity: 1; transform: translate(0,0);
    border-color: var(--teal); color: var(--teal);
  }
}
.service .service-arrow {
  position: absolute; top: 20px; right: 20px; width: 28px; height: 28px;
  border-radius: 50%; border: 1px solid var(--hairline);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: var(--ivory-dim);
  opacity: 0; transform: translate(-6px, 6px);
  transition: opacity 0.3s, transform 0.3s, border-color 0.3s, color 0.3s;
  z-index: 2;
}

/* ─── PROJECT CARDS ─── */
.project { overflow: hidden; }

/* ─── SCROLL-LINKED PROCESS LINE ─── */
.process-grid { position: relative; }
.process-progress-line {
  position: absolute; top: 0; left: 0; width: 100%; height: 2px;
  background: var(--hairline); z-index: 1; overflow: hidden;
}
.process-progress-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--teal), var(--purple-2), var(--magenta));
  box-shadow: 0 0 10px var(--teal), 0 0 20px rgba(45,212,191,0.2);
  transition: width 0.05s linear;
}
.step.step-active { border-left-color: var(--teal) !important; }
.step.step-active .step-num { filter: drop-shadow(0 0 12px rgba(192,123,255,0.4)); }

/* ─── BRAND MARQUEE DEPTH ─── */
.brand-mark {
  position: relative;
  transition: color 320ms ease, text-shadow 320ms ease, transform 0.3s ease !important;
}
@media (hover: hover) and (pointer: fine) {
  .brand-mark:hover { transform: scale(1.08); }
}
.brand-mark .brand-tooltip {
  position: absolute; bottom: calc(100% + 10px); left: 50%;
  transform: translateX(-50%) translateY(4px);
  padding: 5px 12px; background: var(--purple); border-radius: 6px;
  font-family: var(--mono); font-size: 8px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--ivory); white-space: nowrap;
  opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s;
  z-index: 10;
}
.brand-mark .brand-tooltip::after {
  content: ''; position: absolute; top: 100%; left: 50%;
  transform: translateX(-50%); border: 5px solid transparent;
  border-top-color: var(--purple);
}
.brand-mark:hover .brand-tooltip { opacity: 1; transform: translateX(-50%) translateY(0); }
.brands { pointer-events: auto !important; }

/* ─── TESTIMONIAL AMBIENT + GLASS ─── */
.test { overflow: hidden; }
.test .test-ambient {
  position: absolute; inset: 0; background-size: cover;
  filter: blur(28px) saturate(1.3); opacity: 0; transform: scale(1.2);
  transition: opacity 0.6s; z-index: 0; pointer-events: none;
}
.test .test-glass {
  position: absolute; inset: 0;
  background: rgba(10,10,10,0.65); backdrop-filter: blur(16px) saturate(1.2);
  z-index: 1; opacity: 0; transition: opacity 0.4s; pointer-events: none;
}
@media (hover: hover) and (pointer: fine) {
  .test:hover .test-ambient { opacity: 0.2; }
  .test:hover .test-glass { opacity: 1; }
}
.test > *:not(.test-ambient):not(.test-glass) { position: relative; z-index: 2; }
.test .test-progress {
  position: absolute; bottom: 0; left: 0; height: 2px; width: 100%;
  background: linear-gradient(90deg, var(--teal), var(--magenta));
  z-index: 3; transform: scaleX(0); transform-origin: left center;
  transition: transform 4s linear;
}
@media (hover: hover) and (pointer: fine) {
  .test:hover .test-progress { transform: scaleX(1); }
}

/* ─── IMMERSIVE WALKTHROUGH SCENE (sticky, in-flow) ─── */
.walkthrough-wrapper {
  position: relative;
  /* z-index 10 so the walkthrough scene fully covers fixed-position hero
     elements (.chrome z:5, .rail z:4, .title-block z:4) underneath as it
     scrolls into view. Was z:3 which let them bleed through on mobile
     when past-hero hadn't fully faded them yet. */
  z-index: 10;
  background: var(--obsidian);
}
.living-room-scene {
  position: sticky;
  top: 0;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  z-index: 2;
}
.living-room-image {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; filter: saturate(1.08) contrast(1.04);
  transition: opacity 0.6s ease;
}
.living-room-scrub-video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; filter: saturate(1.08) contrast(1.04);
  opacity: 0; transition: opacity 0.4s ease;
}
.living-room-scrub-video.ready { opacity: 1; }
.living-room-scene:has(.living-room-scrub-video.ready) .living-room-image { opacity: 0; }
.living-room-overlay {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(1400px 800px at 50% 50%, rgba(107,63,212,0.08) 0%, transparent 60%),
    linear-gradient(180deg, rgba(10,10,10,0.1) 0%, rgba(10,10,10,0.3) 100%);
}
.living-room-vignette {
  position: absolute; inset: 0; pointer-events: none;
  box-shadow: inset 0 0 100px 30px rgba(10,10,10,0.5);
}

/* ─── MAGNETIC PLAY BUTTON — REMOVED 2026-07-10 ───
   Legacy Phase-1 leftover: it ghost-followed the cursor over the V2
   scenes and wired into the hidden A/B audio stage. The PLAY scene's
   click hitbox + vinyl selector replaced it. */

/* ─── PAGE TRANSITIONS (View Transitions API) ─── */
::view-transition-old(root) { animation: vt-out 0.3s cubic-bezier(0.65,0,0.35,1); }
::view-transition-new(root) { animation: vt-in 0.3s cubic-bezier(0.65,0,0.35,1); }
@keyframes vt-out { to { opacity: 0; transform: translateY(-8px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(8px); } }
.wordmark { view-transition-name: logo; }
.topnav   { view-transition-name: nav; }

/* ─── SCROLL REVEAL (generic — BULLETPROOF) ─────────────────
   RULE: never apply opacity:0 to a <section>. Only to its inner children.
   If the IntersectionObserver misses, the section stays visible; only
   the child stagger fails — content is never invisible. */
.scroll-reveal {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 0.7s ease var(--reveal-delay, 0s),
    transform 0.7s cubic-bezier(0.16,1,0.3,1) var(--reveal-delay, 0s);
  will-change: opacity, transform;
}
.scroll-reveal.revealed {
  opacity: 1;
  transform: translateY(0);
  will-change: auto;
}

/* BULLETPROOF FALLBACK: JS adds .reveals-fallback to <html> 2s after init.
   Any element the observer missed gets force-shown. */
.reveals-fallback .scroll-reveal:not(.revealed) {
  opacity: 1 !important;
  transform: translateY(0) !important;
  transition: opacity 0.4s ease, transform 0.4s ease !important;
}

/* REDUCED MOTION: no fades, no stagger, content visible immediately. */
@media (prefers-reduced-motion: reduce) {
  .scroll-reveal,
  .scroll-reveal.revealed,
  .word,
  .reveal-pending {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
    animation: none !important;
  }
}

/* ─── SECTION WIPES (Shopify-style layered transitions) ─── */
.section {
  position: relative;
  /* NOTE: will-change: transform here was previously breaking
     position:fixed descendants (CSS spec — will-change creates a new
     containing block for fixed children). Removed. The browser
     auto-optimizes sections that actually transform. */
}
.section::before {
  content: '';
  position: absolute; top: -1px; left: 0; right: 0; height: 80px;
  background: linear-gradient(to bottom, var(--obsidian), transparent);
  pointer-events: none; z-index: 1;
}
.section:first-child::before { display: none; }

/* ─── STICKY SCROLL SECTIONS (pin while content reveals) ─── */
.stats {
  position: sticky; top: 0; z-index: 2;
}

/* ─── FLOATING DEPTH CARDS (hover-only — at rest cards stay flush) ───
   Adolfo flag: at-rest translateY looked forced. Only stagger when
   the grid is hovered, so users see clean alignment by default. */
.services-grid { transform-style: preserve-3d; }
.service {
  transform: translateY(0) translateZ(0);
  transition:
    transform 0.5s cubic-bezier(0.16,1,0.3,1),
    border-color 320ms ease,
    background 320ms ease !important;
}
@media (hover: hover) and (pointer: fine) {
  .services-grid:hover .service:nth-child(3n+2) { transform: translateY(-8px) translateZ(0); }
  .services-grid:hover .service:nth-child(3n+3) { transform: translateY(-16px) translateZ(0); }
  .services-grid:hover .service:hover {
    transform: translateY(-20px) translateZ(0) scale(1.02);
    z-index: 4;
  }
}

/* ─── TYPOGRAPHY WORD STAGGER ─────────────────────────────────
   JS splits titles into <span class="word"> and adds .words-visible
   to the title when it enters viewport. Stagger via --w-i index. */
.section-title .word,
.brands-title .word,
.coverage-title .word {
  display: inline-block;
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 0.7s ease,
    transform 0.7s cubic-bezier(0.16,1,0.3,1);
  transition-delay: calc(var(--w-i, 0) * 0.045s);
  /* will-change removed 2026-07-31: 76+ pre-promoted layers at startup = compositor pressure */
}
.words-visible .word {
  opacity: 1;
  transform: translateY(0);
  will-change: auto;
}
/* Bulletproof: 2s after init, force-show every word. */
.reveals-fallback .word { opacity: 1 !important; transform: none !important; }

/* ─── PROJECT VIDEO BOXES (parallax depth container + autoplay-on-intersect) ─── */
.project-media {
  transform-style: preserve-3d;
  overflow: hidden;
  position: relative;
}
.project:nth-child(even) .project-media {
  transform: perspective(900px) rotateY(-1.2deg);
}
.project:nth-child(odd) .project-media {
  transform: perspective(900px) rotateY(1.2deg);
}
.project-media,
.project-media .project-video {
  transition: transform 0.7s cubic-bezier(0.16,1,0.3,1);
}
@media (hover: hover) and (pointer: fine) {
  .project:hover .project-media {
    transform: perspective(900px) rotateY(0deg) scale(1.025) !important;
  }
  .project:hover .project-video {
    transform: scale(1.05);
  }
}
/* Subtle Y parallax driven by JS via --proj-parallax CSS var (0 to 1) */
.project-media .project-video {
  will-change: transform;
}

/* ─── SHOPIFY-EDITIONS-LEVEL SECTION TRANSITIONS ──────────────
   Ambient depth glow that drifts per section. JS sets --sec-progress
   (0 → 1) as the section moves through the viewport. No opacity hits
   on the section itself — only on a decorative ::after layer. */
.coverage,
.brands,
.section.stats,
.section.services,
.section.projects,
.section.process,
.section.tests,
.section.final-cta {
  position: relative;
  isolation: isolate;
}
.coverage::after,
.brands::after,
.section.stats::after,
.section.services::after,
.section.projects::after,
.section.process::after,
.section.tests::after,
.section.final-cta::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  background:
    radial-gradient(
      900px 500px at 50% calc(20% + var(--sec-progress, 0) * 60%),
      rgba(107,63,212,0.05) 0%,
      transparent 60%
    );
  transition: opacity 0.8s ease;
}
.coverage.section-visible::after,
.brands.section-visible::after,
.section.section-visible::after {
  opacity: 1;
}
/* Keep all real content above the ambient layer */
.coverage > *,
.brands > *,
.section > * { position: relative; z-index: 1; }

/* Section-divider hairline draws on scroll-in */
.section + .section { position: relative; }
.section + .section::before {
  background: linear-gradient(to bottom, transparent, rgba(45,212,191,0.06) 40%, transparent);
}

/* ─── MOBILE ─── */
@media (max-width: 768px) {
  .walkthrough-wrapper { height: auto !important; min-height: 60vh; }
  .living-room-scene { position: relative; height: 60vh; }
  /* Simplify section animations on mobile */
  .service:nth-child(3n+2),
  .service:nth-child(3n+3) { transform: translateY(0) !important; }
  .section::before { height: 40px; }
  .stats { position: relative; }
  /* Typography animation — no stagger on mobile */
  .section-title .word { transition-delay: 0s !important; }
}
@media (hover: none) and (pointer: coarse) {
  .living-room-scene { position: relative; }
}

/* ─── BULLETPROOF PAST-HERO HIDE ──────────────────────────────────
   index.html's inline `body.past-hero ... { opacity:0 !important }`
   was being beaten by JS-set inline opacity on the hero video +
   title-block (mobile scrub sets style.opacity continuously), so the
   hero typography bled over Projects on phones. visibility:hidden
   CANNOT be overridden by an inline opacity value — this rule lives
   in enhancements.css which loads AFTER the inline <style>, so it
   wins the cascade. */
body.past-hero .hero-video-1,
body.past-hero .hero-video-2,
body.past-hero .title-block,
body.past-hero .chrome,
body.past-hero .constellation,
body.past-hero .stage,
body.past-hero .rail-l,
body.past-hero .rail-r,
body.past-hero #reach-arcs,
body.past-hero #grain,
body.past-hero .scroll-indicator {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* ============================================================
   WALKTHROUGH SCENE HOTSPOTS — built by initWalkthroughInteractiveV2.
   Only the hotspot for the chapter currently on screen is visible.
   ============================================================ */
.lr-hitboxes {
  position: absolute; inset: 0;
  pointer-events: none;
  z-index: 5;
}
.lr-hitbox {
  position: absolute;
  background: transparent;
  /* Inactive hitboxes fully hidden; border + label render once active. */
  border: 2px dashed transparent;
  border-radius: 14px;
  padding: 0;
  pointer-events: none;
  cursor: default;
  outline: none;
  opacity: 0;
  visibility: hidden;
  transition:
    visibility 0s linear 0.4s,
    opacity 0.4s ease,
    border-color 0.35s ease,
    background 0.35s ease,
    box-shadow 0.35s ease,
    transform 0.4s cubic-bezier(0.16,1,0.3,1);
}
.lr-hitbox-label {
  position: absolute;
  top: -26px; left: 6px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.44em;
  color: rgba(250, 250, 249, 0.4);
  text-transform: uppercase;
  pointer-events: none;
  transition: color 0.35s ease;
  white-space: nowrap;
}
.lr-hitbox-hint {
  color: rgba(250, 250, 249, 0.22);
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.lr-hitbox.is-active {
  pointer-events: auto;
  cursor: pointer;
  opacity: 1;
  visibility: visible;
  transition-delay: 0s;
  /* No hard dashed "click line" — a soft breathing teal glow invites the click instead. */
  border-color: transparent;
  background: rgba(45, 212, 191, 0.03);
  animation: hitbox-breathe 2.6s ease-in-out infinite;
}
@keyframes hitbox-breathe {
  0%, 100% {
    background: rgba(45, 212, 191, 0.03);
    box-shadow: inset 0 0 60px rgba(45,212,191,0.06), 0 0 0 0 rgba(45,212,191,0);
  }
  50% {
    background: rgba(45, 212, 191, 0.07);
    box-shadow: inset 0 0 100px rgba(45,212,191,0.16), 0 0 54px rgba(45,212,191,0.20);
  }
}
.lr-hitbox.is-active .lr-hitbox-label {
  color: rgba(45, 212, 191, 0.95);
}
.lr-hitbox.is-active .lr-hitbox-hint {
  color: rgba(45, 212, 191, 0.5);
}
@media (hover: hover) {
  .lr-hitbox.is-active:hover {
    animation: none;
    border-color: transparent;
    background: rgba(45, 212, 191, 0.11);
    box-shadow:
      0 0 64px rgba(45, 212, 191, 0.45),
      inset 0 0 60px rgba(45, 212, 191, 0.16);
    transform: scale(1.008);
  }
  .lr-hitbox.is-active:hover .lr-hitbox-label {
    color: var(--ivory);
  }
}
.lr-hitbox.is-active:active {
  background: rgba(45, 212, 191, 0.18) !important;
  transform: scale(0.995);
  transition-duration: 100ms;
}
.lr-hitbox.was-clicked {
  background: rgba(45, 212, 191, 0.18) !important;
}
@keyframes hitbox-click-pulse {
  0%   { transform: scale(1.02); box-shadow: 0 0 64px rgba(45,212,191,0.6), inset 0 0 48px rgba(45,212,191,0.2); }
  100% { transform: scale(1);    box-shadow: 0 0 48px rgba(45,212,191,0.25), inset 0 0 24px rgba(45,212,191,0.06); }
}

/* Positions per scene — coordinates relative to the .living-room-scene
   (which is 100vh, video object-fit:cover at the source aspect 16:9).
   Initial estimates from the Chrome-filmed positions of the 3D letters. */
.lr-hitbox[data-scene="experience"] { left: 24%; top: 44%; width: 52%; height: 30%; }
.lr-hitbox[data-scene="technology"] { left: 38%; top: 26%; width: 56%; height: 52%; }
.lr-hitbox[data-scene="play"]       { left: 13%; top: 48%; width: 38%; height: 32%; }

@media (max-width: 768px) {
  /* Mobile uses tap on the whole scene — fine-grained hitboxes deferred */
  .lr-hitbox { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .lr-hitbox { transition: none; }
  .lr-hitbox.was-clicked { animation: none; }
}

/* ============================================================
   EFFECT A — CHAPTER PAGE-BREAK (Shopify Editions)
   Full-viewport editorial moment between Services and Projects.
   Sticky-pinned, line-mask typography reveal on IO entry.
   ============================================================ */
.chapter-break {
  position: relative;
  /* Gradient lives on the SECTION (not the sticky pin) so the area
     after the pin scrolls past still has the same ambient color —
     no "box of obsidian-black nothing" after the line-mask reveal. */
  background:
    radial-gradient(1200px 800px at 50% 45%, rgba(107,63,212,0.14) 0%, transparent 65%),
    radial-gradient(900px 600px at 50% 85%, rgba(45,212,191,0.07) 0%, transparent 60%),
    var(--obsidian);
  /* Tightened from 200vh → 150vh. Pin sticks for 50vh of scroll
     (just enough for the line reveal to complete + a beat), then
     transitions cleanly into Projects. */
  height: 150vh;
  z-index: 4;
  overflow: hidden;
}
.chapter-break::before { display: none; }
.chapter-pin {
  position: sticky; top: 0;
  height: 100vh;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.chapter-bg {
  /* Bg moved to .chapter-break itself. This element is now decorative
     only — leave it so the markup stays consistent but invisible. */
  display: none;
}
.chapter-content {
  position: relative;
  text-align: center;
  color: var(--ivory);
  max-width: min(900px, 88vw);
  padding: 0 24px;
}
.chapter-num {
  font-family: var(--mono);
  font-size: clamp(36px, 5vw, 64px);
  font-weight: 400;
  letter-spacing: 0.08em;
  color: var(--ivory-dim);
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s ease, transform 0.9s cubic-bezier(0.16,1,0.3,1);
}
.chapter-divider {
  width: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--teal), transparent);
  margin: 28px auto;
  box-shadow: 0 0 16px rgba(45,212,191,0.4);
  transition: width 1.1s cubic-bezier(0.16,1,0.3,1) 0.3s;
}
.chapter-title {
  font-family: var(--sans);
  font-size: clamp(56px, 10vw, 160px);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 0.95;
  margin: 0;
}
.chapter-title em {
  font-family: 'Playfair Display', var(--sans);
  font-style: italic;
  font-weight: 500;
  color: var(--purple-3);
}
.chapter-line {
  display: block;
  overflow: hidden;
  padding: 0.05em 0;
}
.chapter-line-inner {
  display: block;
  transform: translateY(110%);
  transition: transform 1s cubic-bezier(0.16,1,0.3,1);
}
.chapter-tag {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.44em;
  text-transform: uppercase;
  color: var(--ivory-faint);
  margin-top: 36px;
  opacity: 0;
  transition: opacity 0.6s ease 1s;
}
.chapter-tag::before {
  content: '↓ ';
  color: var(--teal);
  margin-right: 6px;
}
.chapter-break.active .chapter-num { opacity: 1; transform: translateY(0); }
.chapter-break.active .chapter-divider { width: 96px; }
.chapter-break.active .chapter-line:nth-child(1) .chapter-line-inner { transform: translateY(0); transition-delay: 0.4s; }
.chapter-break.active .chapter-line:nth-child(2) .chapter-line-inner { transform: translateY(0); transition-delay: 0.55s; }
.chapter-break.active .chapter-tag { opacity: 1; }
@media (max-width: 768px) {
  .chapter-break { height: 100vh; }
  .chapter-title { font-size: clamp(44px, 12vw, 80px); }
}
@media (prefers-reduced-motion: reduce) {
  .chapter-break { height: auto; min-height: 50vh; padding: 60px 0; }
  .chapter-pin { position: relative; height: auto; }
  .chapter-num, .chapter-line-inner, .chapter-tag { transform: none !important; opacity: 1 !important; }
  .chapter-divider { width: 96px !important; }
}

/* ============================================================
   EFFECT B — STICKY SERVICE CYCLER
   Services section pins to viewport. Scroll cycles the active
   card through 1→9 with a floating HUD progress indicator.
   ============================================================ */
@media (min-width: 769px) and (prefers-reduced-motion: no-preference) {
  /* Nine cards need enough travel that a normal wheel gesture cannot skip
     several states. 650vh yields about 55vh of usable travel per card while
     the sticky grid continues to occupy the full viewport. */
  body.cycler-active .section.services {
    min-height: 650vh;
  }
  body.cycler-active .section.services .services-grid {
    position: sticky;
    top: 0;
    height: 100vh;
    align-content: center;   /* center the grid contents vertically */
    z-index: 1;
  }
  /* Section-intro is no longer sticky — let it scroll past naturally.
     The HUD pill at viewport bottom carries the section context now. */
  body.cycler-active .section.services .service {
    transition:
      transform 0.6s cubic-bezier(0.16,1,0.3,1),
      opacity 0.5s ease,
      box-shadow 0.6s ease,
      border-color 0.4s ease !important;
  }
  body.cycler-active .section.services .service.is-cycle-active {
    transform: translateY(-10px) scale(1.04) !important;
    box-shadow:
      0 0 0 1px var(--teal),
      0 20px 60px rgba(45,212,191,0.18),
      0 0 80px rgba(45,212,191,0.10);
    border-color: var(--teal) !important;
    z-index: 3;
  }
  body.cycler-active .section.services .service.is-cycle-dim {
    opacity: 0.32;
    transform: scale(0.97) !important;
  }
}

/* Short-viewport density: with the cycler grid pinned at 100vh, three
   card rows share the viewport. Cards need ~300px of content each —
   on laptop-height screens the rows compress (the cards' overflow:hidden
   zeroes their min-content size) and the tagline + partner line were
   clipped mid-glyph. Tighten type + padding so full content fits. */
@media (min-width: 769px) and (max-height: 920px) and (prefers-reduced-motion: no-preference) {
  body.cycler-active .section.services .service { padding: 20px 22px; }
  body.cycler-active .section.services .service-num { margin-bottom: 10px; }
  body.cycler-active .section.services .service-title { font-size: 18px; margin-bottom: 5px; }
  body.cycler-active .section.services .service-tagline { font-size: 12px; line-height: 1.45; margin-bottom: 12px; }
  body.cycler-active .section.services .service-partners { font-size: 8px; line-height: 1.5; }
}

/* Shared HUD style — used by both cycler + cinema */
.cycle-hud {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.36em;
  text-transform: uppercase;
  color: var(--ivory);
  z-index: 60;
  background: rgba(10,10,10,0.72);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  padding: 12px 24px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.05);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
  white-space: nowrap;
  display: flex; align-items: center; gap: 14px;
}
.cycle-hud.visible { opacity: 1; }
.cycle-hud-cinema.visible { pointer-events: auto; }
.cycle-hud-bar {
  display: inline-block;
  width: 100px;
  height: 2px;
  background: rgba(255,255,255,0.15);
  position: relative;
  border-radius: 2px;
  overflow: hidden;
}
.cycle-hud-bar-fill {
  position: absolute; top: 0; left: 0;
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--teal), var(--purple-2));
  transition: width 0.25s ease;
}
.cycle-hud-name {
  color: var(--teal);
  font-weight: 500;
}
.cycle-hud-cinema .cycle-hud-bar {
  height: 18px;
  overflow: visible;
  background: transparent;
  cursor: ew-resize;
  touch-action: none;
}
.cycle-hud-cinema .cycle-hud-bar::before {
  content: '';
  position: absolute;
  top: 8px;
  left: 0;
  right: 0;
  height: 2px;
  border-radius: 2px;
  background: rgba(255,255,255,0.20);
}
.cycle-hud-cinema .cycle-hud-bar-fill {
  top: 8px;
  height: 2px;
  transition: none;
}
.cycle-hud-cinema .cycle-hud-bar-fill::after {
  content: '';
  position: absolute;
  top: 50%;
  right: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 12px rgba(45,212,191,0.65);
  transform: translate(50%, -50%);
}
.cycle-hud-cinema .cycle-hud-bar:focus-visible {
  outline: 2px solid var(--ivory);
  outline-offset: 4px;
  border-radius: 999px;
}

/* ============================================================
   EFFECT C — PROJECT SCROLL CINEMA
   Projects become full-bleed sticky scroll-driven scenes.
   Each project takes the viewport for ~80vh of scroll with its
   video playing, overlay sliding in from the right.
   ============================================================ */
@media (min-width: 769px) and (prefers-reduced-motion: no-preference) {
  /* PROJECT CINEMA — FIXED-POSITION variant
     Sticky positioning was fragile with body.overflow:hidden + nested
     section-intro sticky. Using position:fixed keeps the grid pinned
     to the viewport reliably. JS toggles .cinema-pinned on body when
     the section is in viewport. Section height = 740vh of phantom
     scroll, so the user has scroll-distance to cycle through projects. */
  body.cinema-active .section.projects {
    /* Eight projects × roughly 80vh each, plus the pinned viewport. */
    min-height: 740vh;
    overflow: visible;
  }
  body.cinema-active .section.projects .section-intro {
    /* Floating pill at top-center, visible only during cinema range */
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 55;
    width: max-content;
    max-width: calc(100vw - 200px);
    background: rgba(10,10,10,0.72);
    backdrop-filter: blur(16px) saturate(1.4);
    -webkit-backdrop-filter: blur(16px) saturate(1.4);
    padding: 10px 24px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.08);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
  }
  body.cinema-pinned .section.projects .section-intro {
    opacity: 1;
  }
  body.cinema-active .section.projects .section-intro .section-title {
    font-size: 13px !important;
    margin: 0 !important;
    font-weight: 500;
    color: var(--ivory);
    letter-spacing: 0.04em;
  }
  body.cinema-active .section.projects .section-intro .section-title em {
    color: var(--teal); font-style: normal;
  }
  body.cinema-active .section.projects .section-intro .section-eyebrow {
    display: none !important;
  }
  body.cinema-active .section.projects::after {
    display: none; /* disable ambient gradient layer over video */
  }
  body.cinema-active .projects-grid {
    /* Fixed-position cinema container. Visibility/pointer-events
       toggled via body.cinema-pinned. */
    position: fixed;
    top: 0; left: 0;
    width: 100vw;
    height: 100vh;
    max-width: none !important;
    display: block !important;
    padding: 0 !important;
    gap: 0 !important;
    margin: 0 !important;
    overflow: hidden;
    z-index: 4;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
  }
  body.cinema-active:not(.cinema-pinned) .projects-grid {
    display: none !important;
  }
  body.cinema-pinned .projects-grid {
    opacity: 1;
    pointer-events: auto;
  }
  /* Belt-and-braces vs the fixed cinema grid (z4): the 3D X-Ray Tours section
     above the cinema must NEVER be covered or lose clicks to it. */
  body.cinema-active .section.projects-tours {
    z-index: 5;
  }
  body.cinema-active .projects-grid > .project {
    position: absolute !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    display: flex !important;
    align-items: flex-end !important;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.7s cubic-bezier(0.16,1,0.3,1);
    border-radius: 0 !important;
    border: none !important;
    overflow: hidden;
    background: var(--obsidian);
    transform: none !important;
  }
  body.cinema-active .projects-grid > .project.is-cinema-active {
    opacity: 1;
    pointer-events: auto;
    z-index: 2;
  }
  body.cinema-active .projects-grid .project-media {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    transform: none !important;
    border-radius: 0 !important;
    margin: 0 !important;
    overflow: hidden;
  }
  body.cinema-active .projects-grid .project-video {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important; height: 100% !important;
    object-fit: cover !important;
    transform: scale(1.04) !important;
    transition: transform 4s ease;
  }
  body.cinema-active .projects-grid > .project.is-cinema-active .project-video {
    transform: scale(1.10) !important;
  }
  /* Vignette + cinematic gradient over the video */
  body.cinema-active .projects-grid > .project::before {
    content: '';
    position: absolute; inset: 0;
    background:
      linear-gradient(115deg, rgba(10,10,10,0.85) 0%, rgba(10,10,10,0.4) 35%, rgba(10,10,10,0.0) 60%),
      linear-gradient(0deg, rgba(10,10,10,0.6) 0%, transparent 50%);
    z-index: 1;
    pointer-events: none;
  }
  body.cinema-active .projects-grid .project-body {
    position: relative;
    z-index: 2;
    max-width: 540px;
    padding: 48px 56px;
    margin: 0 0 80px 80px;
    color: var(--ivory);
    transform: translateX(-40px);
    opacity: 0;
    transition: transform 0.8s 0.2s cubic-bezier(0.16,1,0.3,1), opacity 0.8s 0.2s ease;
    /* Keep the copy visually above the villa without blocking the full-frame
       X-ray drag surface or trapping the handle when it moves behind copy. */
    pointer-events: none;
  }
  body.cinema-active .projects-grid .project-body a,
  body.cinema-active .projects-grid .project-body button {
    pointer-events: auto;
  }
  body.cinema-active .projects-grid > .project.is-cinema-active .project-body {
    transform: translateX(0);
    opacity: 1;
  }
  body.cinema-active .projects-grid .project-loc {
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.4em;
    text-transform: uppercase;
    color: var(--teal);
    margin-bottom: 16px;
  }
  body.cinema-active .projects-grid .project-name {
    font-family: var(--sans);
    font-size: clamp(36px, 4vw, 56px);
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.05;
    margin: 0 0 16px;
    color: var(--ivory);
  }
  body.cinema-active .projects-grid .project-desc {
    font-size: 15px;
    line-height: 1.55;
    color: rgba(250,250,249,0.78);
    max-width: 460px;
  }
}

/* Cinema reduced-motion / mobile fallback — keep the current grid layout. */
@media (max-width: 768px), (prefers-reduced-motion: reduce) {
  body.cinema-active .section.projects { min-height: 0 !important; }
  body.cinema-active .projects-grid { position: relative !important; height: auto !important; }
  body.cinema-active .projects-grid > .project { position: relative !important; height: auto !important; opacity: 1 !important; transform: none !important; pointer-events: auto !important; display: block !important; }
}

/* ============================================================
   PHASE 3 — 3-VIDEO LAYERED WALKTHROUGH + DISK SELECTOR
   Three Grok-generated scene videos layered over each other,
   visibility driven by body.lr-phase-* class on scroll progress.
   ============================================================ */
.lr-scene-layers {
  position: absolute; inset: 0;
  z-index: 1;
  pointer-events: none;
}
.lr-scene-video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0;
  transition:
    opacity 0.9s cubic-bezier(0.16,1,0.3,1),
    transform 1.2s cubic-bezier(0.16,1,0.3,1),
    filter 0.6s ease;
  filter: saturate(1.08) contrast(1.04);
}

/* Phase visibility — only one scene visible at a time */
body.lr-phase-experience .lr-scene-experience { opacity: 1; }
body.lr-phase-technology .lr-scene-technology { opacity: 1; }
body.lr-phase-play       .lr-scene-play       { opacity: 1; }

/* Camera-dolly effect for technology → play handoff */
body.lr-phase-play .lr-scene-technology {
  transform: scale(1.15);
  opacity: 0;
}
body.lr-phase-technology .lr-scene-play {
  transform: scale(0.94);
}

/* Veo alt clip — sits above the three scene layers while playing */
.lr-scene-alt { z-index: 1; }
.lr-scene-layers .lr-scene-alt.is-on { opacity: 1; }

/* Visually hidden, still announced */
.lr-sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ─── 2-DISK VINYL SELECTOR ────────────────────────────────── */
.lr-disk-selector {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background: rgba(6,8,14,0.62);
  backdrop-filter: blur(24px) saturate(1.25);
  -webkit-backdrop-filter: blur(24px) saturate(1.25);
  opacity: 0;
  pointer-events: none;
  z-index: 9;
  transition: opacity 200ms ease-out;
}
.lr-disk-selector.visible {
  opacity: 1;
  pointer-events: auto;
  transition: opacity 0.7s ease;
}
.lr-disk-selector-header {
  /* 88px clears the fixed topnav (~68px tall) — at 28px the title
     "Select your soundtrack" was hidden underneath it. */
  position: absolute; top: 88px; left: 0; right: 0;
  display: flex; justify-content: center; align-items: center;
}
.lr-disk-selector-title {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.52em;
  color: rgba(250,250,249,0.55);
  text-transform: uppercase;
}
.lr-disk-close {
  position: absolute;
  top: 84px; right: 28px;
  width: 38px; height: 38px;
  border-radius: 50%;
  background: rgba(0,0,0,0.6);
  border: 1px solid rgba(255,255,255,0.15);
  color: var(--ivory);
  font-size: 22px; line-height: 1;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 200ms ease, border-color 200ms ease, transform 160ms cubic-bezier(0.23,1,0.32,1);
  z-index: 2;
}
@media (hover: hover) and (pointer: fine) {
  .lr-disk-close:hover {
    background: rgba(45,212,191,0.18);
    border-color: var(--teal);
    transform: scale(1.05);
  }
}
.lr-disk-close:active { transform: scale(0.92); transition-duration: 100ms; }
.lr-disk-selector-disks {
  display: flex;
  gap: 96px;
  align-items: center;
}
.lr-disk {
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  text-align: center;
  transition: transform 240ms cubic-bezier(0.16,1,0.3,1);
}
@media (hover: hover) and (pointer: fine) {
  .lr-disk:hover {
    transform: scale(1.06) translateY(-6px);
  }
}
.lr-disk:active { transform: scale(0.97); transition-duration: 100ms; }
.lr-disk:focus-visible { outline: 2px solid var(--teal); outline-offset: 8px; }
.lr-disk-vinyl {
  width: 220px; height: 220px;
  border-radius: 50%;
  position: relative;
  background:
    radial-gradient(circle at 50% 50%, #1c1c1c 0%, #0e0e0e 40%, #1a1a1a 70%, #0a0a0a 100%);
  box-shadow:
    0 28px 64px rgba(0,0,0,0.7),
    inset 0 0 50px rgba(0,0,0,0.55);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.lr-disk-grooves {
  position: absolute; inset: 8%;
  border-radius: 50%;
  background:
    repeating-radial-gradient(circle at center,
      transparent 0px, transparent 2px,
      rgba(255,255,255,0.035) 3px, transparent 4px);
  pointer-events: none;
}
.lr-disk[data-track="day"] .lr-disk-vinyl::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(circle at center,
    transparent 28%,
    rgba(255,180,80,0.22) 36%,
    rgba(255,140,50,0.12) 52%,
    transparent 65%);
  border-radius: 50%;
  pointer-events: none;
}
.lr-disk[data-track="night"] .lr-disk-vinyl::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(circle at center,
    transparent 28%,
    rgba(80,140,255,0.22) 36%,
    rgba(50,90,220,0.12) 52%,
    transparent 65%);
  border-radius: 50%;
  pointer-events: none;
}
.lr-disk-label {
  position: relative;
  width: 86px; height: 86px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--teal) 0%, var(--purple-2) 100%);
  display: flex; align-items: center; justify-content: center;
  z-index: 2;
  box-shadow: 0 0 18px rgba(45,212,191,0.3);
}
.lr-disk-label span {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.34em;
  color: #0a0a0a;
  font-weight: 600;
}
.lr-disk-name {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.42em;
  color: rgba(250,250,249,0.6);
  text-transform: uppercase;
  margin-top: 22px;
  transition: color 0.4s ease;
}
.lr-disk.is-playing .lr-disk-vinyl {
  animation: lr-vinyl-spin 3.6s linear infinite;
  box-shadow:
    0 28px 64px rgba(45,212,191,0.32),
    inset 0 0 50px rgba(0,0,0,0.55),
    0 0 0 1px rgba(45,212,191,0.35);
}
.lr-disk.is-playing .lr-disk-name {
  color: var(--teal);
}
@keyframes lr-vinyl-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

@media (max-width: 768px) {
  .lr-disk-selector-disks { gap: 28px; flex-direction: column; }
  .lr-disk-vinyl { width: 150px; height: 150px; }
  .lr-disk-label { width: 60px; height: 60px; }
}
@media (prefers-reduced-motion: reduce) {
  .lr-disk-selector,
  .lr-scene-video { transition: opacity 0.2s ease !important; }
  .lr-disk.is-playing .lr-disk-vinyl { animation: none !important; }
}

/* ============================================================
   HERO PLAY BUTTON — idle glow affordance + reliable hit area
   + cinematic scenes stay dark in light mode (2026-05-24).
   ============================================================ */

/* The living-room / audio cinematic scene is dark by nature — keep it dark
   in light mode (its scrub video washes out on a light bg). */
:root[data-theme="light"] #living-room-scene {
  --obsidian: #0A0A0A; --obsidian-2: #1A1A1A; --surface: #1A1A1A;
  --ivory: #FAFAF9; --ivory-dim: rgba(250,250,249,0.62);
  --ivory-faint: rgba(250,250,249,0.58); --hairline: rgba(250,250,249,0.10);
  --surface-tint: rgba(255,255,255,0.03);
  background: #0A0A0A;
}

/* (Magnetic play-button affordance styles removed 2026-07-10 with the
   button itself — the PLAY hitbox + vinyl selector are the affordance.) */

/* === Design-craft pass 2026-08-23 (apple-design / emil-design-eng) === */
/* ─── ACCESSIBILITY SIGNALS (reduced transparency / contrast / focus) ─── */
.lr-hitbox.is-active:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 4px;
}
@media (prefers-reduced-transparency: reduce) {
  .cycle-hud,
  .lr-disk-selector,
  body.cinema-active .section.projects .section-intro {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: rgba(10,10,10,0.96);
  }
}
@media (prefers-contrast: more) {
  .cycle-hud,
  body.cinema-active .section.projects .section-intro {
    background: #0A0A0A;
    border-color: rgba(250,250,249,0.6);
  }
  .lr-disk-close { border-color: var(--ivory); }
}
