/* Aly & Mimi — the page. Phones first, paper everywhere, sage line.
   Colours and type come from tokens.css; the few page-level additions
   below are proposed back to the orchestrator for tokens.css. */

/* The Youth's apostrophes and middle dot are drawn outside their advance (the
   apostrophe vanishes into the next letter, the dot floats at x-height), so
   those glyphs (and the ampersand's lopsided spacing) come from a tiny
   re-spaced copy of them. */
@font-face {
  font-family: "AMPunct";
  src: url("data:font/woff2;base64,d09GMk9UVE8AAAIkAAkAAAAAA1gAAAHeAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAADYIWBmAATAE2AiQDFAQGBWAHIBu1AiCO0UtPUSYpU1CmzUeUTTZ7/01fFYOsqGo9guAI2iGEwyAkwdhe2dx+ElwPK70TNWldOu3MKyqYSzjEbKf74XBgsUUSZt6NMNNd591NJNGAOk8ig/SGhXKpxeRwuL0avSChOE0cnDMSw9KBCiXCRLQ6NZYSy5dt+1KHZ4VPhKaWAsNLKg5TKC5pVdtTZnWdeH09B3/dBrNHbIodr1irbIbNiZ2/DseyfMWS2MlKtNoS2I6bn80lHhCLK+3JnENzU8NzHfJzHfnDcSguKTOuRJ6/jsWjJjb3UXOdecqJjwNL7Ei0USUH3i+IKZH1lTfEMaTzeRHLca51bc/soINDH6LQL9/BPo812aYSzYcMkbZqsHaqfJ5XX+h8BKcl2Zj/UcSPCMs9nVwty484N1okqXOSD3NY7EULa5oeEVlO83BDTyKASE8n/rjAFvL80NJONQObDvkbNHgStPsmRS//Z6fowDfIxi80XNEl5hgewDAUDkub1P/p2FnSOe2BGKTURWk48k0YvwsS0P/ipNPfAf8ntCGhc7Q6aIdAUyAsuaN+wK06gQI75RNkwE2tX5b1zJmFJnR3FIgZFDWeNelcEIuFoup6QuU71u3BhANnGRKFSecqQpQM8UKkogMAAAA=") format("woff2");
  unicode-range: U+0026-0027, U+2018-2019, U+00B7;
  font-display: block;
}
@font-face {
  font-family: "YouthFig";
  src: url("../assets/fonts/the-youth.woff2") format("woff2");
  unicode-range: U+0020-002A, U+002C-0039;
  font-display: swap;
}
@font-face {
  font-family: "AMPlus";
  src: local("Georgia"), local("NotoSerif-Regular"), local("Noto Serif"), local("DroidSerif"), local("Times New Roman");
  unicode-range: U+002B;
}

:root {
  /* per-glyph fallback: CS Reggie has letters only, so digits and
     punctuation fall through to The Youth — exactly as the card sets them */
  --font-body: "Reggie", "AMPunct", "Youth", Georgia, serif;
  --font-figure: "AMPunct", "Youth", Georgia, serif;
  --ink: #50573c;            /* small text on paper: 5.6:1 (sage is 3.1:1, large text only) */
  --ink-soft: #5a6147;       /* 4.7:1 on paper — secondary lines */
  --error: #7e4238;          /* 6.1:1 on paper */
  --card-stock: #f7e5de;     /* the reply card: a lighter stock than the invitation */
  --hair: rgba(95, 103, 73, 0.42);
  --hair-soft: rgba(95, 103, 73, 0.2);
  --pad: max(var(--gutter), env(safe-area-inset-left), env(safe-area-inset-right));
  --paper-tex: url("../assets/icons/paper-grain.png") 0 0 / 128px 128px repeat, var(--paper);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  background: var(--paper-tex);
  color: var(--ink);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: auto;
}
html.intro-active, html.intro-active body { overflow: hidden; height: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background: transparent; /* the paper (with its grain) is html's */
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.5;
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
  /* CS Reggie's only ligatures (fi, fl) set wide: "fi nd" */
  font-variant-ligatures: no-common-ligatures;
  overflow-x: clip;
  -webkit-tap-highlight-color: transparent;
}

