/* The scrolling sections under the invitation: the weekend, the château,
   getting there, questions, "are you in?". Builds on site.css. */

html { scroll-behavior: smooth; scroll-padding-top: 76px; }
main { overflow-x: clip; }
@media (max-width: 720px) { html { scroll-padding-top: 96px; } }
a { color: var(--red); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

/* ---------- hero additions ---------- */
.site-head { display: grid; gap: 6px; justify-items: start; }
.sleeps { font: italic 400 14px/1 var(--text); letter-spacing: 0; text-transform: none; color: var(--red); }
.cue {
  position: relative; align-self: center; margin-top: 4px;
  font-size: 11.5px; color: var(--navy); text-decoration: none;
  animation: kt-fade 1s 3.4s ease-out both;
}
.cue span { display: inline-block; margin-left: .4em; animation: kt-nudge 2.4s 4s ease-in-out infinite; }
.cue:hover { color: var(--red); }
@keyframes kt-nudge { 0%, 60%, 100% { transform: translateY(0); } 30% { transform: translateY(5px); } }

/* ---------- top bar: slides in once the invitation has scrolled away ---------- */
.topbar {
  position: fixed; z-index: 20; left: 0; right: 0; top: 0;
  display: flex; align-items: center; gap: 12px 28px;
  padding: 12px clamp(16px, 4vw, 48px);
  background: color-mix(in srgb, var(--cream) 92%, transparent);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  border-bottom: 1.5px solid var(--navy);
  transform: translateY(-110%); transition: transform .45s var(--spring);
}
.topbar.on { transform: none; }
.tb-brand { font-size: 13px; color: var(--navy); text-decoration: none; white-space: nowrap; }
.tb-links { display: flex; gap: 22px; margin: 0 auto; }
.tb-links a {
  position: relative; font: italic 400 15px/1.2 var(--text); color: var(--navy); text-decoration: none; white-space: nowrap;
}
.tb-links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 1.5px; background: var(--red);
  transform: scaleX(0); transform-origin: left; transition: transform .35s var(--spring);
}
.tb-links a:hover::after, .tb-links a.here::after { transform: scaleX(1); }
.tb-links a.here { color: var(--red); }
.tb-cta {
  font-size: 11.5px; padding: 8px 14px 7px; color: var(--cream); background: var(--red); text-decoration: none; white-space: nowrap;
  border: 1.5px solid var(--red); transition: transform .25s var(--spring);
}
.tb-cta:hover { transform: rotate(-2deg); }
@media (max-width: 720px) {
  .topbar { flex-wrap: wrap; padding: 10px 16px 0; }
  .tb-cta { margin-left: auto; }
  .tb-links {
    order: 3; flex: 1 0 100%; margin: 0 -16px; padding: 2px 16px 10px; gap: 20px;
    overflow-x: auto; scrollbar-width: none;
  }
  .tb-links::-webkit-scrollbar { display: none; }
}

/* ---------- section scaffolding ---------- */
.sec {
  position: relative;
  box-sizing: border-box;
  max-width: 1120px; margin: 0 auto;
  padding: clamp(72px, 12vw, 140px) clamp(16px, 5vw, 56px) 0;
}
.sec-head { display: grid; justify-items: center; gap: 14px; text-align: center; margin-bottom: clamp(36px, 6vw, 64px); }
.kicker { font-size: 12px; color: var(--red); }
.kicker::before, .kicker::after { content: "★"; font-size: .9em; margin: 0 .7em; }
.sec-head h2 { font-size: clamp(52px, 10vw, 118px); max-width: 14ch; text-wrap: balance; }
/* Display type is stretched downward from its top, so leave room under it. */
.sec .disp, .foot .disp { transform-origin: 50% 0; }
.sec-head h2 { margin-bottom: .2em; }
.getting .sec-head h2 { font-size: clamp(40px, 7.4vw, 88px); max-width: 15ch; line-height: .95; margin-bottom: .62em; }
.lede { max-width: 34em; font: italic 400 clamp(17px, 2vw, 20px)/1.5 var(--text); text-wrap: pretty; }
.sec p:not([class]), .sec .a p { font: 400 16.5px/1.65 var(--text); text-wrap: pretty; }

