/* ============================================
   Happy Birthday, Yomna — Stylesheet
   Design tokens live at the top. Change here,
   the whole site follows.
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;1,500&family=Jost:wght@300;400;500&family=Caveat:wght@500;600;700&display=swap');

:root {
  /* Color tokens — neutral & luxe, with pastel whispers reserved for accents */
  --cream:        #F6F1E8;
  --ivory:        #FBF8F2;
  --ink:          #2E2A25;
  --ink-soft:     #55504A;
  --taupe:        #A98F76;
  --gold:         #C4A15C;
  --gold-soft:    #DCC48F;
  --line:         rgba(46, 42, 37, 0.14);

  /* her colors, used sparingly as tiny accents only */
  --her-blue:     #A9C6E8;
  --her-babyblue: #CFE3F2;
  --her-lilac:    #C9B8DE;
  --her-white:    #FFFFFF;

  /* type */
  --font-display: 'Cormorant Garamond', serif;
  --font-body:    'Jost', sans-serif;
  --font-hand:    'Caveat', cursive;

  /* rhythm */
  --section-pad: clamp(4rem, 12vh, 7rem);
  --content-w: 640px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 300;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }

::selection {
  background: var(--gold-soft);
  color: var(--ink);
}

a { color: inherit; }

button {
  font-family: inherit;
  cursor: pointer;
}

/* ---------- focus visibility (accessibility) ---------- */
a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 4px;
}

/* ---------- the stitched thread — signature element ----------
   A single gold thread runs the length of the page, breaking and
   re-tying itself at each section: two different people,
   stitched together anyway. */
.thread-svg {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 100%;
  z-index: 1;
  pointer-events: none;
  opacity: 0.35;
}
.thread-svg svg {
  width: 100%;
  height: 100%;
}
.thread-svg path {
  fill: none;
  stroke: var(--gold);
  stroke-width: 1.5;
  stroke-dasharray: 6 10;
}

/* ============================================
   OPENING SCREEN — the photo is the focus
   ============================================ */
.open-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity 1s ease, visibility 1s ease;
}
.open-screen.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.open-photo-btn {
  background: none;
  border: none;
  padding: 0;
  width: min(84vw, 380px);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 30px 70px -25px rgba(0, 0, 0, 0.7);
  transition: transform 0.4s ease;
}
.open-photo-btn:active { transform: scale(0.98); }

.open-photo {
  width: 100%;
  display: block;
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.open-screen.is-celebrating .open-photo-btn {
  transform: scale(1.03);
}

.open-hint {
  margin-top: 1.5rem;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-soft);
  transition: opacity 0.4s ease;
}
.open-screen.is-celebrating .open-hint {
  opacity: 0;
}

/* the cake mark that blooms in on tap */
.celebrate-mark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.6);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.7s cubic-bezier(0.2, 1.4, 0.4, 1), opacity 0.5s ease;
  z-index: 3;
}
.open-screen.is-celebrating .celebrate-mark {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
}
.celebrate-mark svg {
  width: 88px;
  height: 88px;
  filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.5));
}
.celebrate-mark .flame {
  transform-origin: center bottom;
  animation: flicker 1.1s ease-in-out infinite alternate;
}
@keyframes flicker {
  0% { transform: scaleY(1) translateX(0); }
  100% { transform: scaleY(1.15) translateX(0.5px); }
}

/* ============================================
   STORY VIEWER — the photo journey
   Full-screen, tap/swipe controlled, no captions.
   ============================================ */
.story-viewer {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: #0d0b09;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.8s ease, visibility 0.8s ease;
}
.story-viewer.is-active {
  opacity: 1;
  visibility: visible;
}

.story-progress {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 5;
  display: flex;
  gap: 5px;
  padding: 14px 12px 0;
}
.story-progress .bar {
  flex: 1;
  height: 2.5px;
  background: rgba(255, 255, 255, 0.28);
  border-radius: 2px;
  overflow: hidden;
}
.story-progress .bar-fill {
  height: 100%;
  width: 0%;
  background: var(--gold-soft);
}
.story-progress .bar.is-done .bar-fill { width: 100%; transition: none; }
.story-progress .bar.is-active .bar-fill {
  transition: width linear;
}