h1, h2, h3, p { margin: 0; font-weight: 400; }
h1, h2, h3, .season-line, .done-msg, .closing-names, .cd-title, .cd-caption { text-wrap: balance; }
p, label, li { text-wrap: pretty; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
a { color: inherit; }

.num { font-family: var(--font-figure); }
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
[hidden] { display: none !important; }

.skip {
  position: absolute; inset-inline-start: 12px; top: -80px; z-index: 200;
  background: var(--paper-light); color: var(--ink); padding: 10px 16px; border-radius: 999px;
  box-shadow: inset 0 0 0 1px var(--hair); text-decoration: none;
}
.skip:focus { top: 12px; }

/* focus: drawn in the same sage line as everything else */
:focus { outline: none; }
:focus-visible {
  outline: 1.5px solid var(--sage-deep);
  outline-offset: 4px;
  border-radius: 10px;
}

/* ---- paper: the grain is IN the paper (owner round 3, note 5) ----
   No overlay sits on top of the content any more: a fine, tileable tooth
   (assets/icons/paper-grain.png: #f2d6ce with a fine, featureless +-1.3 level luminance tooth — no mottle, no repeating marks)
   is the page's own background, behind every chapter, ornament and word.
   The few opaque surfaces laid on the paper (the map card, the reply card,
   the seam under the card) use the same paper, so no box ever shows. */
/* ---- the one cohort of leaves (chapters.js, owner round 3) ----
   the falling layer is fixed, behind everything that is laid on the paper:
   the card covers it at the top, and text, frames, the map and the reply card
   are painted over it. The pile is anchored on the page's foot (chapters.js
   sets its top) and, like the falling layer, sits over the footer only (the
   footer is not positioned), so a few leaves lie over its last line. */
.page-drift {
  position: fixed; inset: 0; z-index: 0;
  pointer-events: none; overflow: hidden;
  contain: strict;
}
.page-drift .fall:not(.is-on) { visibility: hidden; }
.leaf-pile {
  position: absolute; left: 0; top: 0; width: 100%; height: 0; z-index: 0;
  pointer-events: none; overflow: hidden;
}
.leaf-pile .fall { will-change: auto; }

/* ---- the cue under the card once it has bloomed (owner round 2, note 2) ---- */
.swipe-cue {
  position: absolute; left: 0; right: 0; top: 0; z-index: 3;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  color: var(--sage-deep);
  pointer-events: none;
  opacity: 0; transform: translateY(12px);
  transition: opacity calc(var(--dur-slow) * var(--tempo)) var(--ease-out), transform calc(var(--dur-slow) * var(--tempo)) var(--ease-out);
}
.swipe-cue.is-shown { opacity: 1; transform: none; }
.swipe-cue.is-gone { opacity: 0; transform: translateY(-10px); transition-duration: calc(var(--dur-base) * var(--tempo)); }
.swipe-cue svg { width: 44px; height: 28px; overflow: visible; fill: none; stroke: currentColor; stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
.swipe-cue .cue-bud { fill: currentColor; stroke: none; }
.swipe-cue-text { font-size: 17px; line-height: 1.1; letter-spacing: 0.08em; color: var(--ink); }
/* a pointer, not a thumb: "scroll" beside a chevron that points down the page */
.swipe-cue[data-dir="down"] { flex-direction: row; justify-content: center; gap: 8px; }
.swipe-cue[data-dir="down"] svg { transform: rotate(180deg); width: 34px; height: 22px; }

/* ---- intro + hero slots (their own CSS lives in intro.css / hero.css) ---- */
#intro { position: fixed; inset: 0; z-index: 70; }
#intro:empty { display: none; }
/* until the envelope arrives, its linen covers the page (no flash of the chapters);
   if the scripts never come, the cover steps aside on its own */
html.intro-pending #intro:empty {
  display: block; background: var(--linen, #e9ddd3);
  animation: intro-cover-out 0.6s ease-out 9s forwards;
}
@keyframes intro-cover-out { to { opacity: 0; visibility: hidden; } }
#hero { position: relative; min-height: 100vh; min-height: 100svh; }
/* phones held upright: the card spans the width (hero.js "bleed"), so the hero is
   the card plus a breath above and below, and the chapter line shows on the first screen */
@media (max-width: 640px) and (orientation: portrait) {
  #hero { min-height: calc(100vw * 4 / 3 + 96px); }
}
/* the seam: on a phone the card bleeds edge to edge, so its bottom crop (the
   botanicals cut straight) melts into the page's paper over its last 30px,
   and the stage's own ground below it becomes paper */
#hero::after {
  content: ""; position: absolute; inset-inline: 0; bottom: 0; height: 78px;
  background: var(--paper-tex);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, rgba(0, 0, 0, 0.62) 17px, #000 30px);
  mask-image: linear-gradient(to bottom, transparent 0, rgba(0, 0, 0, 0.62) 17px, #000 30px);
  pointer-events: none; z-index: 2;
}
@media (min-width: 641px), (orientation: landscape) {
  /* framed card on linen: the linen fades into paper below the hero, not over the card */
  #hero::after { display: none; }
  .chapter-season::before {
    content: ""; position: absolute; inset-inline: 0; top: 0; height: 180px;
    background: linear-gradient(to bottom, var(--linen, #e9ddd3), rgba(233, 221, 211, 0.55) 38%, rgba(242, 214, 206, 0));
    pointer-events: none; z-index: 0;
  }
}
.hero-static {
  position: absolute; inset: 0; display: grid; place-items: center;
  padding: max(16px, env(safe-area-inset-top)) var(--pad) 16px;
}
.hero-static img {
  width: min(100%, calc((100svh - 32px) * 0.75));
  aspect-ratio: 3 / 4; height: auto; object-fit: cover;
  box-shadow: 0 1px 2px rgba(120, 80, 70, 0.12), 0 24px 50px -30px rgba(120, 80, 70, 0.45);
}

/* ---- chapters ---- */
#chapters { position: relative; }
.chapter {
  position: relative;
  padding: 56px var(--pad);
  scroll-margin-top: 24px;
}
.chapter + .chapter { padding-top: 24px; }

/* Mucha's framed panel: an embossed arch of paper with a double hairline */
.panel {
  --arch: clamp(92px, 26vw, 150px);
  position: relative;
  max-width: 36rem;
  margin-inline: auto;
  padding: calc(var(--arch) * 0.42) 22px 40px;
  border-radius: 50% 50% 22px 22px / var(--arch) var(--arch) 22px 22px;
  /* owner round 2, note 4: no lighter panel behind the chapters — the line
     work and the words sit straight on the one paper */
  background: none;
  box-shadow: none;
  text-align: center;
}
.panel > * { position: relative; z-index: 1; }
.panel > .orn-frame-host { z-index: 0; }
/* with the ornament frame: a quiet rectangle of paper; the frame does the drawing */
.panel.has-frame {
  border-radius: 10px;
  padding: 74px 32px 76px;
  background: none;
  box-shadow: none;
}
.panel.has-frame::before { display: none; }
.orn-frame-host svg { color: var(--sage); }
.panel::before {
  content: "";
  position: absolute; inset: 9px;
  border: 1px solid var(--hair-soft);
  border-radius: 50% 50% 15px 15px / calc(var(--arch) - 9px) calc(var(--arch) - 9px) 15px 15px;
  pointer-events: none;
}

.ch-orn {
  width: 200px; aspect-ratio: 320 / 60; margin: 0 auto 6px;
  color: var(--sage);
}
.ch-orn svg { width: 100%; height: 100%; overflow: visible; }
.ch-orn-wide { width: min(360px, 86vw); aspect-ratio: 560 / 60; }
.ch-orn-small { width: 132px; aspect-ratio: 200 / 60; }

.ch-label {
  font-size: clamp(32px, 8.6vw, 46px);
  line-height: 1.1;
  color: var(--sage);
  letter-spacing: 0.005em;
  margin: 2px 0 14px;
}
.ch-intro {
  font-size: 19px; line-height: 1.45; color: var(--ink);
  max-width: 26em; margin: 0 auto 6px;
}

/* entrance: hidden only when motion is on (JS adds .motion). Every CSS
   duration in this file is calc(<base> * var(--tempo)) — owner round 3. */
.motion .reveal { opacity: 0; transform: translateY(18px); }

/* ---- 1 · Out of season ---- */
/* phones: the divider and the first words show under the card on the first
   screen; the leaves drift from just under the card through the line */
.chapter-season {
  display: grid; place-items: start center;
  padding-block: clamp(56px, 9svh, 84px) 112px;
  overflow: hidden;
}
/* the leaves may start above the chapter (under the card's paper fade), so only
   the sides clip; browsers without overflow:clip keep the hidden box above */
@supports (overflow-x: clip) {
  .chapter-season { overflow: visible; overflow-x: clip; }
}
.season-body { position: relative; z-index: 1; text-align: center; max-width: 44rem; }
.season-line {
  font-size: clamp(42px, 11.4vw, 96px);
  line-height: 1.08;
  color: var(--sage);
  margin: 18px auto 18px;
  max-width: 11em;
}
.season-sub {
  font-size: clamp(24px, 6.2vw, 32px);
  color: var(--sage-deep);
  letter-spacing: 0.02em;
}
.fall {
  position: absolute; top: 0; left: 0;
  width: var(--s); height: var(--s);
  will-change: transform;
}
.fall-leaf, .fall-bloom {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: contain;
}
.fall-bloom { transform: scale(0); }

/* ---- 2 · The date ---- */
/* the medallion (owner round 3, note 4): its opening (rasterised from
   medallion.svg, viewBox 440x484: x 47.3 -> 396, y 88.8 -> 380.9 between the
   stems) holds the three lines, each line box cut to its ink (line-height =
   ink height; Reggie's ink nudged into its box), evenly spaced, the block
   centred in the opening. Everything scales with the medallion's width
   (--mw), so the composition is the same at 320 and 1440. The figures are
   "Youth Num" in the face's own lean (no synthesised italic) and are moved
   by their ink, not their advance (the lean puts the ink right of it). */
.medallion {
  --mw: min(74vw, 290px);
  position: relative;
  width: var(--mw);
  aspect-ratio: 440 / 484;
  margin: 10px auto 0;
}
.medallion-orn { position: absolute; inset: 0; color: var(--sage); }
.medallion-orn svg { width: 100%; height: 100%; overflow: visible; }
.medallion-text {
  position: absolute; inset: 18.55% 10% 21.1% 10.74%; /* + 0.6 px down: measured */
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: var(--sage);
  font-kerning: none;
}
.medallion-text > span { display: block; white-space: nowrap; }
.md-day, .md-year { font-family: var(--font-num-box); font-style: normal; line-height: 0.72; }
.md-day { font-size: calc(var(--mw) * 0.29); translate: -0.1105em 0; }
.md-month { font-size: calc(var(--mw) * 0.11); line-height: 0.76; translate: -0.013em 0.0905em; margin-top: calc(var(--mw) * 0.05); }
.md-year { font-size: calc(var(--mw) * 0.095); translate: -0.0725em 0; margin-top: calc(var(--mw) * 0.05); letter-spacing: 0; }
.when {
  font-size: clamp(22px, 6.2vw, 28px);
  color: var(--sage);
  margin-top: 8px;
}
.when .num { font-style: italic; }
.when .clock { white-space: nowrap; }
.when .ampm { font-size: 0.82em; letter-spacing: 0.04em; margin-inline-start: 0.16em; } /* the slanted figures eat the space before PM */
.when .dot { font-family: var(--font-figure); padding-inline: 0.15em; }

.countdown { margin: 26px auto 0; max-width: 25rem; }
.cd-title {
  font-size: clamp(26px, 7vw, 34px); line-height: 1.15; color: var(--sage-deep);
  margin-bottom: 10px;
}
.cd-title:empty { display: none; }
.cd-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(6px, 2.4vw, 14px);
}
.cd-cell {
  position: relative;
  display: flex; flex-direction: column; align-items: center;
  min-width: 0;
  color: var(--sage);
}
/* the cartouche: finial on top, pointed foot; the figures sit in its opening.
   The opening's inner box (rasterised from cartouche.svg, viewBox 120x172)
   runs x 14.7 -> 105.2 and y 36.1 -> 149.3: its centre is 49.96% across and
   53.9% down. Owner round 3, note 4: the figures are set in "Youth Num"
   (tokens.css), whose line box at line-height 1 is centred on the ink, so
   centring the box centres the figures; each figure's ink is placed in its
   fixed slot by countdown.js (placeInk). */
.cd-card {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 120 / 172;
}
.cd-frame { position: absolute; inset: 0; color: var(--sage); }
.cd-frame svg { width: 100%; height: 100%; overflow: visible; }
.cd-num {
  position: absolute; left: 49.96%; top: 53.9%;
  transform: translate(-50%, -50%);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-num-box);
  font-size: clamp(26px, 7.6vw, 40px);
  line-height: 1;
  font-style: normal; font-kerning: none;
  color: var(--sage-deep);
  perspective: 240px;
}
/* fixed-width slots: tabular, so nothing shifts when a figure changes */
.cd-slot { position: relative; display: block; flex: none; width: 0.6em; height: 1em; }
.cd-digit {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  line-height: 1;
  backface-visibility: hidden;
  transform-origin: 50% 50%;
  will-change: transform, opacity;
}
.cd-unit {
  position: relative;
  margin-top: 6px;
  font-size: clamp(15px, 4.2vw, 17px);
  letter-spacing: 0.04em;
  color: var(--ink);
  white-space: nowrap;
}
.cd-caption { font-size: 18px; color: var(--ink-soft); margin-top: 12px; }
.cd-caption:empty { display: none; }
/* on the day itself the days cartouche has nothing left to count */
.countdown[data-state="today"] .cd-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 78%; margin-inline: auto; }
.countdown[data-state="today"] .cd-cell:first-child { display: none; }
.countdown[data-state="now"] .cd-title,
.countdown[data-state="after"] .cd-title { font-size: clamp(30px, 8.4vw, 42px); margin-top: 6px; }

.cal { margin-top: 26px; }
.cal-label {
  font-size: 15px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink-soft); margin-bottom: 10px;
}
.cal-actions { display: grid; grid-template-columns: 1fr; gap: 10px; max-width: 22rem; margin-inline: auto; }
@media (min-width: 480px) { .cal-actions { grid-template-columns: 1fr 1fr; max-width: none; } }
.cal-actions .btn { white-space: nowrap; }

