/* ============================================================
   COMPONENTS — written mobile-first at 390px, then expanded
   spatially at 900px+ (not merely scaled).
   ============================================================ */

/* ---------- Photo (shared) ----------
   A photo is a frame with a fixed crop. The image fills it and can drift
   slightly inside it. Replace the files in assets/images/ to change photos. */
.photo {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-photo);
}
.photo picture {
  position: absolute;
  inset: 0;
  display: block;
  overflow: hidden;
  background: var(--tone-dusk);
}
.photo img {
  position: absolute;
  inset: -8% 0;
  width: 100%;
  height: 116%;
  object-fit: cover;
  filter: var(--photo-filter);
}
.photo figcaption { position: absolute; left: 0; bottom: 0; }

/* ---------- NAVIGATION ---------- */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: var(--z-nav);
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--nav-h);
  padding: env(safe-area-inset-top) var(--gutter) 0;
  background: transparent;
  color: var(--fg);
  text-shadow: 0 0 6px var(--bg), 0 0 12px var(--bg);   /* keeps the text readable over photos with no bar */
  transition: color var(--dur-tone) var(--ease-inout);
}
.nav__right { display: flex; gap: var(--s-5); }
.nav__link {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: var(--step-label);
  font-weight: 500;
  letter-spacing: var(--label-tracking);
  text-transform: uppercase;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-decoration-thickness: var(--hairline);
  text-underline-offset: 0.5em;
  transition: text-decoration-color var(--dur-micro) var(--ease-out);
}
.nav__link:hover { text-decoration-color: currentColor; }

/* Index overlay: same grey paper and pink as the rest of the site */
.index {
  margin: 0;
  padding: 0;
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  border: 0;
  background: var(--tone-day) url("../assets/images/paper.png");
  background-size: 360px 360px;
  color: var(--ink);
}
.index[open] {
  display: grid;
  grid-template-rows: auto 1fr;
  animation: index-in var(--dur-micro) var(--ease-out);
}
.index::backdrop { background: transparent; }
.index__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  padding: env(safe-area-inset-top) var(--gutter) 0;
}
.index__close {
  min-height: 48px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}
.index__list {
  align-self: center;
  padding: var(--s-6) var(--gutter) var(--s-9);
}
.index__list li { border-top: var(--hairline) solid var(--line); }
.index__list li:last-child { border-bottom: var(--hairline) solid var(--line); }
.index__list a,
.index__list li.is-soon {
  display: grid;
  grid-template-columns: 2.5rem 1fr auto;
  align-items: baseline;
  gap: var(--s-3);
  padding-block: var(--s-4);
  text-decoration: none;
}
.index__item {
  font-family: var(--font-hand);
  font-weight: 600;
  font-size: clamp(1.75rem, 8vw, 3rem);
  line-height: 1.1;
}
.index__list a:hover .index__item { color: var(--ink); text-decoration: underline wavy; }
.index__list li.is-soon { color: var(--ink); opacity: .6; }
@keyframes index-in { from { opacity: 0; } to { opacity: 1; } }

/* ---------- HERO ----------
   The couple's own photos, held in a rounded frame like a printed invitation.
   The names are written across the top edge of the frame. */
.hero {
  /* on tablets the poster stays phone-width and centred rather than ballooning */
  padding: calc(var(--nav-h) + var(--s-3)) max(var(--gutter), calc((100% - 32rem) / 2)) var(--rhythm-s);
}
.hero__names {
  position: relative;
  z-index: 3;
  display: grid;
  margin-bottom: calc(var(--s-5) * -1);
}
.hero__first { width: 66%; justify-self: start; transform: rotate(-3deg); transform-origin: 0 100%; }
.hero__second { width: 80%; justify-self: end; margin-top: -0.35rem; transform: rotate(-2deg); transform-origin: 100% 100%; }

.hero__frame {
  position: relative;
  margin: 0;
  aspect-ratio: 3 / 4;
  border-radius: var(--radius-photo);
}
.hero__frames {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: inherit;
  background: var(--tone-dusk);
}
.hero__frames img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  filter: var(--photo-filter);
}
/* With motion off, one frame is shown and it simply sits there (motion.css cycles the rest) */
.hero__frames img.is-static { opacity: 1; }

/* Doodles: sit across the frame's edge, never over faces */
.doodle { position: absolute; z-index: 2; color: var(--accent); pointer-events: none; overflow: visible; }
.doodle--sparkles { left: -5%; top: 10%; width: 24%; }
.doodle--star { right: 2%; top: -21%; width: 12%; }
.doodle--squiggle { left: 2.5%; bottom: 3%; width: 11%; z-index: 3; }   /* sits on the photo's lower-left corner, clear of the words below */

.hero__info {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  gap: var(--s-3);
  margin-top: var(--s-5);
  text-align: center;
}
.hero__script { width: 70%; }
.hero__date { display: grid; justify-items: center; gap: var(--s-1); width: 100%; }
.hero__date .lettering { width: 88%; }
.hero__where { margin-top: var(--s-1); }

/* ---------- INVITATION ---------- */
.invitation { padding-block: var(--rhythm-m) var(--rhythm-s); }
.invitation__inner { display: grid; }
.invitation__label { color: var(--fg-soft); max-width: 24ch; margin-bottom: var(--s-6); }
.invitation__lead {
  position: relative;
  z-index: 2;                  /* the words sit in front of the photograph */
  font-size: var(--step-lead);
  line-height: 1.22;
  text-wrap: balance;
}
.invitation__detail {
  width: 68vw;
  aspect-ratio: 4 / 5;
  margin-top: calc(var(--rhythm-s) * -0.9);
  margin-left: auto;
  overflow: visible;           /* caption sits below the frame */
  border-radius: 0;
  background: none;
}
.invitation__detail picture { border-radius: var(--radius-photo); }
.invitation__detail figcaption {
  top: calc(100% + var(--s-2));
  bottom: auto;
  right: 0;
  left: auto;
  color: var(--fg-soft);
}

/* ---------- THE DAY ---------- */
.day { padding-bottom: 0; }
.event { padding-inline: var(--gutter); }
.event__time {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin-block: var(--s-5) var(--s-4);   /* room above, so the big time never touches the label */
}
.event__time .lettering { width: 76%; flex: none; }
.event__meridiem { margin-top: 0.4rem; }
.event__date { color: var(--fg-soft); margin-bottom: var(--s-5); }
.event__venue { margin-bottom: var(--s-2); }
.event__venue .lettering { width: 94%; }
.event__place { color: var(--fg-soft); margin-bottom: var(--s-4); }
.event__address { color: var(--fg-soft); margin-bottom: var(--s-5); }
.event__note { max-width: 30ch; margin-bottom: var(--s-3); }
.event__note.hand { max-width: 24ch; }
.event__note--small { font-size: var(--step-body-s); color: var(--fg-soft); margin-bottom: var(--s-4); max-width: 34ch; }

.event--ceremony { padding-top: var(--rhythm-m); }

/* Portrait: bleeds off the right edge and drifts slightly inside its frame */
.day__portrait {
  width: 76vw;
  aspect-ratio: 3 / 4;
  margin: var(--rhythm-s) 0 var(--rhythm-s) auto;
  border-radius: var(--radius-photo) 0 0 var(--radius-photo);
}

/* The route mark: first appearance of the recurring thread */
.routemark {
  display: flex;
  align-items: stretch;
  gap: var(--s-3);
  padding-inline: var(--gutter);
  margin-bottom: var(--s-7);
}
.routemark svg { flex: none; overflow: visible; }
.routemark circle,
.routemark rect { fill: none; stroke: var(--accent); stroke-width: 1.5; }
.routemark__line { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linecap: round; }
.routemark__caption { align-self: center; color: var(--fg-soft); }

