/* The save-the-date view (views/save-the-date.js). */

.back-nav {
  position: fixed;
  top: clamp(0.9rem, 3vh, 1.4rem);
  left: clamp(0.9rem, 3vw, 1.4rem);
  z-index: 50;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cream);
  text-decoration: none;
  background: rgba(43, 42, 36, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(251, 246, 235, 0.3);
  border-radius: 999px;
  padding: 0.55em 1.1em;
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.back-nav[hidden] {
  display: none;
}

.back-nav:hover {
  background: #85320A;
  color: var(--cream);
  border-color: #85320A;
}

/* --- Montserrat / Sans-Serif Compactness Update --- */
.eyebrow {
  font-family: var(--font-sans);
  font-weight: 800;
  font-size: clamp(0.72rem, 2.6vw, 1.4rem);
  letter-spacing: 0.4em;
  /* Increased spacing for more negative space */
  text-transform: uppercase;
  color: var(--sienna);
  opacity: 0.9;
}

.eyebrow.on-dark {
  color: var(--gold);
}

section,
header,
footer {
  padding-left: var(--edge);
  padding-right: var(--edge);
  position: relative;
}

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.9s ease, transform 0.9s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- SCROLL "WRITING EFFECT" WORD REVEAL ---------- */
.reveal-line .w {
  display: inline-block;
  opacity: 0.16;
  filter: blur(3px);
  transform: translateY(0.18em);
  transition: opacity 0.7s ease, filter 0.7s ease, transform 0.7s ease, color 0.7s ease;
  will-change: opacity, filter, transform;
}

.reveal-line.is-active .w {
  opacity: 1;
  filter: blur(0);
  transform: translateY(0);
}

/* words tagged for emphasis brighten into a highlight color as they reveal */
.reveal-line .w.hl {
  color: inherit;
}

.reveal-line.is-active .w.hl {
  color: var(--gold);
}

.reveal-line .w.hl-strong {
  color: inherit;
  font-weight: 700;
}

.reveal-line.is-active .w.hl-strong {
  color: var(--gold);
}

@media (prefers-reduced-motion: reduce) {
  .reveal-line .w {
    opacity: 1 !important;
    filter: none !important;
    transform: none !important;
    transition: none !important;
  }
}

/* ---------- HERO SECTION IMPROVEMENTS ---------- */
/* Hero Container */

.hero {
  width: 100%;
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  align-items: center;
  justify-content: flex-start;
  text-align: center;
  /* video fills the whole hero; "See the Details" is pinned over it. The
     base is a dark olive close to the graded footage, so while the 14 MB
     video is still loading the hero shows that, not a light flash. */
  background: #3f4331;
  padding: 0;
}

/* 2. The Gradient Overlay (NEW) */
.hero::after {
  content: "";
  /* Required for pseudo-elements to render */
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100svh;

  /* One flat sage wash over the whole frame, the couple included — no
     gradient, so there is no fade anywhere on the video. */
  background: rgba(143, 165, 128, 0.5);

  z-index: 1;
  /* Places the gradient above the video (0) */
  pointer-events: none;
  /* Lets clicks pass through to the video if needed */
}

/* 2. The Video Background */
.hero-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100svh;
  object-fit: cover;
  /* Crops the video to fill the space without stretching */
  /* Lean the crop down toward the couple while keeping the surf in frame */
  object-position: 60% 82%;
  /* Colour grade: pull the raw grey-blue footage down to near-neutral, then add
     only enough warmth to sit inside the palette — sepia is half what it was and
     the hue is rotated *forward* off amber toward olive, which is what takes the
     yellow cast out; the olive wash above now carries the colour instead.
     Tune sepia() and the hue-rotate() first — they do most of the work. */
  filter: saturate(0.52) sepia(0.16) hue-rotate(5deg) saturate(1.1) contrast(1.14) brightness(0.68);
  z-index: 0;
  /* Pushes the video to the very back */
  pointer-events: none;
  /* Prevents users from accidentally clicking/pausing the video */
}

/* 3. The Content Overlay */
.hero-content {
  position: relative;
  /* Pulls the content forward, above the video */
  z-index: 2;
  width: 100%;
  height: 100svh;
  justify-content: flex-start;
  padding-top: clamp(2.5rem, 8vh, 5rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  /* the whole stack breathes with the viewport instead of clumping in the middle.
     Held in a custom property so .hero-closing can space its lines by the same
     amount — nesting them must not change the rhythm of the stack. */
  --stack-gap: clamp(1.5rem, 4.5vh, 3rem);
  gap: var(--stack-gap);
}

/* The closing line sits on a pool of warm light: the wash has laid olive down by
   this point, so rather than recolour the type, the ground beneath it is lit
   back up. */
.hero-closing {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--stack-gap);
}

