/* ============ RESET & BASE ============ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #F5EFE6;
  --bg-warm: #EFE6D7;
  --ink: #1A1815;
  --ink-soft: #4A4540;
  --muted: #8B8378;
  --rule: #D6CCBC;
  --accent: #C9532E;
  --accent-soft: #E8895E;
  --gold: #C9A961;
  --gold-deep: #A88940;
  --cream: #FAF6EE;

  --font-display: 'neulis-neue', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
  --font-body: 'neulis-neue', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
}

html, body {
  height: 100%;
  width: 100%;
  overflow: hidden;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
::selection { background: var(--accent); color: var(--cream); }

/* ============ FLOATING SHAPES ============ */
.floating-shapes { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.shape {
  position: absolute; border-radius: 50%;
  background: var(--gold); opacity: 0.08;
  filter: blur(4px);
  animation: float 22s infinite ease-in-out;
}
.shape--1 { width: 320px; height: 320px; top: 10%; left: -100px; }
.shape--2 { width: 200px; height: 200px; top: 60%; right: -80px; background: var(--accent); opacity: 0.06; animation-delay: -5s; }
.shape--3 { width: 140px; height: 140px; top: 30%; right: 10%; opacity: 0.05; animation-delay: -10s; }
.shape--4 { width: 380px; height: 380px; bottom: 5%; left: 12%; opacity: 0.04; animation-delay: -15s; }
.shape--5 { width: 90px; height: 90px; top: 78%; left: 60%; background: var(--accent); opacity: 0.07; animation-delay: -8s; }
.shape--6 { width: 220px; height: 220px; top: 18%; left: 50%; opacity: 0.05; animation-delay: -12s; }

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(40px, -60px) scale(1.1); }
  66% { transform: translate(-30px, 40px) scale(0.95); }
}

/* ============ STAGE ============ */
.stage {
  position: relative;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.scene {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 1.1s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s 1.1s;
  z-index: 1;
}

.scene.is-active {
  opacity: 1;
  visibility: visible;
  transition: opacity 1.1s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 2;
}

/* Scene-internal animation system: opacity + Y travel, played when scene becomes active */
.scene-anim {
  opacity: 0;
  transform: translateY(30px);
  filter: blur(6px);
  transition: opacity 1.2s cubic-bezier(0.2, 0.7, 0.2, 1),
              transform 1.2s cubic-bezier(0.2, 0.7, 0.2, 1),
              filter 1.2s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.scene.is-active .scene-anim {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}

/* Stagger via inline transition-delay, set by JS */

/* ============ SCENE 1 · HERO ============ */
.scene--hero {
  background: radial-gradient(ellipse at 30% 20%, #FBF4E5 0%, var(--bg) 60%);
  /* Keep hero copy above the fixed bottom controls timeline */
  padding-bottom: 120px;
}

.hero__inner { text-align: center; max-width: 1100px; width: 100%; }

.hero__eyebrow {
  display: inline-flex; align-items: center; gap: 12px;
  font-size: 12px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--ink-soft); font-weight: 500;
  padding: 10px 20px;
  border: 1px solid var(--rule);
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(8px);
  margin-bottom: 36px;
}

.hero__dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  animation: pulse 2.4s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.4); }
}

.hero__title {
  font-family: var(--font-display);
  font-weight: 300;
  letter-spacing: -0.04em;
  line-height: 0.92;
  margin-bottom: 10px;
}

.hero__line {
  display: block;
  font-size: clamp(40px, 6.5vw, 90px);
}
.hero__line--2 { font-style: italic; color: var(--ink-soft); }

.hero__logo {
  display: block;
  margin: 0 auto 6px;
  height: clamp(48px, 7.5vw, 100px);
  width: auto;
}

/* === Hero medal: 02 anniversary plate ============================== */

.hero__medal {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(20px, 3vw, 44px);
  margin: 0 0 4px;
  padding: 0;
}

/* Flanking flourishes — hairline + dot, anniversary medallion vibe */
.hero__flourish {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}
.hero__flourish-line {
  display: block;
  width: clamp(40px, 6vw, 90px);
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--gold-deep) 50%, transparent 100%);
}
.hero__flourish-dot {
  display: block;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--gold-deep);
  box-shadow: 0 0 0 3px rgba(168, 137, 64, 0.12);
}
.hero__flourish--left { padding-right: 4px; }
.hero__flourish--right { padding-left: 4px; }