/* Reception: mirrored — time sits right, copy is indented */
.event--reception { padding-bottom: var(--rhythm-m); }
.event--reception .event__time { justify-content: flex-end; }
.event--reception .event__time .lettering { width: 60%; }
.event--reception .event__venue,
.event--reception .event__address,
.event--reception .event__note,
.event--reception .textlink { margin-left: 22%; }
.event--reception .event__venue { display: grid; gap: var(--s-1); margin-bottom: var(--s-4); }
.event--reception .lettering--venueR1 { width: 70%; }
.event--reception .lettering--venueR2 { width: 84%; }

/* ---------- LANDSCAPE INTERLUDE ---------- */

/* ---------- THE JOURNEY ---------- */
.journey { padding-top: var(--rhythm-m); }
.journey__intro { padding-bottom: var(--rhythm-s); }
.journey__intro .label { color: var(--fg-soft); margin-bottom: var(--s-4); }
.journey__statement { margin-bottom: var(--s-5); }
.journey__statement .lettering { width: 100%; }
.journey__copy { max-width: 34ch; }

/* The map itself */
.map {
  position: relative;
  width: var(--map-w);
  height: var(--map-h);
  margin-top: var(--s-4);
}
.map__svg { width: 100%; height: 100%; }
.map__blocks { fill: var(--block); }
.map__streets path { fill: none; stroke: var(--line-soft); stroke-width: 1; }
.map__road-edge { fill: none; stroke: var(--line); stroke-width: 1; }
.map__tag.map__tag--street { font-size: 6.4px; letter-spacing: 0.02em; text-transform: uppercase; }
.map__fountain { fill: none; stroke: var(--line); stroke-width: 1; }
.map__ghost { fill: none; stroke: var(--fg-soft); stroke-width: 1.5; stroke-dasharray: 2 6; opacity: 0.7; }
.map__route {
  fill: none;
  stroke: var(--accent);
  stroke-width: 5;       /* a marker line: the route dominates, everything else is hairline */
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 9 11;
  animation: route-march 1.1s linear infinite;   /* dashes run from the ceremony to the reception */
}
@keyframes route-march { to { stroke-dashoffset: -20; } }
.map__marker circle,
.map__marker rect { fill: var(--bg); stroke: var(--accent); stroke-width: 2; }
.map__marker .map__marker-fill { fill: var(--accent); stroke: none; }
.map__dot { display: none; }
.map__dot circle { fill: var(--accent); }
.map__dot .map__dot-ring { fill: none; stroke: var(--accent); stroke-width: 1.5; opacity: 0.4; }
.journey.is-live .map__dot { display: block; }

/* Labels are HTML (crisp, accessible type) positioned on the map's own grid */
.map__label { position: absolute; z-index: var(--z-map-label); color: var(--fg-soft); }
.map__label--ceremony {
  transform: translateX(-100%);   /* hangs to the left of the ring: the ring sits near the right edge */
  text-align: right;
  white-space: nowrap;
  color: var(--fg);
}
.map__label--reception {
  width: min(17rem, calc(100% - 36% - var(--gutter)));
  color: var(--fg);
}
.map__street { fill: var(--fg-soft); stroke: none; font: 500 10px var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; }
.map__reception-name { display: grid; gap: 2px; margin-bottom: var(--s-2); }
.map__reception-name .lettering--venueR1 { width: 62%; }
.map__reception-name .lettering--venueR2 { width: 78%; }
.map__label--reception .label { color: var(--fg-soft); }

/* Odometer: pinned while you travel, tallying distance and time in hand-drawn digits */
.odo-track {
  position: absolute;
  left: 0;
  right: 0;            /* top and height are set from the map geometry in the page */
  pointer-events: none;
}
.odo {
  position: sticky;
  top: 34svh;
  padding-right: var(--gutter);
  display: grid;
  justify-items: end;
  gap: var(--s-3);
  color: var(--accent);
}
.odo__distance,
.odo__time { display: flex; align-items: flex-end; }
.odo-digit { width: var(--odo-w); height: auto; overflow: visible; flex: none; }
.odo__time .odo-digit { width: calc(var(--odo-w) * 0.46); }
.odo__unit {
  margin: 0 0 0.35rem 0.5rem;
  font-family: var(--font-mono);
  font-size: var(--step-label);
  font-weight: 500;
  letter-spacing: var(--label-tracking);
  color: var(--fg);
}

.map__proto {
  position: absolute;
  right: var(--gutter);
  bottom: var(--s-4);
  max-width: 22ch;
  text-align: right;
  color: var(--accent);
}
.map__proto:empty { display: none; }

/* Practical information after the destination */
.journey__after {
  display: grid;
  gap: 0;
  padding-block: var(--rhythm-s) var(--rhythm-m);
}
.journey__after > div {
  display: grid;
  gap: var(--s-3);
  padding-block: var(--s-5);
  border-top: var(--hairline) solid var(--line);
}
.journey__after > div:last-child { border-bottom: var(--hairline) solid var(--line); }
.journey__after dt { color: var(--fg-soft); }
.journey__after dd { max-width: 36ch; font-size: var(--step-body-s); }

/* ---------- RSVP ----------
   Fields follow the couple's own form: pink capital labels, light boxes, a pill SEND button. */
.rsvp { padding-block: var(--rhythm-m) var(--rhythm-l); }
.rsvp__title { width: auto; max-width: none; margin-bottom: var(--s-3); white-space: nowrap; }
.rsvp__deadline { margin-bottom: var(--s-6); }
.rsvp__form { display: grid; gap: var(--s-5); max-width: 40rem; }
.rsvp__trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.field { display: grid; gap: var(--s-2); }
.field label, .field legend {
  font-family: var(--font-hand);
  font-size: var(--step-body);
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink);
  padding: 0;
}
.field--choice { border: 0; margin: 0; padding: 0; min-width: 0; }
.choice { display: flex; flex-wrap: wrap; gap: var(--s-3); margin-top: var(--s-2); }
.field .choice__opt { position: relative; flex: 1 1 11rem; cursor: pointer; text-transform: none; letter-spacing: 0; font-size: var(--step-body); }
.choice__opt input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.choice__opt span { display: flex; align-items: center; justify-content: center; min-height: 3.5rem; padding: 0.5rem 1.1rem; border: 1.5px solid var(--ink); border-radius: 6px; font-family: var(--font-hand); font-size: var(--step-body); text-align: center; color: var(--ink); transition: background var(--dur-micro) var(--ease-out); }
.choice__opt input:checked + span { background: var(--ink); color: var(--tone-day); }
.choice__opt input:focus-visible + span { box-shadow: 0 0 0 3px rgba(255, 0, 200, 0.28); }
.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 3.5rem;                 /* a comfortable thumb target */
  padding: 0.9rem 1.1rem;
  border: 1.5px solid var(--ink);
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  font-family: var(--font-hand);
  font-size: var(--step-body);        /* 17px+: stops iPhones zooming in on focus */
  font-weight: 400;
  line-height: 1.4;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color var(--dur-micro) var(--ease-out), box-shadow var(--dur-micro) var(--ease-out);
}
.field textarea { resize: vertical; field-sizing: content; min-height: 3.5rem; }
.field input::placeholder,
.field textarea::placeholder { color: var(--ink); opacity: .6; }
.field select {
  padding-right: 3rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1.5l6 6 6-6' fill='none' stroke='%23ff00c8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1.1rem center;
}
.field select:invalid { color: var(--ink); opacity: .75; }       /* the "Surely yes..." prompt looks like a placeholder */
.field select option { color: var(--ink); }
.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 0, 200, 0.28);
}
.field [aria-invalid="true"] { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 0, 200, 0.28); }
.field__req { color: var(--accent); }
.field__error { font-size: var(--step-body); font-weight: 400; color: var(--fg-soft); }

