/* =========================================================================
   Isabel & Hudson — 05.29.2027
   Breakpoints: desktop ≥ 1200px · tablet 810–1199px · phone ≤ 809px
   ========================================================================= */

/* ---- Fonts ------------------------------------------------------------- */
@font-face { font-family: "Apfel Grotezk"; src: url("../fonts/apfel-grotezk-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Apfel Grotezk"; src: url("../fonts/apfel-grotezk-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Apfel Grotezk"; src: url("../fonts/apfel-grotezk-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Bastide Celestine Serif"; src: url("../fonts/bastide-celestine-serif.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Churchward Roundsquare"; src: url("../fonts/churchward-roundsquare.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Inter"; src: url("../fonts/inter-400-latin.woff2") format("woff2"); font-weight: 400; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; src: url("../fonts/inter-400-latin-ext.woff2") format("woff2"); font-weight: 400; font-display: swap; unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Inter"; src: url("../fonts/inter-500-latin.woff2") format("woff2"); font-weight: 500; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; src: url("../fonts/inter-500-latin-ext.woff2") format("woff2"); font-weight: 500; font-display: swap; unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Inter"; src: url("../fonts/inter-600-latin.woff2") format("woff2"); font-weight: 600; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; src: url("../fonts/inter-600-latin-ext.woff2") format("woff2"); font-weight: 600; font-display: swap; unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; }

/* ---- Tokens ------------------------------------------------------------ */
:root {
  --cream: #fdf4e3;
  --lime: #bcd500;
  --green: #2b5d37;
  --rust: #b24e1d;
  --wine: #7f292c;
  --yellow: #e3b641;
  --night: #28171d;
  --error: #b40030;

  --serif: "Bastide Celestine Serif", Georgia, serif;
  --display: "Churchward Roundsquare", "Arial Black", sans-serif;
  --sans: "Apfel Grotezk", system-ui, sans-serif;
  --ui: "Inter", system-ui, sans-serif;

  --text: 16.1px;          /* body copy */
  --leading: 1.2;
  --line: calc(var(--text) * var(--leading));   /* one blank line of body copy */

  /* Layout grid: one 1040px content column, centred, with fixed gutters. */
  --content: 1040px;
  --gutter: 40px;
  --col-gap: 40px;
  --section-gap: 240px;
  --title-gap: 54px;        /* section title → content */

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);

  --shadow: 0 0.6px 0.6px -1.25px rgba(0, 0, 0, 0.18), 0 2.29px 2.29px -2.5px rgba(0, 0, 0, 0.16), 0 10px 10px -3.75px rgba(0, 0, 0, 0.06);
}
@media (max-width: 1199.98px) { :root { --col-gap: 24px; --section-gap: 160px; } }
@media (max-width: 809.98px)  { :root { --gutter: 20px; --col-gap: 32px; --section-gap: 100px; } }

/* ---- Base -------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scroll-padding-top: 120px; }  /* anchors clear the fixed nav */
@media (max-width: 809.98px) { html { scroll-padding-top: 96px; } }
body {
  margin: 0;
  background: var(--cream);
  color: var(--green);
  font: 400 var(--text) / var(--leading) var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img, svg, canvas { display: block; max-width: 100%; }
img { height: auto; }
[hidden] { display: none !important; }
h1, h2, h3, h4, p, figure, ul, dl, dd { margin: 0; }
h1, h2, h3, h4 { font-weight: inherit; font-size: inherit; }
ul { padding: 0; list-style: none; }
a { color: var(--rust); text-decoration: underline; text-underline-offset: 0.12em; }
a:focus-visible, button:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; border-radius: 2px; }
button { font: inherit; color: inherit; }

.container { width: 100%; max-width: calc(var(--content) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }
.stack { display: flex; flex-direction: column; align-items: flex-start; gap: var(--title-gap); min-width: 0; }

/* Two equal columns on the content grid; stacks on phones. */
.split { display: grid; grid-template-columns: 1fr 1fr; column-gap: var(--col-gap); row-gap: 48px; align-items: start; }
.split--center { align-items: center; }
@media (max-width: 1199.98px) {
  .split--center { align-items: start; }
  .split--stack-tablet { grid-template-columns: 1fr; }
}
@media (max-width: 809.98px) {
  .split { grid-template-columns: 1fr; row-gap: var(--col-gap); }
}

.section-title { font: 400 48px / 1.2 var(--serif); }
.section-title--wine { color: var(--wine); }
.section-title--green { color: var(--green); }
.section-title--rust { color: var(--rust); }

/* Running text: blank-line rhythm between blocks, headings sit directly on their text. */
.prose > * + * { margin-top: var(--line); }
.prose h4 { font-weight: 700; }
.prose .medium { font-weight: 500; }
.prose--green { color: var(--green); }
.link-list { margin-top: var(--line); }

/* Coloured photo frames */
.frame { padding: 16px; }
.frame img { width: 100%; border-radius: 16px; object-fit: cover; }
.frame--lime { background: var(--lime); }
.frame--wine { background: var(--wine); }

/* ---- Navigation --------------------------------------------------------- */
.nav {
  position: fixed; z-index: 10; top: 40px; left: 50%; translate: -50% 0;
  width: 80%; max-width: 1155px;
  padding: 8px; background: var(--lime); box-shadow: var(--shadow);
  transition: opacity 0.35s ease, translate 0.45s var(--ease-out);
}
/* Scrolling down tucks it away; scrolling up (or tabbing into it) brings it back. */
.nav.is-hidden { opacity: 0; translate: -50% -14px; pointer-events: none; }
.nav__panel {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 12px; border-radius: 8px; background: var(--cream);
}
.nav__bar { display: flex; align-items: center; justify-content: space-between; height: 30px; }
.nav__logo {
  display: block; width: 117px; height: 18px; background: var(--green);
  -webkit-mask: url("../svg/logo.svg") center / contain no-repeat; mask: url("../svg/logo.svg") center / contain no-repeat;
}
.nav__toggle { display: none; padding: 0; border: 0; background: none; cursor: pointer; }
.nav__menu, .nav__menu-inner { display: contents; }
.nav__links { display: flex; align-items: center; gap: 2px; }
.nav__links a {
  display: block; padding: 7px 10px; border-radius: 999px;
  font-size: 15.31px; font-weight: 500; line-height: 1; text-decoration: none; white-space: nowrap;
  transition: background-color 0.2s ease, color 0.2s ease;
}
/* Underline that draws in on hover and stays under the section you are reading. */
.nav__links a {
  background: linear-gradient(currentColor, currentColor) 10px calc(100% - 3px) / 0 1px no-repeat;
  transition: background-size 0.3s var(--ease-out);
}
.nav__links a:hover, .nav__links a[aria-current] { background-size: calc(100% - 20px) 1px; }
/* Tablets: a little tighter so all seven links fit beside the logo and countdown. */
@media (min-width: 810px) and (max-width: 1199.98px) {
  .nav__links a { padding-inline: 7px; background-position-x: 7px; }
  .nav__links a:hover, .nav__links a[aria-current] { background-size: calc(100% - 14px) 1px; }
}
/* Registry leaves the site: same link, with a small arrow. */
.nav__out { display: inline-block; margin-left: 0.15em; font: 500 0.8em / 1 var(--ui); translate: 0 -0.08em; }
.nav a:focus-visible, .nav button:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; border-radius: 999px; }
.nav__countdown { width: 117px; padding-top: 3px; text-align: right; }
.countdown { font: 400 16px / 1 var(--display); color: var(--green); white-space: nowrap; font-variant-numeric: tabular-nums; }
.nav-scrim { display: none; }

@media (max-width: 809.98px) {
  .nav { top: 16px; width: calc(100% - 32px); }
  .nav__panel { flex-direction: column; align-items: stretch; padding: 8px 12px; max-height: calc(100svh - 48px); overflow-y: auto; overscroll-behavior: contain; }
  .nav__bar { width: 100%; }
  /* A full 44px tap target around the little wave icon, which turns into a cross. */
  .nav__toggle { display: grid; place-items: center; width: 44px; height: 44px; margin: -7px -11px -7px 0; border-radius: 999px; }
  .nav__toggle > * { grid-area: 1 / 1; transition: opacity 0.25s ease, rotate 0.45s var(--ease-out), scale 0.45s var(--ease-out); }
  .nav__toggle-open { width: 24px; height: 17px; }
  .nav__toggle-close { fill: none; stroke: var(--green); stroke-width: 2; stroke-linecap: round; opacity: 0; rotate: -90deg; scale: 0.6; }
  .nav.is-open .nav__toggle-open { opacity: 0; rotate: 90deg; scale: 0.6; }
  .nav.is-open .nav__toggle-close { opacity: 1; rotate: 0deg; scale: 1; }
  .nav:not(.is-open) { cursor: pointer; }

  /* The menu unfolds under the bar: links are big, full-width rows. */
  .nav__menu { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.5s var(--ease-out); }
  .nav.is-open .nav__menu { grid-template-rows: 1fr; }
  .nav__menu-inner { display: block; min-height: 0; overflow: hidden; visibility: hidden; transition: visibility 0s 0.5s; }
  .nav.is-open .nav__menu-inner { visibility: visible; transition-delay: 0s; }
  .nav__links { flex-direction: column; align-items: stretch; gap: 0; padding-top: 14px; }
  .nav__links li, .nav__countdown { opacity: 0; translate: 0 -8px; transition: opacity 0.2s ease, translate 0.2s ease; }
  .nav.is-open .nav__links li, .nav.is-open .nav__countdown {
    opacity: 1; translate: 0 0;
    transition: opacity 0.4s ease calc(0.08s + var(--i, 0) * 0.04s), translate 0.5s var(--ease-out) calc(0.08s + var(--i, 0) * 0.04s);
  }
  .nav__links a {
    padding: 13px 4px; border-radius: 0; border-bottom: 1px solid color-mix(in srgb, var(--green) 18%, transparent);
    font: 400 30px / 1.1 var(--serif); text-align: center; background: none;
  }
  .nav__links a[aria-current] { color: var(--green); }
  .nav__out { font-size: 0.6em; translate: 0 -0.25em; }
  .nav__countdown { width: 100%; padding: 22px 0 14px; text-align: center; --i: 7; }
  .nav .countdown { font-size: 30px; }

  /* Dim the page behind the open menu; tapping it closes the menu. */
  .nav-scrim {
    display: block; position: fixed; inset: 0; z-index: 9; background: var(--night);
    opacity: 0; pointer-events: none; transition: opacity 0.4s ease;
  }
  .nav-scrim.is-on { opacity: 0.45; pointer-events: auto; }

  /* Over the hero the names are already on screen, so only the menu button floats top right
     (in the same lime-framed cream as the bar). Past the hero, or once opened, it's the full bar. */
  .nav, .nav__panel { transition: opacity 0.35s ease, translate 0.45s var(--ease-out), background-color 0.35s ease, box-shadow 0.35s ease; }
  .nav__logo, .nav__toggle { transition: opacity 0.35s ease, background-color 0.35s ease, box-shadow 0.35s ease; }
  .nav.is-compact { background-color: transparent; box-shadow: none; pointer-events: none; }
  .nav.is-compact .nav__panel { background-color: transparent; overflow: visible; }
  .nav.is-compact .nav__logo { opacity: 0; visibility: hidden; transition: opacity 0.35s ease, visibility 0s 0.35s; }
  .nav.is-compact .nav__toggle {
    pointer-events: auto; border-radius: 8px;
    background-color: var(--cream); box-shadow: 0 0 0 8px var(--lime), var(--shadow);
  }
}

/* ---- Hero ---------------------------------------------------------------- */
.hero {
  position: relative; height: 90vh; height: 90svh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.hero__media { position: absolute; inset: 0; overflow: hidden; }
/* Black and white until unlocked. The shader on top does the same itself (and ripples into
   colour on unlock); this is what shows before it starts, or without WebGL. */
.hero__image { filter: grayscale(1); }
.hero__image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.shader { position: absolute; inset: 0; overflow: hidden; touch-action: pan-y; }
.shader canvas { width: 100%; height: 100%; }
.shader-fallback { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

.hero__title {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center; gap: 46px;
  opacity: 0; translate: 0 28px; pointer-events: none;
}
.hero__mark { width: 79px; height: 79px; }
.hero__names { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.hero__names img { width: 334px; height: auto; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.25)); }
.hero__date { font: 400 24px / 1.2 var(--display); color: var(--lime); text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25); }  /* same lift as the names */

@media (max-width: 1199.98px) { .hero { height: 700px; } }
@media (max-width: 809.98px) {
  /* Nearly the whole screen, leaving a strip of the story below so it's clear there's more. */
  .hero { height: calc(100svh - 150px); min-height: 480px; }
  .hero__names img { width: 260px; }
}

/* ---- Guest gate ----------------------------------------------------------- */
.gate-area {
  position: absolute; inset: 0; z-index: 2;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  max-height: 2000px;
}
.gate {
  width: 560px; max-width: 100%;
  display: flex; flex-direction: column; padding: 24px;
  background: rgba(252, 244, 227, 0.6); border: 1px solid var(--lime); border-radius: 24px;
  backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px);
  box-shadow: var(--shadow);
  font-family: var(--ui);
}
.gate__logo {
  width: 126px; aspect-ratio: 771 / 271;
  background: var(--rust); filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.25));
  -webkit-mask: url("../img/gate-logo.svg") left center / contain no-repeat;
          mask: url("../img/gate-logo.svg") left center / contain no-repeat;
}
.gate__form { display: grid; gap: 8px; margin-top: 24px; }
.gate__fields { display: flex; flex-wrap: wrap; gap: 8px; }
.gate input {
  flex: 1 1 180px; min-width: 0; padding: 10px 12px;
  border: 1px solid var(--lime); border-radius: 16px; outline: none;
  background: #fff; color: var(--green);
  font: 400 15px / 1.2 var(--ui); letter-spacing: -0.01em;
}
.gate input::placeholder { color: #757575; }
.gate button {
  margin-top: 2px; padding: 11px 14px; width: 100%;
  border: 1px solid transparent; border-radius: 16px; cursor: pointer;
  background: var(--lime); color: var(--green);
  font: 600 14px / 1 var(--ui); letter-spacing: -0.01em;
}
.gate button:focus-visible { border-color: var(--green); }
.gate button:disabled { cursor: progress; opacity: 0.75; }
.gate__error { margin-top: 2px; color: var(--error); font: 500 15px / 1.3 var(--ui); letter-spacing: -0.01em; }
@media (max-width: 809.98px) { .gate { width: 350px; } }

/* ---- Locked / unlocked states -------------------------------------------- */
html:not(.is-unlocked) .protected { display: none !important; }
html:not(.is-unlocked) .hero { height: 100vh; height: 100svh; }
html.is-unlocking .hero { transition: height 1.2s var(--ease-in-out) 1.4s; }
html.is-unlocked:not(.is-unlocking) .gate-area { display: none; }
html.is-unlocked .hero__image { filter: none; }
html.is-unlocked .hero__title { opacity: 1; translate: 0 0; pointer-events: auto; }
html.is-unlocking .hero__image { transition: filter 1.4s ease-in-out 0.2s; }
html.is-unlocking .hero__title { transition: opacity 0.9s ease-out 1s, translate 0.9s ease-out 1s; }
html.is-unlocking .protected { animation: fade-in 0.6s ease-out 1.4s both; }
.gate-area.is-leaving { overflow: hidden; opacity: 0; translate: 0 -12px; max-height: 0; transition: opacity 0.5s ease-out, translate 0.5s ease-out, max-height 0.5s ease-in-out; }
@keyframes fade-in { from { opacity: 0; } }

/* Welcome party: only for guests with it ticked in the guest sheet. */
html:not(.is-welcome-guest) .welcome-only { display: none !important; }

/* Wrong name: a small shake. */
.gate.is-shaking { animation: shake 0.4s var(--ease-out); }
@keyframes shake { 20% { translate: -6px 0; } 40% { translate: 5px 0; } 60% { translate: -3px 0; } 80% { translate: 2px 0; } }
.gate button { transition: transform 0.15s var(--ease-out), opacity 0.2s; }
.gate button:active:not(:disabled) { transform: scale(0.98); }
.gate input { transition: box-shadow 0.2s var(--ease-out); }
.gate input:focus { box-shadow: 0 0 0 3px rgba(188, 213, 0, 0.35); }

/* ---- Motion ------------------------------------------------------------- */
/* Scroll reveals (added by site.js, so the page is fully visible without JS). */
.reveal { opacity: 0; translate: 0 24px; transition: opacity 0.9s var(--ease-out), translate 0.9s var(--ease-out); }
.reveal.is-visible { opacity: 1; translate: 0 0; }
.places.reveal .place { opacity: 0; translate: 0 10px; transition: opacity 0.6s var(--ease-out), translate 0.6s var(--ease-out); transition-delay: calc(0.15s + var(--i) * 0.05s); }
.places.reveal.is-visible .place { opacity: 1; translate: 0 0; }
.places.reveal .places__heading::after { clip-path: inset(0 100% 0 0); transition: clip-path 1.2s var(--ease-out) 0.1s; }
.places.reveal.is-visible .places__heading::after { clip-path: inset(0 0 0 0); }

/* Slowly turning suns. */
@keyframes spin { to { rotate: 360deg; } }

/* ---- Story --------------------------------------------------------------- */
.story { --band: 677px; --overlap: 276px; margin-bottom: 176px; }
.story__band {
  position: relative; overflow: hidden;
  /* Grows with its text but keeps the photo 48px below it,
     overlapping the band by --overlap. */
  min-height: var(--band); padding: 120px var(--gutter) calc(var(--overlap) + 48px);
  background: var(--lime);
}
.story__sunburst {
  position: absolute; left: 50%; translate: -50% 0;
  top: 142px; width: 1277px; max-width: none;
}
.story__intro {
  position: relative; width: 594px; max-width: 100%; margin-inline: auto;
  display: flex; flex-direction: column; align-items: center; gap: 17px;
  text-align: center;
}
.story__lede { font-size: 21.47px; }
.story__lede span { display: block; }
.story__sunburst { animation: spin 240s linear infinite; }
.story__date { font: 400 var(--date-size, 110px) / 0.72 var(--display); white-space: nowrap; padding-block: 2px; }
.story__place { font: 400 32px / 1.2 var(--serif); }
.story__photo {
  position: relative; z-index: 2;
  width: 776px; max-width: calc(100% - 2 * var(--gutter)); margin: calc(-1 * var(--overlap)) auto 0;
  padding: 13.4px;
}
.story__photo img { aspect-ratio: 4 / 3; }

@media (max-width: 1199.98px) {
  .story { margin-bottom: 152px; }
  .story__sunburst { top: 237px; width: 899px; }
  .story__photo { width: 700px; }
}
@media (max-width: 809.98px) {
  .story { --band: 480px; --overlap: 127px; margin-bottom: 76px; }
  .story__band { padding-top: 72px; }
  .story__sunburst { top: 263px; width: 454px; }
  .story__intro { gap: 12px; }
  .story__date { --date-size: 63.5px; }
  .story__photo { width: auto; padding: 8px; }
}

/* ---- Main sections -------------------------------------------------------- */
.sections { display: flex; flex-direction: column; align-items: center; gap: var(--section-gap); }
/* Photos fanned or flung past the screen edge must not widen the page: on phones a wider
   page makes the browser zoom out (and the fixed nav overhang). The body's own clip is not
   enough there, so clip here too. */
.sections { overflow-x: clip; }
.sections > * { width: 100%; }

/* Events */
.event-card {
  position: relative; width: 100%; padding: 24px; border-radius: 16px;
  background: var(--lime); color: var(--green);
  display: flex; flex-direction: column; gap: 10px;
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) scale(var(--lift, 1));
  transition: transform 0.6s var(--ease-out), box-shadow 0.6s var(--ease-out);
}
/* Tilts so the part under the pointer comes toward you, with a soft light following it. */
.event-card.is-tilting { transition: transform 0.12s linear, box-shadow 0.3s ease; box-shadow: var(--tilt-shadow); }
.event-card::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, 0.38), transparent 55%);
  opacity: 0; transition: opacity 0.4s ease;
}
.event-card.is-tilting::after { opacity: 1; }
.event-card__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.event-card__title { display: flex; flex-direction: column; gap: 10px; }
.event-card__date { font: 400 24px / 1.2 var(--display); }
.event-card h3 { font: 400 40px / 36px var(--serif); text-transform: uppercase; }
.event-cards { width: 100%; display: flex; flex-direction: column; gap: 24px; }
.event-card__icon { flex: none; width: 38px; height: 35px; }
.event-card__icon--sun {
  height: 38px; background: currentColor; animation: spin 40s linear infinite;
  -webkit-mask: url("../svg/sun.svg") center / contain no-repeat; mask: url("../svg/sun.svg") center / contain no-repeat;
}
.event-card:hover .event-card__icon--heart { animation: beat 0.9s var(--ease-out); }
@keyframes beat { 15% { scale: 1.18; } 30% { scale: 0.96; } 45% { scale: 1.1; } 70% { scale: 1; } }
.event-photo img { height: 635px; }