/* A little rule of stars between sections */
.sec + .sec::before {
  content: "★   ·   ★   ·   ★"; white-space: pre;
  position: absolute; left: 0; right: 0; top: clamp(24px, 5vw, 56px); text-align: center;
  font-size: 12px; letter-spacing: .3em; color: var(--navy);
}

/* ---------- reveal on scroll (only when JS is on) ---------- */
.js .rv { opacity: 0; transform: translateY(28px); transition: opacity .9s ease-out, transform 1s var(--spring); }
.js .rv.in { opacity: 1; transform: none; }

/* ---------- the weekend ---------- */
.journey { --col: 120px; position: relative; padding-left: var(--col); }
.canal { position: absolute; left: 0; top: 0; bottom: 0; width: var(--col); pointer-events: none; }
.canal svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.canal .ahead { fill: none; stroke: var(--navy); stroke-width: 1.6; stroke-dasharray: 1 7; stroke-linecap: round; opacity: .55; }
.canal .done { fill: none; stroke: var(--navy); stroke-width: 2.6; stroke-linecap: round; }
.canal .bank { fill: none; stroke: var(--navy); stroke-width: 1.2; opacity: .35; }
.boat { position: absolute; left: 0; top: 0; width: 132px; z-index: 2; pointer-events: none; will-change: transform; }
.boat img { width: 100%; height: auto; }

.days { list-style: none; margin: 0; padding: 0; display: grid; gap: clamp(64px, 10vw, 120px); padding-bottom: 24px; }
.day {
  position: relative;
  display: grid; grid-template-columns: 150px minmax(0, 1fr) minmax(0, 300px); gap: 12px 36px; align-items: start;
}
.stop {
  position: absolute; left: calc(var(--col) * -1); top: 30px; width: 0; height: 0;
}
.stop::before {
  content: ""; position: absolute; left: var(--sx, 56px); top: 0; width: 13px; height: 13px; translate: -50% -50%;
  border-radius: 50%; background: var(--cream); border: 2px solid var(--navy);
  transition: background .3s, border-color .3s, scale .5s var(--spring);
}
.day.passed .stop::before { background: var(--red); border-color: var(--red); scale: 1.25; }

.date { display: flex; align-items: flex-end; gap: 10px; color: var(--red); }
.date .num { font-size: 96px; line-height: .8; margin-bottom: .2em; }
.date .dow { font-size: 11.5px; line-height: 1.5; padding-bottom: 2px; }
.day h3 { font-size: clamp(36px, 4.6vw, 54px); line-height: .95; margin: 6px 0 calc(14px + .2em); text-wrap: balance; }
.day .sub { font: italic 400 18px/1.3 var(--text); color: var(--red); margin-bottom: 12px; }
.art { position: relative; display: flex; align-items: flex-end; justify-content: center; gap: 18px; min-height: 120px; }
.art img { width: 30%; max-width: 92px; height: auto; cursor: help; transition: transform .5s var(--spring); }
.art img:nth-child(2) { width: 26%; translate: 0 -18px; }
.art img.wide { width: 40%; max-width: 112px; }
.art img:hover { transform: rotate(-6deg) scale(1.08); }
.js .day .art img { opacity: 0; translate: 0 -24px; scale: .85; transition: opacity .5s, translate .9s var(--spring), scale .9s var(--spring), transform .5s var(--spring); }
.js .day.in .art img { opacity: 1; translate: 0 0; scale: 1; }
.js .day.in .art img:nth-child(2) { translate: 0 -18px; transition-delay: .12s; }
.js .day.in .art img:nth-child(3) { transition-delay: .24s; }