.rsvp__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-4); margin-top: var(--s-2); }
.rsvp__send {
  min-height: 3.5rem;
  padding: 0 2.6rem;
  border: 2px solid var(--ink);
  border-radius: 999px;               /* pill, as in the couple's form */
  background: transparent;
  color: var(--ink);
  font-family: var(--font-hand);
  font-size: var(--step-body);
  font-weight: 400;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform var(--dur-micro) var(--ease-out), opacity var(--dur-micro) var(--ease-out);
}
.rsvp__send:hover { background: rgba(255, 0, 200, 0.12); }
.rsvp__send:active { transform: translateY(1px); }
.rsvp__send:focus-visible { outline: 3px solid var(--fg); outline-offset: 3px; }
.rsvp__send:disabled { opacity: 0.6; cursor: progress; transform: none; }
.rsvp__status { flex: 1 1 14rem; font-size: var(--step-body); font-weight: 400; color: var(--fg-soft); }
.rsvp__status:empty { display: none; }

.rsvp__thanks { max-width: 40rem; }
.rsvp__thanks[hidden] { display: none; }
.rsvp__thanks:focus { outline: none; }
.rsvp__thanks-art { width: min(100%, 22rem); margin-bottom: var(--s-4); }
.rsvp__contact { margin-top: var(--s-6); color: var(--fg-soft); }

/* ============================================================
   900px+ — the phone composition expanded across the page
   ============================================================ */
@media (min-width: 900px) {
  /* Hero: names on the left, framed photo on the right, the first name spilling over the frame's edge */
  .hero {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    grid-template-rows: auto 1fr;
    column-gap: var(--col-gap);
    min-height: 100svh;
    padding: calc(var(--nav-h) + var(--s-3)) var(--gutter) var(--s-7);
  }
  .hero__names {
    grid-column: 1 / 8;
    grid-row: 1;
    align-self: start;
    margin: var(--s-8) 0 0;
  }
  .hero__first { width: min(30rem, 80%); }
  .hero__second { width: min(37rem, 100%); justify-self: start; margin-left: 12%; margin-top: 0; }
  .hero__frame {
    grid-column: 7 / 12;
    grid-row: 1 / span 2;
    justify-self: center;
    align-self: center;
    width: min(100%, calc((100svh - var(--nav-h) - 3rem) * 0.75));
  }
  .hero__info {
    grid-column: 1 / 7;
    grid-row: 2;
    align-self: end;
    justify-items: start;
    text-align: left;
    margin-top: 0;
  }
  .hero__script { width: min(17rem, 60%); margin-left: 4%; }
  .hero__date { justify-items: start; }
  .hero__date .lettering { width: min(27rem, 90%); }
  .doodle--sparkles { left: -9%; }
  .doodle--star { right: -6%; top: -9%; width: 12%; }
  .doodle--squiggle { left: -9%; bottom: -3%; width: 11%; }

  /* Invitation: statement offset to the right; detail sits low-left */
  .invitation__inner { grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--col-gap); }
  .invitation__label { grid-column: 3 / 8; }
  .invitation__lead { grid-column: 3 / 12; }
  .invitation__detail {
    grid-column: 6 / 10;
    width: auto;
    margin: calc(var(--rhythm-s) * -1.1) 0 0;
  }

  /* The Day: three-part composition across the width */
  .day {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: var(--col-gap);
    align-items: start;
  }
  .event--ceremony { grid-column: 1 / 6; grid-row: 1; padding-right: 0; }
  .event__time .lettering { width: min(18rem, 80%); }
  .event__venue .lettering { width: min(24rem, 100%); }
  .day__portrait {
    grid-column: 6 / 10;
    grid-row: 1;
    width: auto;
    margin: var(--rhythm-m) 0 0;
    aspect-ratio: 4 / 5;
    border-radius: var(--radius-photo);
  }
  .routemark { grid-column: 1 / 4; grid-row: 2; align-self: end; margin: 0 0 var(--s-8); }
  .event--reception {
    grid-column: 1 / 6;
    grid-row: 2;
    align-self: start;
    padding-left: var(--gutter);
    padding-top: var(--rhythm-s);
    padding-bottom: var(--s-8);
  }
  .event--reception .event__venue,
  .event--reception .event__address,
  .event--reception .event__note,
  .event--reception .textlink { margin-left: 0; }
  .event--reception .event__time { justify-content: flex-start; }
  .event--reception .event__time .lettering { width: min(13rem, 70%); }
  .event--reception .lettering--venueR1 { width: min(11rem, 70%); }
  .event--reception .lettering--venueR2 { width: min(13.5rem, 84%); }


  /* Journey: statement pins on the left while the map passes on the right */
  .journey__layout {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: var(--col-gap);
    padding-inline: var(--gutter);
    max-width: var(--wrap-max);
    margin-inline: auto;
  }
  .journey__intro {
    grid-column: 1 / 6;
    position: sticky;
    top: 22vh;
    align-self: start;
    padding-inline: 0;
  }
  .journey__statement .lettering { width: min(26rem, 100%); }
  .map {
    grid-column: 7 / -1;
    justify-self: end;
    margin-top: 0;
  }
  .journey__after {
    grid-template-columns: repeat(3, 1fr);
    column-gap: var(--col-gap);
    margin-top: var(--rhythm-s);
  }
  .journey__after > div { border-bottom: var(--hairline) solid var(--line); padding-right: var(--s-6); }
  .journey__after > div:last-child { border-bottom: var(--hairline) solid var(--line); }

  /* RSVP: title and form side by side */
  .rsvp__inner { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--col-gap); align-items: start; }
  .rsvp__title, .rsvp__deadline { grid-column: 1 / 5; }
  .rsvp__title { max-width: none; }
  .rsvp__form, .rsvp__thanks { grid-column: 5 / 12; grid-row: 1 / span 3; }
  .rsvp__contact { grid-column: 1 / 5; }
}

/* ============================================================
   PHOTO REEL — scrolls by itself; drag, swipe or wheel to take over
   ============================================================ */
.reel { padding-block: var(--rhythm-s); }
.reel__track {
  display: flex; gap: 0; list-style: none; margin: 0;
  padding: 0;
  overflow-x: auto; overscroll-behavior-x: contain;
  scrollbar-width: none; -ms-overflow-style: none;
  cursor: grab; touch-action: pan-x pan-y;
  -webkit-user-select: none; user-select: none;
}
.reel__track::-webkit-scrollbar { display: none; }
.reel__track.is-dragging { cursor: grabbing; }
.reel__item { flex: 0 0 auto; height: clamp(16rem, 62vw, 30rem); }
.reel__item img {
  display: block; height: 100%; width: auto;
  border-radius: 0; filter: var(--photo-filter);
  pointer-events: none;
}
.reel__track:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

/* Scattered pen-line doodles (same pink as the text; drawn on as they arrive) */
.invitation, .day, .reel, .journey, .rsvp { position: relative; }
.scribble { z-index: 1; height: auto; opacity: .95; }
@media (max-width: 899px) { .scribble { opacity: .9; } }

/* ============================================================
   TIMELINE — a pour of champagne down into a glass
   ============================================================ */
