:root {
  --bg: #1d1015;
  --surface: rgba(255, 248, 243, 0.12);
  --text: #fff7f0;
  --muted: rgba(255, 247, 240, 0.74);
  --accent: #ffb085;
  --accent-strong: #ff7e74;
  --border: rgba(255, 255, 255, 0.18);
  --shadow: 0 24px 60px rgba(16, 8, 13, 0.4);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    linear-gradient(rgba(30, 13, 19, 0.42), rgba(30, 13, 19, 0.7)),
    radial-gradient(circle at top, rgba(255, 193, 140, 0.28), transparent 32%),
    linear-gradient(180deg, #6c3e3f 0%, #24141d 38%, #120c12 100%);
  color: var(--text);
  font-family: "Poppins", sans-serif;
  overflow-x: hidden;
}

body.locked { overflow: hidden; }
body.intro-complete .page-shell { opacity: 1; transform: none; }
.hidden { opacity: 0; transform: translateY(30px); }

.loading-screen,
.intro,
.success-modal {
  position: fixed;
  inset: 0;
  z-index: 30;
}

.loading-screen {
  display: grid;
  place-items: center;
  background: #120c12;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: opacity 0.8s ease;
}

.loading-screen.hidden,
.success-modal.hidden { opacity: 0; pointer-events: none; }

.intro {
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(180deg, rgba(20, 12, 15, 0.76), rgba(20, 12, 15, 0.95));
}

.intro-copy {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 620px;
}

.intro h1,
.hero h2,
.section-heading h3,
.modal-card h3 {
  font-family: "Playfair Display", serif;
}

.intro h1 { font-size: clamp(2.4rem, 6vw, 4.8rem); margin-bottom: 12px; }
.intro p { color: var(--muted); }

.intro-actions,
.share-actions,
.response-options {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
}

.gate {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
  background:
    linear-gradient(90deg, rgba(255, 192, 156, 0.18), rgba(255, 135, 105, 0.32)),
    url("assets/bg.jpg") center/cover;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  transition: transform 2s cubic-bezier(.22,1,.36,1);
}

.gate-left { left: 0; }
.gate-right { right: 0; }
.gate-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, rgba(255, 204, 128, 0.24), transparent 42%);
  filter: blur(22px);
}

body.intro-complete .gate-left { transform: translateX(-100%); }
body.intro-complete .gate-right { transform: translateX(100%); }
body.intro-complete .intro { opacity: 0; pointer-events: none; transition: opacity 1s ease 1.25s; }

.page-shell {
  position: relative;
  z-index: 1;
  transition: opacity 1s ease 1s, transform 1s ease 1s;
}

.section {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 88px 0;
}

.hero {
  min-height: 100vh;
  display: grid;
  align-items: center;
  background:
    linear-gradient(180deg, rgba(20, 10, 14, 0.2), rgba(20, 10, 14, 0.78)),
    url("assets/bg.jpg") center/cover;
  position: relative;
}

.top-nav {
  position: absolute;
  top: 28px;
  right: 0;
  display: flex;
  gap: 18px;
}

.top-nav a,
.share-actions button,
.response-choice,
.skip-button {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
}

.top-nav a {
  padding: 10px 16px;
  border-radius: 999px;
  text-decoration: none;
  backdrop-filter: blur(10px);
}

.hero-content {
  max-width: 620px;
  padding: 40px 0;
}

.hero h2 { font-size: clamp(3.3rem, 9vw, 6.4rem); line-height: 0.96; margin: 12px 0 18px; }
.typed-line { min-height: 54px; color: var(--muted); font-size: 1.05rem; }
.eyebrow {
  margin: 0;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: rgba(255, 231, 214, 0.86);
  font-size: 0.8rem;
}

.cta-button,
.share-actions button,
.response-choice,
.skip-button,
.music-toggle {
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.35s ease, box-shadow 0.35s ease, background 0.35s ease;
}

.cta-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 15px 28px;
  color: #31141a;
  text-decoration: none;
  background: linear-gradient(135deg, var(--accent), #ffd7ac);
  box-shadow: 0 18px 40px rgba(255, 159, 117, 0.28);
}

.glass-card {
  background: var(--surface);
  border: 1px solid var(--border);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
}

.quote-section {
  text-align: center;
  padding-top: 0;
}

.quote {
  margin: 0;
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  font-family: "Cormorant Garamond", serif;
  color: #ffe0c8;
}

.letter-card,
.response-form,
.modal-card {
  border-radius: 32px;
  padding: 30px;
}

.letter-card p { color: var(--muted); line-height: 1.9; }

.gallery {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.memory-card {
  min-height: 280px;
  position: relative;
  padding: 24px;
  display: flex;
  align-items: end;
  border-radius: 28px;
  overflow: hidden;
  background:
    linear-gradient(180deg, transparent, rgba(20, 10, 14, 0.82)),
    url("assets/bg.jpg") center/cover;
  transform: rotate(var(--twist));
  box-shadow: var(--shadow);
}

.memory-card:nth-child(1) { --twist: -2deg; }
.memory-card:nth-child(2) { --twist: 3deg; }
.memory-card:nth-child(3) { --twist: -1deg; }
.memory-card:nth-child(4) { --twist: 2deg; }

.response-options { justify-content: flex-start; margin-bottom: 18px; }
.response-choice,
.share-actions button,
.skip-button {
  padding: 14px 20px;
}

.response-form label {
  display: block;
  margin-bottom: 18px;
  color: var(--muted);
}

.response-form input,
.response-form textarea {
  width: 100%;
  margin-top: 8px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font: inherit;
}

.form-status { margin-top: 16px; min-height: 24px; color: #ffd8c5; }

.music-toggle {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 56px;
  height: 56px;
  z-index: 10;
  color: var(--text);
  background: linear-gradient(135deg, rgba(255, 176, 133, 0.92), rgba(255, 126, 116, 0.88));
  box-shadow: 0 15px 32px rgba(255, 124, 103, 0.3);
}

.success-modal {
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(11, 7, 11, 0.76);
  transition: opacity 0.4s ease;
}

.modal-card { max-width: 420px; text-align: center; }

.reveal {
  opacity: 0;
  transform: translateY(34px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.visible { opacity: 1; transform: none; }

.floating-hearts::before,
.floating-hearts::after {
  content: "❤";
  position: absolute;
  font-size: 24px;
  color: rgba(255, 203, 188, 0.3);
  animation: drift 6s linear infinite;
}

.floating-hearts::before { left: 12%; bottom: 18%; }
.floating-hearts::after { right: 18%; bottom: 12%; animation-delay: 2s; }

.cta-button:hover,
.share-actions button:hover,
.response-choice:hover,
.skip-button:hover,
.music-toggle:hover {
  transform: translateY(-3px);
  box-shadow: 0 20px 38px rgba(0, 0, 0, 0.18);
}

@keyframes drift {
  0% { transform: translateY(0) scale(1); opacity: 0; }
  20% { opacity: 1; }
  100% { transform: translateY(-180px) scale(1.4); opacity: 0; }
}

@media (max-width: 768px) {
  .top-nav {
    top: 20px;
    right: auto;
    left: 0;
    flex-wrap: wrap;
  }

  .section { padding: 72px 0; }
  .hero h2 { font-size: clamp(2.7rem, 13vw, 4.2rem); }
}
