:root {
  --deep: #041322;
  --ocean-1: #062a45;
  --ocean-2: #0b4870;
  --ocean-3: #14719e;
  --teal: #2fb8c6;
  --gold: #f3c969;
  --gold-soft: #f8dfa1;
  --foam: #eaf6f8;
  --ink: #dff1f6;
  --muted: #9fc2d1;
  --radius: 18px;
  --shadow: 0 20px 60px rgba(2, 10, 20, 0.55);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: radial-gradient(ellipse at top, var(--ocean-2) 0%, var(--ocean-1) 45%, var(--deep) 100%);
  color: var(--ink);
  font-family: "Segoe UI", ui-sans-serif, system-ui, -apple-system, sans-serif;
  overflow-x: hidden;
}

#stars {
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(1.5px 1.5px at 20% 30%, rgba(255,255,255,0.55), transparent),
    radial-gradient(1.5px 1.5px at 65% 15%, rgba(255,255,255,0.4), transparent),
    radial-gradient(1px 1px at 80% 60%, rgba(255,255,255,0.5), transparent),
    radial-gradient(1.5px 1.5px at 40% 80%, rgba(255,255,255,0.35), transparent),
    radial-gradient(1px 1px at 90% 25%, rgba(255,255,255,0.4), transparent),
    radial-gradient(1.5px 1.5px at 10% 70%, rgba(255,255,255,0.3), transparent);
  background-repeat: no-repeat;
  pointer-events: none;
  z-index: 0;
}

/* floating birthday sparkles that drift upward */
.sky { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.sky i {
  position: absolute; bottom: -24px; color: var(--gold); opacity: 0;
  animation: rise linear infinite; font-style: normal;
}
@keyframes rise {
  0% { transform: translateY(0) rotate(0); opacity: 0; }
  12% { opacity: 0.5; }
  88% { opacity: 0.32; }
  100% { transform: translateY(-108vh) rotate(300deg); opacity: 0; }
}
.conf { position: fixed; inset: 0; pointer-events: none; z-index: 60; }

.screen {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
}

.hidden { display: none !important; }

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 12px;
  color: var(--gold-soft);
  margin: 0 0 10px;
  font-weight: 600;
}

h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(32px, 6vw, 56px);
  margin: 0 0 14px;
  background: linear-gradient(120deg, var(--foam) 20%, var(--gold-soft) 55%, var(--foam) 80%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: 0.01em;
}

/* ---------- Passport entry ---------- */
.passport-card {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 600px;
  padding: 46px 34px 34px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
  border: 1px solid rgba(243, 201, 105, 0.28);
  box-shadow: var(--shadow);
  backdrop-filter: blur(6px);
}
.passport-card h1 { font-size: clamp(1.7rem, 5.4vw, 2.3rem); }
.lead {
  color: var(--muted);
  line-height: 1.7;
  margin: 0 auto 22px;
  max-width: 46ch;
  font-size: 15px;
}
.passage {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.1rem;
  line-height: 1.95;
  margin: 8px auto 4px;
  max-width: 48ch;
  color: var(--ink);
}
.blank {
  display: inline;
  color: var(--gold-soft);
  padding: 0 0.12em;
  letter-spacing: 0.16em;
  white-space: nowrap;
  animation: blankGlow 2.4s ease-in-out infinite;
}
@keyframes blankGlow {
  0%, 100% { text-shadow: 0 0 0 rgba(248,223,161,0); }
  50% { text-shadow: 0 0 14px rgba(248,223,161,0.55); }
}
.hint {
  color: var(--teal);
  font-style: italic;
  font-size: 0.95rem;
  margin: 18px 0 20px;
  opacity: 0.9;
}
.field {
  display: flex;
  gap: 10px;
  max-width: 420px;
  margin: 0 auto;
  flex-wrap: wrap;
  justify-content: center;
}
.field input {
  flex: 1;
  min-width: 220px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.16);
  color: var(--foam);
  font-family: inherit;
  font-size: 1.02rem;
  padding: 13px 16px;
  border-radius: 12px;
  text-align: center;
}
.field input::placeholder { color: rgba(159, 194, 209, 0.6); }
.field input:focus { outline: none; border-color: rgba(243, 201, 105, 0.55); background: rgba(255,255,255,0.08); }
.field .btn-primary { padding: 13px 26px; }
.msg { text-align: center; margin: 16px 0 0; min-height: 1.2em; font-size: 0.98rem; }
.msg.err { color: var(--gold-soft); }
.msg.ok { color: var(--teal); }