.tl { position: relative; padding-top: var(--rhythm-s); }
.tl__head { text-align: left; }
.tl__title { font-size: var(--step-lead); line-height: 1.1; margin: var(--s-3) 0 0; font-weight: 400; }
.tl__stage { position: relative; width: min(100%, 30rem); margin: var(--s-5) auto 0; aspect-ratio: 390 / 1060; color: var(--accent); }
.tl__svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.tl__ghost { fill: none; stroke: currentColor; stroke-width: 2; opacity: .18; stroke-linecap: round; }
.tl__pour { fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 0; }
.tl__bubbles { fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-dasharray: 0.1 9; opacity: .55; }
.tl__tick { fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.tl__liquid { fill: currentColor; fill-opacity: .22; }
.tl__stops { list-style: none; margin: 0; padding: 0; }
.tl__stop { position: absolute; transform: translateY(-50%); }
.tl__stop--l { transform: translate(-100%, -50%); text-align: right; }
.tl__btn { all: unset; box-sizing: border-box; cursor: pointer; display: block; padding: var(--s-2) var(--s-1); min-height: 48px; color: var(--fg); }
.tl__btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.tl__time { display: block; font-size: clamp(1.75rem, 8vw, 2.75rem); line-height: 1; color: var(--accent); }
.tl__time small { font-size: .38em; margin-left: .3em; letter-spacing: .06em; }
.tl__name { display: block; margin-top: .25rem; }
.tl__btn:hover .tl__time, .tl__btn[aria-expanded="true"] .tl__time { text-decoration: underline wavy; text-underline-offset: .15em; text-decoration-thickness: 1.5px; }
.tl__note { position: relative; z-index: 1; background: var(--bg); border-radius: 6px; display: block; margin-top: var(--s-1); padding-inline: var(--s-1); font-size: var(--step-body-s); line-height: 1.4; }
.tl__note[hidden] { display: none; }
.js .tl.is-live .tl__stop, .js .tl.is-live .tl__tick { opacity: 0; transition: opacity 500ms var(--ease-out); }
.js .tl.is-live .tl__stop.is-on, .js .tl.is-live .tl__tick.is-on { opacity: 1; }
@media (min-width: 900px) { .tl__stage { width: 34rem; } }
@media (prefers-reduced-motion: reduce) { .js .tl.is-live .tl__stop, .js .tl.is-live .tl__tick { transition: none; } }

/* Paper grain: a soft fibre texture laid over the grey, in every tone */
body { background-image: url("../assets/images/paper.png"); background-size: 360px 360px; }
html[data-theme="night"] body { background-image: url("../assets/images/paper-night.png"); }


/* keep the rings clear of the ceremony text on wide screens */
@media (min-width: 900px) { .scribble--rings { left: 80% !important; top: 30% !important; } }

/* map: Carlton Gardens extent, Royal Exhibition Building outline, tags */
.map__gardens { fill: var(--block); stroke: none; }
.map__gardens-edge { fill: none; stroke: var(--line); stroke-width: 1.5; stroke-dasharray: 5 5; }
.map__reb path, .map__reb circle { fill: none; stroke: var(--accent); stroke-width: 1.5; stroke-linejoin: round; }
.map__tag { fill: var(--fg-soft); font: 500 8.5px var(--font-mono); letter-spacing: 0.1em; }
.map__tag--strong { fill: var(--fg); }
.event__maplink { display: inline-block; margin: calc(var(--s-3) * -1) 0 var(--s-5); }

/* What to wear, Gifts */
.info { position: relative; padding-block: var(--rhythm-m) 0; }
.info__inner { display: grid; gap: var(--s-4); max-width: 44rem; }
.info__title { font-size: var(--step-lead); line-height: 1.1; font-weight: 400; margin: 0; }
.info__body { font-size: var(--step-hand); line-height: 1.4; margin: 0; max-width: 34ch; }
.rsvp__contact { text-transform: none; letter-spacing: 0.02em; font-size: var(--step-body); }

/* Schedule fireworks: draw on, then keep bursting gently */
.tl { position: relative; }
.scribble--fireworks { position: absolute; }
.fw { transform-box: fill-box; transform-origin: center; }
.scribble--fireworks.is-in .fw--a { animation: fw-burst 3.2s ease-out infinite; opacity: 0; }
.scribble--fireworks.is-in .fw--b { animation: fw-burst 3.2s ease-out -1.6s infinite; opacity: 0; }
.scribble--fireworks.is-in > g > path:last-child { stroke-dasharray: 1; animation: fw-trail 3.2s ease-in infinite; }
@keyframes fw-burst { 0%, 18% { transform: scale(.15); opacity: 0; } 24% { opacity: 1; } 55% { transform: scale(1.15); opacity: 1; } 80%, 100% { transform: scale(1.3); opacity: 0; } }
@keyframes fw-trail { 0% { stroke-dashoffset: 1; opacity: 1; } 18% { stroke-dashoffset: 0; opacity: 1; } 24%, 100% { stroke-dashoffset: 0; opacity: 0; } }

/* Trees on the map */
.map__trees { fill: none; stroke: var(--accent); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; opacity: .9; }

.info__body--gap { margin-top: .5rem; }
.info__sub { font-size: var(--step-lead); font-weight: 400; line-height: 1.1; margin: var(--s-6) 0 var(--s-3); }

/* Hero star: bursts, rays fly out, then it settles and goes again */
.doodle--star { overflow: visible; }
.star__body, .star__rays { transform-box: fill-box; transform-origin: center; }
.doodle--star.is-in .star__body { animation: star-pop 3.2s ease-in-out infinite; }
.doodle--star.is-in .star__rays { animation: star-rays 3.2s ease-out infinite; opacity: 0; }
@keyframes star-pop { 0%, 55%, 100% { transform: scale(1) rotate(0); } 62% { transform: scale(.78) rotate(-8deg); } 72% { transform: scale(1.22) rotate(6deg); } 85% { transform: scale(1) rotate(0); } }
@keyframes star-rays { 0%, 58% { opacity: 0; transform: scale(.55); } 70% { opacity: 1; transform: scale(1); } 92%, 100% { opacity: 0; transform: scale(1.35); } }

/* Hero squiggle: draws itself, rests, rubs out, and draws again */
@media all {
  .js .doodle--squiggle.is-in path { stroke-dasharray: 1; animation: squiggle-draw 6s ease-in-out infinite; transition: none; }
  .js .doodle--squiggle.is-in path:nth-child(2) { animation-delay: .5s; }
  .js .doodle--squiggle.is-in path:nth-child(3) { animation-delay: 1s; }
}
@keyframes squiggle-draw { 0% { stroke-dashoffset: 1; } 35%, 80% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: -1; } }

/* Invitation flutes: lean in, clink, spark, lean back */
.flute { transform-box: view-box; }
.flute--l { transform-origin: 30px 84px; }
.flute--r { transform-origin: 70px 84px; }
.flute__spark { transform-box: fill-box; transform-origin: 50% 100%; }
@media all {
  .scribble--flutes.is-in .flute--l { animation: flute-l 3.4s ease-in-out infinite; }
  .scribble--flutes.is-in .flute--r { animation: flute-r 3.4s ease-in-out infinite; }
  .scribble--flutes.is-in .flute__spark { animation: flute-spark 3.4s ease-out infinite; opacity: 0; }
}
@keyframes flute-l { 0%, 50%, 100% { transform: rotate(0); } 34% { transform: rotate(-4deg); } 42% { transform: rotate(11deg); } 46% { transform: rotate(9deg); } }
@keyframes flute-r { 0%, 50%, 100% { transform: rotate(0); } 34% { transform: rotate(4deg); } 42% { transform: rotate(-11deg); } 46% { transform: rotate(-9deg); } }
@keyframes flute-spark { 0%, 40% { opacity: 0; transform: scale(.5); } 46% { opacity: 1; transform: scale(1.1); } 70%, 100% { opacity: 0; transform: scale(1.3); } }

