/* ═══════════════════════════════════════════════════════════════════════
   variant-douro — warm & golden
   The wedding day itself: bleached afternoon linen at the top, deep wine by
   the time you reach the RSVP. One amber sun descends the page as you scroll.
   ═══════════════════════════════════════════════════════════════════════ */

:root {
  --linen: #f0e9dc;
  --linen-deep: #e6dcc9;
  --wine: #8c2f39;
  --amber: #d98e32;
  --umber: #2b2118;
  /* deep enough to clear 4.5:1 on linen — it carries small tracked-out labels */
  --olive: #63614a;

  --ink: var(--umber);
  --ink-soft: color-mix(in oklab, var(--umber), transparent 24%);
  --light: #f7f1e6;
  --light-soft: color-mix(in oklab, #f7f1e6, transparent 34%);

  --focus: var(--wine);
  --skip-bg: var(--umber);
  --skip-fg: var(--linen);

  --display: 'Bodoni Moda', 'Didot', 'Times New Roman', serif;
  --body: 'Archivo', system-ui, -apple-system, sans-serif;

  --gutter: clamp(1.25rem, 5vw, 5.5rem);
  --stack: clamp(4.5rem, 11vh, 9rem);
  --measure: 62ch;

  /* The sun cools from amber to wine as the day goes on */
  --sun-hue: color-mix(in oklab, var(--amber), var(--wine) calc(var(--scroll, 0) * 100%));
}

body {
  background: var(--linen);
  color: var(--ink);
  font-family: var(--body);
  font-weight: 300;
  font-size: clamp(1rem, 0.95rem + 0.2vw, 1.075rem);
}

/* ── the signature: a descending sun ───────────────────────────────────── */

.sun {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  /* clips the glow's blur, which otherwise widens the document on phones */
  overflow: hidden;
  --sun-y: calc(13% + var(--scroll, 0) * 72%);
}

.sun-line {
  position: absolute;
  inset-inline: 0;
  top: var(--sun-y);
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--sun-hue) 14%, var(--sun-hue) 86%, transparent);
  opacity: 0.9;
  mix-blend-mode: plus-lighter;
}

.sun-glow {
  position: absolute;
  top: var(--sun-y);
  left: 50%;
  translate: -50% -50%;
  width: min(78vw, 1000px);
  aspect-ratio: 5 / 2;
  background: radial-gradient(ellipse at center, color-mix(in oklab, var(--sun-hue), transparent 52%), transparent 68%);
  filter: blur(38px);
  opacity: 0.75;
  mix-blend-mode: plus-lighter;
}

/* Warms the whole page as you descend */
.wash {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(180deg, transparent 30%, color-mix(in oklab, var(--wine), transparent 22%) 100%);
  opacity: calc(0.12 + var(--scroll, 0) * 0.4);
}

/* ── parallax + reveal primitives ──────────────────────────────────────── */

.layer {
  position: absolute;
  inset: -16% 0;
  z-index: 0;
}

.layer img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: translate3d(0, var(--py, 0px), 0);
  will-change: transform;
}