/* Travel */
.travel-map { width: 100%; height: auto; }
@media (max-width: 1199.98px) { .travel-map { max-width: 568px; } }
@media (min-width: 1200px) { #travel .travel-map { position: sticky; top: 140px; } }

/* Divider */
.sections > .divider { width: 129px; height: 129px; }
.sections > .divider.is-visible { animation: spin 60s linear infinite; }

/* Exploring the coast */
.explore { display: flex; flex-direction: column; align-items: center; gap: 120px; color: var(--rust); }
.explore__body {
  width: 100%; max-width: calc(660px + 2 * var(--gutter)); padding-inline: var(--gutter);
  display: flex; flex-direction: column; gap: var(--title-gap);
}
.explore .section-title, .explore__lede { text-align: center; }
.places { display: flex; flex-direction: column; gap: 24px; }
.places__heading { display: flex; align-items: center; gap: 10px; font-weight: 700; white-space: nowrap; }
.places__heading::after {
  content: ""; flex: 1; height: 8px;
  background: url("../svg/squiggle.svg") center / 100% 100% no-repeat;
}
/* Rows are at least two lines tall so the rhythm stays even, but opening one place only grows its own row. */
.places__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: minmax(calc(2 * var(--line)), auto); gap: 24px; align-items: start; }
.place { min-width: 0; }
.place__toggle {
  display: grid; grid-template-columns: 1fr 16px; column-gap: 8px; align-items: start;
  width: 100%; padding: 0; border: 0; background: none; color: var(--rust);
  text-align: left; cursor: pointer;
}
.place__name { font-weight: 500; }
/* + that turns into − : the vertical bar rotates flat. */
.place__icon { position: relative; width: 16px; height: 16px; margin-top: calc((var(--line) - 16px) / 2); }
.place__icon::before, .place__icon::after {
  content: ""; position: absolute; left: 1.75px; right: 1.75px; top: 50%; height: 1.5px; margin-top: -0.75px;
  border-radius: 1px; background: currentColor; transition: rotate 0.35s var(--ease-out);
}
.place__icon::after { rotate: 90deg; }
.place__toggle[aria-expanded="true"] .place__icon::after { rotate: 0deg; }
.place__toggle:hover .place__name { text-decoration: underline; text-underline-offset: 0.12em; }
.place__toggle:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }
.place__panel {
  display: grid; grid-template-rows: 0fr; opacity: 0; visibility: hidden;
  transition: grid-template-rows 0.4s var(--ease-out), opacity 0.3s ease, visibility 0s 0.4s;
}
.place__panel > div { min-height: 0; overflow: hidden; }
.place__panel p { padding-top: 8px; }
.place__map { display: inline-block; margin-top: 6px; font-size: 14px; }
.place__toggle[aria-expanded="true"] + .place__panel { grid-template-rows: 1fr; opacity: 1; visibility: visible; transition-delay: 0s; }
.explore__further { display: flex; flex-direction: column; gap: 24px; }
.explore__further h3 { font-weight: 700; }
@media (max-width: 809.98px) {
  .explore { gap: 80px; }
  .explore__lede { text-align: left; }
  .places__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Coast collage: the bento sits on an exact 5 × 5 grid (equal tracks, gutter = padding),
   with the sea creatures overlapping its lower half. Everything scales with the figure. */
.coast {
  container-type: inline-size;
  position: relative; width: min(1165px, 100%);
  aspect-ratio: 1165 / 782;
}
.bento {
  --g: round(1.03cqi, 1px);                       /* 12px at full size, whole pixels */
  position: absolute; top: 0; left: 50%; translate: -50% 0;
  width: 80.26cqi;                               /* 935px at full size */
  aspect-ratio: 935 / 527;
  display: grid; grid-template-columns: repeat(5, 1fr); grid-template-rows: repeat(5, 1fr);
  gap: var(--g); padding: var(--g);
  background: var(--rust);
}
.bento img { width: 100%; height: 100%; min-height: 0; object-fit: cover; border-radius: var(--g); transition: scale 0.5s var(--ease-out); }
.bento img:not(.bento__title):hover { scale: 1.03; }
.bento .bento__title { object-fit: contain; border-radius: 0; grid-area: 1 / 1 / 3 / 4; }
.bento__a { grid-area: 1 / 4 / 4 / 5; }
.bento__b { grid-area: 1 / 5 / 4 / 6; }
.bento__c { grid-area: 3 / 1 / 6 / 2; }
.bento__d { grid-area: 3 / 2 / 5 / 4; }
.bento__e { grid-area: 4 / 4 / 6 / 5; }
.bento__f { grid-area: 4 / 5 / 6 / 6; }
.bento__g { grid-area: 5 / 2 / 6 / 3; }
.bento__h { grid-area: 5 / 3 / 6 / 4; }
.coast__creatures { position: absolute; left: 0; top: 44.1%; width: 100%; height: auto; pointer-events: none; }
@media (max-width: 809.98px) {
  .coast { aspect-ratio: 390 / 262; }
  .bento { width: calc(100cqi - 2 * var(--gutter)); --g: 4px; }
}

/* FAQ */
.faq-photo { width: 100%; aspect-ratio: 1.18; object-fit: contain; }
.faq { color: var(--wine); }
.faq > div + div { margin-top: var(--line); }
.faq dt { font-weight: 700; }

/* Gallery */
.sections > .gallery { width: min(1400px, 100% - 2 * var(--gutter)); }

/* While the gallery fills the screen, the page dims to night (the darkest colour).
   A fixed layer fades in behind the page, so nothing has to repaint. */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: var(--night); opacity: 0; transition: opacity 0.9s ease;
}
html.is-gallery-dark body::before { opacity: 1; }