/* Burst doodle in The day: fires like a firework, then fades and goes again */
.scribble--burst path { transform-box: fill-box; transform-origin: center; }
@media all {
  .scribble--burst.is-in path:nth-child(1) { animation: fw-burst 3.6s ease-out infinite; opacity: 0; transform-origin: 50px 50px; transform-box: view-box; }
  .scribble--burst.is-in path:nth-child(2) { animation: fw-burst 3.6s ease-out .12s infinite; opacity: 0; transform-origin: 50px 50px; transform-box: view-box; }
}

/* Disco ball: the meridians sweep across so the ball looks like it spins */
.dm { transform-box: view-box; transform-origin: 50px 50px; }
@media all {
  .scribble--disco.is-in .dm { animation: disco-spin 3s ease-in-out var(--d, 0s) infinite; }
  .scribble--disco.is-in path:last-child { animation: disco-twinkle 1.6s ease-in-out infinite; }
}
@keyframes disco-spin { 0%, 100% { transform: scaleX(1); } 25% { transform: scaleX(0.05); } 50% { transform: scaleX(-1); } 75% { transform: scaleX(0.05); } }
@keyframes disco-twinkle { 0%, 100% { opacity: 1; } 50% { opacity: .2; } }

/* Heart: a double-beat bulge, like a heartbeat */
.scribble--heart > g { transform-box: view-box; transform-origin: 50px 55px; }
@media all {
  .scribble--heart.is-in > g { animation: heartbeat 1.6s ease-in-out infinite; }
}
@keyframes heartbeat { 0%, 40%, 100% { transform: scale(1); } 10% { transform: scale(1.22); } 20% { transform: scale(.97); } 30% { transform: scale(1.14); } }

/* Beer glasses: swing apart, then clink and splash */
.beer { transform-box: view-box; }
.beer--l { transform-origin: 30px 84px; }
.beer--r { transform-origin: 70px 84px; }
.beer__spark { transform-box: fill-box; transform-origin: 50% 100%; }
@media all {
  .scribble--beers.is-in .beer--l { animation: beer-l 2.8s ease-in infinite; }
  .scribble--beers.is-in .beer--r { animation: beer-r 2.8s ease-in infinite; }
  .scribble--beers.is-in .beer__spark { animation: beer-spark 2.8s ease-out infinite; opacity: 0; }
}
@keyframes beer-l { 0%, 100% { transform: rotate(-14deg); } 55% { transform: rotate(0); } 62% { transform: rotate(-3deg); } 70% { transform: rotate(0); } 85% { transform: rotate(-10deg); } }
@keyframes beer-r { 0%, 100% { transform: rotate(14deg); } 55% { transform: rotate(0); } 62% { transform: rotate(3deg); } 70% { transform: rotate(0); } 85% { transform: rotate(10deg); } }
@keyframes beer-spark { 0%, 54% { opacity: 0; transform: scale(.4); } 60% { opacity: 1; transform: scale(1.15); } 85%, 100% { opacity: 0; transform: scale(1.3); } }

/* Route arrows: pop in as the route is drawn past them, then nudge forward */
.map__arrow { opacity: 0; transition: opacity .25s ease; }
.map__arrow.is-on { opacity: 1; }
.map__arrow path { fill: var(--paper); stroke: var(--accent); stroke-width: 1; stroke-linejoin: round; }
@media all {
  .map__arrow.is-on path { transform-box: fill-box; transform-origin: center; animation: arrow-run 2.8s ease-in-out infinite; }
}
@keyframes arrow-run { 0%, 28%, 100% { transform: scale(1); opacity: .35; } 10% { transform: scale(1.7); opacity: 1; } }
@keyframes arrow-nudge { 0%, 100% { transform: translateX(-1px); } 50% { transform: translateX(1.6px); } }

.map__venue { fill: var(--accent); stroke: none; }

/* Gifts sits close under What to wear */
.info + .info { padding-top: var(--s-6); }

/* ---------- Headings: the body typeface (Edu SA Hand), as bold as it goes ---------- */
.lt {
  display: block;
  font-family: var(--font-hand);
  font-weight: 700;
  -webkit-text-stroke: 0.035em currentColor;
  paint-order: stroke fill;
  color: var(--accent);
  line-height: 1.02;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}
.lt--first, .lt--second { font-size: clamp(2.6rem, 14vw, 6.2rem); line-height: .95; width: auto; text-transform: uppercase; letter-spacing: 0.02em; }
.hero__first, .hero__second { width: auto; }
.lt--dateA, .lt--dateB { font-size: clamp(2rem, 11vw, 3.6rem); }
.lt--script { font-size: clamp(1.3rem, 6vw, 2.1rem); text-transform: uppercase; letter-spacing: 0.04em; }
.hero__script { width: 100%; min-width: 0; max-width: 100%; }
.hero__script .lt--script { line-height: 1.3; padding-top: .12em; text-shadow: none; display: block; white-space: nowrap; text-align: center; font-size: 5.2vw; letter-spacing: 0.02em; }   /* js/fit.js sizes it to the page width exactly */
.lt--clockC { font-size: clamp(4.6rem, 27vw, 8.6rem); line-height: 1.05; padding-top: .08em; }
.lt--clockR { font-size: clamp(4.2rem, 24vw, 7.6rem); line-height: 1.05; padding-top: .08em; }
.event__time .lt { width: auto; flex: none; }
.lt--venueC { font-size: clamp(1.8rem, 8vw, 3rem); }
.lt--venueR1, .lt--venueR2 { font-size: clamp(2rem, 9.6vw, 3rem); width: auto; }
.lt--rsvp { font-size: clamp(2.8rem, 15vw, 4.4rem); }
.lt--thanks { font-size: clamp(2.2rem, 10.5vw, 3.4rem); }
.lt--statement { font-size: clamp(2.3rem, 10.5vw, 4rem); }
.odo-digit {
  width: auto;
  font-family: var(--font-hand);
  font-weight: 700;
  -webkit-text-stroke: 0.03em currentColor;
  font-size: calc(var(--odo-w) * 1.35);
  line-height: .95;
  min-width: calc(var(--odo-w) * 0.55);
  text-align: center;
}
.odo__time .odo-digit { font-size: calc(var(--odo-w) * 0.8); min-width: calc(var(--odo-w) * 0.34); }
@media (min-width: 900px) {
  .lt--first, .lt--second { font-size: clamp(4.4rem, 6.2vw, 7.4rem); }
  .lt--dateA, .lt--dateB { font-size: clamp(2.6rem, 3.6vw, 4.2rem); }
  .lt--clockC, .lt--clockR { font-size: clamp(6rem, 8vw, 9rem); }
  .lt--venueC, .lt--venueR1, .lt--venueR2 { font-size: clamp(2.2rem, 3vw, 3.4rem); }
  .lt--statement { font-size: clamp(3rem, 5vw, 5rem); }
}

.map__tag--small { font-size: 7.5px; letter-spacing: 0.06em; }

