/* =========================================================
   Our First Year — styles
   ========================================================= */

:root {
  --ink: #fbf1ea;
  --ink-soft: #e8d6dc;
  --muted: #b99aa6;
  --rose: #f2a7b9;
  --rose-deep: #d9627f;
  --gold: #e9c79f;
  --blue: #9fb4d6;
  --paper: #fbf6f0;
  --paper-ink: #4a2d36;

  --card-bg: rgba(255, 240, 245, 0.055);
  --card-border: rgba(255, 210, 225, 0.14);

  --gutter: 170px;
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --script: "Great Vibes", "Brush Script MT", cursive;
  --sans: "Jost", system-ui, -apple-system, "Segoe UI", sans-serif;

  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.6;
  background: #1a0816;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Romantic night-sky gradient (fixed, works on mobile too) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(ellipse 80% 60% at 15% 0%, rgba(150, 40, 90, .45) 0%, transparent 60%),
    radial-gradient(ellipse 70% 50% at 95% 35%, rgba(90, 30, 110, .40) 0%, transparent 60%),
    radial-gradient(ellipse 90% 60% at 50% 110%, rgba(200, 80, 110, .30) 0%, transparent 60%),
    linear-gradient(180deg, #160713 0%, #230a1f 45%, #2b0c22 75%, #1a0814 100%);
}

#sky {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

img { max-width: 100%; display: block; }
a { color: inherit; }

.script { font-family: var(--script); font-weight: 400; }

.eyebrow {
  font-family: var(--sans);
  font-size: .72rem;
  font-weight: 400;
  letter-spacing: .32em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 .6rem;
}

/* ---------- reveal on scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 1s var(--ease), transform 1s var(--ease);
}
.reveal.in { opacity: 1; transform: none; }

/* =========================================================
   HERO
   ========================================================= */
.hero {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 64px 16px 96px;
  position: relative;
}
.hero-inner { max-width: 1100px; width: 100%; display: flex; flex-direction: column; align-items: center; }

.title {
  font-size: clamp(4rem, 13vw, 8.5rem);
  line-height: 1;
  margin: .1em 0 .15em;
  background: linear-gradient(100deg, var(--gold) 0%, #ffd9e2 45%, var(--rose) 70%, var(--gold) 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shimmer 8s linear infinite;
  filter: drop-shadow(0 4px 30px rgba(242, 167, 185, .25));
  padding: 0 .15em;
}
@keyframes shimmer { to { background-position: 200% center; } }

.names {
  font-size: clamp(1.4rem, 3.4vw, 1.9rem);
  font-style: italic;
  letter-spacing: .04em;
  margin: 0 0 2rem;
  color: var(--ink-soft);
}
.names .amp { font-family: var(--script); font-style: normal; color: var(--rose); font-size: 1.4em; margin: 0 .25em; }

.hero-photo {
  width: min(210px, 56vw);
  aspect-ratio: 3 / 4;
  padding: 8px;
  border-radius: 999px 999px 26px 26px;
  border: 1px solid rgba(233, 199, 159, .55);
  box-shadow: 0 0 0 6px rgba(233, 199, 159, .06), 0 30px 80px rgba(0, 0, 0, .5), 0 0 80px rgba(242, 167, 185, .18);
  margin-bottom: 2.2rem;
}
.hero-photo img, .hero-photo .ph {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 999px 999px 20px 20px;
}

.counter { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.tile {
  min-width: 84px;
  padding: 12px 10px 10px;
  border-radius: 16px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.tile b {
  display: block;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 2rem;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.tile span {
  font-family: var(--sans);
  font-size: .62rem;
  letter-spacing: .25em;
  text-transform: uppercase;
  color: var(--muted);
}
.counter-note { font-style: italic; color: var(--muted); margin: .9rem 0 0; }

.scroll-cue {
  position: absolute;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-decoration: none;
  font-family: var(--sans);
  font-size: .7rem;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--gold);
  opacity: .85;
}
.scroll-cue svg {
  width: 22px; height: 22px;
  fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round;
  animation: bob 2.2s ease-in-out infinite;
}
@keyframes bob { 50% { transform: translateY(7px); } }

/* =========================================================
   STORY / TIMELINE
   ========================================================= */
.story-intro { text-align: center; padding: 40px 16px 30px; max-width: 640px; margin: 0 auto; }
.story-intro h2 {
  font-weight: 500;
  font-size: clamp(2.2rem, 6vw, 3.4rem);
  line-height: 1.1;
  margin: 0 0 .5rem;
}
.story-intro p:last-child { color: var(--muted); font-style: italic; font-size: 1.2rem; margin: 0; }

.timeline {
  position: relative;
  max-width: 1120px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

.path-svg {
  position: absolute;
  top: 0; left: 0;
  pointer-events: none;
  overflow: visible;
  z-index: 0;
}
.path-svg path { fill: none; stroke-linecap: round; }
.path-bg { stroke: rgba(242, 167, 185, .28); stroke-width: 1.5; stroke-dasharray: 1 9; }
.path-fg { stroke-width: 2.6; filter: drop-shadow(0 0 6px rgba(242, 167, 185, .7)); }

.traveler {
  position: absolute;
  top: 0; left: 0;
  width: 22px; height: 22px;
  z-index: 3;
  pointer-events: none;
  will-change: transform;
  opacity: 0;
  transition: opacity .4s;
}
.traveler.on { opacity: 1; }
.traveler svg {
  width: 100%; height: 100%;
  fill: #ffd9e2;
  filter: drop-shadow(0 0 6px #f2a7b9) drop-shadow(0 0 14px rgba(217, 98, 127, .9));
  animation: beat 1.3s ease-in-out infinite;
}
@keyframes beat { 0%, 100% { transform: scale(1); } 15% { transform: scale(1.22); } 30% { transform: scale(.95); } 45% { transform: scale(1.12); } }

.memory { position: relative; z-index: 1; margin-bottom: 70px; }
.memory:last-child { margin-bottom: 0; }

.transition-text {
  display: block;
  width: max-content;
  max-width: 90%;
  margin: 0 auto 34px;
  padding: 6px 18px;
  font-style: italic;
  font-size: 1.25rem;
  color: var(--gold);
  border-radius: 999px;
  background: rgba(30, 9, 26, .75);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  position: relative;
  z-index: 2;
}
.transition-text::before, .transition-text::after { content: "—"; opacity: .5; margin: 0 .5em; }

.memory-row {
  display: grid;
  grid-template-columns: 1fr var(--gutter) 1fr;
  align-items: center;
}

.node {
  grid-column: 2;
  grid-row: 1;
  justify-self: center;
  width: 50px; height: 50px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #24091f;
  border: 1.5px solid rgba(242, 167, 185, .35);
  position: relative;
  z-index: 2;
  cursor: pointer;
  transition: transform .5s var(--ease), box-shadow .5s, border-color .5s;
  --c: var(--rose);
}
.node svg { width: 22px; height: 22px; fill: var(--c); opacity: .45; transition: opacity .5s; }
.node .crack { fill: none; stroke: #24091f; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.node.lit { border-color: var(--c); box-shadow: 0 0 0 6px rgba(255, 255, 255, .03), 0 0 26px var(--c); transform: scale(1.08); }
.node.lit svg { opacity: 1; }
.mood-hard .node { --c: var(--blue); border-color: rgba(159, 180, 214, .35); }
.mood-milestone .node { --c: var(--gold); border-color: rgba(233, 199, 159, .4); }

.card {
  grid-row: 1;
  width: 100%;
  max-width: 470px;
  padding: 20px 20px 28px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 240, 245, .075), rgba(255, 240, 245, .03));
  border: 1px solid var(--card-border);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 30px 60px rgba(0, 0, 0, .35);
  transition: opacity 1s var(--ease), transform 1s var(--ease);
}
.left .card { grid-column: 1; justify-self: end; }
.right .card { grid-column: 3; justify-self: start; }

.memory .card { opacity: 0; }
.left .card { transform: translateX(-50px); }
.right .card { transform: translateX(50px); }
.memory.in .card { opacity: 1; transform: none; }
.memory .transition-text { opacity: 0; transform: translateY(14px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.memory.in .transition-text { opacity: 1; transform: none; }

.mood-hard .card {
  border-color: rgba(159, 180, 214, .22);
  background: linear-gradient(180deg, rgba(159, 180, 214, .09), rgba(159, 180, 214, .025));
}
.mood-milestone .card { border-color: rgba(233, 199, 159, .28); }

/* photos */
.photos { position: relative; margin: -2px 6px 26px; }
.photos.has-more::before,
.photos.has-more::after {
  content: "";
  position: absolute;
  inset: 0;
  background: #eadfd3;
  border-radius: 4px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .35);
}
.photos.has-more::before { transform: rotate(4deg) translate(6px, 2px); }
.photos.has-more::after { transform: rotate(-3.5deg) translate(-4px, 4px); background: #f3eae0; }

.polaroid {
  position: relative;
  z-index: 1;
  margin: 0;
  padding: 12px 12px 10px;
  background: var(--paper);
  border-radius: 4px;
  box-shadow: 0 20px 44px rgba(0, 0, 0, .45);
  transform: rotate(var(--tilt, -1.5deg));
  transition: transform .6s var(--ease);
  cursor: zoom-in;
}
.card:hover .polaroid { transform: rotate(0deg) scale(1.02); }
.polaroid::before { /* washi tape */
  content: "";
  position: absolute;
  top: -12px; left: 50%;
  width: 96px; height: 26px;
  transform: translateX(-50%) rotate(-3deg);
  background: rgba(242, 167, 185, .55);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .15);
  z-index: 2;
}
.mood-hard .polaroid::before { background: rgba(159, 180, 214, .6); }
.mood-milestone .polaroid::before { background: rgba(233, 199, 159, .7); }

.polaroid img, .polaroid .ph {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 2px;
}
.mood-hard .polaroid img { filter: saturate(.75) contrast(.97); }
.polaroid figcaption {
  font-family: var(--script);
  color: var(--paper-ink);
  font-size: 1.65rem;
  line-height: 1.2;
  text-align: center;
  padding-top: 8px;
  min-height: 1.4em;
}
.photo-count {
  position: absolute;
  right: 20px; bottom: 54px;
  z-index: 2;
  padding: 3px 10px;
  border-radius: 999px;
  font-family: var(--sans);
  font-size: .68rem;
  letter-spacing: .12em;
  background: rgba(26, 8, 22, .7);
  color: #fff;
  backdrop-filter: blur(4px);
}

/* placeholder for photos not added yet */
.ph {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 12px;
  text-align: center;
  background: linear-gradient(135deg, #f7d6de 0%, #efcfc0 55%, #e8c4a8 100%);
  color: #8a5566;
}
.ph .ph-heart { font-size: 2rem; line-height: 1; }
.ph small { font-family: var(--sans); font-size: .66rem; letter-spacing: .25em; text-transform: uppercase; }
.ph code { font-size: .72rem; word-break: break-all; opacity: .85; }

/* memory text */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--sans);
  font-size: .66rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--rose);
  margin: 0 4px 6px;
}
.tag::before { content: ""; width: 18px; height: 1px; background: currentColor; }
.mood-hard .tag { color: var(--blue); }
.mood-milestone .tag { color: var(--gold); }

.meta { margin: 0 4px; font-style: italic; color: var(--muted); font-size: 1.05rem; }
.card h3 {
  margin: .1rem 4px .5rem;
  font-weight: 500;
  font-size: clamp(1.8rem, 3.6vw, 2.3rem);
  line-height: 1.12;
  color: var(--ink);
}
.story { margin: 0 4px; font-size: 1.18rem; line-height: 1.7; color: var(--ink-soft); white-space: pre-line; }

/* =========================================================
   FINALE
   ========================================================= */
.finale { text-align: center; padding: 60px 16px 40px; max-width: 760px; margin: 0 auto; }
.finale h2 {
  font-size: clamp(2.6rem, 8vw, 4.6rem);
  line-height: 1.15;
  margin: 0 0 2rem;
  color: var(--rose);
  text-shadow: 0 0 40px rgba(242, 167, 185, .35);
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 0 auto 64px;
}
.stat { padding: 16px 8px; border-radius: 18px; background: var(--card-bg); border: 1px solid var(--card-border); }
.stat b { display: block; font-size: 2.3rem; font-weight: 500; line-height: 1.1; color: var(--ink); }
.stat span { font-family: var(--sans); font-size: .64rem; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }

/* envelope */
.envelope-wrap { display: flex; flex-direction: column; align-items: center; margin: 150px 0 28px; }
.envelope {
  position: relative;
  width: min(330px, 86vw);
  aspect-ratio: 330 / 215;
  border: 0;
  padding: 0;
  background: none;
  cursor: pointer;
  perspective: 900px;
  filter: drop-shadow(0 26px 40px rgba(0, 0, 0, .45));
  animation: float 4s ease-in-out infinite;
}
.envelope.open { animation: none; cursor: default; }
@keyframes float { 50% { transform: translateY(-8px) rotate(-.6deg); } }

.envelope > span { position: absolute; inset: 0; border-radius: 8px; }
.env-back { background: #c9707f; z-index: 1; }
.env-paper {
  inset: 8px 14px 10px !important;
  background: var(--paper);
  z-index: 2;
  display: grid;
  place-items: start center;
  padding-top: 10%;
  color: var(--rose-deep);
  font-size: 2rem;
  transition: transform .8s var(--ease) .45s;
}
.env-front {
  z-index: 3;
  background: linear-gradient(160deg, #e8909f, #d77786);
  clip-path: polygon(0 0, 50% 56%, 100% 0, 100% 100%, 0 100%);
}
.env-flap {
  z-index: 4;
  background: linear-gradient(180deg, #f0a3b1, #dc8191);
  clip-path: polygon(0 0, 100% 0, 50% 60%);
  transform-origin: top center;
  transition: transform .6s var(--ease), z-index 0s .3s;
}
.env-seal {
  inset: auto !important;
  left: 50% !important; top: 60% !important;
  width: 54px; height: 54px;
  transform: translate(-50%, -50%);
  border-radius: 50% !important;
  background: radial-gradient(circle at 35% 30%, #c2465f, #8e2239);
  display: grid; place-items: center;
  z-index: 5;
  box-shadow: 0 3px 8px rgba(0, 0, 0, .35), inset 0 0 0 3px rgba(255, 255, 255, .08);
  transition: opacity .3s, transform .3s;
}
.env-seal svg { width: 24px; fill: #ffd7df; }
.envelope:not(.open):hover .env-seal { transform: translate(-50%, -50%) scale(1.08); }
.envelope.open .env-seal { opacity: 0; transform: translate(-50%, -50%) scale(.6); }
.envelope.open .env-flap { transform: rotateX(180deg); z-index: 1; }
.envelope.open .env-paper { transform: translateY(-55%); }

.hint { font-family: var(--sans); font-size: .7rem; letter-spacing: .3em; text-transform: uppercase; color: var(--muted); margin-top: 18px; transition: opacity .4s; }
.envelope.open + .hint { opacity: 0; }

/* letter */
.letter {
  text-align: left;
  max-width: 620px;
  margin: 10px auto 40px;
  padding: clamp(28px, 6vw, 56px);
  background:
    radial-gradient(ellipse at top left, rgba(242, 167, 185, .18), transparent 60%),
    var(--paper);
  color: var(--paper-ink);
  border-radius: 6px;
  box-shadow: 0 40px 80px rgba(0, 0, 0, .5);
  transform: rotate(-.6deg);
  animation: letterIn 1.1s var(--ease) both;
}
.letter[hidden] { display: none; }
@keyframes letterIn { from { opacity: 0; transform: translateY(40px) rotate(-2deg); } }
.letter .greeting { font-size: 2.6rem; margin: 0 0 .6rem; color: var(--rose-deep); }
.letter p { font-size: 1.24rem; line-height: 1.8; margin: 0 0 1.1rem; }
.letter #letterBody p { opacity: 0; animation: fadeUp .9s var(--ease) forwards; }
.letter .signature { font-size: 2.2rem; text-align: right; margin: 1.4rem 0 0; white-space: pre-line; line-height: 1.3; color: var(--rose-deep); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.footer { text-align: center; padding: 30px 16px 60px; color: var(--muted); }
.footer .script { font-size: 2.4rem; color: var(--gold); margin: 0; }
.footer a { font-family: var(--sans); font-size: .7rem; letter-spacing: .28em; text-transform: uppercase; text-decoration: none; opacity: .8; }
.footer a:hover { opacity: 1; color: var(--rose); }

/* =========================================================
   LIGHTBOX
   ========================================================= */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: 64px 1fr 64px;
  align-items: center;
  background: rgba(14, 4, 12, .9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: fade .3s ease;
}
.lightbox[hidden] { display: none; }
@keyframes fade { from { opacity: 0; } }
.lb-figure { margin: 0; grid-column: 2; display: flex; flex-direction: column; align-items: center; }
.lb-media img, .lb-media .ph {
  max-width: 100%;
  max-height: 80vh;
  border-radius: 6px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6);
  animation: fade .35s ease;
}
.lb-media .ph { width: min(560px, 80vw); aspect-ratio: 4 / 3; }
.lb-figure figcaption { margin-top: 14px; font-style: italic; color: var(--ink-soft); font-size: 1.15rem; text-align: center; }
.lb-btn {
  width: 48px; height: 48px;
  justify-self: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .2);
  background: rgba(255, 255, 255, .06);
  color: #fff;
  font-size: 1.9rem;
  line-height: 1;
  cursor: pointer;
  transition: background .2s;
}
.lb-btn:hover { background: rgba(242, 167, 185, .25); }
.lb-btn[hidden] { visibility: hidden; display: block; }
.lb-prev { grid-column: 1; }
.lb-next { grid-column: 3; }
.lb-close { position: absolute; top: 16px; right: 16px; }

/* =========================================================
   MUSIC + HEART BURST
   ========================================================= */
.music-btn {
  position: fixed;
  right: 18px; bottom: 18px;
  z-index: 40;
  width: 50px; height: 50px;
  border-radius: 50%;
  border: 1px solid rgba(242, 167, 185, .4);
  background: rgba(36, 9, 31, .8);
  backdrop-filter: blur(6px);
  color: var(--rose);
  cursor: pointer;
  display: grid; place-items: center;
}
.music-btn[hidden] { display: none; }
.music-btn svg { width: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.music-btn.playing { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 10px rgba(242, 167, 185, 0); } 0% { box-shadow: 0 0 0 0 rgba(242, 167, 185, .45); } }

.burst {
  position: fixed;
  z-index: 60;
  pointer-events: none;
  color: var(--rose);
  font-size: 18px;
  line-height: 1;
  text-shadow: 0 0 10px rgba(242, 167, 185, .8);
}

:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

/* =========================================================
   MOBILE — the path runs down the left side
   ========================================================= */
@media (max-width: 760px) {
  :root { --gutter: 46px; }
  body { font-size: 17px; }
  .timeline { padding: 24px 16px 60px 6px; }
  .memory { margin-bottom: 54px; }
  .memory-row { grid-template-columns: var(--gutter) 1fr; align-items: start; }
  .node { grid-column: 1; width: 38px; height: 38px; margin-top: 40px; }
  .node svg { width: 17px; height: 17px; }
  .left .card, .right .card { grid-column: 2; justify-self: stretch; max-width: none; transform: translateX(30px); }
  .memory.in .card { transform: none; }
  .card { padding: 16px 14px 22px; border-radius: 20px; }
  .transition-text { margin: 0 0 24px calc(var(--gutter) + 4px); font-size: 1.1rem; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .lightbox { grid-template-columns: 44px 1fr 44px; }
  .lb-btn { width: 38px; height: 38px; font-size: 1.5rem; }
  .tile { min-width: 70px; }
  .tile b { font-size: 1.6rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
}