@media (max-width: 900px) {
  .day { grid-template-columns: minmax(0, 1fr) minmax(0, 220px); }
  .date { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .journey { --col: 58px; }
  .boat { width: 72px; }
  .day { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .date .num { font-size: 72px; }
  .stop { top: 24px; }
  .art { justify-content: flex-start; min-height: 0; margin-top: 10px; }
  .art img { width: 76px; }
  .art img.wide { width: 108px; }
  .art img:nth-child(2) { width: 64px; }
}

/* ---------- the château ---------- */
.ch-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 72px); align-items: center; }
.ch-art { position: relative; aspect-ratio: 1.45; }
.ch-art img { position: absolute; height: auto; cursor: help; transition: transform .6s var(--spring); }
.ch-art img:hover { transform: rotate(-3deg) translateY(-4px); }
.ch-main { left: 8%; top: 12%; width: 74%; }
.ch-tent { left: 0; bottom: 0; width: 22%; }
.ch-grapes { right: 0; top: 0; width: 15%; }
.ch-copy { display: grid; gap: 18px; }
.ch-copy .lede { font-size: clamp(19px, 2.3vw, 24px); }
.ch-egg { display: flex; align-items: center; gap: 14px; margin-top: 4px; font: italic 400 15px/1.45 var(--text); color: var(--red); }
.ch-egg img { flex: none; width: 92px; height: auto; cursor: help; transform: rotate(-3deg); transition: transform .6s var(--spring); }
.ch-egg img:hover { transform: rotate(3deg) translateY(-3px); }

