:root {
  --dark: #120d08;
  --dark-2: #1d140b;
  --beige: #e8d9c4;
  --cream: #f6ecdc;
  --cream-dim: rgba(246, 236, 220, 0.72);
  --gold: #d9a945;
  --gold-light: #f6d68a;
  --light: #ffcf7a;
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Manrope", system-ui, sans-serif;
  --lamp-zone: 34svh; /* lamba küçülünce kapladığı üst alan */
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; background: var(--dark); }

body {
  min-height: 100svh;
  background: var(--dark);
  color: var(--cream);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

body.locked { overflow: hidden; height: 100dvh; }

/* ---------- oda ışığı ---------- */
/* sabit katmanlar en büyük ekran yüksekliği kadar: adres çubuğu gizlenince altta boşluk kalmaz */
.room { position: fixed; top: 0; left: 0; right: 0; height: 100lvh; z-index: 0; pointer-events: none; }

.room-light {
  position: absolute; inset: 0;
  opacity: 0;
  background:
    radial-gradient(calc(70% * var(--gs, 1)) calc(45% * var(--gs, 1)) at 50% var(--gy, 42%), rgba(255, 207, 122, 0.55), transparent 70%),
    radial-gradient(120% 80% at 50% var(--gy, 45%), #5a4128 0%, #2c1f13 55%, var(--dark) 100%);
}

.room-warm {
  position: absolute; inset: 0;
  opacity: 0;
  background:
    radial-gradient(90% 60% at 50% var(--gy, 40%), rgba(255, 196, 120, 0.35), transparent 75%),
    linear-gradient(180deg, rgba(120, 70, 30, 0.25), rgba(60, 30, 10, 0.15));
  mix-blend-mode: screen;
}

.vignette {
  position: absolute; inset: 0;
  background: radial-gradient(120% 90% at 50% 45%, transparent 55%, rgba(0, 0, 0, 0.55) 100%);
}

/* ---------- lamba ---------- */
.lamp-wrap {
  position: fixed; top: 0; left: 0; right: 0; height: 100svh; z-index: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: env(safe-area-inset-top) 16px env(safe-area-inset-bottom);
  pointer-events: none;
}

.lamp {
  pointer-events: auto;
  background: none; border: 0; cursor: pointer;
  position: relative;
  width: min(92vw, 62svh, 440px);
  aspect-ratio: 360 / 290;
  perspective: 900px;
  transform-origin: 50% 0%;
  will-change: transform;
}
.lamp:focus-visible { outline: 2px solid var(--gold-light); outline-offset: 8px; border-radius: 12px; }
.lamp svg { width: 100%; height: 100%; overflow: visible; display: block; transform-style: preserve-3d; }

.lamp svg { filter: brightness(var(--metal, 1)) saturate(calc(0.6 + var(--metal, 1) * 0.4)); }

/* göğüsten yayılan ışık huzmeleri */
.rays-fade { position: absolute; inset: 0; pointer-events: none; }

.rays {
  position: absolute;
  left: 30%; top: 52%;
  width: 260%; aspect-ratio: 1;
  translate: -50% -50%;
  border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, rgba(255, 214, 150, 0.22) 0deg 4deg, transparent 4deg 13deg, rgba(255, 230, 180, 0.12) 13deg 15deg, transparent 15deg 24deg);
  -webkit-mask: radial-gradient(closest-side, #000 8%, rgba(0,0,0,0.5) 35%, transparent 72%);
  mask: radial-gradient(closest-side, #000 8%, rgba(0,0,0,0.5) 35%, transparent 72%);
  mix-blend-mode: screen;
  filter: blur(2px);
  opacity: 0;
  pointer-events: none;
}

/* dokunmatik lambalardaki gibi bekleme ışığı */
.standby {
  position: absolute;
  left: 27%; top: 53%;
  width: 6px; height: 6px; margin: -3px 0 0 -3px;
  border-radius: 50%;
  background: #fff4d6;
  box-shadow: 0 0 6px 2px rgba(255, 207, 122, 0.8), 0 0 18px 6px rgba(255, 180, 90, 0.35);
  animation: standby 2.6s ease-in-out infinite;
  pointer-events: none;
}
@keyframes standby {
  0%, 100% { opacity: 0.25; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.15); }
}

.ripple {
  position: fixed; z-index: 4;
  width: 12px; height: 12px; margin: -6px 0 0 -6px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 220, 160, 0.9);
  box-shadow: 0 0 18px rgba(255, 207, 122, 0.6);
  pointer-events: none;
  animation: ripple 0.9s cubic-bezier(.2,.7,.3,1) forwards;
}
@keyframes ripple {
  to { transform: scale(9); opacity: 0; border-width: 0.5px; }
}

.dust {
  position: fixed; top: 0; left: 0; z-index: 1;
  width: 100%; height: 100lvh;
  pointer-events: none;
  opacity: 0;
}

.hint {
  margin-top: 28px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.35rem;
  letter-spacing: 0.04em;
  color: var(--cream-dim);
  animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 0.9; }
}

/* ---------- hikaye ---------- */
.story {
  position: relative; z-index: 2;
  max-width: 34rem;
  margin: 0 auto;
  padding: 0 16px env(safe-area-inset-bottom);
  visibility: hidden;
}
body:not(.locked) .story { visibility: visible; }

.spacer { height: 100svh; }

