/* ══════════════════════════════════════════════════════════════════════════
   DAC SCROLL INTRO  ·  homepage only (index.html)
   ══════════════════════════════════════════════════════════════════════════
   The page opens on a black screen with "Scroll down". Scrolling fades the eye
   up out of the black and then moves through the film: down pushes into the
   eye and through the tunnel, up plays it backwards. At the end the website
   slides up over it like a sheet of paper.

   Logic: assets/js/intro.js   Frames: assets/intro/   Animations: Framer Motion
   Every class here is prefixed  .dac-intro  so nothing else on the page clashes.
   ══════════════════════════════════════════════════════════════════════════ */

:root {
  --dac-stage-h: 100vh;
  --dac-ink: #05030a;
  --dac-purple: #B026FF;
  --dac-pad: clamp(16px, 2.8vw, 40px);
  --dac-ease: cubic-bezier(.22, .61, .36, 1);
}
@supports (height: 100svh) { :root { --dac-stage-h: 100svh; } }

/* nothing here shows unless the <head> script switched the intro on */
#dacIntro { display: none; }
html.dac-intro-on #dacIntro { display: block; }

html.dac-intro-on { background: var(--dac-ink); scrollbar-gutter: stable; }
html.dac-in-intro { scrollbar-color: rgba(244,242,239,.28) var(--dac-ink); }   /* dark scrollbar beside the film */

/* coming back from another DAC page: start on the hero, no flash of the film */
html.dac-intro-jumping { background: #EDEEF5; }
html.dac-intro-jumping .dac-intro { background: transparent; }
html.dac-intro-jumping .dac-intro__stage { visibility: hidden; }

/* ── the website, as a sheet that slides up over the film ── */
html.dac-intro-on #root {
  position: relative;
  margin-top: calc(-1 * var(--dac-stage-h));
  background: #EDEEF5;
  border-radius: clamp(18px, 2.4vw, 34px) clamp(18px, 2.4vw, 34px) 0 0;
  overflow: clip;
  box-shadow: 0 -34px 90px rgba(0, 0, 0, .55);
}
html.dac-intro-on #root::before {
  content: ''; position: absolute; z-index: 5; top: 0; left: 10%; right: 10%; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(176,38,255,.9), rgba(232,121,249,.9), rgba(176,38,255,.9), transparent);
  box-shadow: 0 0 22px 2px rgba(176,38,255,.45);
  pointer-events: none;
}

/* ── the site's own floating bits stay out of the way during the film ── */
html.dac-in-intro #root nav.fixed { opacity: 0 !important; translate: 0 -100%; pointer-events: none; }
html.dac-in-intro #root .fixed.origin-left { opacity: 0 !important; }
#root .fixed.bottom-4.left-4 { transition: opacity .5s var(--dac-ease), translate .6s var(--dac-ease), visibility .5s; }
html.dac-in-intro #root .fixed.bottom-4.left-4 { opacity: 0 !important; translate: 0 24px; visibility: hidden; }
html.dac-in-intro .dacb-fab,
html.dac-in-intro .dacb-teaser,
html.dac-in-intro .dacx-tab { visibility: hidden; opacity: 0 !important; pointer-events: none; }
html.dac-intro-on:not(.dac-in-intro) .dacb-fab,
html.dac-intro-on:not(.dac-in-intro) .dacx-tab { animation: dacIntroFadeIn .6s var(--dac-ease) both; }
@keyframes dacIntroFadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ══ THE SCROLL TRACK + PINNED STAGE ══
   Track height = the stage itself + the film (length × screen) + one more
   screen for the website to slide up over it. --dac-intro-len comes from
   DAC_INTRO.length in <head>.                                              */
.dac-intro {
  position: relative;
  height: calc((var(--dac-intro-len, 5) + 2) * var(--dac-stage-h));
  background: var(--dac-ink);
  color: #fff;
  font-family: 'Outfit', system-ui, -apple-system, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
}
.dac-intro__stage { position: sticky; top: 0; height: var(--dac-stage-h); overflow: hidden; }
.dac-intro__cam { position: absolute; inset: 0; transform: scale(1.04); will-change: transform; }
.dac-intro__cam canvas { display: block; width: 100%; height: 100%; background: var(--dac-ink); }
.dac-intro__vig {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 88% 92% at 50% 50%, transparent 48%, rgba(5,3,10,.28) 80%, rgba(5,3,10,.76) 100%),
    linear-gradient(to bottom, rgba(5,3,10,.45), transparent 20%, transparent 78%, rgba(5,3,10,.55));
}
/* soft dark pool behind whichever headline is showing, so it reads over the bright iris */
.dac-intro__veil {
  position: absolute; inset: 0; pointer-events: none; opacity: 0; z-index: 1;
  background: radial-gradient(ellipse 52% 40% at 50% 50%, rgba(5,3,10,.62) 0%, rgba(5,3,10,.35) 45%, rgba(5,3,10,0) 75%);
}
.dac-intro__scrim { position: absolute; inset: 0; background: var(--dac-ink); opacity: 0; pointer-events: none; z-index: 6; }