[data-reveal] {
  opacity: 0;
  transform: translate3d(0, 20px, 0);
  transition:
    opacity 750ms cubic-bezier(0.22, 0.61, 0.36, 1),
    transform 750ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

[data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* ── shared type ───────────────────────────────────────────────────────── */

.eyebrow {
  font-family: var(--body);
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.36em;
  color: var(--olive);
}

.section-title {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2.2rem, 6vw, 4.25rem);
  line-height: 1.02;
  letter-spacing: -0.015em;
}

.section-lead {
  max-width: 46ch;
  margin-top: 0.9rem;
  color: var(--ink-soft);
  font-size: 1.05rem;
}

.section {
  position: relative;
  padding: var(--stack) var(--gutter);
}

.section-head {
  margin-bottom: clamp(2.5rem, 6vh, 4.5rem);
}

/* ── hero ──────────────────────────────────────────────────────────────── */

.hero {
  position: relative;
  min-height: 100svh;
  overflow: hidden;
  display: grid;
  align-content: center;
  padding: clamp(6rem, 14vh, 10rem) var(--gutter) clamp(5rem, 12vh, 8rem);
}

.hero-layer img {
  opacity: 0.58;
  filter: saturate(0.8) contrast(0.95);
}

.hero::after {
  /* keeps the names readable over the field without washing it out */
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(
    180deg,
    color-mix(in oklab, var(--linen), transparent 42%),
    color-mix(in oklab, var(--linen), transparent 62%) 45%,
    var(--linen)
  );
}

.hero-inner {
  position: relative;
  z-index: 3;
}

.eyebrow-hero {
  margin-bottom: clamp(1.5rem, 4vh, 2.75rem);
}

.names {
  display: grid;
  justify-items: start;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(3.4rem, 13.5vw, 11rem);
  line-height: 0.86;
  letter-spacing: -0.025em;
}

.amp {
  font-size: 0.34em;
  font-style: italic;
  font-weight: 400;
  color: var(--wine);
  margin: 0.18em 0 0.1em clamp(0.5rem, 3vw, 2.5rem);
}

.name-offset {
  margin-left: clamp(1rem, 9vw, 7rem);
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.9rem;
  margin-top: clamp(2rem, 5vh, 3.5rem);
  font-size: 0.82rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.24em;
  color: var(--ink-soft);
}

.sep {
  width: 2.5rem;
  height: 1px;
  background: currentColor;
  opacity: 0.5;
}

.scroll-cue {
  position: relative;
  z-index: 3;
  justify-self: start;
  margin-top: clamp(3rem, 9vh, 6rem);
  display: grid;
  gap: 0.9rem;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  color: var(--olive);
  text-decoration: none;
}

.scroll-cue-line {
  width: 1px;
  height: 3.5rem;
  background: linear-gradient(180deg, var(--olive), transparent);
  animation: cue 2.4s ease-in-out infinite;
  transform-origin: top;
}

@keyframes cue {
  0%, 100% { scale: 1 0.55; opacity: 0.5; }
  50% { scale: 1 1; opacity: 1; }
}

/* ── countdown ─────────────────────────────────────────────────────────── */

.section-countdown {
  text-align: center;
  padding-block: clamp(3.5rem, 9vh, 6rem);
}

.countdown {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: clamp(1.5rem, 6vw, 4.5rem);
  margin-top: 1.75rem;
}

.cd-unit {
  display: grid;
  gap: 0.4rem;
  min-width: 4.5rem;
}

.cd-num {
  font-family: var(--display);
  font-size: clamp(2.4rem, 7vw, 4.5rem);
  font-weight: 400;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.cd-label {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.28em;
  color: var(--olive);
}

.countdown-passed {
  font-family: var(--display);
  font-size: clamp(1.4rem, 4vw, 2.2rem);
}

/* ── story ─────────────────────────────────────────────────────────────── */

.moments {
  display: grid;
  gap: clamp(2.5rem, 6vh, 4.5rem);
  max-width: 68rem;
}

.moment {
  display: grid;
  grid-template-columns: minmax(0, 7rem) minmax(0, 1fr);
  gap: clamp(1rem, 4vw, 3rem);
  align-items: start;
  padding-top: 1.5rem;
  border-top: 1px solid color-mix(in oklab, var(--umber), transparent 86%);
}

.moment-year {
  font-family: var(--display);
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  color: var(--wine);
  line-height: 1;
  font-variant-numeric: lining-nums;
}

.moment-place {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.3rem, 3vw, 1.9rem);
  line-height: 1.2;
  margin-bottom: 0.6rem;
}

.moment-text {
  max-width: var(--measure);
  color: var(--ink-soft);
}

/* ── full-bleed bands ──────────────────────────────────────────────────── */

.band {
  position: relative;
  height: clamp(280px, 58vh, 580px);
  overflow: hidden;
}

/* ── schedule ──────────────────────────────────────────────────────────── */

.slots {
  display: grid;
  gap: 0;
  max-width: 60rem;
}

.slot {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.3rem;
  padding: clamp(1.1rem, 3vh, 1.8rem) 0;
  border-bottom: 1px solid color-mix(in oklab, var(--umber), transparent 88%);
}

@media (min-width: 720px) {
  .slot {
    grid-template-columns: 6rem 12rem minmax(0, 1fr);
    gap: clamp(0.75rem, 3vw, 2.5rem);
    align-items: baseline;
  }
}

.slot:first-child {
  border-top: 1px solid color-mix(in oklab, var(--umber), transparent 88%);
}

.slot-time {
  font-family: var(--display);
  font-size: clamp(1.15rem, 2.6vw, 1.5rem);
  color: var(--wine);
}

.slot-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-weight: 500;
}

