/* ===== Sofia · Dreamy Pastel ===== */
:root {
  --bg-1: #f3ecff;
  --bg-2: #ffe6f3;
  --bg-3: #ffd9ec;
  --ink: #5c4a66;
  --ink-soft: #8a7d94;
  --accent: #d96aa5;
  --accent-2: #8a5fb0;
  --grad: linear-gradient(90deg, #c98be0, #f08fbf);
  --card: rgba(255, 255, 255, 0.72);
  --card-line: rgba(255, 255, 255, 0.9);
  --shadow: 0 14px 38px rgba(160, 110, 170, 0.22);
  --radius: 24px;
}

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

html, body { height: 100%; }

body {
  font-family: 'Poppins', system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg-2);
  min-height: 100svh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
/* fixed full-viewport gradient layer (robust on iOS, no background-attachment bug) */
body::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: linear-gradient(165deg, var(--bg-1) 0%, var(--bg-2) 52%, var(--bg-3) 100%);
}

/* ---------- Screens ---------- */
#app { position: relative; z-index: 2; }

.screen {
  display: none;
  min-height: 100svh;
  padding: clamp(24px, 7vw, 56px) 22px calc(80px + env(safe-area-inset-bottom));
  align-items: center;
  justify-content: center;
}
.screen.active { display: flex; animation: screen-in 0.7s cubic-bezier(.2,.7,.2,1) both; }

@keyframes screen-in {
  from { opacity: 0; transform: translateY(22px) scale(.99); }
  to   { opacity: 1; transform: none; }
}

.screen-inner { width: 100%; max-width: 560px; }
.center { text-align: center; display: flex; flex-direction: column; align-items: center; }

/* ---------- Typography ---------- */
.eyebrow {
  font-size: 13px; letter-spacing: 3px; text-transform: uppercase;
  color: var(--accent-2); font-weight: 600; margin-bottom: 18px; opacity: .9;
}
.title {
  font-family: 'Quicksand', sans-serif; font-weight: 700;
  font-size: clamp(40px, 12vw, 64px); line-height: 1.08; color: var(--accent-2);
  letter-spacing: -.5px;
}
.title .accent { color: var(--accent); }
.heading {
  font-family: 'Quicksand', sans-serif; font-weight: 700;
  font-size: clamp(24px, 6.5vw, 34px); color: var(--accent-2); margin-bottom: 26px;
}
.lead { font-size: clamp(15px, 4.4vw, 18px); color: var(--ink-soft); margin: 16px 0 30px; max-width: 22ch; }
.center .lead { margin-left: auto; margin-right: auto; }

/* ---------- Buttons ---------- */
.btn {
  font-family: 'Quicksand', sans-serif; font-weight: 700; font-size: 16px;
  letter-spacing: .3px; color: #fff; border: none; cursor: pointer;
  padding: 15px 34px; border-radius: 40px; background: var(--grad);
  box-shadow: 0 10px 24px rgba(217, 106, 165, 0.4);
  transition: transform .15s ease, box-shadow .2s ease, filter .2s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(217,106,165,.5); }
.btn:active { transform: translateY(0) scale(.98); }
.btn-soft { background: var(--card); color: var(--accent-2); box-shadow: var(--shadow); }
.row { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: 8px; }

/* ---------- Story / Timeline ---------- */
.timeline { position: relative; margin: 10px 0 30px; padding-left: 26px; }
.timeline::before {
  content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 3px;
  background: linear-gradient(var(--accent), var(--accent-2)); border-radius: 3px; opacity: .5;
}
.tl-item { position: relative; margin-bottom: 22px; animation: screen-in .6s both; }
.tl-item::before {
  content: ""; position: absolute; left: -23px; top: 6px; width: 13px; height: 13px;
  border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px rgba(217,106,165,.18);
}
.tl-card {
  background: var(--card); border: 1px solid var(--card-line); border-radius: 20px;
  box-shadow: var(--shadow); overflow: hidden; backdrop-filter: blur(6px);
}
.tl-card > img { width: 100%; display: block; aspect-ratio: 4/3; object-fit: cover; }
.tl-gallery {
  display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch; scrollbar-width: none; padding: 8px 8px 4px;
}
.tl-gallery::-webkit-scrollbar { display: none; }
.tl-gallery img {
  flex: 0 0 auto; width: 78%; aspect-ratio: 3/4; object-fit: cover;
  border-radius: 14px; scroll-snap-align: center; box-shadow: 0 6px 16px rgba(160,110,170,.22);
}
.tl-body { padding: 14px 16px 16px; }
.tl-date { font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--accent); font-weight: 600; }
.tl-title { font-family: 'Quicksand', sans-serif; font-weight: 700; font-size: 18px; color: var(--accent-2); margin: 3px 0 4px; }
.tl-text { font-size: 14.5px; color: var(--ink-soft); line-height: 1.5; }