.hero-closing::before {
  content: "";
  position: absolute;
  /* behind the line, but still inside .hero-content's stacking context, so
     it stays above the hero's wash (z-index 1) instead of being buried by it */
  z-index: -1;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  /* Sized off the viewport rather than the text so it runs past both edges: a
     pool only as wide as the words reads as a lamp switched on behind them,
     whereas a wide, flat band reads as the beach still catching light. */
  width: 200vw;
  /* A fixed height, not a share of the one-line box: that short a pool falls
     off so fast it reads as a hard bright stripe across the beach. */
  height: clamp(12rem, 34vh, 20rem);
  /* sand, not white, held near full through the middle so the type keeps its
     contrast against the olive underneath */
  background: radial-gradient(closest-side,
      rgba(250, 245, 234, 0.92) 0%,
      rgba(248, 242, 229, 0.84) 34%,
      rgba(245, 238, 221, 0.58) 58%,
      rgba(239, 230, 211, 0.3) 74%,
      rgba(239, 230, 211, 0.09) 88%,
      rgba(239, 230, 211, 0) 100%);
  pointer-events: none;
}

/* ---------- HERO COUPLE NAMES ----------
   The names are hand-lettered artwork (assets/name-aaron.png, assets/name-harriet.png),
   both exported on an identical 768x154 canvas. Rendering both at the same width is
   what keeps their letterforms at a matching scale, so the transparent padding is
   load-bearing — do not crop these PNGs.

   Measured ink geometry, as fractions of that shared canvas:
     aaron    ink spans  1.7%..46.6% wide; its entry stroke meets the left edge
              at (1.95%, 68.51%) and the "n" tail exits at (46.35%, 62.01%)
     harriet  ink spans 15.0%..90.1% wide; its long tail exits at (89.84%, 34.09%)
     stroke weight at those joins is ~2/154 = 1.3% of canvas height
   The hairlines below continue those tails out to the edge of the screen, so they
   are pinned to exactly those coordinates. */
.hero-names {
  /* width of the shared artwork canvas, as a share of the hero */
  --art-w: 60%;
  /* aspect ratio of that canvas, used to close the transparent gap between rows */
  --art-ratio: 0.2005;
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  margin: 0;
  font-weight: 400;
}

.name-row {
  display: flex;
  align-items: flex-start;
  width: 100%;
  min-width: 0;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 8%, #000 93%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 8%, #000 93%, transparent 100%);
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
}

/* The lead/trail spacers split the leftover width, which is what sets each
   name off centre — aaron to the left, harriet to the right. */
.name-row .lead,
.name-row .trail {
  min-width: 0;
}

.name-row--first .lead {
  flex: 1.34 1 0;
}

.name-row--first .trail {
  flex: 1 1 0;
}

.name-row--second .lead {
  flex: 3.55 1 0;
}

.name-row--second .trail {
  flex: 1 1 0;
}

/* Pull the second line up through the transparent padding the two canvases
   leave facing each other (13% below aaron + 10.4% above harriet). */
.name-row--second {
  margin-top: calc(var(--art-w) * var(--art-ratio) * -0.2);
}

.art {
  position: relative;
  flex: 0 0 var(--art-w);
  /* the PNGs are 768px wide, so this caps how far they can be upscaled on a
     very wide monitor — raise it if the artwork is re-exported at 2x/3x */
  max-width: min(var(--art-w), 1400px);
}

.art img {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 1px 18px rgba(38, 42, 16, 0.42));
}

/* Fallback if the artwork fails to load: the alt text still reads as a name. */
.art img[alt] {
  font-family: var(--font-name);
  font-size: clamp(2.5rem, 9vw, 7rem);
  color: #fff;
}

.name-row--amp {
  --amp-x: 57%;
  --amp-y: 50%;
  position: absolute;
  display: block;
  width: auto;
  left: var(--amp-x);
  top: var(--amp-y);
  transform: translate(-50%, -50%);
  font-family: var(--font-amp);
  font-size: clamp(2.5rem, 9vw, 10rem);
  line-height: 1;
  /* the one glyph set in real type is also the one carrying the accent colour */
  color: var(--gold);
  text-shadow: 0 1px 22px rgba(38, 42, 16, 0.55), 0 0 3px rgba(38, 42, 16, 0.3);
}

/* The flower sits between the closing line and the button. The PNG is a black
   spray on a 2000x2000 canvas with ~25% empty either side, so the wrapper crops
   to the ink (510..1490 x 108..1892) and the filter turns it white like the names. */
