/* ═══════════════════════════════════════════
   VARIABLES
═══════════════════════════════════════════ */
:root {
  --gold:          #F0A500;
  --gold-light:    #FFD98E;
  --gold-pale:     #FFF3C4;
  --gold-glow:     rgba(240, 165, 0, 0.22);
  --purple:        #8B5CF6;
  --purple-soft:   #C4B5FD;
  --purple-glow:   rgba(139, 92, 246, 0.26);
  --purple-deep:   #2d1060;
  --beige:         #F5EDD8;
  --beige-mid:     #E8DCC4;
  --cream:         #FDFAF4;
  --ink:           #2a1f0e;
  --void:          #090711;
}

/* ═══════════════════════════════════════════
   RESET & BASE
═══════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: auto; }
body {
  background: var(--cream);
  color: var(--ink);
  font-family: 'Lora', Georgia, serif;
  overflow-x: hidden;
  scrollbar-width: none;
  touch-action: pan-y;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
body::-webkit-scrollbar { display: none; }

section {
  position: relative;
  width: 100vw;
  height: 100vh;
  height: 100svh; /* stable: excludes address bar on Android Chrome */
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

img { display: block; width: 100%; height: 100%; object-fit: cover; }
figure { margin: 0; }

/* ═══════════════════════════════════════════
   SHARED: PHOTO FRAMES
═══════════════════════════════════════════ */
.photo-frame {
  position: relative;
  border-radius: 3px;
  overflow: hidden;
}

.frame-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.frame-glow.golden {
  background: linear-gradient(to top, rgba(240,165,0,0.35) 0%, transparent 55%);
}
.frame-glow.purple {
  background: linear-gradient(to top, rgba(139,92,246,0.4) 0%, rgba(139,92,246,0.12) 100%);
}
.frame-glow.reunion {
  background: linear-gradient(145deg, rgba(240,165,0,0.3) 0%, rgba(139,92,246,0.25) 100%);
  opacity: 0.8;
}

/* ═══════════════════════════════════════════
   ACT I  —  BERABER
═══════════════════════════════════════════ */
#act1 {
  background: linear-gradient(155deg, var(--cream) 0%, var(--beige) 45%, #f5e8b5 100%);
  flex-direction: column;
}

.act1-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 70% 60% at 58% 42%, rgba(240,165,0,0.16) 0%, transparent 65%);
  pointer-events: none;
}

.act1-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(0.55rem, 1.4vh, 1.1rem);
  text-align: center;
  padding: 1rem 2rem 0;
  z-index: 1;
  max-width: 480px;
  width: 100%;
}

.act-label {
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.68rem;
  font-weight: 300;
  letter-spacing: 0.55em;
  text-transform: uppercase;
  color: var(--gold);
  opacity: 0;
}

.name-title {
  font-family: 'Great Vibes', cursive;
  font-size: clamp(3rem, 9vw, 6.5rem);
  color: var(--ink);
  line-height: 1.05;
  opacity: 0;
}

.subtitle {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-weight: 300;
  font-size: clamp(0.95rem, 2.3vw, 1.25rem);
  color: #7a5522;
  opacity: 0;
}

.photo-1 {
  width: min(260px, 70vw);
  max-height: 42vh;
  aspect-ratio: 4/5;
  box-shadow:
    0 6px 30px var(--gold-glow),
    0 0 0 1px rgba(240,165,0,0.14);
  background: var(--beige-mid);
  opacity: 0;
  will-change: transform;
}

.caption {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: clamp(0.82rem, 1.8vw, 1rem);
  color: #8a6030;
  line-height: 1.9;
  opacity: 0;
}

.scroll-hint {
  position: absolute;
  bottom: 1.6rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  opacity: 0;
}
.scroll-hint span {
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.68rem;
  letter-spacing: 0.45em;
  text-transform: uppercase;
  color: var(--gold);
}
.scroll-line {
  width: 1px;
  height: 34px;
  background: linear-gradient(to bottom, var(--gold), transparent);
  animation: scrollPulse 2s ease-in-out infinite;
}
@keyframes scrollPulse {
  0%, 100% { opacity: 0.2; transform: scaleY(0.55); }
  50%       { opacity: 1;   transform: scaleY(1); }
}

/* ═══════════════════════════════════════════
   ACT II  —  AYRILIK
═══════════════════════════════════════════ */
#act2 {
  background: var(--void);
  padding: 0;
}

.void-bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 90% 80% at 50% 50%, #18093a 0%, var(--void) 68%);
  z-index: 0;
}

.thread {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  transform: translateX(-50%);
  background: linear-gradient(
    to bottom,
    transparent 0%,
    var(--gold) 22%,
    var(--purple-soft) 78%,
    transparent 100%
  );
  z-index: 3;
  opacity: 0;
}