/* ---- buttons: letterpress pills with a double hairline ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 54px; padding: 0 20px;
  border: 0; border-radius: 999px;
  font-family: var(--font-body); font-size: 19px; line-height: 1.1;
  text-decoration: none; text-align: center;
  cursor: pointer;
  transition: transform calc(var(--dur-quick) * var(--tempo)) var(--ease-out), background-color calc(var(--dur-quick) * var(--tempo)) var(--ease-out), box-shadow calc(var(--dur-quick) * var(--tempo)) var(--ease-out);
  touch-action: manipulation;
}
.btn:active { transform: scale(0.98); }
.btn-primary {
  background: var(--sage-deep);
  color: var(--paper-light);
  box-shadow:
    inset 0 0 0 3px var(--sage-deep),
    inset 0 0 0 4px rgba(248, 237, 228, 0.5),
    0 1px 0 rgba(255, 250, 246, 0.6),
    0 12px 24px -16px rgba(60, 66, 42, 0.7);
}
.btn-primary:hover { background: #565e41; box-shadow: inset 0 0 0 3px #565e41, inset 0 0 0 4px rgba(248, 237, 228, 0.5), 0 1px 0 rgba(255, 250, 246, 0.6), 0 14px 26px -16px rgba(60, 66, 42, 0.75); }
.btn-primary[disabled] { cursor: progress; opacity: 0.86; }
.btn-ghost {
  background: #f6e2da;
  color: var(--ink);
  box-shadow:
    inset 0 0 0 1px var(--hair),
    inset 0 0 0 3.5px #f6e2da,
    inset 0 0 0 4.5px var(--hair-soft),
    0 1px 0 rgba(255, 250, 246, 0.6);
}
.btn-ghost:hover { background: #f9e9e2; box-shadow: inset 0 0 0 1px var(--sage), inset 0 0 0 3.5px #f9e9e2, inset 0 0 0 4.5px var(--hair), 0 1px 0 rgba(255, 250, 246, 0.6); }
.btn-wide { width: 100%; }
.btn.is-busy .btn-label::after { content: "…"; font-family: var(--font-figure); }
/* the drawn line icons (assets/ornaments/icon-*.svg) sit before the label in the button's own colour */
.btn .btn-orn {
  width: 22px; height: 22px; flex: none; margin-inline-end: 10px;
  overflow: visible; color: inherit;
}
.btn-ghost .btn-orn { color: var(--sage-deep); }
/* the sprig pressed beside "Send my reply": every tone of the ornament becomes the button's ink */
.btn .btn-orn-sprig {
  width: 42px; height: 14px; margin-inline-end: 12px;
  --orn-ink: currentColor; --orn-soft: currentColor; --orn-sage-light: currentColor; --orn-line: currentColor;
  --orn-rose: currentColor; --orn-rose-deep: currentColor; --orn-rose-light: currentColor;
  opacity: 0.92;
}
.link-btn {
  background: none; border: 0; cursor: pointer;
  min-height: 44px; padding: 0 10px; margin-top: 10px;
  font-size: 18px; color: var(--ink);
  text-decoration: underline; text-decoration-color: var(--hair);
  text-underline-offset: 5px; text-decoration-thickness: 1px;
}