/* ---------- Compliments ---------- */
.compliment-card {
  position: relative; background: var(--card); border: 1px solid var(--card-line);
  border-radius: var(--radius); box-shadow: var(--shadow); backdrop-filter: blur(6px);
  padding: 40px 26px 32px; margin: 26px 0 28px; max-width: 460px; min-height: 180px;
  display: flex; align-items: center; justify-content: center;
}
.compliment-card .quote-mark {
  position: absolute; top: 4px; left: 18px; font-family: 'Cormorant Garamond', serif;
  font-size: 70px; color: var(--accent); opacity: .35; line-height: 1;
}
#compliment-text {
  font-family: 'Cormorant Garamond', serif; font-size: clamp(20px, 6vw, 26px);
  line-height: 1.45; color: var(--ink); font-style: italic;
  animation: fade-pop .5s both;
}
@keyframes fade-pop { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- Questions ---------- */
.q-progress { font-family: 'Quicksand', sans-serif; font-weight: 700; color: var(--accent); letter-spacing: 1px; margin-bottom: 14px; }
.question-host { animation: fade-pop .45s both; }
.q-emoji { font-size: 40px; text-align: center; display: block; margin-bottom: 8px; }
.q-text {
  font-family: 'Quicksand', sans-serif; font-weight: 700; font-size: clamp(21px, 6vw, 27px);
  color: var(--accent-2); text-align: center; line-height: 1.25; margin-bottom: 22px;
}
.chips { display: flex; flex-direction: column; gap: 12px; max-width: 460px; margin: 0 auto; }
.chip {
  background: var(--card); border: 2px solid transparent; border-radius: 18px;
  padding: 15px 18px; font-size: 16px; color: var(--ink); cursor: pointer;
  box-shadow: var(--shadow); text-align: left; transition: border-color .15s, transform .12s, background .15s;
  -webkit-tap-highlight-color: transparent;
}
.chip:hover { transform: translateY(-1px); }
.chip.selected { border-color: var(--accent); background: #fff; color: var(--accent-2); font-weight: 600; }
.own-wrap { margin: 14px auto 0; max-width: 460px; }
.own-input {
  width: 100%; border: 2px solid rgba(217,106,165,.3); border-radius: 16px;
  padding: 14px 16px; font-family: 'Poppins', sans-serif; font-size: 16px; color: var(--ink);
  background: rgba(255,255,255,.8); outline: none; transition: border-color .15s;
}
.own-input:focus { border-color: var(--accent); }
.q-actions { display: flex; justify-content: center; margin-top: 22px; }

/* ---------- Surprise / Finale ---------- */
.screen-surprise {
  background: linear-gradient(170deg, #ffe9f2 0%, #ffe0cf 55%, #ffc9a8 100%);
}
.letter {
  background: rgba(255,255,255,.78); border: 1px solid #fff; border-radius: var(--radius);
  box-shadow: 0 18px 44px rgba(190,120,90,.28); backdrop-filter: blur(6px);
  padding: 30px 26px; max-width: 520px; text-align: left; margin-bottom: 24px;
}
.letter h3 { font-family: 'Quicksand', sans-serif; color: #c25a86; font-size: 22px; margin-bottom: 14px; text-align: center; }
.letter p {
  font-family: 'Cormorant Garamond', serif; font-size: clamp(18px, 5vw, 21px);
  line-height: 1.6; color: #6e4b48; margin-bottom: 14px;
}
.letter p:last-child { margin-bottom: 0; }
.photo-finale { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-bottom: 22px; }
.photo-finale img {
  width: 150px; height: 150px; object-fit: cover; border-radius: 20px;
  border: 4px solid #fff; box-shadow: 0 12px 28px rgba(190,120,90,.3);
}
.love {
  font-family: 'Quicksand', sans-serif; font-weight: 700; font-size: clamp(30px, 9vw, 44px);
  color: #c25a86;
}
.love .big-heart { display: inline-block; animation: beat 1.4s ease-in-out infinite; }
@keyframes beat { 0%,100% { transform: scale(1); } 15% { transform: scale(1.25); } 30% { transform: scale(1.05); } 45% { transform: scale(1.18); } }
.signed { font-family: 'Cormorant Garamond', serif; font-style: italic; font-size: 18px; color: #8a5b58; margin-top: 12px; }

/* ---------- Floating hearts ---------- */
#hearts { position: fixed; inset: 0; pointer-events: none; z-index: 1; overflow: hidden; }
.heart {
  position: absolute; bottom: -40px; font-size: 18px; opacity: 0;
  animation: rise linear forwards;
}
@keyframes rise {
  0% { opacity: 0; transform: translateY(0) translateX(0) rotate(0); }
  10% { opacity: .8; }
  90% { opacity: .7; }
  100% { opacity: 0; transform: translateY(-112svh) translateX(var(--drift, 0)) rotate(40deg); }
}

/* ---------- Progress dots ---------- */
.progress {
  position: fixed; left: 0; right: 0; bottom: calc(16px + env(safe-area-inset-bottom));
  display: flex; gap: 8px; justify-content: center; z-index: 5;
}
.progress .dot {
  width: 8px; height: 8px; border-radius: 50%; background: rgba(138,95,176,.28);
  transition: all .3s ease;
}
.progress .dot.active { background: var(--accent); width: 22px; border-radius: 6px; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .screen.active, .tl-item, .question-host, #compliment-text { animation: none; }
  .love .big-heart { animation: none; }
  #hearts { display: none; }
}
