:root {
  --bg: #07060d;
  --bg-2: #0f0d1c;
  --panel: rgba(22, 19, 40, 0.72);
  --line: rgba(255, 255, 255, 0.08);
  --text: #ece8ff;
  --muted: #9a93bd;
  --rose: #ff4f8b;
  --rose-soft: #ff9cc0;
  --gold: #ffd166;
  --cyan: #4cf2e0;
  --violet: #9d7bff;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --serif: "Fraunces", Georgia, serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}
a { color: inherit; }

/* Background layers */
#matrix {
  position: fixed; inset: 0; z-index: 0;
  opacity: 0.22; pointer-events: none;
}
.glow {
  position: fixed; z-index: 0; pointer-events: none;
  width: 60vmax; height: 60vmax; border-radius: 50%;
  filter: blur(120px); opacity: 0.28;
}
.glow.one { background: var(--rose); top: -20vmax; right: -20vmax; }
.glow.two { background: var(--violet); bottom: -25vmax; left: -20vmax; }
main, nav, footer { position: relative; z-index: 1; }

/* Nav */
nav {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1.2rem clamp(1rem, 5vw, 4rem);
  font-size: 0.85rem;
}
nav .brand { color: var(--rose-soft); text-decoration: none; }
nav .brand span { color: var(--cyan); }
nav .links a {
  text-decoration: none; color: var(--muted); margin-left: 1.4rem;
  transition: color .2s;
}
nav .links a:hover, nav .links a.active { color: var(--cyan); }

section { padding: clamp(4rem, 9vw, 7rem) clamp(1rem, 5vw, 4rem); max-width: 1180px; margin: 0 auto; }

.eyebrow {
  font-size: 0.78rem; letter-spacing: 0.25em; text-transform: uppercase;
  color: var(--cyan); margin-bottom: 1rem;
}
.eyebrow::before { content: "// "; color: var(--muted); }
h2 {
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(2rem, 5vw, 3.4rem); line-height: 1.1;
  margin-bottom: 1.5rem;
}
h2 em { color: var(--rose); font-style: italic; }

/* Hero */
.hero { min-height: 88vh; display: flex; flex-direction: column; justify-content: center; text-align: center; }
.hero .version {
  display: inline-block; margin: 0 auto 1.6rem;
  border: 1px solid rgba(76,242,224,.35); color: var(--cyan);
  padding: .35rem .9rem; border-radius: 999px; font-size: .8rem;
  background: rgba(76,242,224,.06);
}
.hero h1 {
  font-family: var(--serif); font-weight: 700;
  font-size: clamp(2.6rem, 9vw, 7rem); line-height: .98;
  letter-spacing: -0.02em;
}
.hero h1 .big18 {
  display: block;
  font-family: var(--mono); font-weight: 800;
  font-size: clamp(5rem, 20vw, 14rem);
  background: linear-gradient(120deg, var(--gold), var(--rose) 45%, var(--violet));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  line-height: .9; margin: .1em 0;
  text-shadow: 0 0 80px rgba(255,79,139,.25);
}
.hero .name {
  margin-top: 1.4rem; font-size: clamp(1rem, 2.6vw, 1.5rem);
  letter-spacing: .3em; text-transform: uppercase; color: var(--rose-soft);
}
.glitch { position: relative; }
.glitch::before, .glitch::after {
  content: attr(data-text); position: absolute; inset: 0;
  opacity: .7; pointer-events: none;
}
.glitch::before { color: var(--cyan); transform: translate(2px, 0); clip-path: inset(0 0 60% 0); animation: glitch 3.2s infinite steps(2); }
.glitch::after { color: var(--rose); transform: translate(-2px, 0); clip-path: inset(55% 0 0 0); animation: glitch 2.7s infinite steps(2) reverse; }
@keyframes glitch {
  0%, 88%, 100% { transform: translate(0); opacity: 0; }
  90% { transform: translate(3px, -1px); opacity: .8; }
  94% { transform: translate(-3px, 1px); opacity: .8; }
}
.hero .date { margin-top: 1rem; color: var(--muted); font-size: .9rem; }
.scroll-hint { margin-top: 3rem; color: var(--muted); font-size: .8rem; animation: float 2.4s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(8px); } }

/* Uptime */
.uptime {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem; margin-top: 2rem;
}
.stat {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 1.4rem 1rem; text-align: center; backdrop-filter: blur(8px);
}
.stat b { display: block; font-size: clamp(1.6rem, 4vw, 2.4rem); color: var(--gold); font-variant-numeric: tabular-nums; }
.stat span { font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .15em; }

