/* The pinned stage, its layers and captions. Screens inside the layers are styled in webapp.css and phone.css. */
:root {
  --night: #0b0418;
  --plum: #200940;
  --pink: #ef118e;
  --purple: #5a29a9;
  --cream: #f5f1e9;
  --lavender: #cfc6e6;
  --font: 'Poppins', Arial, sans-serif;
  --gutter: 16px;
}
* { box-sizing: border-box; }
/* Copied product styles set display on some pieces; the hidden attribute must still hide them. */
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--night); color: var(--cream); font-family: var(--font); }
/* One snap stop per scene, and scroll-snap-stop keeps a fling from skipping any of them. */
html { scroll-snap-type: y mandatory; }
.snapPages { position: absolute; top: 0; left: 0; width: 1px; pointer-events: none; }
.snapPage { height: 100vh; scroll-snap-align: start; scroll-snap-stop: always; }

#stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}
#world { position: absolute; inset: 0; width: 100%; height: 100%; }
/* The tall track holds the pinned stage, so the stage stays in view for the whole scroll. */
#track { position: relative; }

.layer {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.layer .browser, .layer .iphone { pointer-events: auto; }

.introLayer {
  display: grid;
  place-content: start center;
  padding-top: 12vh;
  text-align: center;
}
.introLayer .eyebrow { margin: 0; font-weight: 300; font-size: clamp(1rem, 2vw, 1.4rem); letter-spacing: 0.02em; }
.introLayer .eyebrow span { color: var(--pink); font-weight: 500; }
.introLayer h1 { margin: 0.2em 0 0; font-size: clamp(2.6rem, 7vw, 5.5rem); font-weight: 700; letter-spacing: -0.03em; }

.caption {
  position: absolute;
  left: var(--gutter);
  right: var(--gutter);
  bottom: 5vh;
  margin: 0;
  text-align: center;
  font-size: clamp(1.1rem, 2.4vw, 1.75rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  text-shadow: 0 2px 18px rgba(11, 4, 24, 0.9);
  opacity: 0;
  transform: translateY(8px);
}
.caption.isIn { opacity: 1; transform: none; transition: opacity 0.5s ease, transform 0.5s ease; }

.soundToggle {
  position: absolute;
  top: var(--gutter);
  right: var(--gutter);
  z-index: 40;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid rgba(207, 198, 230, 0.35);
  border-radius: 999px;
  background: rgba(11, 4, 24, 0.6);
  color: var(--cream);
  font: 500 13px var(--font);
  cursor: pointer;
}
.soundToggle:hover, .soundToggle:focus-visible { border-color: var(--pink); }
.soundToggle:focus-visible { outline: 2px solid var(--pink); outline-offset: 2px; }

.sceneDots {
  position: absolute;
  right: var(--gutter);
  top: 50%;
  z-index: 35;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transform: translateY(-50%);
}
.sceneDots button {
  width: 10px;
  height: 10px;
  padding: 0;
  border: 1.5px solid var(--lavender);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}
.sceneDots button[aria-current='step'] { background: var(--pink); border-color: var(--pink); transform: scale(1.3); }
.sceneDots button:focus-visible { outline: 2px solid var(--pink); outline-offset: 3px; }

.nextHint {
  position: absolute;
  left: 50%;
  bottom: calc(5vh + 2.6em);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin: 0;
  color: var(--lavender);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0;
  transform: translateX(-50%);
  transition: opacity 0.4s ease;
  pointer-events: none;
}
.nextHint.isIn { opacity: 1; }
.nextHint i { animation: nudge 1.4s ease-in-out infinite; }
@keyframes nudge { 50% { transform: translateY(5px); } }

.loading, .failed {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  margin: 0;
  padding: var(--gutter);
  text-align: center;
  color: var(--lavender);
}
.failed { display: none; }
.failed a { color: var(--pink); }
#stage.isReady .loading, #stage.hasFailed .loading { display: none; }
#stage.hasFailed .failed { display: grid; }

@media (prefers-reduced-motion: reduce) {
  .caption.isIn { transition: none; }
  .nextHint i { animation: none; }
}
@media (max-width: 900px) {
  .sceneDots { right: 6px; gap: 8px; }
  .sceneDots button { width: 8px; height: 8px; }
}