/* ---- 3 · The place ---- */
.venue { display: flex; flex-direction: column; align-items: center; gap: 0; margin-bottom: 16px; }
.venue-name { font-size: clamp(28px, 7.6vw, 36px); line-height: 1.15; color: var(--sage-deep); }
.venue-area { font-size: clamp(24px, 6.2vw, 26px); color: var(--sage); }
.map-card { margin: 0 auto; max-width: 30rem; }
.map-frame {
  position: relative;
  padding: 10px;
  border-radius: 16px;
  /* the same paper as the page (no lighter box), opaque so the falling
     leaves pass behind the map, never over it */
  background: var(--paper-tex);
  box-shadow:
    inset 0 0 0 1px var(--hair),
    inset 0 0 0 5px var(--paper),
    inset 0 0 0 6px var(--hair-soft);
}
.map-art-wrap { position: relative; aspect-ratio: 400 / 340; }
.map-draw { position: absolute; inset: 0; }
.map-art { width: 100%; height: 100%; color: var(--sage); direction: ltr; }
/* the pen's line (draw.js draws it, then the art inks in under it) */
.map-art .orn-draw { opacity: 0; }
.map-art .orn-draw path { fill: none; stroke: var(--sage); stroke-width: 1.1; stroke-linecap: round; stroke-linejoin: round; }
/* the compass rose from the ornament set, top right of the card */
.map-compass { position: absolute; left: 79%; top: 3%; width: 16%; aspect-ratio: 1; color: var(--sage); }
.map-compass svg { width: 100%; height: 100%; overflow: visible; }
.map-art path, .map-art circle { fill: none; stroke: currentColor; stroke-width: 1.2; stroke-linecap: round; stroke-linejoin: round; }
.map-art .thin { stroke-width: 0.6; }
.map-art .fill { fill: var(--sage-soft); }
.map-dunes path { stroke: var(--sage-soft); stroke-width: 1; }
.map-road-edge { stroke: var(--sage-deep) !important; stroke-width: 12 !important; }
.map-road-fill { stroke: #f6e3dc !important; stroke-width: 9.2 !important; }
.map-road-mid { stroke: var(--sage-soft) !important; stroke-width: 0.8 !important; }
.map-art .map-road-guide { stroke: none !important; fill: none; }
.map-palm path { stroke: var(--sage); stroke-width: 1.3; }
.map-sprig path { stroke: var(--sage-soft); stroke-width: 1.1; }
.map-art text {
  font-family: var(--font-body); fill: var(--ink) !important; stroke: none;
  opacity: 0; transition: opacity calc(0.9s * var(--tempo)) var(--ease-out) calc(1.1s * var(--tempo));
}
.map-road-label { font-size: 15.5px; letter-spacing: 0.05em; }
.map-end { font-size: 14.5px; }
.map-n { font-size: 15.5px; }
#place.is-drawing .map-art text, #place.is-drawn .map-art text { opacity: 1; }
.map-pin {
  position: absolute; left: var(--px); top: var(--py);
  width: 34px; height: 48px;
  transform: translate(-50%, -94%);
  pointer-events: none;
}
.map-pin-drop {
  position: absolute; inset: 0;
  transform: translateY(-34px); opacity: 0;
  transition: transform calc(0.72s * var(--tempo)) var(--ease-bloom), opacity calc(0.4s * var(--tempo)) var(--ease-out);
  filter: drop-shadow(0 2px 1.5px rgba(80, 60, 50, 0.25));
}
.map-pin-drop svg { width: 100%; height: 100%; }
.map-pin-shadow {
  position: absolute; left: 50%; bottom: -4px; width: 18px; height: 6px;
  margin-left: -9px; border-radius: 50%;
  background: rgba(95, 103, 73, 0.28);
  transform: scale(0.3); opacity: 0;
  transition: transform calc(0.72s * var(--tempo)) var(--ease-out), opacity calc(0.5s * var(--tempo)) var(--ease-out);
}
#place.is-drawn .map-pin-drop { transform: none; opacity: 1; }
#place.is-drawn .map-pin-shadow { transform: none; opacity: 1; }
.map-caption { margin-top: 14px; font-size: 20px; color: var(--ink); }
.address { font-size: 16px; color: var(--ink-soft); margin: 4px auto 22px; max-width: 22em; }
.map-actions { display: grid; gap: 10px; max-width: 30rem; margin-inline: auto; }
.map-actions-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.map-actions-row .btn { padding-inline: 10px; white-space: nowrap; font-size: clamp(17px, 4.9vw, 19px); }
.sunset {
  display: flex; flex-direction: column; align-items: center;
  margin-top: 28px; color: var(--ink);
}
.sunset-mark { width: 46px; height: 23px; margin-bottom: 6px; fill: none; stroke: var(--sage); stroke-width: 1.3; stroke-linecap: round; }
.sunset-time { font-size: 19px; }
.sunset-golden { font-size: 19px; color: var(--ink); }
.sunset-golden:empty { display: none; }

/* ---- 4 · RSVP: the reply card tucked into the invitation ---- */
.reply-card {
  position: relative;
  max-width: 30rem;
  margin: 22px auto 0;
  padding: 34px 22px 30px;
  /* owner round 2, note 4: the reply card is the same paper, its frame does
     the drawing; opaque so the falling leaves pass behind the form */
  background: var(--paper-tex);
  border-radius: 6px;
  text-align: start;
}
.reply-card:focus-within { transform: none; }
.reply-frame {
  position: absolute; inset: 9px; pointer-events: none; color: var(--sage);
  border: 1px solid var(--hair-soft); border-radius: 3px;
}
.reply-card.has-frame .reply-frame { display: none; }
.reply-card.has-frame { padding: 52px 26px 46px; }
.reply-card > .orn-frame-host { z-index: 0; }
.reply-frame svg { width: 100%; height: 100%; overflow: visible; }
.reply-form, .reply-done { position: relative; }

.field { margin-bottom: 18px; }
.field label, .field .label {
  display: block; font-size: 18px; color: var(--ink); margin-bottom: 6px;
}
.opt { font-size: 15px; color: var(--ink-soft); margin-inline-start: 4px; }
input[type="text"], input[type="tel"], textarea {
  display: block; width: 100%;
  font-family: var(--font-body); font-size: 19px; line-height: 1.4;
  color: var(--ink);
  background: rgba(255, 250, 246, 0.62);
  border: 0;
  border-bottom: 1.2px solid var(--hair);
  border-radius: 8px 8px 3px 3px;
  padding: 12px 14px;
  min-height: 52px;
  transition: background-color calc(var(--dur-quick) * var(--tempo)) var(--ease-out), box-shadow calc(var(--dur-quick) * var(--tempo)) var(--ease-out);
  -webkit-appearance: none; appearance: none;
}
/* The Youth's "+" is a tiny raised mark ("·20 100…"): the plus comes from a
   plain serif at figure height (AMPlus, or Georgia/serif when the system has
   no Georgia — YouthFig is The Youth WITHOUT its "+"), the figures stay The
   Youth. Reggie goes first: WebKit sizes the field from the first font's line
   metrics, and The Youth's tall ones made it 90px on iPhone (r2 review). */
input[type="tel"] { font-family: "Reggie", "AMPunct", "AMPlus", "YouthFig", Georgia, serif; letter-spacing: 0.02em; }
textarea { resize: none; min-height: 96px; }
input:focus, textarea:focus {
  background: rgba(255, 252, 249, 0.92);
  box-shadow: 0 0 0 1.5px var(--sage);
  border-bottom-color: transparent;
  outline: none;
}
input[aria-invalid="true"] { box-shadow: 0 0 0 1.5px var(--rose-deep); }
.field-err { font-size: 16px; color: var(--error); margin-top: 6px; }
.field-err:empty { display: none; }

.choices { border: 0; padding: 0; margin: 4px 0 18px; display: grid; gap: 10px; min-width: 0; }
.choice {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  min-height: 58px; padding: 8px 14px 8px 10px;
  border-radius: 999px;
  background: rgba(255, 250, 246, 0.42);
  box-shadow: inset 0 0 0 1px var(--hair-soft);
  font-size: clamp(18px, 5vw, 21px); color: var(--ink);
  cursor: pointer;
  transition: background-color calc(var(--dur-quick) * var(--tempo)) var(--ease-out), box-shadow calc(var(--dur-quick) * var(--tempo)) var(--ease-out);
}
.choice input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.choice:has(input:checked) {
  background: rgba(255, 252, 249, 0.85);
  box-shadow: inset 0 0 0 1.5px var(--sage-deep), 0 8px 18px -14px rgba(95, 103, 73, 0.6);
}
.choice:has(input:focus-visible) { outline: 1.5px solid var(--sage-deep); outline-offset: 4px; }
.mark { width: 34px; height: 34px; flex: none; }
.mark svg { width: 100%; height: 100%; overflow: visible; }
/* the ornament agent's bud → bloom */
.mark.is-orn { position: relative; }
.mark.is-orn svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.mk-orn-bud, .mk-orn-bloom { transform-origin: 50% 60%; }
.mk-orn-bud { transition: transform calc(var(--dur-base) * var(--tempo)) var(--ease-out), opacity calc(var(--dur-quick) * var(--tempo)) var(--ease-out); }
.mk-orn-bloom {
  opacity: 0; transform: scale(0.35) rotate(-35deg);
  transition: transform calc(var(--dur-slow) * var(--tempo)) var(--ease-bloom), opacity calc(var(--dur-quick) * var(--tempo)) var(--ease-out);
}
.choice input:checked ~ .mark .mk-orn-bud { opacity: 0; transform: scale(0.55); }
.choice input:checked ~ .mark .mk-orn-bloom { opacity: 1; transform: none; }

.stepper-field { text-align: start; }
.stepper { display: inline-flex; align-items: center; gap: 18px; }
.step {
  width: 50px; height: 50px; border-radius: 50%;
  display: grid; place-items: center;
  border: 0; cursor: pointer;
  background: rgba(255, 250, 246, 0.55);
  box-shadow: inset 0 0 0 1px var(--hair);
  touch-action: manipulation;
  transition: transform calc(var(--dur-quick) * var(--tempo)) var(--ease-out), opacity calc(var(--dur-quick) * var(--tempo)) var(--ease-out);
}
.step:active { transform: scale(0.94); }
.step[disabled] { opacity: 0.35; cursor: default; }
.step svg { width: 22px; height: 22px; fill: none; stroke: var(--sage-deep); stroke-width: 1.6; stroke-linecap: round; }
.step-val { min-width: 1.4em; text-align: center; font-size: 36px; line-height: 1; color: var(--sage-deep); }
.hint { font-size: 15px; color: var(--ink-soft); margin-top: 6px; }

.form-err {
  font-size: 17px; line-height: 1.45; color: var(--error);
  background: rgba(201, 151, 143, 0.16);
  border-inline-start: 2px solid var(--rose-deep);
  border-radius: 4px;
  padding: 10px 14px; margin: 0 0 14px;
}

.reply-done { text-align: center; padding: 4px 0 2px; outline: none; }
.done-title { font-size: 17px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 4px; }
.bloom {
  position: relative;
  width: min(100%, 330px);
  aspect-ratio: 320 / 180;
  margin: 0 auto 12px;
  display: grid; place-items: center;
}
.bloom-orn { position: absolute; inset: 0; color: var(--sage); }
.bloom-orn svg { width: 100%; height: 100%; overflow: visible; }
.bloom-name {
  position: relative; max-width: 66%;
  font-size: clamp(26px, 7.6vw, 34px); line-height: 1.1;
  color: var(--sage-deep);
  overflow-wrap: anywhere;
}
/* the rosette (assets/ornaments/bloom.svg): a square flower, the name in its heart */
.bloom.is-rosette {
  width: min(100%, 318px);
  aspect-ratio: 1;
  margin: -4px auto 4px;
}
.bloom.is-rosette .bloom-name {
  max-width: 40%;
  font-size: 30px; line-height: 1.02;
  text-wrap: balance;
  overflow-wrap: break-word;
}
.bloom.is-rosette .bloom-name[data-len="m"] { font-size: 24px; }
.bloom.is-rosette .bloom-name[data-len="l"] { font-size: 19px; line-height: 1.06; }
.bloom.is-rosette .bloom-name[data-len="xl"] { font-size: 16px; line-height: 1.08; }
.done-msg { font-size: clamp(22px, 6.2vw, 28px); line-height: 1.25; color: var(--sage-deep); max-width: 18em; margin: 0 auto; }
.done-detail { font-size: 18px; color: var(--ink-soft); margin-top: 8px; word-spacing: 0.12em; } /* The Youth's italic figures overhang the space after them */
.reply-done .cal { margin-top: 22px; }

/* ---- 5 · Closing: the monogram pressed into sage wax ---- */
.chapter-closing { text-align: center; padding-block: 64px 36px; }
.seal {
  position: relative;
  width: 148px; height: 148px;
  margin: 0 auto 28px;
  filter: drop-shadow(0 3px 2px rgba(60, 66, 42, 0.22)) drop-shadow(0 16px 18px rgba(60, 66, 42, 0.18));
}
.seal-wax { width: 100%; height: 100%; }
.seal-mono {
  position: absolute; inset: 27%;
  filter: drop-shadow(0.8px 0.9px 0 rgba(178, 186, 150, 0.7)) drop-shadow(-0.7px -0.8px 0 rgba(44, 50, 32, 0.55));
}
.seal-mono-mask {
  position: absolute; inset: 0;
  background: #616a4a;
  -webkit-mask: var(--mono, none) center / contain no-repeat;
  mask: var(--mono, none) center / contain no-repeat;
}
.motion .seal { transform: scale(1.14) rotate(-6deg); opacity: 0; }
.motion #closing.is-pressed .seal {
  transform: none; opacity: 1;
  transition: transform calc(0.9s * var(--tempo)) var(--ease-out), opacity calc(0.5s * var(--tempo)) var(--ease-out);
}
.with-love {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  font-size: clamp(24px, 6.6vw, 30px); color: var(--sage);
}
.sprig { display: block; width: 58px; aspect-ratio: 72 / 24; flex: none; color: var(--sage); }
.sprig svg { width: 100%; height: 100%; overflow: visible; }
.sprig-flip { transform: scaleX(-1); }
[dir="rtl"] .sprig { transform: scaleX(-1); }
[dir="rtl"] .sprig-flip { transform: none; }
.closing-names {
  font-size: clamp(48px, 14vw, 88px); line-height: 1.05;
  color: var(--sage-deep); margin: 6px 0 12px;
}
.closing-names .amp { font-family: var(--font-figure); color: var(--rose-deep); font-size: 0.72em; padding-inline: 0.04em; }
/* one copy string; Reggie has no digits, so the figures fall through to The Youth */
.closing-date { font-family: var(--font-body); font-size: clamp(24px, 6.4vw, 28px); color: var(--sage); }