.half {
  position: absolute;
  top: 0;
  width: 50%;
  height: 100%;
  z-index: 2;
  will-change: transform;
}
.left-half  {
  left: 0;
  background: linear-gradient(140deg, var(--beige) 0%, var(--beige-mid) 55%, #cfc0a2 100%);
}
.right-half {
  right: 0;
  background: linear-gradient(230deg, #3a1480 0%, var(--purple-deep) 50%, #130824 100%);
}

.half-inner {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 2.5rem;
  gap: 2rem;
}

.thought {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-weight: 400;
  font-size: clamp(0.9rem, 2vw, 1.2rem);
  color: #3a2810;
  text-align: center;
  line-height: 1.95;
  opacity: 0;
}

.photo-2 {
  width: min(230px, 62%);
  aspect-ratio: 4/5;
  box-shadow:
    0 8px 40px rgba(139,92,246,0.4),
    0 0 0 1px rgba(139,92,246,0.18);
  background: var(--purple-deep);
  opacity: 0;
}

/* ═══════════════════════════════════════════
   ACT III  —  KAVUŞMA ANI
═══════════════════════════════════════════ */
#act3 {
  background: var(--void);
  flex-direction: column;
}

.burst-flash {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle 60% at 50% 50%, rgba(255,245,200,0.95) 0%, transparent 70%);
  opacity: 0;
  pointer-events: none;
  z-index: 4;
}

.burst {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
}

.burst-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  border-radius: 50%;
  border: 1.5px solid;
  opacity: 0;
}
/* Final sizes defined here; GSAP animates scale 0→1 (GPU-only, no layout) */
#ring1 { width: 62vw;  height: 62vw;  border-color: var(--gold); }
#ring2 { width: 88vw;  height: 88vw;  border-color: var(--purple-soft); }

.transition-line {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: clamp(1.25rem, 3.5vw, 2rem);
  color: var(--gold-pale);
  text-align: center;
  opacity: 0;
  z-index: 5;
  letter-spacing: 0.06em;
}

/* ═══════════════════════════════════════════
   ACT IV  —  KAVUŞMA
═══════════════════════════════════════════ */
#act4 {
  background: linear-gradient(155deg, var(--cream) 0%, #f2eadb 40%, var(--beige) 100%);
  flex-direction: column;
}

.act4-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(1.2rem, 2.5vh, 2rem);
  padding: 1.5rem 2rem;
  z-index: 1;
  max-width: 480px;
  width: 100%;
}

.photo-3 {
  width: min(290px, 74vw);
  max-height: 45vh;
  aspect-ratio: 4/5;
  box-shadow:
    0 10px 50px var(--gold-glow),
    0 0 0 1px rgba(240,165,0,0.18),
    0 0 80px var(--purple-glow);
  background: var(--beige-mid);
  opacity: 0;
}

.message {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  opacity: 0;
}
.msg-to {
  font-family: 'Great Vibes', cursive;
  font-size: clamp(2rem, 5.5vw, 2.7rem);
  color: var(--ink);
  line-height: 1;
}
.msg-body {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: clamp(0.92rem, 1.8vw, 1.08rem);
  color: #4a3520;
  line-height: 2.1;
  max-width: 420px;
  white-space: pre-line;
}
.msg-from {
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.9rem;
  color: var(--gold);
  letter-spacing: 0.2em;
}

/* ═══════════════════════════════════════════
   PARTICLES
═══════════════════════════════════════════ */
#particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}
.p {
  position: absolute;
  border-radius: 50%;
  animation: floatUp var(--d) var(--dl) infinite ease-in-out;
  opacity: 0;
}
@keyframes floatUp {
  0%   { transform: translateY(0) translateX(0);            opacity: 0; }
  8%   { opacity: var(--op); }
  88%  { opacity: var(--op); }
  100% { transform: translateY(-110vh) translateX(var(--dx)); opacity: 0; }
}

/* ═══════════════════════════════════════════
   MOBILE  —  Android-first adjustments
═══════════════════════════════════════════ */
@media (max-width: 600px) {
  /* Act I: tighter vertical rhythm on short screens */
  .photo-1 { max-height: 34vh; }
  .photo-3 { max-height: 38vh; }

  /* Act II: half-inner must fit in ~half the phone width */
  .half-inner {
    padding: 1.6rem 0.9rem;
    gap: 1.1rem;
  }
  .thought {
    font-size: 0.82rem;
    line-height: 1.72;
  }
  /* photo-2: use % of the half width so it never collapses */
  .photo-2 {
    width: 78%;
    min-width: 0;
  }

  /* Act IV: message sits closer to photo */
  .act4-inner { gap: 1.2rem; }
}