.story-stage {
  position: absolute;
  inset: 0;
}

.story-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.7s ease;
  pointer-events: none;
}
.story-slide.is-active {
  opacity: 1;
  pointer-events: auto;
}

.story-bg {
  position: absolute;
  inset: -8%;
  background-size: cover;
  background-position: center;
  transform: scale(1);
  transition: transform 5.5s cubic-bezier(0.16, 1, 0.3, 1);
  filter: brightness(0.96);
}
.story-slide.is-active .story-bg {
  transform: scale(1.1);
}

.story-nav {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 32%;
  background: transparent;
  border: none;
  z-index: 4;
}
.story-nav-prev { left: 0; }
.story-nav-next { left: 32%; width: 68%; }

.story-skip {
  position: absolute;
  bottom: 1.75rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 6;
  background: rgba(251, 248, 242, 0.12);
  border: 1px solid rgba(251, 248, 242, 0.35);
  color: var(--ivory);
  font-family: var(--font-body);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.55rem 1.1rem;
  border-radius: 30px;
  backdrop-filter: blur(4px);
}

/* ============================================
   LAYOUT / SECTIONS
   ============================================ */
main { position: relative; z-index: 2; }

section {
  position: relative;
  padding: var(--section-pad) 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 90vh;
}

.section-inner {
  max-width: var(--content-w);
  width: 100%;
  text-align: center;
}

.eyebrow {
  font-family: var(--font-hand);
  font-size: 1.35rem;
  color: var(--gold);
  margin: 0 0 0.35rem;
}

h1, h2 {
  font-family: var(--font-display);
  font-weight: 500;
  color: var(--ink);
  margin: 0 0 1rem;
  line-height: 1.15;
}

h1 { font-size: clamp(2.4rem, 8vw, 3.6rem); }
h2 { font-size: clamp(1.9rem, 6vw, 2.6rem); }

.section-text {
  font-size: 1.05rem;
  color: var(--ink-soft);
  max-width: 46ch;
  margin: 0 auto 1.5rem;
}

.section-photo {
  width: min(85vw, 420px);
  border-radius: 3px;
  box-shadow: 0 30px 60px -30px rgba(46, 42, 37, 0.45);
  margin: 0 auto 1.75rem;
}

.section-photo.wide {
  width: min(90vw, 560px);
}

.photo-pair {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 1.75rem;
}
.photo-pair img {
  width: min(42vw, 230px);
  border-radius: 3px;
  box-shadow: 0 24px 44px -24px rgba(46, 42, 37, 0.4);
}

.divider {
  width: 46px;
  height: 1px;
  background: var(--gold);
  opacity: 0.6;
  margin: 2rem auto;
}

/* reveal-on-scroll */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.9s ease, transform 0.9s ease;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- hero (childhood reveal) ---------- */
#hero {
  min-height: 100vh;
}
#hero .section-photo {
  width: min(62vw, 260px);
  border-radius: 4px;
}

.color-dots {
  display: flex;
  gap: 0.55rem;
  justify-content: center;
  margin: 1.5rem 0 0.25rem;
}
.color-dots span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
  opacity: 0.85;
}

/* ============================================
   THE LETTER (gated)
   ============================================ */
.letter-teaser {
  font-family: var(--font-hand);
  font-size: 1.5rem;
  color: var(--ink-soft);
  line-height: 1.5;
  max-width: 30ch;
  margin: 0 auto 2rem;
}

.letter-gate {
  background: var(--ivory);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 2rem 1.5rem;
  max-width: 360px;
  margin: 0 auto;
}

.letter-gate p {
  font-size: 0.85rem;
  color: var(--taupe);
  margin: 0 0 1rem;
  letter-spacing: 0.04em;
}

.letter-gate-form {
  display: flex;
  gap: 0.5rem;
}

.letter-gate-form input {
  flex: 1;
  min-width: 0;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--cream);
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--ink);
  letter-spacing: 0.12em;
}

.letter-gate-form button {
  padding: 0.7rem 1.1rem;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--ivory);
  border-radius: 4px;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  transition: background 0.25s ease, color 0.25s ease;
}
.letter-gate-form button:hover {
  background: var(--gold);
  border-color: var(--gold);
}