/* Matting: a palette colour with a paper grain. The grain is drawn once per colour by the
   Paper Texture shader (assets/js/paper-texture.js) and arrives as --paper-<colour>. */
.mat { background-color: var(--mat); background-image: var(--tex, none); background-size: 512px; }
.mat-1 { --mat: var(--lime); --tex: var(--paper-lime); }
.mat-2 { --mat: var(--green); --tex: var(--paper-green); }
.mat-3 { --mat: var(--mat-3); --tex: var(--tex-3); }
.mat-4 { --mat: var(--yellow); --tex: var(--paper-yellow); }
.mat-5 { --mat: var(--mat-5); --tex: var(--tex-5); }

.photo-stack {
  --mat-3: var(--rust); --tex-3: var(--paper-rust); --mat-5: var(--wine); --tex-5: var(--paper-wine); --ink: var(--green);
  display: flex; flex-direction: column; align-items: center; gap: 36px; color: var(--ink);
  transition: color 0.9s ease;
}
html.is-gallery-dark .photo-stack, .photo-stack.is-full {
  --mat-3: var(--cream); --tex-3: var(--paper-cream); --mat-5: var(--rust); --tex-5: var(--paper-rust); --ink: var(--cream);
}
/* As tall as the screen allows (leaving room for the nav and the time slider). */
.photo-stack__stage {
  position: relative; width: 100%; aspect-ratio: 1.28; max-height: max(400px, 100svh - 230px);
  touch-action: pan-y; outline: none;
}
.photo-stack__card {
  position: absolute; inset: 0; margin: auto; padding: clamp(8px, 1.5vw, 24px);
  border: 0; cursor: pointer; user-select: none; -webkit-user-select: none;
  will-change: transform, opacity;
  transition: transform 0.6s var(--ease-out), opacity 0.45s ease, z-index 0s 0.15s;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.16);
}
.photo-stack__card.is-active { cursor: grab; box-shadow: 0 18px 44px rgba(0, 0, 0, 0.26); }
.photo-stack__card.is-leaving { pointer-events: none; }
.photo-stack__stage.is-dragging .photo-stack__card.is-active { transition: none; cursor: grabbing; }
/* Fast scrubbing (time slider, opening flip-through): quicker, snappier moves. */
.photo-stack__stage.is-scrubbing .photo-stack__card {
  transition-duration: 0.22s, 0.18s, 0s; transition-delay: 0s;
}
.photo-stack__card img { width: 100%; height: 100%; object-fit: cover; border-radius: clamp(6px, 1.1vw, 16px); pointer-events: none; }
.photo-stack__stage:focus-visible .photo-stack__card.is-active { outline: 2px solid var(--ink); outline-offset: 4px; }
/* Phones: the stack runs edge to edge and taller, so photos are as big as the screen allows. */
@media (max-width: 809.98px) {
  .sections > .gallery { width: 100%; }
  .photo-stack { gap: 28px; }
  .photo-stack__stage { aspect-ratio: 0.8; }
  .photo-stack .timeline { width: calc(100% - 2 * var(--gutter)); }
}

