/* =====================================================================
   The Days I Missed You — styles
   Visual language: deep space, aurora, frosted glass, holographic type.
   ===================================================================== */

:root {
  --bg:        #05060c;
  --bg-2:      #0a0e1c;
  --ink:       #eef1ff;
  --ink-soft:  #aeb4d6;
  --ink-faint: #5b6190;

  --c1: #7af9ff;   /* cyan   */
  --c2: #b388ff;   /* violet */
  --c3: #ff8fc7;   /* pink   */

  --glass:        rgba(255, 255, 255, 0.04);
  --glass-edge:   rgba(255, 255, 255, 0.14);
  --shadow:       0 40px 120px -30px rgba(0, 0, 0, 0.9);

  --serif: "Cormorant Garamond", Georgia, serif;
  --sans:  "Space Grotesk", system-ui, sans-serif;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html { scroll-behavior: smooth; }

body {
  background: radial-gradient(140% 100% at 50% -10%, var(--bg-2) 0%, var(--bg) 55%);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 300;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ---------- background layers ---------- */
#stars {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  z-index: 0; pointer-events: none;
}

.aurora {
  position: fixed; inset: -20% -10% auto -10%;
  height: 90vh; z-index: 0;
  filter: blur(80px) saturate(140%);
  opacity: 0.55; pointer-events: none;
}
.aurora-band {
  position: absolute; border-radius: 50%;
  mix-blend-mode: screen;
}
.band-1 {
  width: 60vw; height: 60vw; left: -5vw; top: -10vw;
  background: radial-gradient(circle, var(--c2), transparent 60%);
  animation: drift1 22s var(--ease) infinite alternate;
}
.band-2 {
  width: 55vw; height: 55vw; right: -8vw; top: -6vw;
  background: radial-gradient(circle, var(--c1), transparent 60%);
  animation: drift2 26s var(--ease) infinite alternate;
}
.band-3 {
  width: 45vw; height: 45vw; left: 30vw; top: 5vw;
  background: radial-gradient(circle, var(--c3), transparent 62%);
  animation: drift3 30s var(--ease) infinite alternate;
}
@keyframes drift1 { to { transform: translate(12vw, 8vh) scale(1.15); } }
@keyframes drift2 { to { transform: translate(-10vw, 6vh) scale(1.1); } }
@keyframes drift3 { to { transform: translate(6vw, -6vh) scale(1.2); } }

.grain {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  opacity: 0.05; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- side rail ---------- */
.rail {
  position: fixed; right: clamp(14px, 3vw, 42px); top: 50%;
  transform: translateY(-50%); z-index: 20;
}
.rail ul { list-style: none; display: flex; flex-direction: column; gap: 14px; }
.rail button {
  display: flex; align-items: center; gap: 10px;
  background: none; border: 0; cursor: pointer; color: var(--ink-faint);
  font-family: var(--sans); font-size: 11px; letter-spacing: 0.18em;
  text-transform: uppercase; transition: color 0.4s var(--ease);
}
.rail .dot {
  width: 9px; height: 9px; border-radius: 50%;
  border: 1px solid var(--ink-faint);
  transition: all 0.4s var(--ease); flex: none;
}
.rail .label { opacity: 0; transform: translateX(6px); transition: all 0.4s var(--ease); }
.rail button:hover .label,
.rail button.active .label { opacity: 1; transform: none; }
.rail button.active { color: var(--ink); }
.rail button.active .dot {
  border-color: var(--c1);
  background: var(--c1);
  box-shadow: 0 0 14px var(--c1);
  transform: scale(1.2);
}
@media (max-width: 720px) { .rail .label { display: none; } }

/* ---------- shared reveal ---------- */
[data-reveal] {
  opacity: 0; transform: translateY(26px);
  transition: opacity 1s var(--ease), transform 1s var(--ease);
}
[data-reveal].in { opacity: 1; transform: none; }

.eyebrow {
  font-size: clamp(11px, 1.4vw, 13px);
  letter-spacing: 0.42em; text-transform: uppercase;
  color: var(--ink-soft); font-weight: 400;
}

/* ---------- hero ---------- */
.hero {
  position: relative; z-index: 5;
  min-height: 100svh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 26px; padding: 8vh 24px;
}
.hero-name {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(56px, 13vw, 190px);
  line-height: 1.12; letter-spacing: -0.01em;
  padding-bottom: 0.12em;            /* room so descenders (j, g, y) stay painted */
  background: linear-gradient(110deg, var(--c1), var(--ink) 35%, var(--c3) 75%, var(--c2));
  background-size: 220% auto;
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  text-shadow: 0 0 60px rgba(122, 249, 255, 0.12);
  animation: shimmer 9s linear infinite;
}
@keyframes shimmer { to { background-position: 220% center; } }

.hero-line {
  font-family: var(--serif); font-style: italic;
  font-size: clamp(19px, 3vw, 30px);
  color: var(--ink-soft); max-width: 22ch; line-height: 1.4;
}
.scroll-cue {
  margin-top: 18px; display: flex; flex-direction: column; align-items: center; gap: 12px;
  font-size: 11px; letter-spacing: 0.32em; text-transform: uppercase; color: var(--ink-faint);
}
.scroll-cue i {
  width: 1px; height: 54px;
  background: linear-gradient(var(--ink-faint), transparent);
  position: relative; overflow: hidden;
}
.scroll-cue i::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(var(--c1), transparent);
  animation: cue 2.2s var(--ease) infinite;
}
@keyframes cue { 0% { transform: translateY(-100%); } 60%,100% { transform: translateY(100%); } }

/* ---------- day sections ---------- */
.day {
  position: relative; z-index: 5;
  height: 168vh;            /* extra room so each photo can "rise to front" */
}
.day-pin {
  position: sticky; top: 0;
  height: 100svh;
  display: grid; place-items: center;
  padding: 24px;
}
.day-stage {
  position: relative;
  width: min(560px, 86vw);
  display: flex; flex-direction: column; align-items: center; gap: 30px;
  will-change: transform, opacity, filter;
}

/* the giant ghost number behind the photo */
.day-ghost {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -58%);
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(180px, 40vw, 460px);
  line-height: 1; color: transparent;
  -webkit-text-stroke: 1px rgba(255, 255, 255, 0.07);
  white-space: nowrap; pointer-events: none; z-index: 0;
  will-change: transform;
}