/* The numeral container */
.hero__numeral {
  position: relative;
  display: inline-block;
  line-height: 1.45;
  padding: 0.12em 0.22em 0.22em 0.12em;
  overflow: visible;
  isolation: isolate;
}

/* Soft gold halo glow behind */
.hero__numeral-glow {
  position: absolute;
  top: 50%; left: 50%;
  width: 110%;
  height: 110%;
  transform: translate(-50%, -50%);
  background: radial-gradient(ellipse at center,
    rgba(201, 169, 97, 0.35) 0%,
    rgba(201, 169, 97, 0.18) 30%,
    transparent 65%);
  filter: blur(28px);
  z-index: -1;
  pointer-events: none;
  animation: medalBreathe 6s ease-in-out infinite;
}

@keyframes medalBreathe {
  0%, 100% { opacity: 0.85; transform: translate(-50%, -50%) scale(1); }
  50%      { opacity: 1;    transform: translate(-50%, -50%) scale(1.08); }
}

.hero__numeral-shadow,
.hero__numeral-front {
  font-family: 'Fraunces', 'Times New Roman', serif;
  font-size: clamp(100px, 14vw, 180px);
  font-weight: 500;
  font-style: italic;
  font-variation-settings: 'opsz' 144, 'SOFT' 100, 'wght' 500;
  letter-spacing: -0.04em;
  display: block;
  line-height: 1.45;
  padding-right: 0.18em;
  padding-bottom: 0.2em;
  overflow: visible;
}