.letter-error {
  font-size: 0.8rem;
  color: #a3554a;
  margin-top: 0.75rem;
  min-height: 1.2em;
}

.letter-full {
  display: none;
  text-align: left;
  max-width: 52ch;
  margin: 0 auto;
  font-family: var(--font-hand);
  font-size: 1.35rem;
  line-height: 1.65;
  color: var(--ink);
  white-space: pre-line;
}
.letter-full.is-unlocked {
  display: block;
  animation: letterFadeIn 1s ease;
}
@keyframes letterFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.letter-signature {
  font-family: var(--font-hand);
  font-size: 1.4rem;
  color: var(--gold);
  margin-top: 2rem;
  display: block;
}

/* ============================================
   FINAL SECTION
   ============================================ */
#final {
  min-height: 100vh;
}
#final .section-photo {
  width: min(80vw, 380px);
}
.final-signoff {
  font-family: var(--font-hand);
  font-size: 1.6rem;
  color: var(--ink-soft);
  margin-top: 1.5rem;
}

/* ============================================
   AUDIO CONTROL
   ============================================ */
.audio-toggle {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 50;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--ivory);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 24px -10px rgba(46, 42, 37, 0.35);
  transition: transform 0.2s ease;
}
.audio-toggle:hover { transform: scale(1.06); }
.audio-toggle svg { width: 18px; height: 18px; }
.audio-toggle .icon-muted { display: none; }
.audio-toggle.is-muted .icon-on { display: none; }
.audio-toggle.is-muted .icon-muted { display: block; }

/* ============================================
   CINEMATIC PHOTO SLIDES
   Full-bleed background photography with a slow
   continuous zoom (Ken Burns) and scroll parallax.
   Replaces the old card-with-caption treatment.
   ============================================ */
.cinema-slide {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  overflow: hidden;
  color: var(--ivory);
  isolation: isolate;
}

.cinema-bg-wrap {
  position: absolute;
  inset: -10% 0;
  z-index: 0;
  will-change: transform;
}

.cinema-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transform: scale(1);
  transition: transform 9s cubic-bezier(0.16, 1, 0.3, 1);
}

.cinema-slide.in-view .cinema-bg {
  transform: scale(1.12);
}

.cinema-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    to top,
    rgba(15, 12, 10, 0.88) 0%,
    rgba(15, 12, 10, 0.62) 30%,
    rgba(15, 12, 10, 0.18) 62%,
    rgba(15, 12, 10, 0.4) 100%
  );
}

.cinema-text {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: var(--content-w);
  padding: 0 1.75rem clamp(3rem, 10vh, 5.5rem);
  text-align: center;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.45);
}

.cinema-text .eyebrow {
  color: var(--gold-soft);
}

.cinema-text h2 {
  color: var(--ivory);
  font-size: clamp(1.7rem, 6vw, 2.3rem);
  margin-bottom: 0.6rem;
}

.cinema-text p {
  color: rgba(251, 248, 242, 0.88);
  font-size: 1rem;
  max-width: 42ch;
  margin: 0 auto;
}

/* hero + final are cinema slides too, but keep their bigger title treatment */
.cinema-slide#hero,
.cinema-slide#final {
  align-items: center;
}
.cinema-slide#hero .cinema-text h1 {
  color: var(--ivory);
  font-size: clamp(2.6rem, 9vw, 4rem);
}
.cinema-slide#hero .cinema-text .section-text,
.cinema-slide#final .cinema-text .section-text {
  color: rgba(251, 248, 242, 0.88);
}
.cinema-slide#final .cinema-text h2 {
  font-size: clamp(2rem, 7vw, 2.8rem);
}
.cinema-slide#final .final-signoff {
  color: var(--gold-soft);
}

.color-dots span.on-dark {
  border: 1px solid rgba(251, 248, 242, 0.5);
}

/* ============================================
   RESPONSIVE TWEAKS
   ============================================ */
@media (max-width: 480px) {
  :root { --section-pad: 3.5rem; }
  .photo-pair img { width: 44vw; }
}