/* ---------- More doodles, all animated (they play even with Reduce Motion on) ---------- */
.doodle .fh, .doodle .bb, .doodle .bq, .doodle .nt, .doodle .flash, .doodle .hg, .doodle .lid { transform-box: fill-box; transform-origin: center; }
.scribble--hearts.is-in .fh { animation: heart-float 3.4s ease-in infinite; animation-delay: var(--d); opacity: 0; }
@keyframes heart-float { 0% { transform: translateY(8px) scale(.6); opacity: 0; } 20% { opacity: 1; } 100% { transform: translateY(-48px) scale(1.1); opacity: 0; } }
.scribble--bubbles.is-in .bb { animation: bubble-rise 3.2s ease-in infinite; opacity: 0; }
.scribble--bubbles.is-in .b2 { animation-delay: -1s; } .scribble--bubbles.is-in .b3 { animation-delay: -2s; } .scribble--bubbles.is-in .b4 { animation-delay: -.5s; }
@keyframes bubble-rise { 0% { transform: translateY(0) scale(.6); opacity: 0; } 15% { opacity: 1; } 100% { transform: translateY(-62px) scale(1.15); opacity: 0; } }
.scribble--bouquet.is-in .bq { transform-origin: 50% 100%; animation: sway 3.2s ease-in-out infinite; }
@keyframes sway { 0%, 100% { transform: rotate(-6deg); } 50% { transform: rotate(6deg); } }
.scribble--notes.is-in .nt { animation: note-bob 1.8s ease-in-out infinite; }
@keyframes note-bob { 0%, 100% { transform: translateY(3px) rotate(-4deg); } 50% { transform: translateY(-7px) rotate(5deg); } }
.scribble--camera.is-in .flash { animation: cam-flash 2.8s ease-in-out infinite; }
@keyframes cam-flash { 0%, 62%, 100% { opacity: 0; transform: scale(.6); } 68% { opacity: 1; transform: scale(1.15); } 82% { opacity: 0; transform: scale(1.3); } }
.scribble--hanger.is-in .hg { transform-origin: 50% 20%; animation: swing 2.6s ease-in-out infinite; }
@keyframes swing { 0%, 100% { transform: rotate(-9deg); } 50% { transform: rotate(9deg); } }
.scribble--gift.is-in .lid { animation: lid-hop 2.4s ease-in-out infinite; }
@keyframes lid-hop { 0%, 55%, 100% { transform: translateY(0) rotate(0); } 68% { transform: translateY(-9px) rotate(-5deg); } 80% { transform: translateY(0) rotate(0); } }
/* existing doodles that were still: sparkles twinkle, flower turns, confetti falls, swirl breathes */
.doodle--sparkles use { animation: twinkle 2.2s ease-in-out infinite; }
.doodle--sparkles use:nth-child(2) { animation-delay: -.7s; } .doodle--sparkles use:nth-child(3) { animation-delay: -1.4s; }
@keyframes twinkle { 0%, 100% { opacity: 1; } 50% { opacity: .15; } }
.scribble--flower.is-in > g { transform-box: view-box; transform-origin: 50px 45px; animation: slow-spin 12s linear infinite; }
@keyframes slow-spin { to { transform: rotate(360deg); } }
.scribble--confetti.is-in > g { animation: confetti-fall 2.8s ease-in-out infinite; }
@keyframes confetti-fall { 0%, 100% { transform: translateY(-6px) rotate(-4deg); } 50% { transform: translateY(8px) rotate(5deg); } }
.scribble--swirl.is-in > g { transform-box: view-box; transform-origin: 50% 50%; animation: breathe 3.4s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { transform: scale(.94) rotate(-4deg); } 50% { transform: scale(1.06) rotate(4deg); } }

/* ---------- Day / night button (top bar) ---------- */
.theme-toggle { padding: 0; min-width: 2.75rem; justify-content: center; background: none; border: 0; cursor: pointer; color: inherit; }
.theme-toggle svg { width: 1.45rem; height: 1.45rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle .icon-sun { display: none; }
html[data-theme="night"] .theme-toggle .icon-sun { display: block; }
html[data-theme="night"] .theme-toggle .icon-moon { display: none; }
.theme-toggle .icon-moon, .theme-toggle .icon-sun { transition: transform .5s var(--ease-out); }
.theme-toggle:hover .icon-moon, .theme-toggle:hover .icon-sun { transform: rotate(18deg); }
html[data-theme="night"] .index { background-image: url("../assets/images/paper-night.png"); }

/* ---------- Countdown (top bar) ---------- */
.nav__count { margin: 0; font-size: 0.8125rem; letter-spacing: 0.04em; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--fg); }
@media (max-width: 380px) { .nav__count { font-size: 0.75rem; letter-spacing: 0; } .nav__right { gap: var(--s-4); } }

/* ---------- The year ticking over: 2026 -> 2027, forever ---------- */
.yr { padding-block: clamp(3rem, 14vw, 5rem) var(--s-4); container-type: inline-size; position: relative; }
.yr__num {
  margin: 0 auto; display: flex; justify-content: space-between; max-width: 100%;
  padding-inline: var(--gutter);
  font-family: var(--font-hand); font-weight: 700; color: var(--accent);
  -webkit-text-stroke: 0.035em currentColor; paint-order: stroke fill;
  font-size: min(32cqw, 13rem); line-height: 1;
}
.yr__d { flex: 1 1 0; text-align: center; display: block; height: 1.1em; }
.yr__d--roll { position: relative; }
.yr__a, .yr__b { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; line-height: 1; }
.yr__a { animation: yr-a 9s infinite; }
.yr__b { animation: yr-b 9s infinite; }
.yr__mask { position: relative; display: block; height: 1.6em; margin-block: -0.3em; overflow: hidden; }   /* tall window so no digit is ever sliced */
.yr__burst { position: absolute; z-index: 2; width: 1.05em; right: -0.02em; top: -0.55em; opacity: 0; pointer-events: none; overflow: visible; animation: yr-burst 9s infinite; }
.yr__rays, .yr__dots { transform-box: fill-box; transform-origin: center; }
@keyframes yr-a {   /* the 6: sits, drops out the bottom, then comes back up from the bottom */
  0%, 35%    { transform: translateY(0); animation-timing-function: cubic-bezier(.5, 0, .2, 1); }
  38.5%, 69% { transform: translateY(100%); animation-timing-function: cubic-bezier(.5, 0, .2, 1); }
  72.5%, 100% { transform: translateY(0); }
}
@keyframes yr-b {   /* the 7: waits above, drops in, then lifts back out the top */
  0%, 35%    { transform: translateY(-100%); animation-timing-function: cubic-bezier(.5, 0, .2, 1); }
  38.5%, 69% { transform: translateY(0); animation-timing-function: cubic-bezier(.5, 0, .2, 1); }
  72.5%, 100% { transform: translateY(-100%); }
}
@keyframes yr-burst {
  0%, 37% { opacity: 0; transform: scale(.3); }
  40% { opacity: 1; transform: scale(.7); }
  50% { opacity: 1; transform: scale(1.1); }
  60%, 100% { opacity: 0; transform: scale(1.25); }
}
.yr__nye { margin-top: 0.12em; }
.yr__nye .yr__d { flex: 1 1 0; }
.yr__burst--x { right: auto; z-index: 1; }

/* The "are getting married" line sits slightly over the bottom of the hero photo */
@media (max-width: 899px) {
  .hero__info { position: relative; z-index: 3; margin-top: -0.85rem; }
}
html[data-theme="night"] .hero__script .lt--script { text-shadow: none; }

/* "Are getting married": drawn as SVG text that is stretched to exactly the photo's width, in any font */
.hero__script { width: 100%; }
.hero__script-svg { display: block; width: 100%; height: auto; overflow: visible; }
.hero__script-svg text { fill: var(--accent); font-family: var(--font-hand); font-weight: 700; font-size: 8.6px; text-transform: uppercase; stroke: var(--accent); stroke-width: .25px; paint-order: stroke fill; }

