:root {
  --bg: #f6f1ec;
  --bg-2: #efe8e1;
  --ink: #2b2623;
  --ink-soft: #5d544e;
  --gold: #b8975a;
  --line: rgba(120, 100, 80, .18);
  --glass: rgba(255, 255, 255, .62);
  --glass-solid: #fbf8f5;
  --serif: "Playfair Display", Georgia, "Times New Roman", serif;
  --sans: "Jost", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --gutter: clamp(20px, 6vw, 56px);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--serif); font-weight: 400; line-height: 1.2; margin: 0; }
p { margin: 0 0 1.1em; }

/* ---------- Reveal ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 1.1s ease, transform 1.1s ease; }
.reveal.is-in { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

/* ---------- 1. Hero ---------- */
.hero {
  position: relative;
  min-height: 100vh; min-height: 100svh;
  display: grid; place-items: center;
  padding: 72px var(--gutter);
  text-align: center;
  background:
    radial-gradient(ellipse at 20% 10%, #fffaf3 0, transparent 55%),
    radial-gradient(ellipse at 85% 90%, #e6dfda 0, transparent 60%),
    linear-gradient(160deg, #f3eeea, #e4dede);
  overflow: hidden;
}
#sparkles { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.hero__inner { position: relative; max-width: 720px; }
.hero h1 { font-size: clamp(2.1rem, 8vw, 4.2rem); margin-bottom: .5em; }
.hero p { color: var(--ink-soft); font-size: clamp(1rem, 3.6vw, 1.2rem); max-width: 34em; margin: 0 auto 2em; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 12px 28px;
  border-radius: 999px;
  background: #fffdfb; color: var(--ink);
  text-decoration: none; font-size: 1rem;
  border: 1px solid var(--line);
  box-shadow: 0 6px 20px rgba(80, 60, 40, .12);
  transition: transform .3s ease, box-shadow .3s ease;
}
.btn:hover, .btn:focus-visible { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(80, 60, 40, .18); }

/* ---------- 2. Hayal: tıbbi kalp ---------- */
.dream {
  overflow: hidden;
  display: grid; gap: 8px; align-items: center; justify-items: center;
  padding: clamp(40px, 9vw, 72px) var(--gutter);
  background:
    radial-gradient(circle at 50% 30%, rgba(201, 96, 111, .10), transparent 60%),
    linear-gradient(180deg, var(--bg), #f1e9e3);
}
.dream__svg { width: 100%; height: auto; display: block; overflow: visible; }
.dream__art { overflow: hidden; width: min(100%, 440px); }
.dream__text { text-align: center; max-width: 560px; }
.dream__text h2 { font-size: clamp(1.9rem, 7vw, 3rem); margin-bottom: .6em; }
.dream__text p { color: var(--ink-soft); }

/* kalp: illüstrasyon görseli */
.dream__img { display: block; width: min(72vw, 320px); height: auto; margin: 0 auto; }

@media (min-width: 768px) {
  .dream {
    grid-template-columns: 1fr 1fr; gap: clamp(24px, 5vw, 72px);
    max-width: 1100px; margin: clamp(32px, 5vw, 64px) auto;
    border-radius: 28px; box-shadow: 0 24px 70px rgba(80, 60, 40, .12);
    padding: 56px clamp(32px, 5vw, 72px);
  }
  .dream__art { justify-self: end; }
  .dream__img { width: min(100%, 400px); }
  .dream__text { text-align: left; justify-self: start; }
  .dream__text p { color: var(--ink); }
}

/* ---------- 3. Mektup ---------- */
.letter-section {
  padding: clamp(40px, 9vw, 110px) 16px;
  background:
    radial-gradient(circle at 12% 20%, rgba(184, 151, 90, .18), transparent 40%),
    radial-gradient(circle at 90% 70%, rgba(150, 130, 120, .16), transparent 45%),
    var(--bg-2);
}
.letter {
  max-width: 720px; margin: 0 auto;
  padding: clamp(26px, 7vw, 64px) clamp(20px, 6vw, 60px);
  background: var(--glass-solid);
  border: 1px solid rgba(255, 255, 255, .8);
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(80, 60, 40, .12);
}
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .letter { background: var(--glass); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); }
}
/* Zarf */
.envelope-wrap { display: flex; flex-direction: column; align-items: center; padding-top: clamp(130px, 40vw, 210px); }
.envelope {
  position: relative; display: block; padding: 0; border: 0; background: none; cursor: pointer;
  width: min(86vw, 420px); aspect-ratio: 3 / 2; perspective: 1200px;
  -webkit-tap-highlight-color: transparent; filter: drop-shadow(0 18px 30px rgba(80, 60, 40, .18));
}
.envelope:focus-visible { outline: 2px solid var(--gold); outline-offset: 8px; }
.envelope span, .env__seal { position: absolute; display: block; }
.env__back { inset: 0; background: #e4d7c8; border-radius: 6px; z-index: 1; }
.env__paper {
  left: 6%; right: 6%; top: 8%; bottom: 4%; z-index: 2; border-radius: 4px;
  background: #fffdfb repeating-linear-gradient(180deg, transparent 0 22px, rgba(120, 100, 80, .1) 22px 23px);
  box-shadow: 0 1px 6px rgba(80, 60, 40, .12);
}
.env__paper::before { content: "¶1"; position: absolute; left: 0; right: 0; top: 14%; text-align: center; font-size: clamp(1.6rem, 7vw, 2.4rem); line-height: 1; color: var(--gold); }
.env__front { inset: 0; z-index: 3; border-radius: 6px; background: linear-gradient(180deg, #ecdfd0, #e0d2c1); clip-path: polygon(0 0, 50% 56%, 100% 0, 100% 100%, 0 100%); }
.env__flap {
  left: 0; right: 0; top: 0; height: 60%; z-index: 4; background: #ddcebd;
  clip-path: polygon(0 0, 100% 0, 50% 100%); transform-origin: top center;
  transition: transform 1.6s ease .5s, z-index 0s 1.2s, background-color 1.6s ease .5s;
}
.env__seal {
  left: 50%; top: 60%; width: 17%; z-index: 5; transform: translate(-50%, -50%);
  transition: transform 1s ease, opacity 1s ease;
  animation: sealbeat 2.4s ease-in-out infinite;
}
.envelope__hint { margin: 22px 0 0; letter-spacing: .06em; color: var(--ink-soft); transition: opacity .6s ease; }
@keyframes sealbeat { 0%, 100% { transform: translate(-50%, -50%) scale(1); } 50% { transform: translate(-50%, -50%) scale(1.07); } }

.envelope.is-open { cursor: default; }
.envelope.is-open .env__flap { transform: rotateX(180deg); z-index: 1; background-color: #efe4d6; }
.envelope.is-open .env__seal { animation: none; transform: translate(-50%, -50%) scale(1.5); opacity: 0; }
.envelope.is-open .env__paper { animation: cardpop 3s ease-in-out 1.6s both; }
@keyframes cardpop {
  0% { transform: translateY(0) scale(1); }
  55% { transform: translateY(-72%) scale(1); }
  78% { transform: translateY(-86%) scale(1.14); }
  100% { transform: translateY(-78%) scale(1.08); }
}
.envelope.is-open ~ .envelope__hint, .envelope-wrap:has(.is-open) .envelope__hint { opacity: 0; }

.letter-wrap { display: block; }
.js .letter-wrap { display: grid; grid-template-rows: 0fr; opacity: 0; visibility: hidden; transition: grid-template-rows 3s ease, opacity 2s ease, visibility 0s 3s; }
.js .letter-wrap.is-open { grid-template-rows: 1fr; opacity: 1; visibility: visible; transition: grid-template-rows 3.4s ease, opacity 2.6s ease .6s, visibility 0s; }
.letter-wrap__inner { min-height: 0; overflow: hidden; padding-top: 36px; }
.letter__title { font-size: clamp(1.7rem, 6.5vw, 2.6rem); text-align: center; margin-bottom: 1.2em; }
.letter__body { font-size: clamp(1rem, 3.8vw, 1.1rem); max-width: 65ch; margin: 0 auto; }
.letter__body h3 { font-size: clamp(1.15rem, 4.6vw, 1.5rem); font-style: italic; color: var(--gold); margin-bottom: 1.2em; }
.letter__body p { margin-bottom: 1.2em; }
.letter__body strong { font-weight: 500; }

/* ---------- 4. Gelecek ---------- */
.future { padding: clamp(56px, 10vw, 120px) var(--gutter); background: var(--bg); }
.future__head { text-align: center; margin-bottom: clamp(32px, 6vw, 64px); }
.future__eyebrow { font-size: .95rem; letter-spacing: .22em; text-transform: uppercase; color: var(--gold); margin: 0 0 1em; }
.future__head h2 { font-size: clamp(1.8rem, 7vw, 3rem); margin-bottom: .5em; }
.future__head p { color: var(--ink-soft); }
.manifest { max-width: 640px; margin: 0 auto; }
.manifest__label { display: block; font-family: var(--serif); font-size: 1.25rem; margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.manifest textarea {
  width: 100%; min-height: 180px; resize: vertical; display: block;
  font: inherit; font-size: 1rem; line-height: 1.7; color: var(--ink);
  background: #fffdfb; border: 1px solid var(--line); border-radius: 14px; padding: 16px;
  box-shadow: 0 4px 14px rgba(80, 60, 40, .06);
}
.manifest textarea:focus-visible, .manifest input:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.manifest__btn {
  display: block; width: 100%; min-height: 48px; margin-top: 14px; padding: 0 24px;
  font: inherit; letter-spacing: .04em; color: var(--ink); cursor: pointer;
  background: var(--glass-solid); border: 1px solid var(--gold); border-radius: 999px;
}
.manifest__hint { margin: 12px 0 0; text-align: center; color: var(--ink-soft); font-size: .95rem; }
.manifest__sealed { text-align: center; padding: 28px 20px; background: #fffdfb; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 4px 14px rgba(80, 60, 40, .06); }
.manifest__sealed[hidden], .manifest__form[hidden] { display: none; }
.manifest__seal { color: var(--gold); font-size: 1.8rem; margin: 0 0 .4em; }
.manifest__text { font-family: var(--serif); font-style: italic; font-size: 1.15rem; line-height: 1.8; white-space: pre-wrap; overflow-wrap: anywhere; text-align: left; max-width: 60ch; margin: 0 auto 1em; }
.manifest__date { color: var(--ink-soft); font-size: .95rem; margin: 0; }
.manifest__owner { margin-top: 28px; text-align: center; color: var(--ink-soft); font-size: .95rem; }
.manifest__owner summary { display: inline-block; min-height: 44px; line-height: 44px; padding: 0 16px; cursor: pointer; opacity: .55; }
.manifest__owner form { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.manifest__owner input { flex: 1 1 140px; max-width: 220px; min-height: 44px; padding: 0 14px; font: inherit; border: 1px solid var(--line); border-radius: 999px; background: #fffdfb; }
.manifest__owner button { min-height: 44px; padding: 0 22px; font: inherit; border: 1px solid var(--line); border-radius: 999px; background: var(--glass-solid); cursor: pointer; }
.manifest__owner p { flex-basis: 100%; margin: 4px 0 0; }
.manifest__owner:not([open]) ~ * { }

/* ---------- 5. Final ---------- */
.finale {
  min-height: 90vh; min-height: 90svh;
  display: grid; place-items: center;
  padding: 80px var(--gutter) calc(80px + env(safe-area-inset-bottom));
  text-align: center;
  background: linear-gradient(180deg, var(--bg), #ece4dc);
}
.finale__inner { max-width: 640px; }
.finale h2 { font-size: clamp(2.2rem, 9vw, 4rem); margin-bottom: .7em; }
.finale p { color: var(--ink-soft); font-size: clamp(1rem, 3.8vw, 1.2rem); }
.finale__sign { color: var(--ink); font-weight: 500; margin-top: 1.8em; }

/* ---------- Açılış animasyonu ---------- */
body.intro-lock { overflow: hidden; height: 100vh; height: 100dvh; }
.intro {
  position: fixed; inset: 0; z-index: 100;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at 50% 35%, #fffaf3, #efe6df 75%);
  transition: opacity 1s ease, visibility 1s;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.intro.is-out { opacity: 0; visibility: hidden; pointer-events: none; }
.intro__svg { width: min(82vw, 52vh, 380px); height: auto; overflow: visible; }
.intro .stem { fill: none; stroke: #7f9c7b; stroke-width: 3; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.4s ease-out forwards; }
.intro .leaf { fill: #8fae8a; transform-box: fill-box; transform-origin: 50% 100%; transform: scale(0); animation: pop .8s cubic-bezier(.2, .9, .3, 1.2) forwards; }
.intro .bloom { transform: scale(0) rotate(-40deg); animation: bloom 1.1s cubic-bezier(.2, .9, .3, 1.15) forwards; }
.intro .ribbon { fill: #c97b8b; opacity: 0; animation: fade .8s ease 2.6s forwards; }
.intro .heart { transform: scale(0); animation: pop .9s cubic-bezier(.2, .9, .3, 1.4) 3s forwards, beat 1.3s ease-in-out 3.9s infinite; }
.intro__cap { font-family: var(--serif); font-style: italic; font-size: clamp(1.3rem, 5vw, 1.8rem); color: var(--ink-soft); margin: 18px 0 0; opacity: 0; animation: fade 1s ease 3.8s forwards; }
.intro__skip { position: absolute; bottom: calc(32px + env(safe-area-inset-bottom)); font-size: 1rem; letter-spacing: .04em; color: var(--ink); padding: 10px 22px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255, 255, 255, .6); opacity: 0; animation: fade 1s ease 2s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes pop { to { transform: scale(1); } }
@keyframes bloom { to { transform: scale(1) rotate(0); } }
@keyframes fade { to { opacity: 1; } }
@keyframes beat { 0%, 100% { transform: scale(1); } 15% { transform: scale(1.12); } 30% { transform: scale(1); } 45% { transform: scale(1.08); } }

/* ---------- Müzik düğmesi ---------- */
.music {
  position: fixed; z-index: 120;
  right: calc(16px + env(safe-area-inset-right)); bottom: calc(16px + env(safe-area-inset-bottom));
  width: 48px; height: 48px; padding: 0; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--glass-solid); color: var(--ink-soft);
  border: 1px solid var(--line);
  box-shadow: 0 6px 20px rgba(80, 60, 40, .16);
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.music[hidden] { display: none; }
.music svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.music .music__on { display: none; }
.music.is-on { color: #a8324a; }
.music.is-on .music__on { display: block; }
.music.is-on .music__off { display: none; }
.music:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

/* ---------- Masaüstü ---------- */
@media (min-width: 1024px) {
  body { font-size: 19px; }
  .letter { max-width: 800px; }
  .letter__body { font-size: 1.2rem; line-height: 1.85; }
  .hero p, .finale p { font-size: 1.3rem; }
  }

@media (prefers-reduced-motion: reduce) {
  .env__seal { animation: none; }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .btn { transition: none; }
  /* Açılış: hareket yok, sadece yumuşak belirme */
  .intro .stem { stroke-dashoffset: 0; animation: none; }
  .intro .leaf, .intro .bloom, .intro .heart { transform: none; opacity: 0; animation: fade 1.4s ease forwards; }
  .intro .leaf { animation-delay: .6s; }
  .intro .heart { animation-delay: 2.4s; }
}

/* ---------- El yazısı mektup ---------- */
.letter {
  background: #fbf6ec !important;
  -webkit-backdrop-filter: none !important; backdrop-filter: none !important;
  border: 1px solid #e7dcc9;
  box-shadow: 0 20px 60px rgba(80, 60, 40, .14), inset 0 0 60px rgba(190, 160, 110, .10);
  position: relative;
}
.letter::before { content: ""; position: absolute; top: 0; bottom: 0; left: clamp(10px, 3vw, 28px); width: 1px; background: rgba(168, 80, 90, .28); }
.letter__title, .letter__body, .letter__body h3 { font-family: "Caveat", "Segoe Script", "Bradley Hand", cursive; color: #2c3a58; }
.letter__title { font-weight: 600; font-size: clamp(2rem, 8.5vw, 3rem); line-height: 1.15; }
.letter__body {
  --lh: 34px;
  font-size: 1.45rem; line-height: var(--lh); font-weight: 500; letter-spacing: .01em;
  background: repeating-linear-gradient(180deg, transparent 0, transparent calc(var(--lh) - 1px), rgba(110, 130, 170, .22) calc(var(--lh) - 1px), rgba(110, 130, 170, .22) var(--lh));
}
.letter__body h3 { font-size: 1.7rem; font-style: normal; font-weight: 600; color: #8a6a3c; line-height: var(--lh); margin: 0 0 var(--lh); }
.letter__body p { margin: 0 0 var(--lh); }
.letter__body strong { font-weight: 600; }
@media (min-width: 1024px) {
  .letter__body { --lh: 40px; font-size: 1.75rem; line-height: var(--lh); }
  .letter__body h3 { font-size: 2rem; }
}