/* Photo + letter */
.memory { display: grid; grid-template-columns: minmax(260px, 420px) 1fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
@media (max-width: 820px) { .memory { grid-template-columns: 1fr; } }
.polaroid {
  background: #f8f4ee; padding: 14px 14px 56px; border-radius: 4px;
  transform: rotate(-2.5deg);
  box-shadow: 0 30px 70px rgba(0,0,0,.55), 0 0 60px rgba(255,79,139,.2);
  position: relative; transition: transform .4s;
}
.polaroid:hover { transform: rotate(0deg) scale(1.02); }
.polaroid img { width: 100%; display: block; aspect-ratio: 3/4; object-fit: cover; object-position: 60% 35%; }
.polaroid figcaption {
  position: absolute; bottom: 14px; left: 0; right: 0; text-align: center;
  font-family: var(--serif); font-style: italic; color: #3a2c3a; font-size: 1.05rem;
}
.polaroid .tape {
  position: absolute; top: -14px; left: 50%; width: 110px; height: 30px;
  transform: translateX(-50%) rotate(3deg);
  background: rgba(255, 209, 102, .55);
}
.letter p { font-family: var(--serif); font-size: clamp(1.08rem, 1.8vw, 1.3rem); line-height: 1.75; color: #ddd7f5; margin-bottom: 1.1rem; }
.letter p strong { color: var(--rose-soft); font-weight: 600; }
.letter .sign { font-style: italic; color: var(--gold); }

/* Buttons */
.btn {
  font-family: var(--mono); font-size: .9rem; cursor: pointer;
  background: linear-gradient(120deg, var(--rose), var(--violet));
  color: white; border: 0; padding: .75rem 1.4rem; border-radius: 999px;
  box-shadow: 0 10px 30px rgba(255,79,139,.35); transition: transform .2s, box-shadow .2s;
  text-decoration: none; display: inline-block;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 14px 40px rgba(255,79,139,.5); }
.btn.ghost { background: transparent; border: 1px solid rgba(76,242,224,.4); color: var(--cyan); box-shadow: none; }

/* Motivation */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1.2rem; }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px;
  padding: 1.6rem; position: relative; overflow: hidden; backdrop-filter: blur(8px);
  transition: transform .3s, border-color .3s;
}
.card:hover { transform: translateY(-4px); border-color: rgba(255,79,139,.4); }
.card .hash { font-size: .72rem; color: var(--muted); }
.card h3 { font-family: var(--serif); font-size: 1.35rem; margin: .5rem 0 .6rem; color: var(--text); }
.card p { color: #bfb8de; font-size: .9rem; }
.card::after {
  content: ""; position: absolute; inset: auto -40% -60% auto; width: 180px; height: 180px;
  background: radial-gradient(circle, rgba(255,79,139,.25), transparent 70%);
}

/* Photo slot for future pictures */
.gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.2rem; margin-top: 2rem; }
.slot {
  aspect-ratio: 3/4; border: 2px dashed rgba(255, 209, 102, .45); border-radius: 14px;
  display: grid; place-items: center; text-align: center; padding: 1.5rem;
  color: var(--gold); background: rgba(255, 209, 102, .05); font-size: .85rem;
}
.slot img { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; }
.slot.photo { display: flex; flex-direction: column; gap: .8rem; padding: 1rem; }
.slot.photo img { flex: 1; min-height: 0; }
.slot figcaption { font-family: var(--serif); font-style: italic; font-size: 1rem; line-height: 1.4; color: var(--gold); }
/* landscape group photo spans two columns so nobody gets cropped out */
.slot.wide { grid-column: span 2; aspect-ratio: 3/2; }
/* phones keep the collection look: two columns, group photo still full width */
@media (max-width: 560px) {
  .gallery { grid-template-columns: repeat(2, 1fr); gap: .7rem; }
  .slot { padding: .9rem; font-size: .75rem; }
  .slot.photo { gap: .5rem; padding: .5rem; }
  .slot img { border-radius: 8px; }
  .slot figcaption { font-size: .8rem; line-height: 1.3; }
}

/* Candles */
.cake { text-align: center; }
.candles { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; max-width: 640px; margin: 2rem auto; }
.candle {
  width: 16px; height: 64px; border-radius: 4px; cursor: pointer; position: relative; border: 0;
  background: repeating-linear-gradient(45deg, var(--rose-soft) 0 6px, #fff 6px 12px);
}
.candle::before {
  content: ""; position: absolute; top: -22px; left: 50%; width: 12px; height: 20px;
  transform: translateX(-50%); border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  background: radial-gradient(circle at 50% 70%, #fff 0 20%, var(--gold) 40%, #ff7a3d 75%);
  box-shadow: 0 0 18px 6px rgba(255, 180, 60, .55);
  animation: flicker .25s infinite alternate;
}
.candle.out::before { opacity: 0; animation: none; box-shadow: none; }
.candle.out::after {
  content: "~"; position: absolute; top: -28px; left: 50%; transform: translateX(-50%);
  color: var(--muted); animation: smoke 1.4s forwards;
}
@keyframes flicker { to { transform: translateX(-50%) scale(1.08, .94) rotate(3deg); } }
@keyframes smoke { to { opacity: 0; transform: translate(-50%, -24px); } }
#wish { min-height: 2rem; font-family: var(--serif); font-size: 1.4rem; color: var(--gold); margin-top: 1rem; }

/* CTA */
.cta {
  text-align: center; background: var(--panel); border: 1px solid var(--line);
  border-radius: 24px; padding: clamp(2.5rem, 6vw, 4rem);
}
.cta p { color: var(--muted); max-width: 520px; margin: 0 auto 1.8rem; }

/* Birthday song toggle */
.music {
  position: fixed; right: 1.2rem; bottom: 1.2rem; z-index: 45;
  font-family: var(--mono); font-size: .8rem; cursor: pointer;
  background: rgba(12, 11, 22, .85); color: var(--cyan);
  border: 1px solid rgba(76,242,224,.4); border-radius: 999px; padding: .6rem 1rem;
  backdrop-filter: blur(6px);
}
.music[aria-pressed="true"] { color: var(--rose-soft); border-color: rgba(255,79,139,.5); }

footer { text-align: center; color: var(--muted); padding: 3rem 1rem; font-size: .8rem; }
footer span { color: var(--rose); }
footer .made { font-size: .9rem; color: var(--text); }
footer .note { font-family: var(--serif); font-style: italic; font-size: 1.05rem; color: var(--rose-soft); max-width: 34rem; margin: .8rem auto; line-height: 1.6; }
footer small { font-size: .75rem; }

.reveal { opacity: 0; transform: translateY(30px); transition: opacity .9s ease, transform .9s ease; }
.reveal.in { opacity: 1; transform: none; }

#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 40; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}