/* "Are getting married": two lines, plain text, sized so even a wide font stays inside the photo's width */
.hero__script { width: 100%; max-width: 100%; text-align: center; }
.hero__script-line { display: block; white-space: nowrap; font-family: var(--font-hand); font-weight: 700; font-size: min(10.5vw, 4.2rem); line-height: 1.12; letter-spacing: 0.02em; color: var(--accent); -webkit-text-stroke: 0.03em currentColor; paint-order: stroke fill; text-shadow: none; }
html[data-theme="night"] .hero__script-line { text-shadow: none; }
.hero__script { margin-bottom: var(--s-3); }   /* doubles the gap down to the date */

/* Wedding video doodle: the red "recording" dot blinks, the reels turn */
@media all {
  .js .scribble--video.is-in .rec { animation: rec-blink 1.4s steps(1) infinite; }
  .js .scribble--video.is-in circle:not(.rec) { transform-box: fill-box; transform-origin: center; animation: reel-spin 5s linear infinite; }
}
@keyframes rec-blink { 0%, 55% { opacity: 1; } 56%, 100% { opacity: 0; } }
@keyframes reel-spin { to { transform: rotate(360deg); } }

/* Children doodle: the rattle shakes */
@media all {
  .js .scribble--rattle.is-in .rt { transform-box: view-box; transform-origin: 24px 82px; animation: rattle 2.8s ease-in-out infinite; }
}
@keyframes rattle { 0%, 55%, 100% { transform: rotate(0); } 60% { transform: rotate(-12deg); } 66% { transform: rotate(10deg); } 72% { transform: rotate(-8deg); } 78% { transform: rotate(6deg); } 84% { transform: rotate(0); } }

/* Ceremony photos: three views of Carlton Gardens flick over, one second each, forever */
.day__frames { position: absolute; inset: 0; overflow: hidden; }
.day__portrait { position: relative; }
.day__frame { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; filter: var(--photo-filter);
  animation: day-flick 3s step-end infinite !important; animation-delay: calc((var(--n) - 1) * 1s) !important; animation-duration: 3s !important; animation-iteration-count: infinite !important; }
@keyframes day-flick { 0% { opacity: 1; } 33.33% { opacity: 0; } 100% { opacity: 0; } }

/* Schedule heading: bold, like the other section headings */
.tl__title { font-weight: 700; -webkit-text-stroke: 0.035em currentColor; paint-order: stroke fill; font-size: clamp(2.2rem, 10.5vw, 3.6rem); line-height: 1.02; }

/* Section doodles sit in the heading row, the height of the text and centred on it */
.info__row { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); }
.info__row > span { min-width: 0; }
.info__doodle { position: static; flex: none; width: 2em; height: 2em; margin-block: -0.5em; }
.info__sub .info__doodle { width: 1.9em; height: 1.9em; }
.lt--venueR1, .lt--venueR2 { font-size: clamp(1.7rem, 7.4vw, 2.6rem); white-space: nowrap; overflow-wrap: normal; }

/* Reception door photo with its caption and arrow laid over it (no halo: pink only) */
.day__door { position: relative; margin: var(--rhythm-s) 0 0; padding: 0; }
.day__door img { display: block; width: 100%; height: auto; filter: var(--photo-filter); }
.day__door-cap { position: absolute; left: 4%; top: 5%; margin: 0; font-family: var(--font-hand); font-weight: 700; text-transform: uppercase; font-size: clamp(1.15rem, 5.6vw, 2.1rem); line-height: 1.08; letter-spacing: .02em; color: var(--accent); -webkit-text-stroke: .03em currentColor; paint-order: stroke fill; }
.day__door-arrow { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; }
@media (min-width: 900px) { .day__door { grid-column: 6 / 11; grid-row: 2; align-self: start; margin-top: var(--rhythm-s); width: 100%; } .routemark { display: none; } }

/* Fireworks, sprinkled around the page: the same burst as the 2027 line, each on its own timing */
.hero, .invitation, .tl, .reel, .day, .journey, .info, .rsvp { position: relative; }
.fw-spark { position: absolute; z-index: 1; opacity: 0; pointer-events: none; overflow: visible; transform-origin: center; animation: fw-spark var(--t, 6s) ease-out infinite; }
@keyframes fw-spark {
  0%, 4% { opacity: 0; transform: scale(.3); }
  9% { opacity: 1; transform: scale(.7); }
  19% { opacity: 1; transform: scale(1.1); }
  30%, 100% { opacity: 0; transform: scale(1.25); }
}
/* "Are getting married" always in front of the hero photo, on desktop too */
.hero__info { position: relative; z-index: 4; }

/* RSVP form: bolder everywhere (field titles, entries, choices, button, status) */
.rsvp__form, .rsvp__deadline, .rsvp__thanks { font-weight: 700; }
.field label, .field legend, .field .choice__opt, .field input, .field select, .field textarea,
.field input::placeholder, .field textarea::placeholder, .field__error, .rsvp__status, .rsvp__send { font-weight: 700; }
.field label, .field legend, .field input, .field select, .field textarea, .field .choice__opt, .rsvp__send { -webkit-text-stroke: .02em currentColor; }

/* Attending choice: each option on its own full-width row, label never wraps */
.choice { flex-direction: column; flex-wrap: nowrap; }
.field .choice__opt { flex: 0 0 auto; width: 100%; }
.choice__opt span { white-space: nowrap; padding-inline: .6rem; font-size: min(var(--step-body), 4.3vw); }

/* Countdown as a seven-segment digital display */
.nav__count-text { display: inline-flex; align-items: center; gap: .12em; height: 1em; }
.nav__count .seg { height: 1.05rem; width: auto; overflow: visible; }
.nav__count .seg path { fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; }
.nav__count .seg .seg--off { opacity: .12; }
.nav__count .seg--colon circle { fill: currentColor; }
.nav__count .seg-d { font-size: .7rem; margin: 0 .25em 0 .1em; font-weight: 700; }
@media (max-width: 380px) { .nav__count .seg { height: .9rem; } }

/* Invitation: the words are the whole focus, no photo */
.invitation__lead { font-size: clamp(2rem, 9.4vw, 3.6rem); line-height: 1.2; font-weight: 700; -webkit-text-stroke: .02em currentColor; }
.invitation { padding-block: var(--rhythm-m); }
@media (min-width: 900px) { .invitation__lead { grid-column: 2 / 12; font-size: clamp(3rem, 5.2vw, 5.4rem); } }

/* Invitation text: same size and weight as the "Phones & photos" heading */
.invitation__lead { font-size: var(--step-lead); line-height: 1.1; font-weight: 400; -webkit-text-stroke: 0; }
@media (min-width: 900px) { .invitation__lead { font-size: var(--step-lead); } }

/* Door photo: caption sits below the picture at the left; the arrow rises from it to the door */
.day__door-pic { position: relative; }
.day__door-pic img { display: block; width: 100%; height: auto; }
.day__door-arrow { overflow: visible; }
.day__door-cap { position: static; margin: .5rem 0 0; padding-bottom: .5rem; text-align: left; font-size: clamp(1.05rem, 5vw, 1.8rem); }
.day__door-cap { padding-left: var(--gutter); }

/* RSVP form text 20% smaller */
.rsvp__form { --step-body: calc(1.0625rem * .8); }
@media (min-width: 900px) { .rsvp__form { --step-body: calc(1.125rem * .8); } }
.choice__opt span { font-size: min(var(--step-body), 4.3vw); }
@media (min-width: 900px) { .day__door-cap { padding-left: 0; } }