.load-error {
  text-align: center;
  color: var(--muted);
  line-height: 1.7;
  padding: 30px 10px;
}

.btn-primary {
  border: none;
  cursor: pointer;
  background: linear-gradient(120deg, var(--gold) 0%, var(--gold-soft) 100%);
  color: #1a2a1a;
  font-weight: 700;
  font-size: 15px;
  padding: 14px 34px;
  border-radius: 999px;
  box-shadow: 0 10px 30px rgba(243, 201, 105, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 36px rgba(243, 201, 105, 0.45); }
.btn-primary:active { transform: translateY(0); }

.hero { text-align: center; max-width: 640px; margin: 20px auto 40px; }
.hero-sub { color: var(--muted); line-height: 1.6; margin: 0 auto 20px; max-width: 480px; }
.song-btn {
  display: inline-block;
  margin: 16px 0 0;
  padding: 12px 26px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
  color: #0a1124;
  background: linear-gradient(120deg, var(--teal), #7fd8c3);
  box-shadow: 0 10px 30px rgba(47, 184, 198, 0.3);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.song-btn:hover { transform: translateY(-2px); box-shadow: 0 14px 36px rgba(47, 184, 198, 0.42); }

.next-unlock {
  display: inline-block;
  margin-top: 10px;
  padding: 10px 20px;
  border-radius: 999px;
  background: rgba(47, 184, 198, 0.12);
  border: 1px solid rgba(47, 184, 198, 0.35);
  color: var(--teal);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* ---------- The journey (a winding path of 15 doors) ---------- */
.journey {
  position: relative;
  width: 100%;
  max-width: 620px;
  margin: 0 auto 50px;
  padding: 8px 0 20px;
}
/* the dashed trail running down the middle */
.journey::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 3px;
  transform: translateX(-50%);
  background: repeating-linear-gradient(to bottom, rgba(243,201,105,0.45) 0 9px, transparent 9px 18px);
  z-index: 0;
}

.door {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  margin: 14px 0;
}

.door-medallion {
  grid-column: 2;
  position: relative;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  background: rgba(255,255,255,0.06);
  border: 2px solid rgba(255,255,255,0.16);
  box-shadow: 0 6px 20px rgba(0,0,0,0.4);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.door-num {
  position: absolute;
  top: -8px;
  left: -8px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--ocean-3);
  color: var(--foam);
  font-size: 11px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255,255,255,0.22);
}
.door-ico { line-height: 1; }

.door-card {
  max-width: 240px;
  background: linear-gradient(135deg, rgba(255,255,255,0.05), rgba(255,255,255,0.015));
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px;
  padding: 12px 16px;
  transition: transform 0.2s ease, border-color 0.2s ease;
}
/* alternate the card left and right of the trail */
.door:nth-child(odd) .door-card { grid-column: 3; justify-self: start; margin-left: 18px; text-align: left; }
.door:nth-child(even) .door-card { grid-column: 1; justify-self: end; margin-right: 18px; text-align: right; }

.door-date { font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin: 0 0 3px; }
.door-title { margin: 0; font-size: 15px; font-weight: 700; color: var(--ink); }
.door-title.locked-text { color: var(--muted); font-weight: 600; }
.door-sub { margin: 4px 0 0; font-size: 12px; color: var(--teal); }
.door-tag, .door-here { color: var(--gold-soft); font-weight: 700; }

/* unlocked */
.door.unlocked { cursor: pointer; }
.door.unlocked .door-medallion {
  background: linear-gradient(135deg, var(--gold), var(--gold-soft));
  border-color: rgba(243,201,105,0.6);
  color: #1a2a1a;
}
.door.unlocked .door-card { border-color: rgba(243,201,105,0.4); }
.door.unlocked:hover .door-card { transform: translateY(-2px); }
.door.unlocked:hover .door-medallion { transform: scale(1.06); }

/* locked */
.door.locked { opacity: 0.6; }

/* date reached, but she still has to catch that day's song */
.door.needs-song { cursor: pointer; }
.door.needs-song .door-medallion {
  background: rgba(47, 184, 198, 0.14);
  border-color: rgba(47, 184, 198, 0.55);
  animation: songpulse 2s ease-in-out infinite;
}
.door.needs-song .door-title { color: var(--teal); font-weight: 600; }
.door.needs-song:hover .door-card { transform: translateY(-2px); }
@keyframes songpulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(47,184,198,0.5); }
  50% { box-shadow: 0 0 0 9px rgba(47,184,198,0); }
}

