/* ==========================================================================
   Scentist — home page: intro loader, scroll-scrubbed launch, FAQ
   ========================================================================== */

html[data-intro="playing"] {
  overflow: hidden;
}

/* ---------- Intro loader ---------- */
.loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #40160f; /* matches the flat background of the logo reveal video */
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.8s var(--ease), visibility 0.8s;
}

html[data-intro="playing"] .loader {
  opacity: 1;
  visibility: visible;
}

.loader__video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.loader__spinner {
  position: absolute;
  bottom: 12%;
  left: 50%;
  width: 2.25rem;
  height: 2.25rem;
  margin-left: -1.125rem;
  border: 2px solid rgb(180 138 60 / 0.25);
  border-top-color: var(--color-gold-mid);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------- Launch ---------- */
/* The header floats over the pale video, so it takes dark ink; the open phone menu switches it back to light. */
.site-header--overlay {
  position: absolute;
  inset: 0 0 auto;
  background: transparent;
  color: var(--color-burgundy);
}

.site-header--overlay .brand {
  color: inherit;
}

html[data-menu-open] .site-header--overlay {
  color: var(--color-cream);
}

/* A tall track gives the page its scroll length; the stage stays pinned while the video is scrubbed. */
.launch {
  --progress: 0; /* 0 to 1 across the whole track, written by js/launch.js */
  --play: 0; /* 0 to 1 while the video plays, written by js/launch.js */
  --reveal: 0; /* 0 to 1 once the product has been shown, written by js/launch.js */

  height: 320vh;
  background: var(--color-burgundy);
}

.launch__stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
}

.launch__video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.launch__message {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-inline: var(--gutter);
  background: radial-gradient(ellipse at center, rgb(18 7 9 / 0.7), rgb(18 7 9 / 0.5));
  backdrop-filter: blur(8px);
  color: var(--color-cream);
  text-align: center;
  opacity: var(--reveal);
  pointer-events: none;
}

.launch__title {
  margin: 0 0 1.5rem;
  padding-left: 0.3em; /* balances the trailing letter-space so the words sit centred */
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 6.5vw, 5rem);
  font-weight: 500;
  letter-spacing: 0.3em;
  line-height: 1.1;
  text-transform: uppercase;
  white-space: nowrap;
}

.launch__tagline {
  max-width: 28rem;
  margin: 0;
  font-size: clamp(0.8rem, 1.6vw, 1rem);
  font-weight: 400;
  letter-spacing: 0.12em;
  line-height: 1.9;
  opacity: 0.85;
}

/* The scroll hint. Its two phrases share one spot: "Scroll" leads into "Yes. Keep scrolling.",
   which stays until the message arrives. A hair-thin line with a shade drifting down it sits beneath. */
.launch__hint {
  position: absolute;
  bottom: 1.75rem;
  left: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  color: var(--color-burgundy);
  transform: translateX(-50%);
  pointer-events: none;
}

.launch__hint-text {
  display: grid;
  justify-items: center;
}

.launch__hint-label {
  grid-area: 1 / 1;
  font-family: var(--font-system);
  font-size: 0.8125rem;
  font-weight: 600;
  white-space: nowrap;
}

.launch__hint-label--start {
  padding-left: 0.3em; /* balances the trailing letter-space */
  letter-spacing: 0.3em;
  text-transform: uppercase;
  opacity: clamp(0, calc(1 - var(--progress) * 15), 0.8);
}

.launch__hint-label--keep {
  letter-spacing: 0.08em;
  opacity: min(clamp(0, calc((var(--play) - 0.1) * 20), 0.8), clamp(0, calc(1 - var(--reveal) * 5), 0.8));
}

.launch__pulse {
  position: relative;
  width: 1px;
  height: 3rem;
  background: linear-gradient(to bottom, transparent, rgb(59 26 32 / 0.2));
  opacity: clamp(0, calc(1 - var(--progress) * 15), 1);
  overflow: hidden;
}

.launch__pulse::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent, rgb(59 26 32 / 0.55), transparent);
  transform: translateY(-100%);
  animation: pulse 3.2s var(--ease) infinite;
}

@keyframes pulse {
  to {
    transform: translateY(100%);
  }
}

.launch[data-state="failed"] .launch__message {
  opacity: 1;
}

/* ---------- FAQ ---------- */
.faq-section {
  padding-block: clamp(4rem, 9vw, 7rem);
  border-top: 1px solid var(--color-gold);
  background: var(--color-white);
}

.faq-section__inner {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: clamp(2rem, 6vw, 6rem);
}

.faq-section__title {
  margin: 0;
  color: var(--color-gold-deep);
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 500;
  line-height: 1.1;
}

.faq {
  border-top: 1px solid var(--color-gold);
}

.faq__item {
  border-bottom: 1px solid var(--color-gold);
}

.faq__question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.25rem;
  color: var(--color-gold-deep);
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  list-style: none;
  cursor: pointer;
}

.faq__question::-webkit-details-marker {
  display: none;
}

.faq__question::after {
  content: "+";
  color: var(--color-gold);
  font-size: 2rem;
  line-height: 1;
  transition: transform 0.3s var(--ease);
}

.faq__item[open] .faq__question::after {
  transform: rotate(45deg);
}

.faq__answer {
  max-width: 38rem;
  margin: 0;
  padding-bottom: 1.5rem;
  color: var(--color-gold-ink);
}

.faq__answer a {
  color: var(--color-gold-deep);
}

/* ---------- Responsive ---------- */
/* Portrait screens: the loader video is 16:9 with a small centred logo, so zoom it in to fill the screen. */
@media (max-aspect-ratio: 23/20) {
  .loader__video {
    transform: scale(2.8);
  }
}

/* Portrait screens: crop the satin video less. It sits in the middle at twice the screen width, and its
   top and bottom edges dissolve into a backdrop matched to the pale studio colour of the footage. */
@media (max-aspect-ratio: 1/1) {
  .launch__stage {
    background: linear-gradient(90deg, rgb(222 204 186), rgb(196 175 154));
  }

  .launch__video {
    position: absolute;
    top: 50%;
    height: auto;
    aspect-ratio: 16 / 9;
    transform: translateY(-50%) scale(2);
    mask-image: linear-gradient(to bottom, transparent, #000 18%, #000 82%, transparent);
  }
}

@media (max-width: 48rem) {
  .faq-section__inner {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .loader__spinner {
    animation-duration: 3s;
  }

  .launch__pulse::after {
    animation: none;
  }
}