/* Round arrow buttons (time slider and photo viewer). */
.round-button {
  width: 40px; height: 40px; flex: none; padding: 0; border: 1px solid currentColor; border-radius: 999px; background: none; color: inherit; cursor: pointer;
  font: 16px / 1 system-ui, sans-serif; transition: background-color 0.2s, color 0.2s, border-color 0.2s, scale 0.15s var(--ease-out);
}
.round-button:hover { background: var(--lime); border-color: var(--lime); color: var(--green); }
.round-button:active { scale: 0.92; }
.round-button:focus-visible { outline: 2px solid var(--lime); outline-offset: 3px; }

/* Time slider: one tick per photo (evenly spaced, oldest → newest), years marked. */
.timeline { width: 100%; max-width: 980px; display: grid; grid-template-columns: 40px 1fr 40px; align-items: center; gap: 20px; }
.timeline__track { position: relative; height: 72px; cursor: pointer; touch-action: pan-y; outline: none; }
.timeline__ticks { position: absolute; left: 0; right: 0; top: 36px; height: 14px; border-bottom: 1px solid currentColor; }
.timeline__tick { position: absolute; bottom: 0; width: 1px; height: 6px; background: currentColor; opacity: 0.45; }
.timeline__tick.is-year { height: 14px; opacity: 1; }
.timeline__year { position: absolute; top: 58px; translate: -50% 0; font: 400 13px / 1 var(--display); opacity: 0.8; }
.timeline__handle {
  position: absolute; top: 0; bottom: 22px; width: 0; left: 0; will-change: transform;
  transition: transform 0.35s var(--ease-out);
}
.timeline__track.is-dragging .timeline__handle, .timeline__track.is-scrubbing .timeline__handle { transition: none; }
.timeline__handle::after {
  content: ""; position: absolute; left: -1.5px; top: 27px; bottom: 0; width: 3px; border-radius: 2px; background: var(--lime);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--lime) 25%, transparent);
}
.timeline__date {
  position: absolute; top: 0; translate: -50% 0; white-space: nowrap;
  font: 400 17px / 1 var(--display); color: var(--ink); transition: color 0.9s ease;
}
.timeline__track:focus-visible .timeline__handle::after { box-shadow: 0 0 0 3px var(--ink); }
/* A little star over the day we got engaged; it hops above the date when you land on it. */
.star { display: inline-block; width: 1em; height: 1em; fill: var(--yellow); stroke: var(--yellow); stroke-width: 2.2; stroke-linejoin: round; overflow: visible; }
.timeline__star {
  position: absolute; top: 19px; width: 14px; height: 14px; margin-left: -7px; font-size: 14px;
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.timeline__star .star { display: block; animation: twinkle 2.4s ease-in-out infinite; }
.timeline__star.is-active { transform: translateY(-41px) rotate(72deg) scale(1.5); }
@keyframes twinkle { 50% { scale: 0.78; opacity: 0.75; } }
@media (max-width: 809.98px) {
  .timeline { gap: 12px; }
  .timeline__year { font-size: 11px; }
}

/* Full screen: the same stack and time slider, filling the screen over a night backdrop.
   (The section drops its reveal transform so position: fixed is relative to the screen.) */
.photo-stack__close { display: none; }
.gallery.has-full-stack { translate: none; opacity: 1; }
.photo-stack.is-full {
  position: fixed; inset: 0; z-index: 100; justify-content: center; gap: 24px;
  padding: 68px var(--gutter) 24px; background: var(--night);
  animation: fade-in 0.3s ease;
}
.photo-stack.is-full .photo-stack__stage { flex: 1; min-height: 0; aspect-ratio: auto; max-height: none; }
.photo-stack.is-full .photo-stack__card.is-active { cursor: grab; }
.photo-stack.is-full .photo-stack__close { display: block; position: absolute; top: 14px; right: 14px; font-size: 20px; }
@media (max-width: 809.98px) {
  .photo-stack.is-full { padding: 64px 0 16px; gap: 20px; }
}

/* ---- Footer -------------------------------------------------------------- */
.footer {
  position: relative; margin-top: var(--section-gap); padding: 80px;
  display: flex; flex-direction: column; align-items: center; gap: 24px;
}
.footer__shader { inset: 16px; border-radius: 24px; }
.footer__mark, .footer__date { position: relative; }
.footer__mark { width: 145px; height: 145px; }
.footer__date { font: 400 40px / 1.2 var(--display); color: var(--cream); }

/* ---- Buttons ------------------------------------------------------------ */
.button {
  display: inline-block; padding: 11px 16px; border-radius: 16px;
  background: var(--lime); color: var(--green); text-decoration: none;
  font: 600 14px / 1 var(--ui); letter-spacing: -0.01em; white-space: nowrap;
  transition: transform 0.15s var(--ease-out), box-shadow 0.3s var(--ease-out);
}
.button:hover { box-shadow: var(--shadow); }
.button:active { transform: scale(0.98); }
.button:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }

