/* ---------------------------------------------------------------
   Jake & Cara — anniversary
   --------------------------------------------------------------- */

:root {
  --ink-900: #150e11;
  --ink-800: #1e1418;
  --ink-700: #2a1d22;

  --cream:   #f4ece3;
  --cream-dim: #cbbdb0;
  --gold:    #c9a227;
  --gold-soft: #e0c876;
  --rose:    #c97b7b;

  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans:  "Jost", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;

  --fade: 1600ms;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  background:
    radial-gradient(1200px 700px at 50% -10%, #341f28 0%, transparent 60%),
    radial-gradient(900px 600px at 85% 110%, #2b1a20 0%, transparent 65%),
    var(--ink-900);
  background-attachment: fixed;
  color: var(--cream);
  font-family: var(--sans);
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  background: radial-gradient(120% 90% at 50% 50%, transparent 55%, rgba(0,0,0,0.45) 100%);
}

.page {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 880px;
  /* exactly the viewport: the stage below absorbs whatever is left over,
     so the page can never need scrolling */
  height: 100svh;
  margin: 0 auto;
  padding: clamp(0.6rem, 2.2vh, 2rem) 20px clamp(0.6rem, 2.2vh, 1.75rem);
  display: flex;
  flex-direction: column;
  gap: clamp(0.4rem, 1.4vh, 1.25rem);
}

.masthead,
.footer,
.caption,
.controls {
  flex: 0 0 auto;
}

.stage-wrap {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* ---------- masthead ---------- */

.masthead {
  text-align: center;
  animation: rise 1200ms 120ms both cubic-bezier(.16,.84,.44,1);
}

.eyebrow {
  margin: 0 0 0.9rem;
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--gold);
  text-indent: 0.42em;
}

.names {
  margin: 0;
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(2.2rem, min(9vw, 8vh), 5rem);
  line-height: 1.02;
  letter-spacing: 0.01em;
  color: var(--cream);
}

.amp {
  font-style: italic;
  color: var(--gold-soft);
  padding: 0 0.12em;
}

.subtitle {
  margin: 1rem 0 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1rem, min(2.7vw, 2.4vh), 1.3rem);
  color: var(--cream-dim);
}

.subtitle::before,
.subtitle::after {
  content: "";
  display: inline-block;
  width: clamp(1.5rem, 6vw, 3rem);
  height: 1px;
  vertical-align: middle;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  margin: 0 0.9rem;
  opacity: 0.7;
}

/* ---------- the rotator ---------- */

.stage-wrap {
  animation: rise 1200ms 320ms both cubic-bezier(.16,.84,.44,1);
}

.stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  align-self: center;
  width: auto;
  max-width: min(560px, 100%);
  /* pair with max-width so the frame keeps its ratio when there is
     spare vertical room, rather than stretching tall */
  max-height: 420px;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 3px;
  background: #0d0809;
  box-shadow:
    0 0 0 1px rgba(201, 162, 39, 0.28),
    0 0 0 7px rgba(255, 255, 255, 0.022),
    0 34px 70px -28px rgba(0, 0, 0, 0.95);
  cursor: pointer;
}

/* soft blurred fill so portrait + tiny photos never sit on dead space */
.backdrop {
  position: absolute;
  inset: -6%;
  background-size: cover;
  background-position: center;
  filter: blur(34px) saturate(135%) brightness(0.42);
  transform: scale(1.12);
  transition: background-image var(--fade) ease;
}

.frame {
  position: absolute;
  inset: 0;
}

.frame img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transform: scale(1.015);
  transition: opacity var(--fade) ease, transform 9000ms linear;
  will-change: opacity, transform;
}

.frame img.is-active {
  opacity: 1;
  transform: scale(1.055);
}

/* very small originals: show them as the little prints they are,
   rather than upscaling them into mush */
.frame img.is-small {
  width: auto;
  height: auto;
  max-width: 46%;
  max-height: 74%;
  margin: auto;
  image-rendering: auto;
  box-shadow: 0 14px 40px -12px rgba(0, 0, 0, 0.9);
}

/* ---------- caption ---------- */

.caption {
  text-align: center;
  margin-top: 1.1rem;
  min-height: 3.6rem;
}

.caption-date {
  margin: 0 0 0.45rem;
  font-family: var(--sans);
  font-size: 0.68rem;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--gold);
  text-indent: 0.34em;
}

.caption-note {
  margin: 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.05rem, min(3vw, 2.6vh), 1.4rem);
  line-height: 1.4;
  color: var(--cream);
}

.caption-date,
.caption-note {
  transition: opacity 500ms ease;
}

.caption.is-swapping .caption-date,
.caption.is-swapping .caption-note {
  opacity: 0;
}

/* ---------- controls ---------- */

.controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.25rem;
}

.nav {
  flex: none;
  width: 2.4rem;
  height: 2.4rem;
  display: grid;
  place-items: center;
  border: 1px solid rgba(201, 162, 39, 0.3);
  border-radius: 50%;
  background: transparent;
  color: var(--cream-dim);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  transition: color 200ms ease, border-color 200ms ease, background 200ms ease;
}

.nav:hover,
.nav:focus-visible {
  color: var(--gold-soft);
  border-color: var(--gold);
  background: rgba(201, 162, 39, 0.08);
  outline: none;
}

.dots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  max-width: 460px;
}

.dot {
  width: 6px;
  height: 6px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(244, 236, 227, 0.22);
  cursor: pointer;
  transition: background 350ms ease, transform 350ms ease;
}

.dot:hover { background: rgba(244, 236, 227, 0.5); }

.dot.is-current {
  background: var(--gold);
  transform: scale(1.5);
}

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

/* ---------- footer ---------- */

.footer {
  text-align: center;
  animation: rise 1200ms 560ms both cubic-bezier(.16,.84,.44,1);
}

.closing {
  margin: 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1rem, 2.6vw, 1.25rem);
  color: var(--cream-dim);
}

.closing .heart {
  color: var(--rose);
  font-style: normal;
}

/* ---------- motion ---------- */

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .frame img.is-active { transform: none; }
}

/* ---------- small screens ---------- */

@media (max-width: 640px) {
  .stage {
    aspect-ratio: 4 / 5;
    max-width: 100%;
    max-height: calc((100vw - 40px) * 5 / 4);
  }

  .caption {
    margin-top: 0.9rem;
    min-height: 3.2rem;
  }

  .controls { margin-top: 0.9rem; }
  .subtitle::before,
  .subtitle::after { margin: 0 0.6rem; }
  .dots { max-width: 260px; gap: 0.45rem; }
}

/* ---------- very short viewports (phone in landscape) ---------- */

@media (max-height: 480px) {
  .page {
    padding-block: 0.4rem;
    gap: 0.25rem;
  }

  .names { font-size: clamp(1.5rem, 6vh, 2.3rem); }

  .eyebrow { display: none; }

  .subtitle { display: none; }

  .footer { display: none; }

  .caption { min-height: 0; margin-top: 0.5rem; }
  .controls { margin-top: 0.5rem; }
  .dots { display: none; }

  .stage { max-height: none; }
}