.cue {
  position: fixed; left: 0; right: 0;
  bottom: calc(env(safe-area-inset-bottom) + 28px);
  text-align: center;
  font-size: 0.78rem; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--cream-dim);
  opacity: 0;
}
.cue::after {
  content: ""; display: block; margin: 10px auto 0;
  width: 1px; height: 28px;
  background: linear-gradient(var(--gold-light), transparent);
  animation: drip 1.8s ease-in-out infinite;
}
@keyframes drip {
  0% { transform: scaleY(0); transform-origin: top; }
  50% { transform: scaleY(1); transform-origin: top; }
  51% { transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}

.title-scene {
  min-height: 72svh;
  display: flex; align-items: center; justify-content: center;
  padding-top: var(--lamp-zone);
  perspective: 600px;
}
.title {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(3rem, 14vw, 4.4rem);
  line-height: 1;
  letter-spacing: 0.01em;
  text-align: center;
  color: var(--gold-light);
  text-shadow: 0 0 28px rgba(255, 190, 110, 0.35), 0 1px 14px rgba(18, 13, 8, 0.8);
  opacity: 0;
}

.story { text-shadow: 0 1px 14px rgba(18, 13, 8, 0.85), 0 0 2px rgba(18, 13, 8, 0.6); }

/* her paragraf kendi sahnesinde, lambanın altındaki alanda ortalanır */
.scene {
  min-height: 82svh;
  display: flex; align-items: center;
  padding-top: calc(var(--lamp-zone) * 0.5);
}
.line {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.4rem, 6vw, 1.7rem);
  line-height: 1.5;
  color: var(--cream);
  text-wrap: pretty;
  opacity: 0;
  will-change: transform, opacity;
}
.line.lead {
  font-style: italic;
  font-weight: 300;
  font-size: clamp(1.9rem, 8.6vw, 2.5rem);
  line-height: 1.25;
  text-align: center;
  color: var(--gold-light);
  width: 100%;
}

.signature {
  font-family: "Pinyon Script", var(--serif);
  font-size: clamp(2.6rem, 12vw, 3.4rem);
  text-align: right;
  color: var(--gold-light);
  padding-right: 22px;
  margin: 6vh 0 18vh;
  opacity: 0;
}

/* sayfanın sağında ince ilerleme çizgisi */
.progress {
  position: fixed; z-index: 2;
  right: 10px; top: 38svh; height: 48svh;
  width: 1px;
  background: rgba(246, 236, 220, 0.12);
  pointer-events: none;
}
body.locked .progress { display: none; }
.progress span {
  display: block; width: 100%; height: 100%;
  background: linear-gradient(var(--gold-light), rgba(255, 207, 122, 0.4));
  transform: scaleY(0); transform-origin: top;
  box-shadow: 0 0 6px rgba(255, 207, 122, 0.6);
}

/* ---------- soru ---------- */
.ask {
  position: relative;
  text-align: center;
  min-height: 100svh;
  padding-top: calc(var(--lamp-zone) + 6svh);
}
.ask h2, .ask .buttons { opacity: 0; }
.ask h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.4rem, 10vw, 3.2rem);
  color: var(--gold-light);
  margin-bottom: 36px;
}

.buttons {
  position: relative;
  display: flex; gap: 14px; justify-content: center; flex-wrap: wrap;
}

.btn {
  min-height: 52px; min-width: 128px;
  padding: 0 28px;
  border-radius: 999px;
  font-family: var(--sans); font-size: 1rem; font-weight: 500; letter-spacing: 0.04em;
  cursor: pointer;
  touch-action: manipulation;
}
.btn-yes {
  border: 0;
  color: #3d2808;
  background: linear-gradient(135deg, #fff1c4, #e8c069 45%, #b8862b);
  box-shadow: 0 0 0 1px rgba(255, 241, 196, 0.4), 0 10px 40px -8px rgba(255, 207, 122, 0.6);
}
.btn-no {
  border: 1px solid rgba(246, 236, 220, 0.3);
  color: var(--cream-dim);
  background: rgba(255, 255, 255, 0.04);
}

.finale {
  margin-top: 40px;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.35rem, 5.8vw, 1.75rem);
  line-height: 1.3;
  max-width: min(60vw, 230px);
  margin-left: auto;
  margin-right: auto;
  color: var(--gold-light);
  opacity: 0;
  text-wrap: balance;
}

/* ---------- final kalbi ---------- */
.heart-layer {
  position: absolute; left: 0; top: 0;
  width: 100%; height: 100%;
  overflow: visible;
  pointer-events: none;
  z-index: -1;
}
.heart-trail {
  fill: none;
  stroke: #ffe2a6;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 6px rgba(255, 200, 120, 0.9));
}
.heart-fill {
  fill: rgba(255, 196, 120, 0.12);
  opacity: 0;
}
.heart-spark { fill: #fff2cc; }
.heart-head {
  fill: #fffaf0;
  filter: drop-shadow(0 0 4px #ffd38a) drop-shadow(0 0 10px rgba(255, 190, 110, 0.9));
}

/* ---------- partiküller ---------- */
.particles {
  position: fixed; top: 0; left: 0; z-index: 3;
  width: 100%; height: 100lvh;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .hint, .cue::after, .standby { animation: none; }
  .progress { display: none; }
  .reveal { filter: none; transform: none; }
}
