/* ============================================================
   AirPods Max Showcase — style.css
   Apple-inspired minimalism. System font stack, no webfont fetch.
   ============================================================ */

:root {
  --accent: #e8e8ea;
  --accent-knit: #f0f0f2;
  --ink: #f5f5f7;
  --ink-soft: rgba(245, 245, 247, 0.62);
  --ink-faint: rgba(245, 245, 247, 0.38);
  --glass-bg: rgba(255, 255, 255, 0.08);
  --glass-stroke: rgba(255, 255, 255, 0.14);
  --glass-blur: blur(18px) saturate(1.4);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-soft: cubic-bezier(0.4, 0, 0.2, 1);
  --font-stack: -apple-system, BlinkMacSystemFont, "Inter", "SF Pro Display",
    "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --stage: 0;
}

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

html,
body {
  height: 100%;
}

body {
  font-family: var(--font-stack);
  background: #000;
  color: var(--ink);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--accent);
  color: #000;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

/* ---------- 3D canvas — fixed, behind everything ---------- */

#scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  background: radial-gradient(120% 90% at 50% 38%, #1c1c1e 0%, #0a0a0c 55%, #000 100%);
}

#scene canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
  outline: none;
}

/* leader-line overlay sits above canvas, below copy */
#leaders {
  position: fixed;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
}

#leaders line {
  stroke: rgba(255, 255, 255, 0.55);
  stroke-width: 1;
  stroke-dasharray: 3 5;
  opacity: 0;
  transition: opacity 0.5s var(--ease-soft);
}

#leaders circle {
  fill: none;
  stroke: rgba(255, 255, 255, 0.9);
  stroke-width: 1.4;
  opacity: 0;
  transition: opacity 0.5s var(--ease-soft);
}

#leaders .leader-dot {
  fill: var(--accent);
  stroke: none;
}

#leaders.is-active line,
#leaders.is-active circle {
  opacity: 1;
}

/* ---------- Scroll container + sections ---------- */

#scroll {
  position: relative;
  z-index: 2;
}

.stage {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 9vh 6vw;
  background: transparent;
  pointer-events: none;
}

.stage a,
.stage button,
.stage .interactive {
  pointer-events: auto;
}

.stage-copy {
  max-width: 640px;
  pointer-events: none;
}

.stage-copy--right {
  margin-left: auto;
  text-align: right;
  align-items: flex-end;
}

.stage-copy--center {
  margin-inline: auto;
  text-align: center;
  max-width: 820px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}

.eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: var(--accent);
  opacity: 0.7;
}

.stage-copy--center .eyebrow::before,
.stage-copy--right .eyebrow::before {
  display: none;
}

.display {
  margin-top: 16px;
  font-size: clamp(48px, 7.2vw, 96px);
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: -0.03em;
}

.display em {
  font-style: normal;
  background: linear-gradient(92deg, var(--accent) 0%, #fff 55%, var(--accent-knit) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.lede {
  margin-top: 20px;
  font-size: clamp(16px, 1.35vw, 20px);
  font-weight: 400;
  line-height: 1.55;
  letter-spacing: -0.01em;
  color: var(--ink-soft);
  max-width: 48ch;
}

.stage-copy--center .lede {
  margin-inline: auto;
}

.stage-copy--right .lede {
  margin-left: auto;
}

.micro {
  margin-top: 14px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--ink-faint);
}

/* ---------- Glass HUD ---------- */

.hud {
  position: fixed;
  z-index: 10;
  pointer-events: none;
}

.hud--top {
  top: 22px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 980px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
  background: var(--glass-bg);
  border: 1px solid var(--glass-stroke);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.28);
  white-space: nowrap;
}

.badge--dot::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
}

.badge--ghost {
  font-weight: 500;
  color: var(--ink-soft);
}

/* ---------- Callout cards (JS positions via transform) ---------- */

.callout {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 5;
  max-width: 230px;
  padding: 14px 16px;
  border-radius: 18px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-stroke);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.45s var(--ease-soft);
  will-change: transform;
}

.callout.is-visible {
  opacity: 1;
}

.callout h4 {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.callout p {
  margin-top: 5px;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--ink-soft);
}

.callout .chip {
  display: inline-block;
  margin-top: 9px;
  padding: 3px 9px;
  border-radius: 980px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #000;
  background: var(--accent);
}

/* ---------- Swatch bar ---------- */

#swatches {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  border-radius: 980px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-stroke);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

#swatches button[data-color] {
  position: relative;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--swatch, #c8c8c8);
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow: inset 0 -3px 8px rgba(0, 0, 0, 0.22), inset 0 3px 6px rgba(255, 255, 255, 0.35);
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out);
  pointer-events: auto;
}