/* ── the opening: plain black with "Scroll down"; scrolling dissolves it into the eye ── */
.dac-intro__black {
  position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: var(--dac-ink);
}
.dac-intro__hint {
  position: absolute; inset: 0; z-index: 3; pointer-events: none;
  display: grid; place-items: center;
}
.dac-intro__hint-in { display: flex; flex-direction: column; align-items: center; gap: 20px; opacity: 0; }
.dac-intro__hint-in span {
  font-weight: 500; font-size: 11px; line-height: 1; letter-spacing: .42em; text-transform: uppercase;
  color: rgba(244,242,239,.74);
  padding-left: .42em;                 /* letter-spacing adds space on the right only; this re-centres it */
}
.dac-intro__line { position: relative; display: block; width: 1px; height: 64px; background: rgba(244,242,239,.16); overflow: hidden; }
.dac-intro__line::after {
  content: ''; position: absolute; left: 0; top: 0; width: 1px; height: 24px;
  background: linear-gradient(rgba(244,242,239,0), #f4f2ef);
  animation: dacDrip 2s cubic-bezier(.65, 0, .35, 1) infinite;
}
.dac-intro__chev {
  display: block; width: 9px; height: 9px; margin-top: -14px;
  border-right: 1px solid rgba(244,242,239,.85); border-bottom: 1px solid rgba(244,242,239,.85);
  transform: rotate(45deg);
  animation: dacNudge 2s cubic-bezier(.65, 0, .35, 1) infinite;
}
@keyframes dacDrip  { 0% { transform: translateY(-24px); } 75%, 100% { transform: translateY(64px); } }
@keyframes dacNudge { 0%, 55% { transform: translateY(0) rotate(45deg); opacity: .55; } 75% { transform: translateY(5px) rotate(45deg); opacity: 1; } 100% { transform: translateY(0) rotate(45deg); opacity: .55; } }

/* ── headline beats (each one fades in and out at its own scroll range) ── */
.dac-intro__beat {
  position: absolute; inset: 0; z-index: 4;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 0 clamp(20px, 7vw, 120px); text-align: center;
  pointer-events: none; visibility: hidden;
}
.dac-intro__beat .x { display: inline-block; opacity: 0; will-change: transform, opacity, filter; }
.dac-intro__eyebrow {
  display: inline-flex; align-items: center; gap: .7rem; margin: 0 0 1.7rem;
  font-weight: 600; font-size: 11px; line-height: 1; letter-spacing: .34em; text-transform: uppercase;
  color: rgba(255,255,255,.74); text-shadow: 0 1px 14px rgba(0,0,0,.9);
}
.dac-intro__eyebrow::before {
  content: ''; width: 6px; height: 6px; border-radius: 99px;
  background: var(--dac-purple); box-shadow: 0 0 12px var(--dac-purple);
}
.dac-intro__h {
  margin: 0;
  font-weight: 300; font-size: clamp(42px, 7.6vw, 122px); line-height: .98; letter-spacing: -.045em;
  color: #fff; text-shadow: 0 2px 44px rgba(0,0,0,.6);
}
.dac-intro__h--sm { font-size: clamp(32px, 4.6vw, 72px); }
.dac-intro__h em {
  font-style: normal; font-weight: 500;
  background: linear-gradient(100deg, #EBD4FF 0%, #C77DFF 45%, #F5C2FF 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: none; padding-right: .04em;
}
.dac-intro__sub {
  margin: 1.5rem 0 0; max-width: 38ch;
  font-weight: 400; font-size: clamp(14px, 1.15vw, 17px); line-height: 1.55; letter-spacing: .01em;
  color: rgba(255,255,255,.78); text-shadow: 0 1px 14px rgba(0,0,0,.9);
}
.dac-intro__badge {
  width: clamp(96px, 10vw, 140px); height: auto; margin-bottom: 1.6rem;
  filter: drop-shadow(0 0 44px rgba(176,38,255,.55));
}

/* ── the DAC logo, top left ── */
.dac-intro__top {
  position: absolute; z-index: 5; top: 0; left: 0;
  padding: calc(var(--dac-pad) * .8 + env(safe-area-inset-top)) 0 0 calc(var(--dac-pad) + env(safe-area-inset-left));
  opacity: 0;
}
.dac-intro__brand { display: flex; align-items: center; gap: .6rem; color: #fff; }
.dac-intro__brand img { width: 32px; height: 32px; border-radius: 999px; flex-shrink: 0; }
.dac-intro__brand b { font-weight: 800; font-size: 1.4rem; letter-spacing: -.05em; line-height: 1; }
.dac-intro__brand span {
  font-weight: 600; font-size: .6rem; letter-spacing: .32em; white-space: nowrap; color: rgba(255,255,255,.7);
  padding-left: .75rem; margin-left: .1rem; border-left: 1px solid rgba(255,255,255,.25);
}

/* if the Framer Motion file ever fails to load, plain CSS fades these in */
.dac-intro.no-motion .dac-intro__top,
.dac-intro.no-motion .dac-intro__hint-in { opacity: 1; transition: opacity 1.2s ease .2s; }

/* ── phones ── */
@media (max-width: 640px) {
  .dac-intro__brand span { display: none; }
  .dac-intro__brand b { font-size: 1.25rem; }
  .dac-intro__brand img { width: 28px; height: 28px; }
  .dac-intro__eyebrow { font-size: 10px; letter-spacing: .26em; margin-bottom: 1.3rem; }
  .dac-intro__veil { background: radial-gradient(ellipse 85% 42% at 50% 50%, rgba(5,3,10,.66) 0%, rgba(5,3,10,.38) 50%, rgba(5,3,10,0) 80%); }
}
@media (max-height: 520px) and (orientation: landscape) {
  .dac-intro__h { font-size: clamp(30px, 9vh, 56px); }
  .dac-intro__sub { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .dac-intro__line::after, .dac-intro__chev { animation: none; }
}