.hero-flower {
  width: calc(clamp(4.5rem, 17svh, 11rem) * 980 / 1784);
  aspect-ratio: 980 / 1784;
  overflow: hidden;
  /* pinned just above the button (same bottom offset, plus the button's
     height and a small gap) rather than following the closing line. Auto
     side margins centre it, so .reveal's transform stays free. */
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(max(clamp(1.75rem, 6vh, 3.25rem), env(safe-area-inset-bottom)) + 3.1rem + 3rem);
  margin: 0 auto;
  /* the drawing's weight leans right of its bounding box (ink centre of mass is
     ~9% of its width to the right), so nudge it back to look centred (a bit
     further, -15%, so it sits in the middle of the text arcs). The
     standalone `translate` property leaves .reveal's transform alone. */
  translate: -15% 0;
}

.hero-flower img {
  width: calc(100% * 2000 / 980);
  height: auto;
  max-width: none;
  margin-left: calc(-100% * 510 / 980);
  margin-top: calc(-100% * 108 / 980);
  /* the linework is hairline-thin once scaled down, so two tight white
     shadows fatten it a touch before the soft dark one lifts it off the video */
  filter: brightness(0) invert(1) drop-shadow(0 0 0.6px #fff) drop-shadow(0 0 0.6px #fff)
    drop-shadow(0 1px 12px rgba(38, 42, 16, 0.5));
  /* blooms: a feathered mask three times the image's height slides up the
     drawing, so it fades in from the stem to the top of the spray with a soft
     edge instead of a hard line, growing slightly from its base as it goes */
  -webkit-mask-image: linear-gradient(to top, #000 0%, #000 33.3%, transparent 66.6%, transparent 100%);
  mask-image: linear-gradient(to top, #000 0%, #000 33.3%, transparent 66.6%, transparent 100%);
  -webkit-mask-size: 100% 300%;
  mask-size: 100% 300%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: 0 0;
  mask-position: 0 0;
  transform: scale(0.92);
  transform-origin: 50% 100%;
  transition: -webkit-mask-position 3s cubic-bezier(0.45, 0.05, 0.25, 1) 0.6s,
    mask-position 3s cubic-bezier(0.45, 0.05, 0.25, 1) 0.6s,
    transform 3s cubic-bezier(0.45, 0.05, 0.25, 1) 0.6s;
}

.hero-flower.is-visible img {
  -webkit-mask-position: 0 100%;
  mask-position: 0 100%;
  transform: scale(1);
}

@media (prefers-reduced-motion: reduce) {
  .hero-flower img {
    -webkit-mask-position: 0 100% !important;
    mask-position: 0 100% !important;
    transform: none !important;
    transition: none !important;
  }
}

/* "We have a message for you" curves over the flower and a hairline closes the
   oval beneath it. The box is 2.4x the flower's width and ends on the flower's
   bottom edge (viewBox 240 x 199.2 in the flower's own units), centred on the
   flower's nudged centre (-8% of its width = -3.3% of this box). */
.hero-flower-arc {
  /* only invites that carry a role get the text (body.has-flower-message) */
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(max(clamp(1.75rem, 6vh, 3.25rem), env(safe-area-inset-bottom)) + 3.1rem + 3rem);
  margin: 0 auto;
  width: calc(clamp(4.5rem, 17svh, 11rem) * 980 / 1784 * 2.4);
  aspect-ratio: 240 / 199.2;
  translate: -3.3% 0;
  overflow: visible;
  /* fades in together with the "See the Details" button (same delay and duration) */
  transition: opacity 0.6s ease 2.4s;
}

body.has-flower-message .hero-flower-arc {
  display: block;
}

/* for those invites the flower and the text around it open the proposal */
body.has-flower-message .hero-flower,
body.has-flower-message .hero-flower-arc {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

/* After the text has faded in, the flower swivels from its base in a short
   burst, then rests, on repeat, to hint that it can be tapped. The
   standalone `rotate` property leaves .reveal's transform and the centring
   `translate` alone. */
body.has-flower-message .hero-flower {
  transform-origin: 50% 100%;
  animation: flower-swivel 4.5s ease-in-out 3.6s infinite;
}

body.has-flower-message .hero-flower:hover {
  animation-play-state: paused;
}

@keyframes flower-swivel {
  0%, 40%, 100% { rotate: 0deg; }
  8% { rotate: -5deg; }
  16% { rotate: 5deg; }
  24% { rotate: -3.5deg; }
  32% { rotate: 2deg; }
}

@media (prefers-reduced-motion: reduce) {
  body.has-flower-message .hero-flower { animation: none; }
}

body.has-flower-message .hero-flower:focus-visible {
  outline: 1.5px solid #fff;
  outline-offset: 4px;
  border-radius: 6px;
}

@media (prefers-reduced-motion: reduce) {
  .hero-flower-arc {
    transition-delay: 0s;
  }
}

.hero-flower-arc text {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 14px;
  text-transform: uppercase;
  fill: #fff;
}

.hero-flower-arc .arc-hint {
  font-size: 12px;
}

/* the paths only guide the text along its curve; they are never drawn */
.hero-flower-arc path {
  fill: none;
  stroke: none;
}

.hero-flower-arc .arc-glow {
  filter: drop-shadow(0 1px 6px rgba(38, 42, 16, 0.55));
}

/* the wedding date, tucked right under the line above it: the negative top
   margin cancels the stack's gap and leaves a small one */
.hero-date {
  font-family: var(--font-serif);
  font-weight: 700;
  font-style: italic;
  letter-spacing: 0.06em;
  font-size: clamp(1.2rem, 4.2vw, 2rem);
  color: #F2D98A;
  text-shadow: 0 1px 3px rgba(38, 42, 16, 0.55), 0 2px 16px rgba(38, 42, 16, 0.75);
  margin: calc(var(--stack-gap) * -1 + 0.4rem) 0 0;
}

.hero-sub {
  font-family: var(--font-sans);
  font-weight: 400;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  font-size: clamp(0.8rem, 2.8vw, 1.25rem);
  /* sits straight on the video, so light type with a soft shadow, not a pool */
  color: var(--cream);
  text-shadow: 0 1px 14px rgba(38, 42, 16, 0.6);
  margin: 0;
}

/* Everything below the hero stays unrendered until the guest taps
   "See the Details". That tap is also the interaction browsers require
   before the background music may start, so music and details arrive
   together instead of the page being scrolled through in silence. */
body:not(.is-unsealed) [data-gated] {
  display: none !important;
}

/* A small gold pill. Gold carries over from the RSVP button; the hover
   goes olive rather than .btn-primary's cream, which would vanish into
   the hero's cream bottom wash. Qualified with .btn because the .btn
   rule comes later in the sheet and would otherwise win on size and
   transition.
   Pinned near the hero's bottom edge, where the scroll cue used to be, rather
   than stacked under the lettering. Centred with auto margins, not a
   translate, so .reveal's and the hover's transforms stay free. */
.btn.enter-btn {
  position: absolute;
  left: 0;
  right: 0;
  bottom: max(clamp(1.75rem, 6vh, 3.25rem), env(safe-area-inset-bottom));
  width: max-content;
  margin: 0 auto;
  /* above the hero's wash (z-index 1) */
  z-index: 2;
  background: transparent;
  color: #fff;
  border: 1.5px solid var(--sienna);
  border-radius: 999px;
  font-size: calc(clamp(0.7rem, 1.4vw, 0.78rem) * 0.95);
  padding: 0.85em 2.4em;
  box-shadow: none;
  /* .btn's transition list drops opacity, which .reveal fades in on */
  /* the opacity delay holds it back until the flower has finished blooming
     (0.6s delay + 3s wipe), appearing as the last of the wipe finishes */
  transition: opacity 0.6s ease 2.4s, background 0.25s ease, color 0.25s ease, transform 0.2s ease, box-shadow 0.25s ease;
}

/* Once tapped it has done its job: fade it out straight away, then the
   script removes it once the hero is off screen. A refresh brings it back. */
body.is-unsealed .enter-btn {
  opacity: 0;
  transition-delay: 0s;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .btn.enter-btn {
    transition-delay: 0s;
  }
}

/* Role invites: "See the Details" stays out of sight until the guest has
   opened their proposal (see releaseProposalGate in the script). The gate
   also covers the moment before the invite has loaded, for any invite with
   a code, so the button never flashes in and out. Once opened, the button
   follows soon after instead of waiting out the hero's longer delay. */
body.proposal-gate .btn.enter-btn {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

body.proposal-unlocked .btn.enter-btn {
  transition-delay: 0.5s, 0s, 0s, 0s, 0s;
}

.enter-btn[hidden] {
  display: none;
}

.enter-btn:hover,
.enter-btn:focus-visible {
  background: #85320A;
  border-color: #85320A;
  color: var(--cream);
  transform: translateY(-2px);
  box-shadow: none;
}

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

/* Phones: the names need nearly the full width, so give back the offset and
   let the type run larger relative to the (very tall) viewport. */
@media (max-width: 700px) {
  /* The lettering is a ~5:1 banner, so on a portrait phone every percent of
     width spent on the hairlines comes straight out of the names. Drop them,
     let the canvas run wider than the viewport (its transparent padding means
     the ink still lands well inside), and place each row by hand. */
  .hero-names {
    --art-w: 118%;
  }

  .name-row {
    -webkit-mask-image: none;
    mask-image: none;
  }

  .art {
    max-width: none;
  }

  .name-row .lead,
  .name-row .trail {
    flex: 0 0 0;
  }

  /* Placed on ink, not on the canvas: the transparent padding differs between
     the two exports, so equal margins would read as a left-aligned stack. At
     --art-w 118% these land aaron's ink at 18%..71% of the viewport and
     harriet's letters at 12%..89%, both centred on the same axis, with the
     indent between the two lines carrying the stagger. */
  .name-row--first .art {
    margin-left: 4%;
  }

  /* harriet is placed on its letterforms, so the tail past the final "t" is
     allowed to run out to the edge of the screen rather than being counted
     as width the name has to balance against. */
  .name-row--second .art {
    margin-left: -6%;
  }

  .name-row--second {
    margin-top: calc(var(--art-w) * var(--art-ratio) * -0.13);
  }

  /* harriet runs nearly full width here, so the only clear pocket is the
     upper right — above its tail and past the end of aaron, which now ends
     at 71% rather than 60% */
  .name-row--amp {
    --amp-x: 70%;
    --amp-y: 34%;
    font-size: clamp(2.25rem, 13vw, 5rem);
  }

  .hero-content {
    --stack-gap: clamp(2rem, 6.5vh, 3.5rem);
    /* phones are tall, so seat the names lower than the desktop offset */
    padding-top: 18svh;
  }

  .hero-sub {
    letter-spacing: 0.22em;
  }

}

/* Short/landscape windows: height is the binding constraint, not width. */
@media (max-height: 560px) {
  .hero-names {
    --art-w: 46%;
  }

  .name-row--amp {
    font-size: clamp(1.75rem, 4.5vw, 3.5rem);
  }

  .hero-content {
    --stack-gap: clamp(0.75rem, 3vh, 1.5rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  .journey-caption-img {
    clip-path: inset(0 0 0 0) !important;
    transition: none !important;
  }

  .polaroid {
    opacity: 1 !important;
    transform: rotate(var(--tilt, -3deg)) !important;
    animation: none !important;
  }
}

/* ---------- MILESTONE ---------- */
.milestone {
  background-color: var(--olive-mid);
  background-image:
    /* soft corner highlight — pulled further up/left and dimmed so it clears the eyebrow + lead-line text */
    radial-gradient(100% 50% at 6% -18%, rgba(251, 246, 235, 0.07), transparent 55%),
    /* thicker, shorter diagonal band, concentrated near the bottom-right corner — full-bleed so it
     tapers to transparent on its own instead of being clipped into a hard-edged box */
    linear-gradient(125deg,
      transparent 38%,
      rgba(43, 42, 36, 0.05) 66%,
      rgba(251, 246, 235, 0.1) 82%,
      transparent 101%),
    /* full-bleed satin sheen, dimmed so it stays a texture rather than a glare */
    linear-gradient(125deg,
      rgba(251, 246, 235, 0) 0%,
      rgba(251, 246, 235, 0.03) 22%,
      rgba(251, 246, 235, 0.07) 36%,
      rgba(251, 246, 235, 0.025) 48%,
      rgba(251, 246, 235, 0) 60%,
      rgba(43, 42, 36, 0.04) 80%,
      rgba(43, 42, 36, 0.1) 100%);
  color: var(--cream);
  padding-top: clamp(4.5rem, 12vh, 7rem);
  padding-bottom: clamp(4.5rem, 12vh, 7rem);
  overflow: hidden;
}

.milestone-inner {
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
}

.milestone-banner {
  font-family: var(--font-sans);
  font-weight: 400;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  font-size: clamp(1rem, 4vw, 1.8rem);
  /* Reduced size */
  color: var(--gold);
  white-space: nowrap;
  margin: 0.6em 0 0;
}

.milestone-copy {
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}

.milestone-copy p {
  margin: 0 0 0.9em;
}

.milestone-copy p:last-child {
  margin-bottom: 0;
}

/* the giant, high-impact line of the section */
.milestone-copy .lead-line {
  font-family: var(--font-serif);
  font-weight: 500;
  font-style: italic;
  font-size: clamp(1.9rem, 6.4vw, 4.2rem);
  line-height: 1.1;
  color: var(--cream);
  margin-bottom: 1.5em;
}

/* the quieter, supporting lines — deliberately much smaller for contrast */
.milestone-copy .support-line {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: clamp(0.6rem, 1vw, 1.2rem);
  color: var(--cream-2);
}

/* ---------- DATE BLOCK ---------- */
.datepad {
  padding-top: clamp(4.5rem, 12vh, 7rem);
  padding-bottom: clamp(3.5rem, 10vh, 6rem);
  text-align: center;
}

.date-readable {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(0.5rem, 1.8vh, 0.9rem);
  margin: 0.4em 0 0.2em;
}

.date-readable .date-day {
  font-family: var(--font-sans);
  font-weight: 500;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  font-size: clamp(1rem, 2.6vw, 1.5rem);
  color: var(--charcoal);
}

.date-readable .date-main {
  display: flex;
  align-items: baseline;
  justify-content: center;
  flex-wrap: wrap;
  gap: clamp(0.4rem, 2.2vw, 1.4rem);
}

.date-readable .date-month {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(1.8rem, 6.5vw, 4.2rem);
  color: var(--olive);
}

.date-readable .date-day-num {
  font-family: var(--font-serif);
  font-weight: 600;
  color: var(--sienna);
  font-size: clamp(6rem, 20vw, 12rem);
  line-height: 0.8;
}

.date-readable .date-year {
  font-family: var(--font-sans);
  font-weight: 400;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  font-size: clamp(1rem, 2.6vw, 1.5rem);
  color: var(--olive);
}

.countdown {
  margin-top: clamp(2rem, 5vh, 3rem);
  display: flex;
  justify-content: center;
  gap: clamp(1rem, 4vw, 2.4rem);
}

.countdown .unit {
  text-align: center;
  min-width: 3.2em;
}

.countdown .num {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  /* Reduced size */
  color: var(--olive);
  font-variant-numeric: tabular-nums;
}

.countdown .label {
  font-family: var(--font-sans);
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-size: clamp(0.5rem, 1vw, 0.6rem);
  /* Reduced size */
  color: var(--charcoal-soft);
  margin-top: 0.35em;
}

/* ---------- GALLERY ---------- */
.gallery {
  padding-top: clamp(4rem, 10vh, 6rem);
  padding-bottom: clamp(4rem, 10vh, 6rem);
  padding-left: unset;
  padding-right: unset;
}

.gallery-head {
  text-align: center;
  margin-bottom: clamp(2.2rem, 6vh, 3.2rem);
}

.gallery-head h2 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-style: italic;
  font-size: clamp(2.2rem, 8vw, 5.2rem);
  color: var(--olive);
  margin: 0.2em 0 0;
  line-height: 1.05;
}

/* ---------- JOURNEY SCRAPBOOK (polaroid + taped-in caption) ---------- */
.journey-scrapbook {
  max-width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: clamp(3rem, 10vh, 5.5rem);
  padding-top: 1rem;
}

.journey-item {
  display: flex;
  align-items: center;
  gap: clamp(3.4rem, 15.4vw, 8rem);
  --wipe-duration: 2.6s;
}

.journey-item--reverse {
  flex-direction: row-reverse;
}

.polaroid {
  flex: 0 0 auto;
  width: clamp(160px, 34vw, 260px);
  background: var(--cream);
  padding: 12px 12px 40px;
  box-shadow: 0 18px 30px rgba(43, 42, 36, 0.16), 0 4px 10px rgba(43, 42, 36, 0.08);
  position: relative;
  opacity: 0;
  transform: translateY(-55px) rotate(calc(var(--tilt, -3deg) - 9deg));
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.journey-item.is-visible .polaroid {
  animation: polaroidDrop 0.9s cubic-bezier(0.34, 1.45, 0.64, 1) forwards;
}

@keyframes polaroidDrop {
  0% {
    opacity: 0;
    transform: translateY(-55px) rotate(calc(var(--tilt, -3deg) - 9deg));
  }

  55% {
    opacity: 1;
  }

  100% {
    opacity: 1;
    transform: translateY(0) rotate(var(--tilt, -3deg));
  }
}

.polaroid-tape {
  position: absolute;
  top: -13px;
  left: 50%;
  width: 64px;
  height: 24px;
  background: linear-gradient(rgba(255, 255, 255, 0.65), rgba(255, 255, 255, 0.4));
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 2px 5px rgba(43, 42, 36, 0.14);
  transform: translateX(-50%) rotate(var(--tape-tilt, -4deg));
}

.polaroid-photo {
  width: 100%;
  aspect-ratio: var(--photo-ratio, 4 / 5);
  background: var(--nude);
  overflow: hidden;
  position: relative;
}

.polaroid-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  /* Colour grade: mute the three very different sources (sepia selfie, blue snow,
     yellow tungsten) down to one warm, faded-film look. contrast(<1) + brightness(>1)
     lifts the blacks toward charcoal without dulling the highlights. */
  filter: saturate(1.15) sepia(0.35) hue-rotate(-4deg) contrast(0.88) brightness(1.08);
}

/* Palette washes over the graded photo: a rosy-brown soft-light tint (kept off the
   yellow/olive side so skin and whites don't go jaundiced), then a cream multiply
   so the whites read as --cream paper rather than pure white. */
.polaroid-photo::before,
.polaroid-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.polaroid-photo::before {
  background: #7A5238;
  mix-blend-mode: soft-light;
  opacity: 0.38;
}

.polaroid-photo::after {
  background: var(--cream);
  mix-blend-mode: multiply;
}

@media (hover: hover) {
  .polaroid:hover {
    transform: rotate(0deg) translateY(-6px);
    box-shadow: 0 24px 40px rgba(43, 42, 36, 0.2), 0 6px 14px rgba(43, 42, 36, 0.1);
  }
}

.journey-caption {
  flex: 1 1 auto;
  margin: 0;
  text-align: left;
  font-family: 'Petit Formal Script';
  font-size: clamp(1.7rem, 5.2vw, 2rem);
  color: var(--sienna);
  line-height: 1.15;
}

.journey-caption-img {
  display: block;
  width: 60%;
  height: auto;
  clip-path: inset(0 100% 0 0);
  transition: clip-path var(--wipe-duration, 2.6s) cubic-bezier(0.55, 0, 0.15, 1);
}

.journey-item.is-visible .journey-caption-img {
  clip-path: inset(0 0 0 0);
}

.journey-caption .cap-year {
  display: block;
  font-size: 0.58em;
  margin-top: 0.15em;
}

.scroll-video {
  transform: scale(0.6);
}

/* ---------- DESKTOP: left-to-right reveal sequencing ----------
 Items 1 & 3 have the polaroid on the left, caption on the right —
 the photo drops first, then the caption wipes in as a handoff.
 Item 2 is reversed (caption on the left, polaroid on the right) —
 so the caption wipes first, then the photo drops in after it.
 Either way, whichever element sits on the left always animates
 first, keeping the reveal reading left-to-right. */
@media (min-width: 901px) {

  .journey-scrapbook .journey-item:nth-child(1) .journey-caption-img,
  .journey-scrapbook .journey-item:nth-child(3) .journey-caption-img {
    transition-delay: 0.55s;
  }

  .journey-scrapbook .journey-item:nth-child(2) .polaroid {
    animation-delay: calc(var(--wipe-duration, 2.6s) / 2);
  }
}

@media (max-width: 900px) {

  .journey-item,
  .journey-item--reverse {
    flex-direction: column;
    align-items: center;
    gap: 1.1rem;
  }

  .polaroid {
    order: 1;
    width: min(62vw, 240px);
    margin-left: auto !important;
    margin-right: auto !important;
    opacity: 0;
    transform: translateY(-55px) rotate(calc(var(--tilt, -3deg) - 9deg));
  }

  .journey-item.is-visible .polaroid {
    animation: polaroidDrop 0.9s cubic-bezier(0.34, 1.45, 0.64, 1) forwards;
    animation-delay: calc(var(--wipe-duration) / 2);
  }

  .journey-caption {
    order: -1;
    font-size: clamp(1.8rem, 8vw, 2.3rem);
    text-align: center !important;
    display: block !important;
    justify-content: normal !important;
  }

  .journey-caption-img {
    margin: 0 auto;
  }

  .journey-scrapbook .journey-item:nth-child(1) .journey-caption-img {
    width: clamp(136px, 42vw, 198px) !important;
  }

  .journey-scrapbook .journey-item:nth-child(2) .journey-caption-img {
    /* this source image's lettering sits shorter relative to its own
     canvas than the others, so it needs extra width to read at the
     same visual size as "first couple photo" alongside it */
    width: clamp(174px, 55vw, 236px) !important;
  }

  .journey-scrapbook .journey-item:nth-child(3) .journey-caption-img {
    /* narrower box than the other two since it's a shorter phrase, but
     scaled so its lettering matches their cap-height exactly rather
     than eyeballing a "smaller" width */
    width: clamp(105px, 32vw, 153px) !important;
  }
}

/* ---------- DETAILS SECTION UPDATED ---------- */
.details {
  background: var(--cream-2);
  /* Changed to #F5EEDD */
  padding-top: clamp(4rem, 10vh, 6rem);
  padding-bottom: clamp(4rem, 10vh, 6rem);
}

.details-head {
  text-align: center;
  margin-bottom: clamp(2.2rem, 6vh, 3.2rem);
}

.details-head h2 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-style: italic;
  font-size: clamp(2.2rem, 8vw, 5.2rem);
  color: var(--olive);
  margin: 0.2em 0 0;
  line-height: 1.05;
}

.venues {
  max-width: 900px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(1.5rem, 4vw, 3rem);
}

@media (max-width: 720px) {
  .venues {
    grid-template-columns: 1fr;
    gap: 2.4rem;
  }
}

.venue {
  text-align: center;
}

.venue svg {
  width: 34px;
  height: 34px;
  color: var(--sienna);
  margin-bottom: 0.9em;
}

.venue .tag {
  font-family: var(--font-sans);
  font-weight: 500;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  font-size: clamp(0.55rem, 1.1vw, 0.65rem);
  /* Reduced size */
  color: var(--sienna);
  margin-bottom: 0.6em;
  display: block;
}

.venue .name {
  font-family: var(--font-serif);
  font-size: clamp(1.1rem, 2.1vw, 1.3rem);
  color: var(--charcoal);
  line-height: 1.4;
  margin: 0 0 0.7em;
}

.venue a.maplink {
  font-family: var(--font-sans);
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.6rem;
  /* Reduced size */
  color: var(--olive);
  text-decoration: none;
  border-bottom: 1px solid var(--olive);
  padding-bottom: 2px;
}

.venue a.maplink:hover {
  color: var(--sienna);
  border-color: var(--sienna);
}

.details-note {
  text-align: center;
  margin-top: clamp(2.4rem, 6vh, 3.2rem);
  font-family: var(--font-sans);
  font-size: 0.6rem;
  /* Reduced size */
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--charcoal-soft);
}

/* ---------- CTA ---------- */
.cta {
  position: relative;
  background-color: var(--olive-deep);
  background-image:
    linear-gradient(180deg, rgba(43, 42, 36, 0.72) 0%, rgba(43, 42, 36, 0.6) 35%, rgba(43, 42, 36, 0.72) 70%, rgba(43, 42, 36, 0.85) 100%),
    url('../rsvp_section_background.jpg');
  background-size: cover;
  background-position: center 22%;
  background-repeat: no-repeat;
  color: var(--cream);
  text-align: center;
  padding-top: clamp(4.5rem, 12vh, 7rem);
  padding-bottom: clamp(4.5rem, 12vh, 7rem);
}

.cta h2 {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(2.4rem, 9vw, 5.6rem);
  line-height: 1.05;
  margin: 0.25em 0 0.4em;
}

.cta p {
  font-family: var(--font-body);
  font-size: clamp(0.6rem, 1.8vw, 1.1rem);
  /* Reduced size */
  color: var(--cream-2);
  max-width: 480px;
  margin: 0 auto clamp(2rem, 5vh, 2.6rem);
  line-height: 1.8;
}

.cta-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  position: relative;
  margin-top: clamp(1.5rem, 4vh, 2.5rem);
}


/* the RSVP call-to-action is a pill, like the hero button */
#rsvp-btn {
  border-radius: 999px;
}

.cal-wrap {
  position: relative;
  display: inline-block;
}

.cal-link {
  font-family: var(--font-sans);
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.72rem;
  color: rgba(251, 246, 235, 0.72);
  background: none;
  border: none;
  border-bottom: 1px solid rgba(251, 246, 235, 0.42);
  padding-bottom: 3px;
  cursor: pointer;
  transition: color 0.25s ease, border-color 0.25s ease;
}

.cal-link:hover {
  color: var(--gold);
  border-color: var(--gold);
}

a.cal-link {
  text-decoration: none;
}

.cal-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--cream);
  min-width: 210px;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.18);
  display: none;
  flex-direction: column;
  z-index: 20;
}