.event--reception { position: relative; }
@media (max-width: 899px) { .event--reception .scribble--notes { top: auto !important; bottom: 2.2rem; right: 5% !important; } }
@media (min-width: 900px) { .scribble--beers { top: -5.5rem !important; } }
@media (max-width: 899px) { .scribble--beers { top: -.5rem !important; } }

/* second reel sits right under the first and drifts the other way */
.reel__track + .reel__track { margin-top: .5rem; }
.nav__count .seg .seg--off { opacity: .08; }

/* Countdown back to plain bold lettering, in the same font as the rest of the page */
.nav__count { font-family: var(--font-hand); font-weight: 700; font-size: .9rem; letter-spacing: .02em; -webkit-text-stroke: .02em currentColor; }
.nav__count-text { display: inline; height: auto; }
@media (max-width: 380px) { .nav__count { font-size: .8rem; letter-spacing: 0; } }

/* Desktop: the map never grows wider than its own column, so the text beside it is never overlapped */
@media (min-width: 900px) {
  .map { width: 100%; max-width: 44rem; height: auto; aspect-ratio: 390 / 760; }
  .journey__intro { padding-right: var(--s-4); }
}

/* Door arrow: slides toward the door, fades, and starts again (plays even with Reduce Motion on) */
.door-arrow__move { transform-box: view-box; animation: door-arrow 2.2s ease-in-out infinite; }
@keyframes door-arrow {
  0% { transform: translate(0, 0); opacity: 0; }
  18% { opacity: 1; }
  72% { transform: translate(0, -90px); opacity: 1; }
  100% { transform: translate(0, -110px); opacity: 0; }
}

/* Parking car doodle: bobs along, wheels turn */
.js .scribble--car.is-in .car__body { animation: car-bob 1.4s ease-in-out infinite; transform-box: view-box; }
.js .scribble--car.is-in .car__wheel { transform-box: fill-box; transform-origin: center; animation: car-wheel 1.2s linear infinite; }
@keyframes car-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-1.6px); } }
@keyframes car-wheel { to { transform: rotate(360deg); } }
/* End of the night fireworks doodle sits in the heading row */
.fw-inline { position: static; z-index: auto; }
.info__row .scribble--car { width: 2.6em; height: 2.6em; margin-block: -.8em; } .info__row .fw-inline { width: 2.4em; height: 2.4em; margin-block: -.7em; }

.day__door-cap { margin-top: 13.3%; }

/* "Please arrive from 4:00 PM…" matches the ceremony note right above it */
.event__note--small { font-size: var(--step-hand); color: var(--fg); max-width: 24ch; line-height: 1.35; }
.event--ceremony .event__venue { margin-bottom: calc(var(--s-2) * 2); }

/* room under NYE for a row of fireworks */
.yr { padding-bottom: clamp(4.4rem, 20vw, 7rem); }
.yr__burst--x { top: auto; }

/* Thank-you pop-up in the middle of the screen after a successful RSVP */
.thanks-pop { border: 2px solid var(--accent); background: var(--paper, #ece9e2); color: var(--accent); width: min(88vw, 26rem); padding: var(--s-8, 2rem) var(--s-6, 1.5rem) var(--s-6, 1.5rem); text-align: center; margin: auto; border-radius: 0; }
.thanks-pop::backdrop { background: rgba(40, 20, 36, .45); }
.thanks-pop__text { font-size: clamp(1.4rem, 6.2vw, 1.9rem); line-height: 1.25; font-weight: 700; margin: 0 0 var(--s-6, 1.5rem); text-wrap: balance; }
.thanks-pop__heart { background: none; border: 0; padding: 0; width: 4.2rem; height: 3.8rem; color: var(--accent); cursor: pointer; animation: heart-beat 1.4s ease-in-out infinite; }
.thanks-pop__heart svg { width: 100%; height: 100%; overflow: visible; }
.thanks-pop__heart:focus-visible { outline: 3px solid var(--accent); outline-offset: 6px; }
@keyframes heart-beat { 0%, 100% { transform: scale(1); } 15% { transform: scale(1.14); } 30% { transform: scale(1); } 45% { transform: scale(1.1); } }
/* Pop-up refinements: form font, rounded box, tighter margins */
.thanks-pop { border-radius: 1.6rem; padding: 1.1rem 1.1rem .9rem; width: min(84vw, 21rem); font-family: var(--font-hand); }
.thanks-pop__text { font-family: var(--font-hand); font-weight: 700; -webkit-text-stroke: .02em currentColor; font-size: clamp(1.15rem, 5vw, 1.5rem); line-height: 1.22; margin: 0 0 .5rem; }
.thanks-pop__heart { width: 3.2rem; height: 2.9rem; }
/* Pop-up text: exactly the site's handwritten body style (same font, weight, spacing and line height as the paragraphs), no extra stroke */
.thanks-pop, .thanks-pop__text { font-family: var(--font-hand); font-weight: 500; font-style: normal; letter-spacing: normal; text-transform: none; -webkit-text-stroke: 0; font-synthesis: none; }
.thanks-pop__text { font-size: var(--step-hand); line-height: 1.35; text-wrap: balance; }

/* Phone and email, once filled in, match the selected "Yes, I'll be there" button: pink fill, light text */
#rsvp-phone:not(:placeholder-shown), #rsvp-email:not(:placeholder-shown) { background: var(--ink); color: var(--tone-day); border-color: var(--ink); transition: background var(--dur-micro) var(--ease-out); }
#rsvp-phone:-webkit-autofill, #rsvp-email:-webkit-autofill { -webkit-text-fill-color: var(--tone-day); box-shadow: 0 0 0 100px var(--ink) inset; caret-color: var(--tone-day); }

/* Every text box, once filled in, matches the selected button: pink fill, light text */
.field input:not([type="radio"]):not([type="checkbox"]):not(:placeholder-shown),
.field textarea:not(:placeholder-shown) { background: var(--ink); color: var(--tone-day); border-color: var(--ink); transition: background var(--dur-micro) var(--ease-out); }
.field input:not([type="radio"]):not([type="checkbox"]):-webkit-autofill,
.field textarea:-webkit-autofill { -webkit-text-fill-color: var(--tone-day); box-shadow: 0 0 0 100px var(--ink) inset; caret-color: var(--tone-day); }
.field input:not([type="radio"]):not([type="checkbox"]):not(:placeholder-shown):focus-visible,
.field textarea:not(:placeholder-shown):focus-visible { outline-color: var(--ink); }

/* Form boxes: enough line height that the tails of g, y, p are never clipped at the bottom */
.field input:not([type="radio"]):not([type="checkbox"]), .field select, .field textarea { line-height: 1.9; padding-block: .6rem; box-sizing: border-box; overflow: visible; }
.field textarea { min-height: 3.5rem; line-height: 1.7; padding-block: .8rem; overflow: hidden; }

/* No sideways movement, ever: nothing may poke past the right edge, and the page itself clips as a backstop */
html { overflow-x: clip; overscroll-behavior-x: none; }
.yr, .hero, .invitation, .tl, .reel, .day, .journey, .info, .rsvp { overflow-x: clip; }

/* No zoom while filling the form: iPhones zoom into any field whose text is under 16px, so the typed text stays at 16px; double-tap zoom is off too */
.field input, .field select, .field textarea { font-size: max(16px, var(--step-body)); }
.rsvp__form, .rsvp__form * { touch-action: manipulation; }