/* Soft drop shadow rendered in gold gradient — depth without grayness */
.hero__numeral-shadow {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(160deg,
    var(--gold) 0%,
    var(--gold-deep) 45%,
    var(--accent) 90%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: blur(20px);
  opacity: 0.5;
  transform: translateY(14px);
  pointer-events: none;
}

/* Front face — multi-stop gradient with internal highlight */
.hero__numeral-front {
  position: relative;
  background:
    linear-gradient(160deg,
      #E6C57A 0%,
      var(--gold) 22%,
      var(--gold-deep) 52%,
      #B8743D 78%,
      var(--accent) 100%);
  background-size: 200% 200%;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: gradientShift 9s ease-in-out infinite;
  text-shadow: 0 1px 0 rgba(255, 245, 220, 0.18);
}

/* Subtle moving sheen across the glyphs */
.hero__numeral-shine {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(115deg,
    transparent 35%,
    rgba(255, 248, 230, 0.28) 50%,
    transparent 65%);
  -webkit-mask-image: linear-gradient(160deg, #000 0%, #000 100%);
  mix-blend-mode: overlay;
  pointer-events: none;
  animation: shineSweep 7s ease-in-out infinite;
  opacity: 0.7;
}

@keyframes shineSweep {
  0%, 100% { transform: translateX(-30%); opacity: 0; }
  45%      { transform: translateX(0%);   opacity: 0.55; }
  55%      { transform: translateX(0%);   opacity: 0.55; }
  100%     { transform: translateX(30%);  opacity: 0; }
}

/* "two — years" small caps marker under the numeral */
.hero__years {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: -10px 0 14px;
  padding-left: 0.42em;
}
.hero__years-rule {
  display: inline-block;
  width: 26px;
  height: 1px;
  background: var(--gold-deep);
  opacity: 0.6;
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.hero__sub {
  font-family: var(--font-display);
  font-size: clamp(16px, 1.6vw, 22px);
  font-weight: 300;
  font-style: italic;
  color: var(--ink-soft);
}

/* ============ SCENE 2 · INTRO ============ */
.intro__inner { max-width: 760px; margin: 0 auto; text-align: center; }
.intro__rule { width: 1px; height: 60px; background: var(--rule); margin: 0 auto 40px; }
.intro__lede {
  font-family: var(--font-display);
  font-size: clamp(24px, 3vw, 38px);
  font-weight: 300;
  line-height: 1.35;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin-bottom: 30px;
}
.intro__lede em { color: var(--accent); font-style: italic; }
.intro__body {
  font-size: clamp(15px, 1.2vw, 17px);
  line-height: 1.75;
  color: var(--ink-soft);
  max-width: 580px;
  margin: 0 auto;
}

/* ============ CHAPTER ============ */
.scene--chapter, .scene--divider { text-align: center; }
.chapter__inner { max-width: 900px; }

.section-label {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 24px;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(40px, 6.5vw, 90px);
  font-weight: 300;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--ink);
}
.section-title em { font-style: italic; color: var(--accent); font-weight: 300; }

/* ============ EVENT SCENES ============ */
.scene--event { padding: 60px 80px; }

.event__inner {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 80px;
  width: 100%;
  max-width: 1400px;
  align-items: center;
}

.event__text-side { max-width: 460px; }

.event__meta { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }

.event__num {
  font-family: var(--font-display);
  font-size: clamp(48px, 5vw, 72px);
  font-weight: 300;
  font-style: italic;
  letter-spacing: -0.04em;
  line-height: 1;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-deep) 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}

.event__date {
  font-size: 11px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}

.event__title {
  font-family: var(--font-display);
  font-size: clamp(32px, 3.6vw, 52px);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 22px;
}

.event__text {
  font-size: clamp(15px, 1.15vw, 17px);
  line-height: 1.75;
  color: var(--ink-soft);
}

.event__gallery { display: grid; gap: 12px; max-height: 70vh; }

.event__gallery--single { grid-template-columns: 1fr; }
.event__gallery--double { grid-template-columns: 1fr 1fr; }
.event__gallery--triple {
  grid-template-columns: 1.4fr 1fr;
  grid-template-rows: 1fr 1fr;
}
.event__gallery--triple figure:first-child { grid-row: span 2; }

.event__gallery figure {
  overflow: hidden;
  border-radius: 6px;
  background: var(--bg-warm);
  position: relative;
  aspect-ratio: 4 / 3;
  box-shadow: 0 30px 60px -30px rgba(26, 24, 21, 0.25);
}

.event__gallery--single figure { aspect-ratio: 16 / 10; }

.event__gallery img {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: saturate(0.92);
  animation: kenburns 20s ease-in-out infinite alternate;
}

.scene.is-active .event__gallery img {
  /* trigger fresh kenburns each scene */
}

@keyframes kenburns {
  from { transform: scale(1.02); }
  to { transform: scale(1.12); }
}

/* Final event title gets gradient */
.scene--event-final .event__title {
  background: linear-gradient(135deg, var(--accent) 0%, var(--gold-deep) 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ============ DIVIDER ============ */
.divider__inner { max-width: 700px; }
.divider__num {
  font-family: 'Fraunces', 'Times New Roman', serif;
  font-size: clamp(120px, 16vw, 220px);
  font-weight: 500;
  font-style: italic;
  font-variation-settings: 'opsz' 144, 'SOFT' 100, 'wght' 500;
  line-height: 1.45;
  letter-spacing: -0.04em;
  background: linear-gradient(160deg, var(--gold) 0%, var(--gold-deep) 50%, var(--accent) 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
  padding: 0.12em 0.22em 0.22em 0.1em;
  margin-bottom: 16px;
  opacity: 0.9;
  overflow: visible;
}
.divider__text {
  font-family: var(--font-display);
  font-size: clamp(20px, 2.4vw, 30px);
  font-weight: 300;
  font-style: italic;
  color: var(--ink-soft);
  line-height: 1.4;
}

/* ============ WISH ============ */
.wish__inner {
  max-width: 780px;
  width: 100%;
  text-align: center;
}

.wish__inner .section-label { margin-bottom: 32px; }

.wish {
  background: var(--cream);
  padding: 56px 56px 44px;
  border-radius: 8px;
  position: relative;
  border: 1px solid var(--rule);
  box-shadow: 0 40px 80px -30px rgba(26, 24, 21, 0.15);
  text-align: left;
}

.wish::before {
  content: '"';
  position: absolute;
  top: 24px; right: 36px;
  font-family: var(--font-display);
  font-size: 130px;
  font-style: italic;
  font-weight: 300;
  line-height: 1;
  color: var(--accent);
  opacity: 0.18;
  pointer-events: none;
}

.wish__portrait {
  width: 80px; height: 80px;
  border-radius: 50%;
  overflow: hidden;
  margin-bottom: 28px;
  border: 2px solid var(--cream);
  box-shadow: 0 0 0 1px var(--rule), 0 8px 20px -8px rgba(26, 24, 21, 0.15);
}

.wish__portrait img { width: 100%; height: 100%; object-fit: cover; filter: saturate(0.95); }

.wish__quote {
  font-family: var(--font-display);
  font-size: clamp(16px, 1.5vw, 20px);
  font-weight: 300;
  line-height: 1.65;
  color: var(--ink);
  margin-bottom: 32px;
  letter-spacing: -0.005em;
  font-style: italic;
}

.wish__attribution {
  display: flex; flex-direction: column; gap: 4px;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
}

.wish__name {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.wish__role {
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}

/* ============ FINALE ============ */
.scene--finale {
  background: linear-gradient(to bottom, var(--bg) 0%, var(--bg-warm) 100%);
}

.finale__inner { text-align: center; max-width: 800px; }

.finale__numeral {
  font-family: 'Fraunces', 'Times New Roman', serif;
  font-size: clamp(140px, 20vw, 280px);
  font-weight: 500;
  font-style: italic;
  font-variation-settings: 'opsz' 144, 'SOFT' 100, 'wght' 500;
  letter-spacing: -0.04em;
  line-height: 1.45;
  display: flex; justify-content: center; align-items: center; gap: 0.08em;
  padding: 0.12em 0.18em 0.22em;
  margin-bottom: 20px;
  overflow: visible;
}
.finale__numeral span { line-height: 1.45; padding: 0 0.08em 0.1em; overflow: visible; }

.finale__numeral span {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-deep) 50%, var(--accent) 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

.finale__numeral span:first-child { transform: translateY(20px) rotate(-4deg); }
.finale__numeral span:last-child { transform: translateY(-10px) rotate(4deg); }

.finale__title {
  font-family: var(--font-display);
  font-size: clamp(36px, 5vw, 64px);
  font-weight: 300;
  line-height: 1.1;
  letter-spacing: -0.025em;
  color: var(--ink);
  margin-bottom: 20px;
}
.finale__title em { font-style: italic; color: var(--accent); }

.finale__sub {
  font-family: var(--font-display);
  font-size: clamp(15px, 1.4vw, 18px);
  font-style: italic;
  font-weight: 300;
  color: var(--ink-soft);
  margin-bottom: 40px;
}

.finale__signature {
  display: flex; align-items: center; justify-content: center; gap: 24px;
  font-size: 11px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 40px;
}

.finale__rule { flex: 1; max-width: 80px; height: 1px; background: var(--rule); }

.finale__replay {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 26px;
  border: 1px solid var(--accent);
  border-radius: 100px;
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  background: transparent;
  transition: background 0.4s, color 0.4s, transform 0.4s;
}

.finale__replay:hover {
  background: var(--accent);
  color: var(--cream);
  transform: translateY(-2px);
}

/* ============ CONTROLS ============ */
.controls {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 100;
  padding: 20px 40px 24px;
  display: flex; flex-direction: column;
  gap: 14px;
  background: linear-gradient(to top, rgba(245, 239, 230, 0.85) 0%, transparent 100%);
  backdrop-filter: blur(6px);
  pointer-events: none;
}

.controls > * { pointer-events: auto; }

.progress {
  height: 2px;
  background: rgba(26, 24, 21, 0.1);
  border-radius: 2px;
  overflow: hidden;
}

.progress__bar {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--accent));
  width: 0%;
  transition: width 0.1s linear;
}

.controls__row {
  display: flex; align-items: center; justify-content: center; gap: 16px;
  position: relative;
}

.ctrl {
  width: 38px; height: 38px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--rule);
  color: var(--ink);
  transition: all 0.3s;
}

.ctrl:hover {
  background: var(--ink);
  color: var(--cream);
  border-color: var(--ink);
  transform: translateY(-2px);
}

.ctrl--play { width: 44px; height: 44px; background: var(--ink); color: var(--cream); border-color: var(--ink); }
.ctrl--play:hover { background: var(--accent); border-color: var(--accent); }

.ctrl__play { display: none; }
.is-paused .ctrl__pause { display: none; }
.is-paused .ctrl__play { display: block; }

.ctrl__counter {
  position: absolute;
  right: 0;
  font-size: 11px;
  letter-spacing: 0.28em;
  color: var(--muted);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 880px) {
  .scene { padding: 40px 24px 100px; }
  .scene--event { padding: 40px 24px 100px; }
  .scene--hero { padding-bottom: 100px; }

  .event__inner {
    grid-template-columns: 1fr;
    gap: 24px;
    max-height: 100%;
  }

  .event__gallery { max-height: 40vh; }
  .event__gallery--triple {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto;
  }
  .event__gallery--triple figure:first-child { grid-row: auto; grid-column: span 2; }

  .wish { padding: 36px 28px 28px; }
  .wish::before { font-size: 90px; top: 18px; right: 24px; }

  .ctrl__counter { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.3s !important;
  }
}