#swatches button[data-color]:hover {
  transform: scale(1.16);
}

#swatches button[data-color]:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

#swatches button[data-color].is-active {
  transform: scale(1.22);
  box-shadow: 0 0 0 2px #000, 0 0 0 3.5px rgba(255, 255, 255, 0.95),
    inset 0 -3px 8px rgba(0, 0, 0, 0.22);
}

#swatches .swatch-label {
  margin-right: 2px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
  white-space: nowrap;
}

/* ---------- Progress dots ---------- */

#progress {
  position: fixed;
  right: 26px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 14px;
  pointer-events: none;
}

#progress button,
#progress .dot {
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.28);
  transition: background 0.3s ease, transform 0.3s var(--ease-out), box-shadow 0.3s ease;
  pointer-events: auto;
}

#progress .dot.is-active {
  background: var(--accent);
  transform: scale(1.5);
  box-shadow: 0 0 14px var(--accent);
}

#progress .dot:hover {
  background: rgba(255, 255, 255, 0.7);
}

/* ---------- CTA (final stage) ---------- */

.cta {
  margin-top: 30px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 15px 32px;
  border-radius: 980px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #000;
  background: var(--accent);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out);
  pointer-events: auto;
}

.cta:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.45);
}

.cta:active {
  transform: translateY(0) scale(0.98);
}

.cta--ghost {
  color: var(--ink);
  background: var(--glass-bg);
  border: 1px solid var(--glass-stroke);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}

.cta-row {
  margin-top: 30px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.stage-copy--center .cta-row {
  justify-content: center;
}

/* ---------- Reveal animations ---------- */

.reveal {
  opacity: 0;
  transform: translateY(34px);
  transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}

.reveal.is-in {
  opacity: 1;
  transform: translateY(0);
}

.reveal--left {
  transform: translateX(-40px);
}

.reveal--right {
  transform: translateX(40px);
}

.reveal--left.is-in,
.reveal--right.is-in {
  transform: translateX(0);
}

.reveal--zoom {
  transform: scale(0.94);
}

.reveal--zoom.is-in {
  transform: scale(1);
}

.reveal--fade {
  transform: none;
}

/* ---------- Scroll hint ---------- */

.scroll-hint {
  position: fixed;
  left: 50%;
  bottom: 92px;
  transform: translateX(-50%);
  z-index: 9;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
  pointer-events: none;
  transition: opacity 0.5s ease;
}

.scroll-hint__line {
  width: 1px;
  height: 34px;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.7), transparent);
  animation: hint-drop 2s var(--ease-soft) infinite;
}

@keyframes hint-drop {
  0% { transform: scaleY(0); transform-origin: top; }
  45% { transform: scaleY(1); transform-origin: top; }
  55% { transform: scaleY(1); transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}

body.has-scrolled .scroll-hint {
  opacity: 0;
}

/* ---------- Footer note ---------- */

.foot {
  position: relative;
  z-index: 2;
  padding: 40px 6vw 120px;
  text-align: center;
  font-size: 12px;
  line-height: 1.7;
  color: var(--ink-faint);
  pointer-events: none;
}

/* ---------- Responsive ---------- */

@media (max-width: 768px) {
  .stage {
    padding: 8vh 22px;
    justify-content: flex-end;
    padding-bottom: 16vh;
  }

  .stage-copy--right {
    margin-left: 0;
    text-align: left;
    align-items: flex-start;
  }

  .stage-copy--right .lede {
    margin-left: 0;
  }

  .display {
    font-size: clamp(40px, 11vw, 56px);
  }

  .lede {
    font-size: 15px;
  }

  .hud--top {
    top: 14px;
    max-width: 92vw;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .hud--top::-webkit-scrollbar {
    display: none;
  }

  .badge {
    font-size: 12px;
    padding: 7px 13px;
  }

  #progress {
    right: 14px;
    gap: 11px;
  }

  #swatches {
    bottom: 18px;
    gap: 10px;
    padding: 10px 14px;
    max-width: 94vw;
  }

  #swatches button[data-color] {
    width: 24px;
    height: 24px;
  }

  #swatches .swatch-label {
    display: none;
  }

  .callout {
    max-width: 180px;
    padding: 11px 13px;
  }

  .callout p {
    font-size: 11px;
  }

  .scroll-hint {
    bottom: 78px;
  }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .reveal,
  .reveal--left,
  .reveal--right,
  .reveal--zoom {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .scroll-hint__line {
    animation: none;
  }

  #leaders line,
  #leaders circle,
  .callout,
  #swatches button[data-color],
  #progress .dot,
  .cta {
    transition: none;
  }
}
