:root {
  --bg: #fff5f0;
  --bg-card: #ffffff;
  --rose: #e8a0a8;
  --rose-deep: #c97b86;
  --peach: #ffd9c7;
  --cream: #fff5f0;
  --ink: #5a4a4a;
  --ink-soft: #8a7676;
  --shadow: 0 8px 30px rgba(201, 123, 134, 0.18);
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

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

body {
  font-family: var(--sans);
  color: var(--ink);
  background: linear-gradient(160deg, var(--cream) 0%, var(--peach) 100%);
  min-height: 100vh;
}

.screen { min-height: 100vh; }
[hidden] { display: none !important; }

/* ---- Гейт ---- */
.gate {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  transition: opacity 0.6s ease;
}
.gate.fade-out { opacity: 0; }

.gate-card {
  background: var(--bg-card);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 40px 28px;
  width: 100%;
  max-width: 380px;
  text-align: center;
}

.gate-title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 2rem;
  color: var(--rose-deep);
  margin-bottom: 8px;
}
.gate-sub { color: var(--ink-soft); margin-bottom: 28px; }

.gate-form { display: flex; flex-direction: column; gap: 14px; }

.date-input {
  font-size: 1.1rem;
  padding: 14px 16px;
  border: 2px solid var(--peach);
  border-radius: 14px;
  background: var(--cream);
  color: var(--ink);
  text-align: center;
}
.date-input:focus { outline: none; border-color: var(--rose); }

.btn-unlock {
  font-size: 1.1rem;
  font-weight: 600;
  padding: 14px;
  border: none;
  border-radius: 14px;
  background: var(--rose);
  color: #fff;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.2s ease;
}
.btn-unlock:hover { background: var(--rose-deep); }
.btn-unlock:active { transform: scale(0.97); }

.hint {
  margin-top: 18px;
  min-height: 1.4em;
  color: var(--rose-deep);
  font-style: italic;
}

@media (min-width: 640px) {
  .gate-title { font-size: 2.4rem; }
}

/* ---- Таймлайн ---- */
.timeline-screen {
  padding: 32px 16px 64px;
  opacity: 1;
}
.timeline-screen.fade-in {
  animation: fadeIn 0.8s ease;
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.timeline-header { text-align: center; margin-bottom: 36px; }
.timeline-title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 2rem;
  color: var(--rose-deep);
}

.timeline {
  position: relative;
  max-width: 600px;
  margin: 0 auto;
  padding-left: 36px;
}
/* вертикальная линия */
.timeline::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--peach);
}

.memory {
  position: relative;
  background: var(--bg-card);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 18px 18px 20px;
  margin-bottom: 28px;
}
.memory-marker {
  position: absolute;
  left: -36px;
  top: 16px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--cream);
  border: 2px solid var(--rose);
  border-radius: 50%;
  font-size: 0.95rem;
}
.memory-date { font-size: 0.85rem; color: var(--ink-soft); margin-bottom: 4px; }
.memory-title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.4rem;
  color: var(--rose-deep);
  margin-bottom: 10px;
}
.memory-img {
  width: 100%;
  border-radius: 12px;
  margin-bottom: 10px;
  display: block;
}
.memory-video {
  width: 100%;
  border-radius: 12px;
  margin-bottom: 10px;
  display: block;
  background: #000;
}
.memory-text { line-height: 1.55; color: var(--ink); }

.final-note {
  text-align: center;
  font-family: var(--serif);
  font-size: 1.6rem;
  color: var(--rose-deep);
  margin-top: 40px;
}

@media (min-width: 640px) {
  .timeline-title { font-size: 2.6rem; }
}

/* появление карточек при скролле */
.memory {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.memory.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---- Кнопка звука ---- */
.sound-toggle {
  position: fixed;
  right: 16px;
  bottom: 16px;
  width: 52px;
  height: 52px;
  border: none;
  border-radius: 50%;
  background: var(--bg-card);
  box-shadow: var(--shadow);
  font-size: 1.4rem;
  cursor: pointer;
  z-index: 10;
}
.sound-toggle:active { transform: scale(0.94); }