.stats {
  list-style: none; margin: clamp(48px, 8vw, 88px) 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1.5px solid var(--navy); border-bottom: 1.5px solid var(--navy);
}
.stats li { display: grid; justify-items: center; align-content: start; gap: 12px; padding: 28px 12px 26px; text-align: center; }
.stats li + li { border-left: 1.5px solid var(--navy); }
.stats .disp { margin-bottom: .2em; font-size: clamp(56px, 8vw, 96px); color: var(--red); font-variant-numeric: tabular-nums; }
.stats .caps { font-size: 11px; line-height: 1.5; max-width: 16ch; }
@media (max-width: 760px) {
  .ch-grid { grid-template-columns: minmax(0, 1fr); }
  .ch-art { max-width: 460px; width: 100%; justify-self: center; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats li:nth-child(3) { border-left: 0; }
  .stats li:nth-child(n+3) { border-top: 1.5px solid var(--navy); }
}

/* ---------- getting there: fold-out map ---------- */
.fold {
  position: relative; max-width: 900px; margin: 0 auto;
  perspective: 1800px;
  filter: drop-shadow(10px 12px 0 var(--card));
}
.map { position: relative; background: color-mix(in srgb, var(--cream) 50%, #fff); border: 1.5px solid var(--navy); }
.map-svg { display: block; width: 100%; height: auto; }
/* JS slices the map into panels that unfold one after another. */
.fold.sliced .map { display: flex; background: none; border: 0; }
.panel {
  position: relative; flex: 1; overflow: hidden;
  background: color-mix(in srgb, var(--cream) 50%, #fff);
  border-top: 1.5px solid var(--navy); border-bottom: 1.5px solid var(--navy);
  transform-origin: left center; backface-visibility: hidden;
  transition: transform 1.1s cubic-bezier(.2, .9, .25, 1.05);
}
.panel:first-child { border-left: 1.5px solid var(--navy); }
.panel:last-child { border-right: 1.5px solid var(--navy); }
.panel .inner { position: relative; }
/* the creases stay once it's open */
.panel::after { content: ""; position: absolute; inset: 0; pointer-events: none; }
.panel:nth-child(odd)::after { background: linear-gradient(90deg, rgba(21, 48, 91, 0) 80%, rgba(21, 48, 91, .035)); }
.panel:nth-child(even)::after { background: linear-gradient(90deg, rgba(255, 255, 255, .35), rgba(255, 255, 255, 0) 20%); }
.fold.sliced:not(.open) .panel:not(:first-child) { transform: rotateY(-100deg); }
.fold.open .panel:nth-child(2) { transition-delay: .15s; }
.fold.open .panel:nth-child(3) { transition-delay: .45s; }
.fold.open .panel:nth-child(4) { transition-delay: .75s; }

.map .s { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.map .n { stroke: var(--navy); }
.map .rf { fill: var(--red); }
.map .sea { fill: color-mix(in srgb, var(--navy) 5%, transparent); }
.map text { font-family: var(--text); fill: var(--navy); }
.map .m-sea { font-style: italic; font-size: 20px; letter-spacing: .04em; }
.map .m-canal { font-style: italic; font-size: 15px; }
.map .m-town { font-size: 17px; }
.map .m-code, .map .m-off { font-family: var(--caps); font-weight: 500; font-size: 13px; letter-spacing: .14em; }
.map .m-here { font-family: var(--display); font-size: 30px; fill: var(--red); text-transform: uppercase; stroke: var(--red); stroke-width: .9; }
.map .m-here-sub { font-style: italic; font-size: 15px; fill: var(--red); }
.map .town { fill: var(--navy); }
.map .pin { fill: var(--cream); stroke: var(--navy); stroke-width: 2; transition: fill .3s; }
.map .ring { fill: none; stroke: var(--red); stroke-width: 2; opacity: 0; transform-box: fill-box; transform-origin: center; }
.map .route { fill: none; stroke: var(--red); stroke-width: 2.4; stroke-dasharray: 2 7; stroke-linecap: round; opacity: 0; transition: opacity .3s; }
.map .port.off text { transition: fill .3s; }
.fold[data-hot="bzr"] [data-p="bzr"] .pin, .fold[data-hot="ccf"] [data-p="ccf"] .pin,
.fold[data-hot="mpl"] [data-p="mpl"] .pin, .fold[data-hot="train"] [data-p="train"] .pin { fill: var(--red); stroke: var(--red); }
.fold[data-hot="bzr"] [data-p="bzr"] .ring, .fold[data-hot="ccf"] [data-p="ccf"] .ring,
.fold[data-hot="mpl"] [data-p="mpl"] .ring, .fold[data-hot="train"] [data-p="train"] .ring { animation: kt-ping 1.4s ease-out infinite; }
.fold[data-hot="tls"] [data-p="tls"] text, .fold[data-hot="bcn"] [data-p="bcn"] text { fill: var(--red); }
.fold[data-hot="bzr"] .route[data-p="bzr"], .fold[data-hot="ccf"] .route[data-p="ccf"], .fold[data-hot="mpl"] .route[data-p="mpl"],
.fold[data-hot="tls"] .route[data-p="tls"], .fold[data-hot="bcn"] .route[data-p="bcn"], .fold[data-hot="train"] .route[data-p="train"] {
  opacity: 1; animation: kt-march 1s linear infinite;
}
/* On phones the map is small, so its labels grow (they're in map units). */
@media (max-width: 600px) {
  .map .m-town { font-size: 23px; }
  .map .m-code, .map .m-off { font-size: 20px; }
  .map .m-here { font-size: 44px; }
  .map .m-here-sub, .map .m-canal { display: none; }
  .map .t-carc { text-anchor: start; translate: -66px 0; }
  .map .t-narb { translate: 16px 26px; }
  .map .m-sea { font-size: 24px; translate: -50px 0; }
}
@keyframes kt-ping { from { opacity: .9; scale: .6; } to { opacity: 0; scale: 1.8; } }
@keyframes kt-march { to { stroke-dashoffset: -18; } }

/* ---------- getting there: postage stamps ---------- */
.stamps {
  list-style: none; margin: clamp(44px, 7vw, 72px) auto 0; padding: 0; max-width: 980px;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(18px, 3vw, 34px);
}
.stamp-w { filter: drop-shadow(5px 6px 0 var(--card)); transition: transform .5s var(--spring); }
.stamp-w:nth-child(3n+1) { rotate: -1.2deg; }
.stamp-w:nth-child(3n+2) { rotate: .8deg; }
.stamp-w:nth-child(3n) { rotate: -.4deg; }
.stamp-w:hover, .stamp-w.hot { transform: translateY(-6px) rotate(-2deg) scale(1.03); }
.stamp {
  --perf: 7px;
  position: relative; box-sizing: border-box; height: 100%;
  display: grid; justify-items: center; align-content: start; gap: 6px; text-align: center;
  padding: calc(var(--perf) * 2 + 14px) calc(var(--perf) * 2 + 12px) calc(var(--perf) * 2 + 16px);
  background: #FBF8F1;
  /* perforated edge: a field of holes, with the middle filled back in */
  -webkit-mask: radial-gradient(circle var(--perf) at var(--perf) var(--perf), #0000 96%, #000) calc(var(--perf) * -1) calc(var(--perf) * -1) / calc(var(--perf) * 2.6) calc(var(--perf) * 2.6) round,
                linear-gradient(#000 0 0) var(--perf) var(--perf) / calc(100% - var(--perf) * 2) calc(100% - var(--perf) * 2) no-repeat;
          mask: radial-gradient(circle var(--perf) at var(--perf) var(--perf), #0000 96%, #000) calc(var(--perf) * -1) calc(var(--perf) * -1) / calc(var(--perf) * 2.6) calc(var(--perf) * 2.6) round,
                linear-gradient(#000 0 0) var(--perf) var(--perf) / calc(100% - var(--perf) * 2) calc(100% - var(--perf) * 2) no-repeat;
}
.stamp::before { content: ""; position: absolute; inset: calc(var(--perf) * 2); border: 1.5px solid var(--navy); pointer-events: none; }
.stamp.red::before { border-color: var(--red); }
.stamp .val { justify-self: start; margin-bottom: .2em; font-size: 30px; color: var(--red); white-space: nowrap; }
.stamp.red .val { color: var(--navy); }
.stamp img { width: 58%; max-width: 150px; height: 84px; object-fit: contain; margin: 4px 0 10px; }
.stamp h3 { font-size: 34px; margin-bottom: .2em; }
.stamp .code { font-size: 10.5px; color: var(--red); margin-top: 4px; }
.stamp .note { font: italic 400 14.5px/1.45 var(--text); margin-top: 6px; text-wrap: pretty; }

.postmark {
  position: absolute; width: 132px; right: clamp(-8px, 2vw, 24px); bottom: -96px; rotate: -14deg;
  fill: none; stroke: var(--red); stroke-width: 2; opacity: .8; pointer-events: none;
}
.postmark text { fill: var(--red); stroke: none; font: 500 9.6px var(--caps); letter-spacing: .2em; }
.postmark .pm-d { font: 400 15px var(--display); letter-spacing: .06em; }
@media (max-width: 860px) { .stamps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) {
  .stamp { --perf: 5px; }
  .stamp .val { font-size: 22px; }
  .stamp h3 { font-size: 22px; }
  .stamp img { height: 60px; }
  .stamp .note { font-size: 13.5px; }
  .postmark { width: 96px; bottom: -84px; }
}

/* ---------- questions ---------- */
.qs { max-width: 760px; margin: 0 auto; border-top: 1.5px solid var(--navy); }
.qs details { border-bottom: 1.5px solid var(--navy); }
.qs summary {
  list-style: none; cursor: pointer; position: relative;
  padding: 22px 48px 22px 0;
  font: 400 clamp(20px, 2.6vw, 25px)/1.3 var(--text);
  transition: color .2s;
}
.qs summary::-webkit-details-marker { display: none; }
.qs summary:hover { color: var(--red); }
.qs summary:focus-visible { outline: 2px dashed var(--red); outline-offset: 4px; }
.qs summary::after {
  content: "+"; position: absolute; right: 6px; top: 50%; translate: 0 -54%;
  font: 400 34px/1 var(--display); color: var(--red); transition: rotate .45s var(--spring);
}
.qs details[open] summary::after { rotate: 135deg; }
.qs .a { padding: 0 48px 26px 0; }
.qs details[open] .a { animation: kt-fade .5s ease-out both; }

/* ---------- are you in? ---------- */
.rsvp { padding-bottom: clamp(60px, 10vw, 120px); }
.rsvp-card {
  position: relative; max-width: 680px; margin: 0 auto; box-sizing: border-box;
  display: grid; justify-items: center; gap: 14px; text-align: center;
  padding: clamp(96px, 13vw, 120px) clamp(20px, 6vw, 56px) clamp(40px, 6vw, 56px);
  background: var(--cream); border: 1.5px solid var(--navy);
  box-shadow: 0 1px 0 var(--card), 12px 14px 0 -2px var(--card);
}
.rsvp-card .bunting { position: absolute; left: 6%; top: -2px; width: 88%; height: auto; }
.rsvp-card h2 { font-size: clamp(60px, 12vw, 110px); margin: 6px 0 .3em; }
.big-count { display: grid; justify-items: center; gap: 4px; color: var(--red); }
.big-count .disp { margin-bottom: .25em; font-size: 46px; font-variant-numeric: tabular-nums; }
.big-count .caps { font-size: 11px; }
.rsvp-actions { display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-start; gap: 14px 18px; margin-top: 10px; }
.rsvp-actions .join-cta { margin-top: 0; font-size: 13px; }
.cal { position: relative; }
.cal summary {
  list-style: none; cursor: pointer;
  padding: 11px 18px 10px; font-size: 12.5px; color: var(--navy);
  border: 1.5px solid var(--navy); box-shadow: 4px 5px 0 -1px var(--card);
  transition: transform .25s var(--spring);
}
.cal summary::-webkit-details-marker { display: none; }
.cal summary:hover { transform: rotate(1.5deg) translateY(-1px); }
.cal summary:focus-visible { outline: 2px dashed var(--red); outline-offset: 4px; }
.cal-menu {
  position: absolute; z-index: 3; left: 50%; top: calc(100% + 10px); translate: -50% 0;
  display: grid; min-width: 220px; background: var(--cream); border: 1.5px solid var(--navy);
  box-shadow: 6px 7px 0 -1px var(--card); animation: kt-fade .3s ease-out both;
}
.cal-menu a { padding: 12px 16px; font: italic 400 16px/1.2 var(--text); color: var(--navy); text-decoration: none; }
.cal-menu a + a { border-top: 1px solid color-mix(in srgb, var(--navy) 30%, transparent); }
.cal-menu a:hover { color: var(--red); background: color-mix(in srgb, var(--card) 50%, transparent); }

/* ---------- footer ---------- */
.foot {
  display: grid; justify-items: center; gap: 12px; text-align: center;
  padding: 48px 16px 56px; border-top: 1.5px solid var(--navy);
}
.foot .disp { font-size: clamp(34px, 6vw, 56px); margin-bottom: .2em; }
.foot .caps { font-size: 11px; line-height: 1.6; }
.foot a { color: var(--red); text-decoration: none; }

/* ---------- hover notes on the drawings ---------- */
.tip {
  position: fixed; left: 0; top: 0; z-index: 30; pointer-events: none;
  padding: 7px 12px 6px; max-width: 220px;
  font: italic 400 14.5px/1.3 var(--text); color: var(--cream); background: var(--navy);
  box-shadow: 3px 4px 0 -1px var(--red);
  opacity: 0; transition: opacity .2s;
  will-change: transform;
}
.tip.on { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .rv, .js .day .art img { opacity: 1; transform: none; translate: none; scale: none; }
  .js .day .art img:nth-child(2) { translate: 0 -18px; }
}
