/* ---------- Fonts (all free, OFL – licenses in /fonts) ---------- */
@font-face { font-family: 'La Belle Aurore'; font-display: swap; src: url(fonts/la-belle-aurore-latin-400-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'La Belle Aurore'; font-display: swap; src: url(fonts/la-belle-aurore-latin-ext-400-normal.woff2) format('woff2');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Playfair Display'; font-weight: 900; font-display: swap; src: url(fonts/playfair-display-latin-900-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Playfair Display'; font-weight: 900; font-display: swap; src: url(fonts/playfair-display-latin-ext-900-normal.woff2) format('woff2');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Mona Sans'; font-weight: 400; font-display: swap; src: url(fonts/mona-sans-latin-400-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Mona Sans'; font-weight: 400; font-display: swap; src: url(fonts/mona-sans-latin-ext-400-normal.woff2) format('woff2');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Mona Sans'; font-weight: 500; font-display: swap; src: url(fonts/mona-sans-latin-500-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Mona Sans'; font-weight: 500; font-display: swap; src: url(fonts/mona-sans-latin-ext-500-normal.woff2) format('woff2');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }

/* ---------- Tokens (colours taken from the cards) ---------- */
:root {
  --bg: #FFFDF8;
  --frame: #819636;    /* wavy frame */
  --sage: #6C7E53;     /* couple drawing */
  --script: #728A1E;   /* handwriting – large text only (3.9:1) */
  --ink: #111110;
  --gray: #6F6E6C;     /* grey text on the cards, a touch darker for reading (4.9:1) */
  --body: #3A3937;
  --line: #E6E2D5;     /* hairlines */
  --rule: #928E85;     /* paper lines under fields, pill borders (3.2:1) */
  --btn: #5F7048;      /* darker sage: 5.4:1 on cream and under white text */
  --btn-dark: #4A5838;
  --soft: #F1F1E3;     /* sage-tinted hover fill */
  --err: #9A3B26;
  --serif: 'Playfair Display', Georgia, serif;
  --script-font: 'La Belle Aurore', cursive;
  --sans: 'Mona Sans', system-ui, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 17px/1.6 var(--sans); overflow-x: clip; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--btn); outline-offset: 3px; border-radius: 4px; }
[hidden] { display: none !important; }

.caps { text-transform: uppercase; letter-spacing: .04em; }
.script { font-family: var(--script-font); color: var(--script); font-weight: 400; line-height: 1.1; margin: 0; }
/* Handwriting (handwrite() in app.js): a drawn copy writes itself over the real, transparent text */
.script.unwritten, .script.writing { color: transparent; }
.writing { position: relative; }
.handpen { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.handpen text { font: inherit; fill: transparent; stroke: var(--script); stroke-width: 1.2; stroke-linejoin: round; stroke-dasharray: 420; stroke-dashoffset: 420;
  animation: pen .32s ease-in-out forwards, inkfill .25s ease-out forwards; }

/* Text links: thin paper line that turns into a firmer green line when hovered, focused or current */
.link, .menu a, .textbtn, #contact a {
  text-decoration: underline; text-decoration-color: var(--rule); text-decoration-thickness: 1px; text-underline-offset: 5px;
  transition: color .2s, text-decoration-color .2s;
}
.link:focus-visible, .menu a:focus-visible, .textbtn:focus-visible, #contact a:focus-visible,
.link:active, .menu a:active, .textbtn:active { color: var(--btn-dark); text-decoration-color: var(--btn); text-decoration-thickness: 1.5px; }
@media (hover: hover) {
  .link:hover, .menu a:hover, .textbtn:hover, #contact a:hover { color: var(--btn-dark); text-decoration-color: var(--btn); text-decoration-thickness: 1.5px; }
}