.day-card {
  position: relative; z-index: 2;
  width: min(440px, 78vw); aspect-ratio: 4 / 5;
  border-radius: 22px; overflow: hidden;
  background: var(--glass);
  border: 1px solid var(--glass-edge);
  box-shadow: var(--shadow);
  backdrop-filter: blur(6px);
}
.day-card::after {           /* glossy edge light */
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: linear-gradient(135deg, rgba(255,255,255,0.18), transparent 40%);
  mix-blend-mode: overlay; pointer-events: none;
}
.day-card img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
/* graceful fallback if a photo isn't added yet */
.day-card .placeholder {
  position: absolute; inset: 0;
  display: grid; place-items: center; text-align: center; gap: 6px;
  background:
    radial-gradient(120% 120% at 30% 20%, rgba(179,136,255,0.25), transparent 55%),
    radial-gradient(120% 120% at 80% 90%, rgba(122,249,255,0.22), transparent 55%),
    linear-gradient(160deg, #11152a, #070912);
  color: var(--ink-soft); font-size: 13px; letter-spacing: 0.2em; text-transform: uppercase;
}
.day-card .placeholder b { font-size: 11px; color: var(--ink-faint); font-weight: 400; }

.day-meta { text-align: center; display: flex; flex-direction: column; gap: 12px; z-index: 2; }
.day-tag {
  font-size: clamp(18px, 2.6vw, 26px); letter-spacing: 0.34em; text-transform: uppercase;
  color: var(--c1); font-weight: 600;
}
.day-text {
  font-family: var(--serif); font-style: italic;
  font-size: clamp(20px, 3.4vw, 32px); line-height: 1.35;
  color: var(--ink); max-width: 24ch;
}
.day-date { font-size: 12px; letter-spacing: 0.24em; color: var(--ink-faint); text-transform: uppercase; }

/* ---------- finale ---------- */
.finale {
  position: relative; z-index: 5;
  min-height: 100svh;
  display: grid; place-items: center; text-align: center; padding: 14vh 24px;
}
.finale-inner { display: flex; flex-direction: column; align-items: center; gap: 22px; }
.finale-title {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(40px, 8vw, 96px); line-height: 1.02;
  background: linear-gradient(110deg, var(--c3), var(--ink) 50%, var(--c1));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  max-width: 16ch;
}
.finale-line {
  font-family: var(--serif); font-style: italic; color: var(--ink-soft);
  font-size: clamp(18px, 2.6vw, 26px); max-width: 30ch; line-height: 1.5;
}
.heart {
  width: 26px; height: 26px; margin-top: 8px; transform: rotate(45deg);
  background: var(--c3); position: relative;
  box-shadow: 0 0 30px var(--c3);
  animation: beat 1.8s var(--ease) infinite;
}
.heart::before, .heart::after { content: ""; position: absolute; width: 26px; height: 26px; background: var(--c3); border-radius: 50%; }
.heart::before { left: -13px; }
.heart::after  { top: -13px; }
@keyframes beat { 0%,100% { transform: rotate(45deg) scale(1); } 30% { transform: rotate(45deg) scale(1.18); } }

/* ---------- accessibility ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001s !important; animation-iteration-count: 1 !important; }
  [data-reveal] { opacity: 1; transform: none; }
}