/* ---- Where to stay (stay.html) ------------------------------------------- */
.stay-hero {
  position: relative; overflow: hidden;
  padding: 200px var(--gutter) 120px; background: var(--lime); color: var(--green);
}
.stay-hero__sunburst {
  position: absolute; left: 50%; top: 60px; translate: -50% 0;
  width: 1277px; max-width: none; opacity: 0.55; animation: spin 240s linear infinite;
}
.stay-hero__intro {
  position: relative; width: 600px; max-width: 100%; margin-inline: auto;
  display: flex; flex-direction: column; align-items: center; gap: 20px; text-align: center;
}
.stay-hero__title { font: 400 88px / 1 var(--serif); }
.stay-hero__lede { font-size: 21.47px; }

/* One plain list per town, closest first: the town and its drive time, then names. */
.stay-page {
  width: 100%; max-width: calc(660px + 2 * var(--gutter)); margin-inline: auto; padding: 96px var(--gutter) 0;
  color: var(--green);
}
.stay-list { display: flex; flex-direction: column; gap: 56px; }
.town__name {
  display: flex; align-items: center; gap: 12px; margin-bottom: 12px;
  font: 400 32px / 1.2 var(--serif);
}
.town__name::after {
  content: ""; order: 1; flex: 1; height: 8px;
  background: url("../svg/squiggle.svg") center / 100% 100% no-repeat;
}
.town__drive { order: 2; font: 400 18px / 1 var(--display); white-space: nowrap; }
.town__list li {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  padding: 10px 0; border-bottom: 1px solid color-mix(in srgb, var(--green) 15%, transparent);
}
.town__list a { color: var(--green); font-weight: 500; text-decoration-thickness: 1px; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); }
.town__list a:hover { text-decoration-color: currentColor; }
.town__list a::after { content: "↗"; margin-left: 0.3em; font: 500 0.75em / 1 var(--ui); opacity: 0.6; }
.town__list span { flex: none; font-size: 14px; opacity: 0.7; text-align: right; }
.stay-more { margin-top: 80px; }

@media (max-width: 809.98px) {
  .stay-hero { padding: 140px var(--gutter) 80px; }
  .stay-hero__title { font-size: 56px; }
  .stay-hero__lede { font-size: 18px; }
  .stay-page { padding-top: 64px; }
  .stay-list { gap: 44px; }
  .town__name { font-size: 28px; }
  .town__list li { flex-direction: column; gap: 2px; }
  .town__list span { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0s !important; animation: none !important; transition-delay: 0s !important; }
}