.site-foot {
  /* not positioned: the leaf pile (chapters.js) lies over its last line, and
     the strip of paper under the line is the ground the leaves rest on */
  text-align: center;
  padding: 18px var(--pad) calc(46px + env(safe-area-inset-bottom));
  color: var(--ink-soft);
}
.foot-line { font-size: 15px; letter-spacing: 0.16em; }

/* after the day there is nothing left to reply to */
html[data-event-state="after"] #rsvp { display: none; }
.noscript { text-align: center; padding: 24px var(--pad); font-size: 18px; }

/* ---- small phones: the frames keep their line, the content keeps its width ---- */
@media (max-width: 419px) {
  .panel.has-frame { padding-inline: 22px; }
  .panel .cal-actions, .panel .map-actions { padding-inline: 6px; }
  .reply-card.has-frame { padding-inline: 24px; }
  .choice { gap: 10px; }
  .mark { width: 30px; height: 30px; }
}

/* ---- larger screens: same composition, more air ---- */
@media (min-width: 720px) {
  .chapter { padding-block: 80px; }
  .chapter + .chapter { padding-top: 40px; }
  .chapter-season { min-height: 70vh; min-height: 70svh; place-items: center; padding-block: 80px 128px; }
  .panel { padding-inline: 48px; padding-bottom: 56px; }
  /* the frame scales up to 1.22× here: its top and foot rules sit ~83px in */
  .panel.has-frame { padding: 100px 60px 108px; }
  .reply-card { padding: 42px 40px 36px; }
  .ch-orn { width: 240px; }
  .ch-orn-wide { width: 420px; }
  .ch-orn-small { width: 150px; }
}
@media (min-width: 1100px) {
  .panel { max-width: 40rem; }
  .chapter-season { min-height: 100vh; }
}

/* ---- reduced motion: calm, complete, still beautiful ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .reply-card { transform: none; }
}