/* bigger toward the birthday */
.door.tier-big .door-medallion { width: 66px; height: 66px; font-size: 25px; }
.door.tier-finale .door-medallion {
  width: 78px; height: 78px; font-size: 32px;
  border-color: rgba(243,201,105,0.7);
  box-shadow: 0 0 28px rgba(243,201,105,0.5);
}
.door.tier-finale .door-card {
  border-color: rgba(243,201,105,0.5);
  background: linear-gradient(135deg, rgba(243,201,105,0.14), rgba(255,255,255,0.02));
}

/* today: a gentle "you are here" pulse */
.door.today .door-medallion { animation: hereglow 1.9s ease-in-out infinite; }
@keyframes hereglow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(47,184,198,0.55); }
  50% { box-shadow: 0 0 0 11px rgba(47,184,198,0); }
}

@media (max-width: 560px) {
  .journey { max-width: 420px; }
  .journey::before { left: 33px; }
  .door { grid-template-columns: auto 1fr; }
  .door-medallion { grid-column: 1; }
  .door:nth-child(odd) .door-card,
  .door:nth-child(even) .door-card {
    grid-column: 2; justify-self: stretch; margin: 0 0 0 18px; text-align: left; max-width: none;
  }
}

.footer {
  color: var(--muted);
  font-size: 13px;
  margin-top: 20px;
  text-align: center;
}

.reveal-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(2, 8, 16, 0.75);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.reveal-card {
  position: relative;
  max-width: 560px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  background: linear-gradient(180deg, var(--ocean-2), var(--deep));
  border: 1px solid rgba(243, 201, 105, 0.3);
  border-radius: 22px;
  padding: 40px 32px;
  box-shadow: var(--shadow);
}

.reveal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 26px;
  cursor: pointer;
  line-height: 1;
}
.reveal-close:hover { color: var(--foam); }

.reveal-content h2 {
  font-family: Georgia, serif;
  color: var(--gold-soft);
  margin-top: 0;
}
.reveal-content p { line-height: 1.8; color: var(--ink); }

.reveal-date {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 6px;
}
.reveal-teaser {
  color: var(--gold-soft);
  font-style: italic;
  margin-top: 0;
}
.reveal-signoff {
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid rgba(255,255,255,0.12);
  color: var(--gold-soft);
  font-family: Georgia, serif;
  font-size: 17px;
}

.reveal-media { margin: 18px 0; }
.reveal-media figcaption {
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}
.reveal-content img, .reveal-content video {
  width: 100%;
  border-radius: 12px;
  display: block;
}
.reveal-content audio { width: 100%; display: block; }
.reveal-embed {
  width: 100%;
  height: 420px;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 12px;
  background: #fff;
  display: block;
}

.reveal-link {
  display: block;
  margin: 14px 0 0;
  padding: 16px 20px;
  border-radius: 14px;
  text-decoration: none;
  background: linear-gradient(120deg, var(--gold) 0%, var(--gold-soft) 100%);
  color: #1a2a1a;
  box-shadow: 0 10px 30px rgba(243, 201, 105, 0.28);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.reveal-link:hover { transform: translateY(-2px); box-shadow: 0 14px 36px rgba(243, 201, 105, 0.4); }
.reveal-link-label {
  display: block;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 0.01em;
}
.reveal-link-note {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  font-weight: 600;
  opacity: 0.75;
}

@media (max-width: 480px) {
  .node { padding: 14px 16px; gap: 12px; }
  .reveal-card { padding: 28px 20px; max-height: 90vh; }
  .gate-card { padding: 34px 22px; }
  .reveal-embed { height: 320px; }
}