/* ---------- Top bar ---------- */
.top { position: sticky; top: 0; z-index: 10; display: flex; justify-content: space-between; align-items: center;
  gap: 6px; padding: 6px 12px; min-height: 56px; background: rgb(255 253 248 / .86); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.mono { margin-right: auto; display: inline-flex; align-items: center; min-height: 44px; padding: 0 8px; font: 900 22px/1 var(--serif); text-decoration: none; transition: color .2s, transform .2s; }
.mono img, .foot-names img, .hero-names img { display: inline-block; height: .95em; width: auto; margin: 0 .08em; vertical-align: -.12em; }
.mono:active { transform: scale(.96); }
.lang { display: flex; align-items: center; }
.lang button { border: 0; background: none; min-width: 40px; min-height: 44px; padding: 0 6px; cursor: pointer;
  font-weight: 500; font-size: 13px; letter-spacing: .1em; color: var(--gray); transition: color .2s;
  text-decoration: underline; text-decoration-color: transparent; text-decoration-thickness: 1.5px; text-underline-offset: 5px; }
.lang button[aria-pressed="true"] { color: var(--ink); text-decoration-color: var(--btn); cursor: default; }
@media (hover: hover) {
  .mono:hover { color: var(--btn); }
  .lang button:not([aria-pressed="true"]):hover { color: var(--ink); }
}

/* ---------- Hero: headline, names, date, RSVP – then the day told as a story along a dotted pen line ---------- */
.hero { padding: 40px 20px 0; text-align: center; }
/* names lead; the handwriting finishes the sentence: "Julia & Wiktor are getting married!" */
.hero-names { font: 900 clamp(38px, 10.5vw, 72px)/1.05 var(--serif); letter-spacing: -.01em; margin: 0; }
.hero-title { font-size: clamp(30px, 8.5vw, 46px); margin: 4px 0 .55em; text-wrap: balance; }  /* room for the g's tail */
.hero-when { font: 900 clamp(20px, 5.5vw, 26px)/1.25 var(--serif); margin: 0 0 4px; }
.hero-place { margin: 0 0 24px; font-size: 14px; color: var(--gray); letter-spacing: .1em; }
#countdown:not(:empty)::before { content: ' · '; }
.hero-by { margin: 14px 0 0; font-size: 13px; color: var(--gray); letter-spacing: .08em; }
.story { position: relative; max-width: 420px; margin: 36px auto 0; view-timeline: --story; }
.story ol { position: relative; z-index: 1; list-style: none; margin: 0; padding: 16px 0 64px; display: grid; gap: 20px; }   /* above the dotted line */
.story li { display: flex; align-items: center; gap: 10px; width: 84%; text-align: left; }
.story li:nth-child(even) { justify-self: end; flex-direction: row-reverse; text-align: right; }
.story img { flex: none; width: 112px; background: var(--bg); }   /* cream behind each doodle hides the dots (no border-radius: it would crop the drawing) */
.story li:last-child img { width: 146px; }
.story p { margin: 0; padding: 2px 4px; background: var(--bg); }
.story .script { display: block; font-size: clamp(28px, 7.5vw, 34px); }
.story .caps { display: block; font-size: 13px; letter-spacing: .1em; color: var(--gray); }
.story-path { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none;
  fill: none; stroke: var(--frame); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 0 10; }
.story-path mask path { stroke: #fff; stroke-width: 14; stroke-dasharray: 1; }   /* reveals the dotted line; animated below */
@media (hover: hover) { .story img { transition: transform .3s; } .story li:hover img { transform: rotate(-5deg) scale(1.06); } }

/* Menu: hidden on phones until the menu button opens it as a full-screen sheet; links in the bar on desktop */
.menu { display: none; }
.menu-btn { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; border: 0; background: none; color: var(--btn); cursor: pointer; }
.menu-btn svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.menu-btn[aria-expanded="true"] .i-open, .menu-btn[aria-expanded="false"] .i-close { display: none; }
.menu-open { overflow: hidden; }                                    /* on <html>: no page scroll behind the sheet */
.menu-open .top { background: var(--bg); backdrop-filter: none; -webkit-backdrop-filter: none; }
.menu-open .menu { position: fixed; inset: 56px 0 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 24px 20px 72px; background: var(--bg); }
.menu-open .menu > a { min-height: 56px; font-size: 16px; }   /* same caps links as desktop, a bit bigger for thumbs */
.menu a[aria-current] { color: var(--ink); }
.menu a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 4px; text-transform: uppercase; font-size: 13px; font-weight: 500; letter-spacing: .1em; color: var(--gray);
  text-decoration: none; transition: color .2s, background-size .35s ease-out;
  background: linear-gradient(var(--btn), var(--btn)) 0 calc(50% + .95em) / 0 1.5px no-repeat; background-origin: content-box; background-clip: content-box; }
.menu a[aria-current], .menu a:focus-visible, .menu a:active { background-size: 100% 1.5px; }   /* the green pen line draws in left to right */
@media (hover: hover) { .menu a:hover { background-size: 100% 1.5px; } }


/* ---------- Sections ---------- */
.section { position: relative; max-width: 640px; margin: 0 auto; padding: 64px 20px; text-align: center; scroll-margin-top: 48px; }
.section h2.script { font-size: clamp(44px, 11vw, 66px); margin: 4px 0 22px; text-wrap: balance; }
.lead { font-size: 14px; color: var(--gray); letter-spacing: .08em; margin: 0 0 20px; text-wrap: balance; }
#plan .lead, #traditions .lead { color: var(--ink); font-size: 15px; }
#traditions .lead { margin-bottom: 6px; }
.text { max-width: 30em; margin: 0 auto 20px; text-wrap: pretty; color: var(--body); }

/* Section titles with a doodle on each side (The day, RSVP) */
.doodle-title { display: flex; align-items: center; justify-content: center; gap: clamp(8px, 3vw, 18px); margin: 4px 0 26px; }
.doodle-title img { width: clamp(52px, 14vw, 72px); translate: 0 calc(clamp(44px, 11vw, 66px) * -.22); }   /* centre on the letters, not the box (handwriting sits high; only the tails hang below) */
.doodle-title .stamp { width: clamp(62px, 17vw, 88px); }
.doodle-title h2.script { margin: 0; }
@media (max-width: 899px) {   /* long titles ("potwierdź obecność"): doodles side by side above, title gets the full width */
  .doodle-title.stack { flex-wrap: wrap; gap: 0 48px; margin-bottom: 18px; }
  .doodle-title.stack h2.script { flex-basis: 100%; order: 2; }
  .doodle-title.stack img { translate: none; }
}

/* The day: plain paper; a drawn building per place, an arrow carries the note between them */
.event { margin: 0; }
.event .place { width: 150px; margin: 0 auto 10px; }
.event .label { margin: 0; font-size: 15px; font-weight: 500; letter-spacing: .1em; }
.label .time:not(:empty)::after { content: ' · '; }
.venue { font: 900 clamp(24px, 6.5vw, 34px)/1.1 var(--serif); text-transform: uppercase; margin: 6px 0 4px; overflow-wrap: anywhere; }
.addr { margin: 0 0 8px; color: var(--gray); font-size: 15px; }
.link { font-size: 14px; font-weight: 500; text-transform: uppercase; letter-spacing: .1em; color: var(--btn); padding: 8px 2px; }
.after { display: grid; grid-template-columns: auto auto; justify-content: center; align-items: center; gap: 6px; margin: 18px 0 22px; }
.after .arrow-across { display: none; }
.after .arrow-down { width: 84px; }
.after .script { font-size: clamp(26px, 7vw, 32px); white-space: pre-line; text-align: left; }
#calendar { margin-top: 40px; }

/* ---------- Buttons: hand-drawn boxes (uneven corners make each look inked, like the doodles) ---------- */
:root { --drawn: 255px 15px 225px 15px / 15px 225px 15px 255px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 28px; border-radius: var(--drawn);
  border: 2px solid var(--btn); background: var(--btn); color: #fff; cursor: pointer; text-decoration: none;
  font-size: 14px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; text-align: center;
  transition: background-color .2s, border-color .2s, color .2s, transform .15s, box-shadow .2s; }
.btn.ghost { background: transparent; color: var(--btn); }
.btn:active { transform: translateY(0) scale(.97); box-shadow: none; }
.btn:disabled { opacity: .5; cursor: progress; transform: none; box-shadow: none; }
.btn:focus-visible { outline-offset: 4px; }
.textbtn { border: 0; background: none; padding: 10px 4px; min-height: 44px; color: var(--gray); cursor: pointer; font-size: 15px; }
.copy { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 0 16px; border: 1.5px solid var(--rule); border-radius: var(--drawn); background: transparent;
  color: var(--btn); font-size: 13px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: background-color .2s, border-color .2s, color .2s, transform .15s; }
.copy:active { transform: scale(.95); }
@media (hover: hover) {
  .btn:hover { background: var(--btn-dark); border-color: var(--btn-dark); transform: rotate(-1deg); }   /* a little nudge, like paper */
  .btn.ghost:hover { background: var(--soft); color: var(--btn-dark); }
  .btn:disabled:hover { background: var(--btn); border-color: var(--btn); transform: none; box-shadow: none; }
  .btn.ghost:disabled:hover { background: transparent; }
  .copy:hover { border-color: var(--btn); background: var(--soft); color: var(--btn-dark); }
}

/* ---------- RSVP: a reply card in a hand-drawn box (like the buttons); a paper plane flies off its corner ---------- */
#rsvp .lead { margin-bottom: 64px; }
.reply { position: relative; max-width: 580px; margin: 0 auto; }
.reply .plane { position: absolute; right: -8px; top: -62px; width: 60px; }
.reply .trail { position: absolute; right: 44px; top: -38px; width: 110px; }
.panel { position: relative; text-align: left; padding: 24px 20px 22px; border: 2px solid var(--btn); border-radius: var(--drawn); }
.panel h3 { margin: 0 0 18px; font: 900 22px/1.25 var(--serif); overflow-wrap: anywhere; }
.panel .kicker { margin: 0; font-size: 13px; color: var(--gray); text-transform: uppercase; letter-spacing: .1em; }
.field { display: block; margin: 0 0 16px; }
.field > span { display: block; font-size: 13px; font-weight: 500; text-transform: uppercase; letter-spacing: .1em; color: var(--gray); margin-bottom: 2px; transition: color .2s; }
.field:focus-within > span { color: var(--btn); }
.input { --ul: var(--rule); width: 100%; min-height: 48px; padding: 10px 4px 9px; border: 0; border-radius: 0; -webkit-appearance: none; appearance: none; color: var(--ink);
  background: linear-gradient(var(--btn), var(--btn)) center bottom / 0 2px no-repeat, linear-gradient(var(--ul), var(--ul)) center bottom / 100% 1.5px no-repeat;
  transition: background-size .3s ease; }
.input::placeholder { color: #8F8C84; }
.input:focus { outline: none; background-size: 100% 2px, 100% 1.5px; }
.input[aria-invalid="true"] { --ul: var(--err); }
textarea.input { min-height: 128px; line-height: 32px; padding: 0 4px 1px; resize: vertical;
  background: linear-gradient(var(--btn), var(--btn)) center bottom / 0 2px no-repeat, linear-gradient(var(--ul), var(--ul)) center bottom / 100% 1.5px no-repeat,
    repeating-linear-gradient(transparent 0 30.5px, var(--line) 30.5px 32px) 0 0 / 100% 32px;
  background-attachment: scroll, scroll, local; }
@media (hover: hover) { .input:hover { --ul: var(--gray); } .input[aria-invalid="true"]:hover { --ul: var(--err); } }
.codeform { display: flex; gap: 12px 10px; flex-wrap: wrap; align-items: flex-end; }
.codeform .input { flex: 1 1 180px; min-width: 0; }
.codeform .btn { flex: 1 0 auto; }
.help { font-size: 15px; color: var(--gray); margin: 14px 0 0; text-wrap: pretty; }
.guest { border-top: 1px solid var(--line); padding: 18px 0 6px; }
.guest:first-of-type { border-top: 0; padding-top: 0; }
.guest .who { font-weight: 500; font-size: 18px; margin: 0 0 10px; }
.choice { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; border: 0; padding: 0; min-width: 0; }
.choice label { position: relative; }
.choice input { position: absolute; opacity: 0; inset: 0; margin: 0; pointer-events: none; }
.choice span { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 18px; border: 1.5px solid var(--rule); border-radius: 999px;
  cursor: pointer; font-size: 15px; background: var(--bg); transition: background-color .18s, border-color .18s, color .18s, transform .15s; }
.choice input:checked + span { border-color: var(--btn); background: var(--btn); color: #fff; }
.choice input:focus-visible + span { outline: 2px solid var(--btn); outline-offset: 3px; }
.choice label:active span { transform: scale(.96); }
.choice.invalid span { border-color: var(--err); }
@media (hover: hover) { .choice label:hover input:not(:checked) + span { border-color: var(--btn); background: var(--soft); } }
.msg { margin: 12px 0 0; font-size: 15px; color: var(--err); }
.done { text-align: center; padding-top: 8px; }
.done .script { font-size: clamp(44px, 12vw, 56px); }
.summary { list-style: none; padding: 0; margin: 14px 0 20px; color: var(--gray); }
.summary li { padding: 4px 0; }
.summary b { color: var(--ink); font-weight: 500; }

/* ---------- Gifts ---------- */
/* the gift box and the envelope flank the title; a hand-drawn arrow arches over it from one to the other */
.gift-title { --i: clamp(60px, 16vw, 86px); position: relative; display: inline-block; margin-top: calc(var(--i) * .42); }
.gift-title .doodle-title img { width: var(--i); }
.gift-title .over { position: absolute; left: calc(var(--i) / 2); width: calc(100% - var(--i)); height: auto; bottom: calc(100% + var(--i) * .15); }
.details { text-align: left; max-width: 520px; margin: 0 auto; padding: 6px 18px; border: 2px solid var(--btn); border-radius: var(--drawn); }
.detail { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.detail:last-child { border-bottom: 0; }
.detail dt { grid-column: 1 / -1; font-size: 13px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: var(--gray); }
.detail dd { margin: 0; font-size: 17px; overflow-wrap: anywhere; }

/* ---------- Travel ---------- */
.doodle-title .train { width: clamp(72px, 20vw, 110px); }
.tips { display: grid; gap: 28px; max-width: 32em; margin: 6px auto 0; }
.tips img, #traditionList img { width: clamp(44px, 12vw, 56px); height: auto; aspect-ratio: 56 / 44; object-fit: contain; }   /* little doodle per tip */
/* Travel: small groups with a handwritten label; doodle left of each tip (desktop: a group of 3 has the doodle on top) */
.group { font-size: clamp(30px, 8vw, 36px); margin: 26px 0 16px; }
.tips + .group { margin-top: 48px; }
#travelList .tip { display: flex; gap: 14px; align-items: flex-start; text-align: left; }
#travelList .tip img { flex: none; }
.tip h4, #traditionList h4 { margin: 0 0 4px; font-size: 14px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; }
.tip p, #traditionList p { margin: 0; color: var(--body); text-wrap: pretty; }
/* A Polish wedding in a nutshell: a cheat sheet in a hand-drawn box, doodle beside each tradition */
#traditionList .detail { display: flex; align-items: flex-start; gap: 14px; padding: 18px 0; }
.tip .link { display: inline-block; margin-top: 4px; }
.subhead { font: 900 22px/1.2 var(--serif); margin: 40px 0 18px; }

/* ---------- Footer ---------- */
.foot { position: relative; text-align: center; padding: 24px 20px 64px; color: var(--gray); }
.bunting { display: block; width: 100%; max-width: 480px; height: auto; margin: 0 auto 26px; }   /* a garland of little flags */
.bye { font-size: clamp(34px, 9vw, 46px); }
#contact:not(:empty) { margin-top: 26px; }
.foot-names { font: 900 32px/1 var(--serif); color: var(--ink); margin: 26px 0 8px; }
#contact h3 { margin: 0 0 6px; font-size: 14px; font-weight: 500; text-transform: uppercase; letter-spacing: .1em; color: var(--ink); }
#contact p { margin: 0; }

/* ---------- Wider screens ---------- */
@media (min-width: 720px) {
  body { font-size: 18px; }
  .section { padding-block: 88px; }
  .panel { padding: 30px 34px 30px; }
  .reply .plane { right: -30px; top: -70px; width: 72px; }
  .details { padding: 10px 28px; }
  .section { scroll-margin-top: 80px; }
  .lead { font-size: 15px; }
}
/* Desktop: the story runs left to right, stops step up and down */
@media (min-width: 900px) {
  .top { padding-inline: 40px; gap: 14px; }
  .menu { display: flex; gap: 0 22px; position: absolute; left: 50%; transform: translateX(-50%); }   /* centred like the page */
  .menu-btn { display: none; }
  .story { max-width: 1040px; margin-top: 56px; }
  .story ol { grid-template-columns: repeat(5, 1fr); gap: 0 8px; padding-bottom: 80px; }
  .story li, .story li:nth-child(even) { width: auto; flex-direction: column; justify-self: center; text-align: center; }
  .story li:nth-child(even) { margin-top: 72px; }
  .story img { width: 134px; } .story li:last-child img { width: 168px; }
  #rsvp { max-width: 880px; }   /* room for "potwierdź obecność" on one line between the doodles */
  .doodle-title.stack h2.script { white-space: nowrap; }
  /* Travel: "getting there" 2 side by side, "good to know" 3 in a row */
  #travel { max-width: 880px; }
  #travelList .tips { grid-template-columns: repeat(var(--n), 1fr); gap: 40px 48px; max-width: 820px; }
  #travelList .above .tip { flex-direction: column; align-items: center; gap: 8px; text-align: center; }
  /* The day: ceremony | arrow with the note | party */
  #plan { max-width: 1040px; }
  .events { display: grid; grid-template-columns: 1fr 300px 1fr; align-items: start; column-gap: 12px; }
  .events .venue { font-size: 28px; }
  .event .place { width: 170px; height: 132px; object-fit: contain; }
  .after { display: block; position: relative; margin: 46px 0 0; }
  .after .arrow-across { display: block; width: 240px; margin: 0 auto; }
  .after .arrow-down { display: none; }
  .after .script { text-align: center; margin-top: -14px; font-size: 28px; white-space: normal; text-wrap: balance; }   /* two even lines */
}
@media (min-width: 1100px) {
  .top { padding-inline: 64px; }
}

/* ---------- Motion: one entrance, then sections that fade in as you scroll ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }
@keyframes draw { from { stroke-dashoffset: 1; } }
@keyframes fade { from { opacity: 0; } }
@keyframes pen { to { stroke-dashoffset: 0; } }
@keyframes inkfill { to { fill: var(--script); } }
@keyframes swing { 0% { rotate: 0deg; } 20% { rotate: 9deg; } 45% { rotate: -6deg; } 70% { rotate: 3deg; } 100% { rotate: 0deg; } }
@keyframes clink { 0%, 100% { rotate: 0deg; } 35% { rotate: -6deg; } 50% { rotate: 4deg; scale: 1.06; } 70% { rotate: -1deg; } }
@keyframes drive { from { translate: -70px 0; opacity: 0; } 30% { opacity: 1; } 80% { translate: 4px 0; } to { translate: 0 0; } }
@keyframes fly { from { translate: -80px 50px; rotate: -12deg; opacity: 0; } 40% { opacity: 1; } to { translate: 0 0; rotate: 0deg; } }
@keyframes arrive { from { translate: 90px 0; opacity: 0; } 30% { opacity: 1; } 85% { translate: -3px 0; } to { translate: 0 0; } }
@keyframes wave { 0%, 100% { skew: 0deg; } 25% { skew: 0 -5deg; } 50% { skew: 0 3deg; } 75% { skew: 0 -2deg; } }
@keyframes sway { 0%, 100% { rotate: -.8deg; } 50% { rotate: .8deg; } }
@keyframes redraw { 0% { border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px; } 33% { border-radius: 15px 225px 15px 255px / 255px 15px 225px 15px; }
  66% { border-radius: 225px 25px 245px 15px / 25px 245px 15px 225px; } }
@media (prefers-reduced-motion: no-preference) {
  .hero > :not(.story) { animation: rise .8s ease-out .1s both; }
  .menu-open .menu { animation: fade .25s ease-out; }
  /* little stories, once, when scrolled to (app.js adds .seen); things that travel in wait off-stage until then */
  .motion .drive:not(.seen), .motion .fly:not(.seen), .motion .arrive:not(.seen) { opacity: 0; }
  .swing.seen { transform-origin: 50% 0; animation: swing 2.4s ease-in-out .3s; }
  .clink.seen { animation: clink .9s ease-in-out .3s; }
  .drive.seen { animation: drive 1.2s cubic-bezier(.2, .7, .3, 1); }
  .fly.seen { animation: fly 1.4s cubic-bezier(.3, .6, .4, 1); }
  .arrive.seen { animation: arrive 1.4s cubic-bezier(.2, .8, .3, 1); }
  .wave.seen { transform-origin: 18% 100%; animation: wave 1.6s ease-in-out .3s; }
  .bunting { transform-origin: 50% 0; animation: sway 5s ease-in-out infinite; }   /* the garland sways in a slow breeze */
  @media (hover: hover) {
    .btn:not(:disabled):hover, .copy:hover { animation: redraw .5s steps(1) infinite; }   /* the inked box redraws itself */
    .hero > .btn:not(:disabled):hover { animation: rise .8s ease-out .1s both, redraw .5s steps(1) infinite; }   /* keep the hero fade-in, or it replays on unhover */
  }
  @supports (animation-timeline: view()) {
    .section, .foot { animation: rise linear both; animation-timeline: view(); animation-range: entry 0% entry 22%; }
    .story li { animation: rise linear both; animation-timeline: view(); animation-range: entry 0% entry 35%; }
    .story-path mask path { animation: draw linear both; animation-timeline: --story; animation-range: entry 0% entry 100%; }  /* the pen line draws itself as the story scrolls in */
  }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition-duration: 0s !important; } }