.cal-menu.open {
  display: flex;
}

.cal-menu a,
.cal-menu button {
  font-family: var(--font-sans);
  font-size: 0.65rem;
  /* Reduced size */
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--charcoal);
  text-decoration: none;
  background: none;
  border: none;
  border-bottom: 1px solid rgba(43, 42, 36, 0.1);
  padding: 0.9em 1.2em;
  text-align: left;
  cursor: pointer;
}

.cal-menu a:last-child,
.cal-menu button:last-child {
  border-bottom: none;
}

.cal-menu a:hover,
.cal-menu button:hover {
  background: var(--nude);
  color: var(--sienna);
}


.rsvp-deadline {
  font-family: var(--font-body);
  font-size: 0.75rem;
  color: rgba(251, 246, 235, 0.7);
  margin: 0.5rem 0 0.2rem;
  text-align: center;
}

.rsvp-deadline-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  margin-top: 1rem;
}

/* ---------- FOOTER ---------- */
footer {
  text-align: center;
  padding-top: clamp(2.6rem, 6vh, 3.4rem);
  padding-bottom: clamp(2.6rem, 6vh, 3.4rem);
}

footer .fine {
  margin-top: 0em;
  font-family: var(--font-sans);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  font-size: 0.9em;
  color: var(--charcoal-soft);
}

/* Mobile improvements: increase readability of smaller text */
@media (max-width: 600px) {
  .milestone-copy .support-line {
    font-size: clamp(0.75rem, 2vw, 1.2rem);
  }

  .cta .rsvp-deadline {
    font-size: 0.95rem;
  }
}

#rsvpSection[hidden] { display: none; }