.slot-note {
  color: var(--ink-soft);
  font-size: 0.95rem;
}

/* ── location ──────────────────────────────────────────────────────────── */

.loc-grid {
  display: grid;
  gap: clamp(2rem, 6vw, 4.5rem);
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}

.loc-venue {
  font-family: var(--display);
  font-size: clamp(1.5rem, 3.4vw, 2.2rem);
  margin-top: 1.75rem;
}

.loc-addr {
  color: var(--ink-soft);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  margin-top: 0.5rem;
}

.loc-dir {
  max-width: var(--measure);
  margin-top: 1.5rem;
  color: var(--ink-soft);
}

.btn-line {
  display: inline-block;
  margin-top: 2rem;
  padding-bottom: 0.35rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.28em;
  color: var(--wine);
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  transition: opacity 200ms ease;
}

.btn-line:hover {
  opacity: 0.62;
}

.loc-map {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: 1px solid color-mix(in oklab, var(--umber), transparent 82%);
}

.loc-map iframe {
  width: 100%;
  height: 100%;
  border: 0;
  filter: sepia(0.28) saturate(0.82) contrast(0.95);
}

@media (min-width: 860px) {
  .loc-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

/* ── gallery ───────────────────────────────────────────────────────────── */

.shots {
  display: grid;
  gap: clamp(1rem, 3vw, 2.25rem);
  grid-template-columns: 1fr;
}

@media (min-width: 560px) {
  .shots {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 860px) {
  .shots {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.shot-frame {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 5;
}

.shot-frame img {
  width: 100%;
  height: 112%;
  object-fit: cover;
  transform: translate3d(0, var(--py, 0px), 0);
  will-change: transform;
}

@media (min-width: 860px) {
  .shot-2 { margin-top: clamp(1.5rem, 5vw, 4rem); }
  .shot-3 { margin-top: clamp(3rem, 9vw, 7rem); }
  .shot-5 { margin-top: clamp(1.5rem, 5vw, 4rem); }
  .shot-6 { margin-top: clamp(3rem, 9vw, 7rem); }
  .shot-1 .shot-frame,
  .shot-4 .shot-frame { aspect-ratio: 3 / 4; }
}

/* ── practical info ────────────────────────────────────────────────────── */

.facts {
  display: grid;
  gap: clamp(1.75rem, 4vw, 3rem);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
  max-width: 72rem;
}

.fact-q {
  font-family: var(--body);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.26em;
  color: var(--wine);
  margin-bottom: 0.85rem;
}

.fact-a {
  color: var(--ink-soft);
  font-size: 0.98rem;
}

/* ── rsvp ──────────────────────────────────────────────────────────────── */

.section-rsvp {
  background: var(--umber);
  color: var(--light);
  --ink-soft: var(--light-soft);
  --focus: var(--amber);
}

.section-rsvp .section-title {
  color: var(--light);
}

.section-rsvp .eyebrow {
  color: var(--amber);
}

.rsvp-shell {
  max-width: 42rem;
  margin-inline: auto;
}

.rsvp {
  display: grid;
  gap: 1.5rem;
}

.demo-notice {
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.24em;
  color: var(--amber);
  padding-bottom: 1rem;
  border-bottom: 1px solid color-mix(in oklab, var(--light), transparent 86%);
}

.field {
  display: grid;
  gap: 0.55rem;
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}

.field > label,
.field legend {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--light-soft);
  padding: 0;
}

.field input[type='text'],
.field input[type='email'],
.field input[type='number'],
.field textarea {
  width: 100%;
  padding: 0.75rem 0;
  background: transparent;
  border: 0;
  border-bottom: 1px solid color-mix(in oklab, var(--light), transparent 78%);
  color: var(--light);
  font-size: 1rem;
  transition: border-color 200ms ease;
}

.field input::placeholder,
.field textarea::placeholder {
  color: color-mix(in oklab, var(--light), transparent 68%);
}

.field input:focus,
.field textarea:focus {
  border-bottom-color: var(--amber);
}

.field textarea {
  resize: vertical;
}

.field-half {
  max-width: 9rem;
}

.field-choice {
  display: grid;
  gap: 0.65rem;
}

.choice,
.check {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  font-size: 0.95rem;
}

.choice input,
.check input {
  accent-color: var(--amber);
  width: 1.05rem;
  height: 1.05rem;
}

.err {
  min-height: 1.1rem;
  font-size: 0.78rem;
  color: color-mix(in oklab, var(--amber), white 22%);
}

.field [aria-invalid='true'] {
  border-bottom-color: color-mix(in oklab, var(--amber), white 22%);
}

.btn {
  justify-self: start;
  margin-top: 0.5rem;
  padding: 0.95rem 2.5rem;
  background: var(--amber);
  color: var(--umber);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.26em;
  transition: background-color 200ms ease;
}

.btn:hover:not(:disabled) {
  background: color-mix(in oklab, var(--amber), white 18%);
}

.btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.rsvp-done {
  padding: clamp(2rem, 6vw, 3.5rem) 0;
}

.rsvp-done h3 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2rem, 5vw, 3rem);
  color: var(--amber);
  margin-bottom: 0.75rem;
}

.rsvp-done p {
  color: var(--light-soft);
  max-width: 40ch;
}

/* ── footer ────────────────────────────────────────────────────────────── */

.footer {
  position: relative;
  z-index: 3;
  background: color-mix(in oklab, var(--umber), black 32%);
  color: var(--light-soft);
  padding: clamp(3rem, 8vh, 5rem) var(--gutter);
  text-align: center;
  display: grid;
  gap: 0.9rem;
  font-size: 0.78rem;
}

.footer-mark {
  font-family: var(--display);
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  color: var(--light);
}

.amp-small {
  font-style: italic;
  color: var(--amber);
}

.footer-note {
  text-transform: uppercase;
  letter-spacing: 0.24em;
  font-size: 0.68rem;
}

.footer-credits {
  font-size: 0.72rem;
  opacity: 0.72;
}

.footer-credits a {
  color: inherit;
}

/* ── music toggle ──────────────────────────────────────────────────────── */

.music {
  position: fixed;
  right: clamp(1rem, 3vw, 2rem);
  bottom: clamp(1rem, 3vw, 2rem);
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 0.9rem;
  background: color-mix(in oklab, var(--umber), transparent 12%);
  color: var(--linen);
  border-radius: 999px;
}

.music-bars {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 14px;
}

.music-bars i {
  width: 2px;
  height: 40%;
  background: var(--amber);
  transition: height 200ms ease;
}

.music[data-playing='true'] .music-bars i {
  animation: bars 900ms ease-in-out infinite alternate;
}

.music[data-playing='true'] .music-bars i:nth-child(2) { animation-delay: 150ms; }
.music[data-playing='true'] .music-bars i:nth-child(3) { animation-delay: 300ms; }

@keyframes bars {
  from { height: 30%; }
  to { height: 100%; }
}

.music-hint {
  max-width: 0;
  overflow: hidden;
  white-space: nowrap;
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  opacity: 0;
  transition:
    max-width 300ms ease,
    opacity 200ms ease;
}

/* Says out loud that the demo has no audio file, rather than doing nothing */
.music[data-empty='true'] .music-hint {
  max-width: 16rem;
  opacity: 0.85;
}

/* ── reduced motion ────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  .scroll-cue-line {
    animation: none;
  }

  [data-reveal] {
    opacity: 1;
    transform: none;
  }
}
