/* =========================================================
   DACC Cinematic Intro, v1.0.0
   Every rule is scoped to .dacc-intro so Flatsome globals
   (h2, p, button, a) cannot leak in or out.
   ========================================================= */

.dacc-intro {
  --di-ink: #120e0c;
  --di-cream: #f3ebe0;
  --di-muted: #cbbfb2;
  --di-accent: #c9a27a;
  --di-ease: cubic-bezier(.2, .7, .1, 1);

  position: fixed;
  inset: 0;
  z-index: 99999;
  display: none;
  overflow: hidden;
  background: var(--di-ink);
  color: var(--di-cream);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

.dacc-intro:focus { outline: none; }
.dacc-intro h2,
.dacc-intro p,
.dacc-intro figure,
.dacc-intro ol { margin: 0; padding: 0; }

html.dacc-intro-on .dacc-intro { display: block; }
.dacc-intro[hidden] { display: none !important; }
.dacc-intro.is-closing { opacity: 0; transition: opacity .6s var(--di-ease); }

html.dacc-intro-open,
html.dacc-intro-open body { overflow: hidden !important; }

/* ---------- Boot shield ---------- */
.dacc-intro .dacc-intro__boot {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  background: var(--di-ink);
  transition: opacity .7s var(--di-ease), visibility .7s;
}
.dacc-intro.is-ready .dacc-intro__boot {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.dacc-intro .dacc-intro__boot-inner { width: min(260px, 70vw); text-align: center; }
.dacc-intro .dacc-intro__boot-label {
  font-size: .75rem;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--di-muted);
  margin-bottom: 18px;
}
.dacc-intro .dacc-intro__bar {
  position: relative;
  height: 2px;
  overflow: hidden;
  background: rgba(243, 235, 224, .16);
}
.dacc-intro .dacc-intro__bar-fill {
  position: absolute;
  inset: 0;
  background: var(--di-accent);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .35s linear;
}

/* ---------- Scroll container and sticky stage ---------- */
.dacc-intro .dacc-intro__scroll {
  position: absolute;
  inset: 0;
  overflow-x: hidden;
  overflow-y: auto;
  /* Mandatory snap makes a single swipe land exactly on the next scene. */
  scroll-snap-type: y mandatory;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.dacc-intro .dacc-intro__scroll::-webkit-scrollbar { display: none; }

.dacc-intro .dacc-intro__track {
  position: relative;
  height: calc(var(--dacc-count, 5) * 100%);
}

.dacc-intro .dacc-intro__stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

/* Sentinels: one full viewport each, drive IntersectionObserver */
.dacc-intro .dacc-intro__beat {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(var(--dacc-i, 0) * 100% / var(--dacc-count, 5));
  height: calc(100% / var(--dacc-count, 5));
  scroll-snap-align: start;
  pointer-events: none;
}

/* ---------- Posters ---------- */
.dacc-intro .dacc-intro__poster {
  position: absolute;
  inset: 0;
  background: var(--dacc-poster, #1d1714);
  opacity: 0;
  transition: opacity 1.2s var(--di-ease);
  will-change: opacity;
}
.dacc-intro .dacc-intro__poster.is-active { opacity: 1; }
.dacc-intro .dacc-intro__poster::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(120% 80% at 70% 20%, rgba(243, 235, 224, .08), transparent 60%),
    linear-gradient(to top, rgba(18, 14, 12, .92) 0%, rgba(18, 14, 12, .35) 45%, rgba(18, 14, 12, .15) 100%);
}

/* Scroll parallax. --dacc-p (0..1) is written by JS on the stage. */
.dacc-intro .dacc-intro__media {
  position: absolute;
  inset: -4vh 0;
  transform: translate3d(0, calc(var(--dacc-p, 0) * -4vh), 0);
}
.dacc-intro .dacc-intro__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.08);
  transition: transform 2.2s var(--di-ease);
}
.dacc-intro .dacc-intro__poster.is-active .dacc-intro__img { transform: scale(1); }
.dacc-intro .dacc-intro__poster.is-broken .dacc-intro__img { display: none; }

/* ---------- Copy beats ---------- */
.dacc-intro .dacc-intro__copy {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  align-items: end;
  pointer-events: none;
  padding: 0 clamp(20px, 6vw, 96px) clamp(132px, 22vh, 190px);
}
.dacc-intro .dacc-intro__beat-text {
  grid-area: 1 / 1;
  max-width: min(34rem, 100%);
  opacity: 0;
  transform: translate3d(0, 28px, 0);
  transition: opacity .9s var(--di-ease), transform .9s var(--di-ease);
}
.dacc-intro .dacc-intro__beat-text.is-active { opacity: 1; transform: none; }

.dacc-intro .dacc-intro__chapter {
  font-size: .72rem;
  letter-spacing: .32em;
  text-transform: uppercase;
  color: var(--di-accent);
  margin-bottom: 1.1rem;
}
.dacc-intro .dacc-intro__title {
  font-family: ui-serif, Georgia, "Times New Roman", serif;
  font-weight: 400;
  font-size: clamp(2.1rem, 6.2vw, 4.75rem);
  line-height: 1.04;
  letter-spacing: -.012em;
  color: var(--di-cream);
  margin-bottom: .75rem;
  text-wrap: balance;
}
.dacc-intro .dacc-intro__body {
  font-size: clamp(.95rem, 1.5vw, 1.12rem);
  color: var(--di-muted);
  max-width: 40ch;
}

/* ---------- Progress dots and cue ---------- */
.dacc-intro .dacc-intro__dots {
  position: absolute;
  right: clamp(14px, 3vw, 40px);
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.dacc-intro .dacc-intro__dot {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}
.dacc-intro .dacc-intro__dot::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(243, 235, 224, .35);
  transition: background .3s, transform .3s;
}
.dacc-intro .dacc-intro__dot.is-active::before {
  background: var(--di-accent);
  transform: scale(1.5);
}
.dacc-intro .dacc-intro__dot:focus-visible { outline: 2px solid var(--di-accent); outline-offset: 2px; }

.dacc-intro .dacc-intro__cue {
  position: absolute;
  left: 50%;
  bottom: calc(96px + env(safe-area-inset-bottom, 0px));
  z-index: 3;
  transform: translateX(-50%);
  font-size: .68rem;
  letter-spacing: .3em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--di-muted);
  opacity: 0;
  pointer-events: none;
  transition: opacity .6s var(--di-ease);
}
.dacc-intro[data-scene="0"] .dacc-intro__cue { opacity: .85; }

/* ---------- Boot-to-ready and dock ---------- */
.dacc-intro .dacc-intro__dock {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px clamp(16px, 4vw, 48px) calc(18px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(to top, rgba(18, 14, 12, .94), rgba(18, 14, 12, 0));
}
.dacc-intro .dacc-intro__btn {
  display: inline-flex;
  align-items: center;
  gap: .6em;
  min-height: 44px;
  padding: 12px 22px;
  border: 1px solid rgba(243, 235, 224, .42);
  border-radius: 999px;
  background: rgba(18, 14, 12, .2);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  color: var(--di-cream);
  font: inherit;
  font-size: .74rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background .3s, color .3s, border-color .3s;
}
.dacc-intro .dacc-intro__btn:hover { border-color: var(--di-cream); }
.dacc-intro .dacc-intro__btn--primary {
  background: var(--di-cream);
  border-color: var(--di-cream);
  color: var(--di-ink);
}
.dacc-intro .dacc-intro__btn--primary:hover { background: #fff; }
.dacc-intro .dacc-intro__btn:focus-visible { outline: 2px solid var(--di-accent); outline-offset: 3px; }

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .dacc-intro .dacc-intro__dots { display: none; }
  .dacc-intro .dacc-intro__copy { padding-bottom: clamp(150px, 26vh, 200px); }
  .dacc-intro .dacc-intro__btn { padding: 12px 16px; font-size: .68rem; letter-spacing: .16em; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .dacc-intro *,
  .dacc-intro *::before,
  .dacc-intro *::after {
    transition-duration: .01ms !important;
    animation: none !important;
  }
  .dacc-intro .dacc-intro__media { transform: none !important; }
  .dacc-intro .dacc-intro__scroll { scroll-behavior: auto; }
}

@media print {
  .dacc-intro { display: none !important; }
}
