/* ============================================================
   Wedding announcement — Peťula & Mánek
   Palette sampled from the background photo (Eilean Donan, backlit):
     clouds #95908e · forest #434136 · castle stone #827053 · foreground #262011
   ============================================================ */

/* ─────────── 0. FONTS ───────────
   Self-hosted, not fetched from Google. Two reasons: the CDN hands every
   visitor's IP address to a third party before they have read a word, which
   sits badly next to the promise made at the RSVP form; and same-origin
   files need no extra DNS lookup or TLS handshake before text can render.

   Cut straight from what the Google CSS served, unicode-ranges included, so
   the rendering is unchanged. Only the latin and latin-ext subsets are kept
   — Czech needs both (á é í are latin, ě ř ů ď ť ň are latin-ext) and
   nothing else. Licences for both families sit in assets/fonts/.
   Numbered 0 because @font-face has to be declared before it is used. */

/* latin-ext */
@font-face {
  font-family: 'Cardo';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('assets/fonts/cardo-400-italic-latin-ext.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;
}

/* latin */
@font-face {
  font-family: 'Cardo';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('assets/fonts/cardo-400-italic-latin.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;
}

/* latin-ext */
@font-face {
  font-family: 'Cardo';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('assets/fonts/cardo-400-latin-ext.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;
}

/* latin */
@font-face {
  font-family: 'Cardo';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('assets/fonts/cardo-400-latin.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;
}

/* latin-ext */
@font-face {
  font-family: 'Cardo';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('assets/fonts/cardo-700-latin-ext.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;
}

/* latin */
@font-face {
  font-family: 'Cardo';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('assets/fonts/cardo-700-latin.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;
}

/* latin-ext */
@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  /* one variable file covers the whole axis; 400 and 500 are the two
     weights this site asks for, and the range keeps it to those. */
  font-weight: 400 500;
  font-display: swap;
  src: url('assets/fonts/montserrat-variable-latin-ext.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;
}

/* latin */
@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  /* one variable file covers the whole axis; 400 and 500 are the two
     weights this site asks for, and the range keeps it to those. */
  font-weight: 400 500;
  font-display: swap;
  src: url('assets/fonts/montserrat-variable-latin.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;
}


/* ─────────── 1. DESIGN TOKENS ─────────── */
:root {
  /* paper and surfaces */
  --paper:        #f4f0e8;
  /* The parchment sheet every content tab is written on. Opacity is the one
     number to reach for when tuning how much of the photo shows through. */
  --sheet:        rgba(243, 236, 218, 0.80);
  --sheet-burn:   rgba(138, 100, 44, 0.34);   /* scorched edge */
  --sheet-edge:   rgba(120, 92, 46, 0.45);    /* outer rule of the sheet */
  --sheet-edge-2: rgba(120, 92, 46, 0.26);    /* inner hairline */

  /* Ink on the parchment. The sheet is translucent, so the paper under the
     text is not a flat colour: measured across widths from 390 to 2560 px its
     darkest fifth-percentile is L = 0.443. Every value below is solved
     against that worst case, not against the paper's average.

     Hence a deliberately compressed scale — at 6:1 on this ground there is no
     room for a light grey. Hierarchy is carried by size and weight instead,
     and the accent differs in hue rather than in lightness. */
  --ink:          #110f0c;   /* headings, names       — 9.0:1 */
  --ink-2:        #252019;   /* body copy             — 7.6:1 */
  --ink-3:        #29251e;   /* quiet captions        — 6.7:1 */
  --stone:        #333029;   /* story years, rules    — 6.2:1 */
  --bronze:       #312713;   /* accent, labels, links — 6.9:1 */
  /* The one gold, for the single line that sits on the bare photo. Lifted
     towards the light so thin uppercase strokes hold up against the sky. */
  --gold:         #f3ddb6;

  /* Two hairlines, named for what they do rather than how dark they are.
     "line" draws the edge of a panel or a field; "divider" parts the items
     inside one sheet.

     The divider is nominally the stronger of the two, which looks wrong in a
     table and is right on the page: a closed rectangle reads as a boundary
     from its shape alone, while a lone horizontal hairline has nothing to lean
     on. At the 0.09 it started from it could be guessed at rather than seen —
     0.18 puts it at 1.41:1 against the parchment, twice the old contrast, and
     still well short of a hard rule. */
  --line:         rgba(38, 32, 26, 0.16);
  --line-divider: rgba(38, 32, 26, 0.18);

  /* typography */
  --font-serif:   'Cardo', Georgia, 'Times New Roman', serif;
  --font-sans:    'Montserrat', 'Helvetica Neue', Arial, sans-serif;

  /* Type scale — seven steps, nothing outside them.
     --type-scale multiplies every one, including the fluid ones, so "make it
     all bigger" stays a single number. Values here are unscaled.
     The floor is 15 px: a good part of the guest list is of our parents' and
     grandparents' generation. */
  --type-scale:   1.0;
  --fs-display:   calc(clamp(3rem, 11vw, 6rem) * var(--type-scale)); /* names */
  --fs-xl:        calc(clamp(2rem, 6vw, 3rem)  * var(--type-scale)); /* section titles, countdown */
  --fs-lg:        calc(1.75rem   * var(--type-scale));               /* venue name, years */
  --fs-md:        calc(1.375rem  * var(--type-scale));               /* subheads, lead line */
  --fs-body:      calc(1.1875rem * var(--type-scale));               /* copy */
  --fs-small:     calc(1.0625rem * var(--type-scale));               /* secondary copy */
  --fs-label:     calc(0.9375rem * var(--type-scale));               /* uppercase labels, nav — the floor */

  /* Letter-spacing for the uppercase labels — three steps, same idea as the
     type scale. The fluid one is for whole sentences set in caps, which at a
     fixed 0.22em overflow a narrow phone. */
  --track:        0.14em;
  --track-wide:   0.22em;
  --track-fluid:  clamp(0.08em, 1.6vw, 0.22em);

  /* metrics */
  --wrap-max:     46rem;

  /* shadows */
  --shadow:       0 2px 14px rgba(23, 19, 8, 0.10);
  --shadow-lg:    0 6px 26px rgba(23, 19, 8, 0.16);

  /* The arrow-out-of-a-box that marks a link leaving this site. Inlined rather
     than fetched: one more request for 400 bytes is a poor trade, and it can
     never arrive late or fail. Drawn in strokes so it stays crisp at any size,
     and used as a mask, so the glyph takes the colour of the link it follows
     instead of being frozen at one value. */
  --icon-external: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M17 13.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h5.5'/%3E%3Cpolyline points='14 3 21 3 21 10'/%3E%3Cline x1='10' y1='14' x2='21' y2='3'/%3E%3C/svg%3E");
}

/* ─────────── 2. BASE ─────────── */
*, *::before, *::after { box-sizing: border-box; }

/* The browser hides [hidden] with `display: none` from its own stylesheet,
   which ANY author rule setting display outranks. So .countdown{display:flex}
   quietly won over hidden, and after the wedding the countdown stayed on
   screen showing three dashes next to the thank-you note. Caught by rendering
   the page with the date moved into the past.
   This is the one place !important is right: there is no situation where an
   element marked hidden should be visible, and without it every new flex or
   grid rule is a fresh chance to make the same mistake. */
[hidden] { display: none !important; }

html {
  /* no fixed root size — respects the reader's system font setting */
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

/* A column the height of the viewport. The active section then claims
   whatever the navigation bar leaves over, without anyone having to know how
   tall that bar is — which changes with --type-scale, so a hard-coded figure
   would be wrong again after every adjustment. */
body {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  margin: 0;
  font-family: var(--font-serif);
  font-size: var(--fs-body);
  line-height: 1.75;
  color: var(--ink-2);
  background-color: var(--paper);
  overflow-x: hidden;
  /* Force lining figures. Old-style ones, which several of these serifs
     default to, turn 10 into IO and the postcode IV40 into IV4o — no good on
     a page full of times, dates and an account number. */
  font-variant-numeric: lining-nums;
  font-feature-settings: 'lnum' 1, 'onum' 0;
  /* No automatic hyphenation. Czech rules for breaking words are subtle and
     the browser gets them wrong ("na naši svat-bu"). Prepositions are held to
     their noun with non-breaking spaces in the markup instead. */
  hyphens: manual;
  -webkit-hyphens: manual;
}

a { color: var(--bronze); }

/* A link that leaves the site says so before it is clicked, not after. Keyed
   off target="_blank" rather than a class of its own: the mark then cannot
   drift apart from the behaviour it describes, and a link added later gets it
   without anyone having to remember.

   Guarded by @supports because the fallback is ugly rather than merely plain —
   without a working mask the icon would paint as a solid square. */
@supports (mask-image: none) or (-webkit-mask-image: none) {
  a[target="_blank"]::after {
    content: "";
    display: inline-block;
    width: 0.68em;
    height: 0.68em;
    /* a margin, not a space: a space would be a place to break the line, and
       the arrow would end up stranded on its own */
    margin-left: 0.3em;
    vertical-align: -0.02em;
    background-color: currentColor;
    -webkit-mask: var(--icon-external) center / contain no-repeat;
            mask: var(--icon-external) center / contain no-repeat;
  }
}

img { max-width: 100%; height: auto; display: block; }

/* visible focus everywhere */
:focus-visible {
  outline: 2px solid var(--bronze);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 500;
  background: var(--ink);
  color: var(--paper);
  padding: 0.75rem 1.25rem;
  font-family: var(--font-sans);
  font-size: var(--fs-label);
}
.skip-link:focus { left: 0; }

/* ─────────── 3. BACKGROUND PHOTO ─────────── */
/* The photo keeps its original colours — its liveliness is why it was chosen,
   so nothing is laid over it globally. Readability is handled only where text
   actually sits: the parchment sheet, and local shadows on the welcome line.
   A fixed layer rather than background-attachment:fixed, which is unreliable
   on iOS. */
.bg-photo {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -2;
  background-color: #2a2418;   /* shown until the photo loads */
  /* Two declarations, not one. A browser that does not understand image-set()
     keeps the first and never sees the second; one that does, overrides it and
     picks AVIF. Same picture either way, about half the bytes.
     q70 was chosen by looking, not by guessing: the sky carries fine film
     grain that q50 smooths away completely. At q70 the grain survives and
     nothing distinguishes it from the JPEG at 1:1. */
  background-image: url('assets/img/bg/hero-bg-900.jpg');
  background-image: image-set(url('assets/img/bg/hero-bg-900.avif') type('image/avif'),
                              url('assets/img/bg/hero-bg-900.jpg')  type('image/jpeg'));
  background-size: cover;
  /* Centred on the castle, which sits right of the middle of the frame.
     Checked by rendering the portrait crop from 50 % to 100 %: below 70 % only
     the outbuildings make it in, at 100 % the keep is pushed against the left
     edge and half the frame is empty sky. */
  background-position: 83% center;
  background-repeat: no-repeat;
}
@media (min-width: 700px) {
  .bg-photo {
    background-image: url('assets/img/bg/hero-bg-1600.jpg');
    background-image: image-set(url('assets/img/bg/hero-bg-1600.avif') type('image/avif'),
                                url('assets/img/bg/hero-bg-1600.jpg')  type('image/jpeg'));
  }
}
@media (min-width: 1500px) {
  .bg-photo {
    background-image: url('assets/img/bg/hero-bg-2560.jpg');
    background-image: image-set(url('assets/img/bg/hero-bg-2560.avif') type('image/avif'),
                                url('assets/img/bg/hero-bg-2560.jpg')  type('image/jpeg'));
  }
}

/* ─────────── 4. NAVIGATION ─────────── */
/* Translucent, with the photo running behind it; the blur keeps the detail
   back there from fighting the labels. */
.nav-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(248, 245, 238, 0.70);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--sheet-edge-2);
}

/* Nine items do not fit a phone. A faded right edge hints that the bar
   continues and can be swiped. It is dropped only well past the width where
   they all fit; erring high costs nothing, because the gradient fades
   parchment into parchment and is invisible over an empty stretch of bar. */
.nav-bar::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 2.5rem;
  pointer-events: none;
  background: linear-gradient(to left, rgba(248, 245, 238, 0.75), rgba(248, 245, 238, 0));
}
@media (min-width: 88rem) {
  .nav-bar::after { display: none; }
}

.nav-list {
  list-style: none;
  margin: 0;
  padding: 0 0.5rem;
  display: flex;
  /* "safe" matters: a plain centred flex row that overflows spills past both
     edges, and the part past the start edge cannot be scrolled back to — the
     first item (Vítejte) was simply unreachable on any window too narrow for
     all ten. With safe, centring is abandoned the moment it would overflow and
     the row falls back to starting at the left. The plain value stays as a
     fallback for browsers that do not parse the keyword. */
  justify-content: center;
  justify-content: safe center;
  gap: 0.25rem;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.nav-list::-webkit-scrollbar { display: none; }

.nav-list a {
  display: block;
  padding: 0.9rem 0.75rem;
  min-height: 2.75rem;          /* 44 px — comfortable tap target */
  font-family: var(--font-sans);
  font-size: var(--fs-label);
  letter-spacing: 0.06em;
  color: var(--ink-2);
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}
.nav-list a:hover { color: var(--bronze); }
.nav-list a[aria-current="page"] {
  color: var(--ink);
  border-bottom-color: var(--bronze);
}

/* ─────────── 5. SECTIONS ─────────── */
/* Everything is visible by default, so without JavaScript the page still
   works as one long document. main.js adds the .js class on load. */
main {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
}

.js .section { display: none; }
.js .section.is-active {
  display: flex;
  justify-content: center;
  /* fills the column left over by the navigation bar, so the sheet inside it
     reaches the bottom of the window */
  flex: 1 0 auto;
  /* The sheet is 90vw wide, so 5vw of photo is left free on either side. The
     same gap above and below frames the paper evenly on all four sides. */
  padding: 5vw 0;
  animation: section-in 0.45s ease both;
}
.section:focus { outline: none; }

@keyframes section-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

/* ─────────── 6. PARCHMENT SHEET ───────────
   Every tab but the welcome screen is a sheet of parchment laid over the
   photo: full height, 90 % of the viewport wide, so a margin of the picture
   stays visible down both sides. */
.sheet {
  width: 90vw;
  display: flex;
  flex-direction: column;
  position: relative;
  background-color: var(--sheet);
  /* Aged paper from four layers and no image file:
       1) fine fractal noise for the grain of the fibres,
       2) coarse, low-frequency noise for the irregular blotching,
       3) a pale pool towards the upper left, so the tone is never even,
       4) a warm wash in the lower right, like a foxed corner.
     Both washes are wider than the sheet and pushed into the corners — kept
     smaller they shrank on a narrow window into an ellipse with a discernible
     edge, which read as a stripe across the paper. The noise layers multiply
     into the base, so they darken it in its own warm tone rather than greying
     it out. */
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='f'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23f)' opacity='0.42'/%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1600' height='1600'%3E%3Cfilter id='m'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.055' numOctaves='5' seed='9'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='1600' height='1600' filter='url(%23m)' opacity='0.30'/%3E%3C/svg%3E"),
    radial-gradient(ellipse 120% 100% at 30% 22%, rgba(255, 251, 238, 0.42), transparent 100%),
    radial-gradient(ellipse 130% 110% at 95% 95%, rgba(178, 140, 74, 0.20), transparent 100%);
  /* The blotch layer is laid down once and scaled to cover, never repeated:
     no tile edge, no mirror axis, and — because cover keeps the aspect ratio —
     no smearing of the blotches into ellipses. The fibre layer stays tiled; at
     a pixel or two per feature there is no edge to see. */
  background-repeat: repeat, no-repeat, no-repeat, no-repeat;
  background-size: 240px 240px, cover, auto, auto;
  background-blend-mode: multiply, multiply, screen, normal;
  border: 1px solid var(--sheet-edge);
  /* the scorched rim of an old sheet — deep soft burn plus a tight one */
  box-shadow:
    inset 0 0 clamp(40px, 7vw, 110px) var(--sheet-burn),
    inset 0 0 14px rgba(138, 100, 44, 0.28),
    var(--shadow-lg);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

/* second rule just inside the first — the printed border of an invitation */
.sheet::before {
  content: '';
  position: absolute;
  inset: clamp(6px, 1.1vw, 12px);
  border: 1px solid var(--sheet-edge-2);
  pointer-events: none;
}

/* The sheet may be very wide on a monitor; the text column inside it is not,
   because a line of 140 characters is unreadable however handsome the paper. */
.sheet__body {
  flex: 1;
  width: 100%;
  max-width: var(--wrap-max);
  margin: 0 auto;
  padding: clamp(1.75rem, 4vw, 3.25rem) clamp(1.5rem, 3.5vw, 2.5rem);
}

/* the invitation, whose content is centred on the page rather than flowing
   from the top */
.sheet__body--centred {
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
}

/* ─────────── 7. TYPOGRAPHY ─────────── */

/* Headings may break a word — but only a word that cannot fit a line on its
   own. At doubled text size "ubytování" at 64 px is wider than the sheet, and
   without this the page scrolls sideways instead. This is not automatic
   hyphenation (see `hyphens: manual` on body): no hyphen is inserted and
   words that fit are never touched. Measured: it is the last 6 px of overflow
   at 2x text on a 390 px phone. */
h1, h2, h3, h4 { overflow-wrap: break-word; }
h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 400;
  color: var(--ink);
  line-height: 1.2;
  margin: 0;
}

h2 {
  font-size: var(--fs-xl);
  letter-spacing: 0.01em;
}

h3 {
  font-size: var(--fs-md);
  /* Cardo ships 400 and 700 only — anything between resolves down to 400 and
     the subheading would sit at the same weight as the copy under it */
  font-weight: 700;
  margin-bottom: 0.35rem;
}

/* the fourth level is only used inside the story, where a year holds several
   small episodes; it sits at body size and is told apart by weight alone */
h4 {
  font-size: var(--fs-body);
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 0.3rem;
}

p { margin: 0 0 1rem; }
p:last-child { margin-bottom: 0; }

/* opening line under a section title */
.lead {
  font-size: var(--fs-md);
  font-style: italic;
  color: var(--ink-2);
  margin-bottom: 2rem;
}

strong { color: var(--ink); font-weight: 700; }

.rule {
  height: 1px;
  margin: 1rem 0 2.5rem;
  background: linear-gradient(90deg, var(--stone), var(--line) 60%, transparent);
}

.placeholder {
  color: var(--ink-3);
  font-style: italic;
  border-left: 2px solid var(--stone);
  padding-left: 1rem;
}

/* a quiet aside — a shade smaller and softer than the copy around it */
.note { font-size: var(--fs-small); color: var(--ink-3); }

/* The small uppercase caption above a thing: a venue, a field, an account
   number. One name for one look — the spacing is set by whatever contains it. */
.label {
  display: block;
  color: var(--bronze);
  margin-bottom: 0.5rem;
  padding: 0;   /* a <legend> indents itself in some browsers */
}

/* Uppercase sans labels. Every one of them is the same four declarations, so
   they are set once here and only colour, weight and spacing differ below. */
.hero__eyebrow,
.hero__date,
.card__time,
.cd-label,
.label,
.btn {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: var(--fs-label);
  letter-spacing: var(--track);
  text-transform: uppercase;
}

/* ─────────── 8. WELCOME SCREEN ───────────
   One sentence, centred across but sitting near the top — the photo keeps the
   rest of the screen. The whole line is a link onward. */
.js .section--welcome.is-active {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(2rem, 8vh, 5rem) clamp(1.25rem, 5vw, 4.5rem) 2rem;
}

.welcome {
  display: block;
  max-width: 26rem;
  text-align: center;
  text-decoration: none;
  color: var(--gold);
  /* The one line on the page with nothing but the photo behind it, sitting
     high up where the sky is at its brightest. Eleven stacked shadows: the
     tight ones cut the letters out, the repeated wide ones compound into a
     pool dense enough to carry the contrast on their own, since the picture
     itself is left untouched. */
  text-shadow:
    0 0 1px  rgba(6, 4, 2, 0.99),
    0 0 2px  rgba(6, 4, 2, 0.98),
    0 0 4px  rgba(6, 4, 2, 0.97),
    0 0 7px  rgba(6, 4, 2, 0.95),
    0 0 7px  rgba(6, 4, 2, 0.93),
    0 0 12px rgba(6, 4, 2, 0.90),
    0 0 12px rgba(6, 4, 2, 0.88),
    0 0 20px rgba(6, 4, 2, 0.84),
    0 0 20px rgba(6, 4, 2, 0.80),
    0 0 30px rgba(6, 4, 2, 0.72),
    0 0 44px rgba(6, 4, 2, 0.62);
  transition: color 0.25s;
}

.welcome__text {
  display: block;
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: var(--fs-md);
  letter-spacing: var(--track-fluid);
  line-height: 1.6;
}

/* ─────────── 9. INVITATION ───────────
   Written on the parchment, so the text is ink rather than light and none of
   the shadow work the photo needed applies here. */
.hero__eyebrow {
  /* heavier than the 400 of the other labels: this one is a whole sentence in
     caps and has to hold its own beside the names */
  font-weight: 500;
  letter-spacing: var(--track-fluid);
  color: var(--bronze);
  margin-bottom: 1.5rem;
}

.hero__names {
  font-size: var(--fs-display);
  line-height: 1.02;
}
.hero__name { display: block; }
.hero__amp {
  display: block;
  font-style: italic;
  font-size: 0.46em;   /* relative to the names, deliberately */
  color: var(--bronze);
  margin: 0.08em 0;
}

.hero__place {
  font-style: italic;
  font-size: var(--fs-md);
  margin: 1.5rem 0 0.35rem;
}

/* matches the eyebrow — the two labels frame the names and read as a pair */
.hero__date {
  font-weight: 500;
  letter-spacing: var(--track-wide);
  color: var(--bronze);
  margin-bottom: 0;
}

/* countdown — no boxes, just figures parted by a hairline */
.countdown {
  display: flex;
  /* Wraps rather than forcing the page wider. Three items in a fixed row each
     carry padding and a separator in rem, so at doubled text size they need
     383 px inside a 253 px sheet and the whole page scrolled sideways by
     61 px. At normal sizes nothing changes — they still sit on one line. */
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(1.25rem, 4vw, 2.25rem);
  margin-top: 2rem;
}
.cd-item {
  min-width: 0;
  padding-right: clamp(1.25rem, 4vw, 2.25rem);
  border-right: 1px solid var(--line);
}
.cd-item:last-child { border-right: none; padding-right: 0; }

.cd-num {
  display: block;
  font-size: var(--fs-xl);
  line-height: 1;
  color: var(--ink);
  font-variant-numeric: tabular-nums lining-nums;
}
.cd-label {
  display: block;
  color: var(--ink-3);
  margin-top: 0.45rem;
}
.cd-note {
  font-style: italic;
  margin-top: 1.5rem;
}

/* ─────────── 10. ITEMS INSIDE A SHEET ───────────
   Parted by a rule, not by a frame of their own — a frame inside a framed
   sheet reads as clutter. */
.card {
  padding-top: 1.5rem;
  margin-top: 1.5rem;
  border-top: 1px solid var(--line-divider);
}
.card:first-of-type { padding-top: 0; margin-top: 0; border-top: none; }

.card__time {
  color: var(--bronze);
  margin-bottom: 0.5rem;
}

/* ─────────── 11. BOXED-OUT BLOCKS ─────────── */
/* Two things get lifted off the parchment into a panel of their own: the
   venue details and the payment details. Same panel, different contents. */
.venue, .payment {
  background: rgba(139, 131, 111, 0.10);
  border: 1px solid var(--line);
  border-radius: 3px;
}

.venue {
  padding: 2.25rem 1.5rem;
  margin-top: 2.5rem;
  text-align: center;
}
.venue .label {
  letter-spacing: var(--track-wide);
  margin-bottom: 0.9rem;
}
.venue__name { font-size: var(--fs-lg); }
.venue__address { font-style: italic; margin: 0.6rem 0 0.3rem; }

/* ─────────── 12. BUTTONS ─────────── */
.btn {
  display: inline-block;
  margin-top: 1.5rem;
  /* Horizontal padding in em, not rem, and capped against the viewport.
     At 2rem a reader who has doubled their font size spends 128 px of a
     390 px phone on padding alone, before the first letter — the button then
     cannot fit, cannot shrink, and pushes the whole page into sideways
     scrolling. Measured: 58 px of overflow, and .btn was the only element
     responsible. em ties the padding to the button's own label instead of to
     the root, and the cap stops it running away on a narrow screen. */
  padding: 0.85rem min(2em, 7vw);
  /* Lets the label wrap onto a second line rather than forcing the box wider
     than its parent. */
  max-width: 100%;
  min-height: 2.75rem;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  border: none;
  border-radius: 2px;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: background 0.2s, box-shadow 0.2s, transform 0.1s;
}
.btn:hover {
  background: var(--bronze);
  box-shadow: var(--shadow-lg);
  transform: translateY(-1px);
}

/* The invitation is a sparse, ceremonial block and a solid dark slab in the
   middle of it would shout. An outline carries the same affordance at a
   fraction of the weight. The text stays --bronze, which is 6.9:1 on the
   parchment, so the quiet version is no harder to read than the loud one. */
.btn--quiet {
  background: transparent;
  color: var(--bronze);
  border: 1px solid var(--sheet-edge);
  box-shadow: none;
}
.btn--quiet:hover {
  background: var(--bronze);
  color: var(--paper);
  border-color: var(--bronze);
}
#cd-calendar { margin: 0; }

/* ─────────── 13. STORY TIMELINE ─────────── */
.story { display: flex; gap: 1.75rem; margin-bottom: 2.5rem; }
.story__year {
  flex: 0 0 4.5rem;
  font-size: var(--fs-lg);
  color: var(--stone);
  text-align: right;
  padding-right: 1.25rem;
  border-right: 1px solid var(--line);
}
.story__text { flex: 1; }

/* one episode within a year — an emoji-led title and a line or two under it */
.beat { margin-top: 1.5rem; }
.story__text > h3 + .beat { margin-top: 1.25rem; }

/* The date riddle closing the story: set on its own line so it reads as a
   thing to be solved rather than as a sentence. Deliberately not --fs-lg —
   at 28 px the expression no longer fits one line on a phone, and a formula
   broken across two lines stops looking like a formula. The groups are held
   together by non-breaking spaces, so if it ever does wrap, it wraps at the
   separators. */
.riddle {
  font-size: var(--fs-md);
  font-weight: 700;
  text-align: center;
  color: var(--ink);
  font-variant-numeric: tabular-nums lining-nums;
  margin: 1.25rem 0 1.5rem;
}

/* ─────────── 14. MUSIC TOGGLE ─────────── */
.music {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 150;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.5rem;
  padding: 0.45rem 1rem;
  background: rgba(248, 245, 238, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--font-sans);
  font-size: var(--fs-label);
  color: var(--ink-2);
  cursor: pointer;
  box-shadow: var(--shadow);
}
/* without this the hidden attribute has no effect — display:flex from the
   class outranks the user-agent rule */
/* .music[hidden] used to be repeated here; the global [hidden] rule in
   section 2 now covers it and every element like it. */

.music__icon { font-size: var(--fs-body); color: var(--bronze); }
/* the state reads from the shape, not from colour alone */
.music[aria-pressed="false"] .music__icon { opacity: 0.45; text-decoration: line-through; }

/* ─────────── 15. RSVP FORM ─────────── */
/* Fields sit on the parchment, so they are a shade lighter than the paper
   rather than a box drawn on top of it — a grey form control would look like
   it had been pasted onto the sheet. */
.field {
  margin-bottom: 1.75rem;
  /* fieldset carries browser defaults that have to go before it can be used
     as a plain grouping element */
  border: none;
  padding: 0;
  margin-inline: 0;
}

.field__input,
.field__textarea {
  display: block;
  width: 100%;
  min-height: 2.75rem;
  padding: 0.7rem 0.9rem;
  font-family: var(--font-serif);
  font-size: var(--fs-body);
  line-height: 1.5;
  color: var(--ink);
  background: rgba(255, 253, 246, 0.55);
  border: 1px solid var(--sheet-edge-2);
  border-radius: 2px;
}
.field__textarea { resize: vertical; }

/* radio rows — the whole label is the target, so it clears 44 px */
.choice {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.75rem;
}
.choice label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 2.75rem;
  cursor: pointer;
}
.choice input {
  width: 1.15rem;
  height: 1.15rem;
  accent-color: var(--bronze);
}

/* the note under a field is quieter still and sits tight to it */
.field .note { margin: 0.5rem 0 0; }

/* Honeypot: off-screen rather than display:none, because some robots skip
   fields they can tell are hidden. People never see it, so anything typed
   here came from a machine. */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.btn:disabled { opacity: 0.6; cursor: default; transform: none; }

/* Account number beside its payment QR — side by side while there is room,
   stacked on a phone. The white padding around the code is not decoration:
   a QR needs a quiet margin or readers struggle, and the parchment is too
   dark and too textured to serve as one. */
.payment {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem 2rem;
  padding: 1.5rem;
  margin-top: 1.5rem;
}
/* min-width:0 is what actually lets this shrink. A flex item defaults to
   min-width:auto, which refuses to go below its own min-content — and the
   account number is one unbreakable string. At doubled text size the 14rem
   basis becomes 448 px, the box would not give way, and the whole page
   scrolled sideways by 139 px. */
.payment__info { flex: 1 1 14rem; min-width: 0; }
.payment__account {
  font-size: var(--fs-lg);
  color: var(--ink);
  font-variant-numeric: tabular-nums lining-nums;
  margin-bottom: 0.5rem;
  /* Last resort only: the number wraps rather than pushing the page wider.
     An account number split over two lines is awkward; half of it off the
     right edge of the screen is worse. */
  overflow-wrap: break-word;
}
.payment__qr {
  width: 10rem;
  padding: 0.6rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 2px;
}

.form__status {
  margin-top: 1.25rem;
  padding: 0.9rem 1rem;
  border-left: 2px solid var(--bronze);
  background: rgba(255, 253, 246, 0.5);
}
/* Hidden by being empty, NOT by the hidden attribute. A role="status" element
   carrying hidden is absent from the accessibility tree, and a live region
   that appears and fills in the same tick is announced by no screen reader
   worth the name — it has to be there already, waiting. Emptiness keeps it in
   the tree and off the screen at the same time. */
.form__status:empty { display: none; }

/* ─────────── 16. RESPONSIVE ─────────── */
@media (max-width: 40rem) {
  .venue { padding: 2rem 1.25rem; }
  .story { flex-direction: column; gap: 0.4rem; }
  .story__year {
    flex: none;
    text-align: left;
    padding: 0 0 0.5rem;
    border-right: none;
    border-bottom: 1px solid var(--line);
  }
}

/* A phone held sideways leaves only about 330 px below the navigation bar and
   the full-size block no longer fits. The type keeps its size — what gives way
   is the air between the lines, which costs far less than shrinking the text
   for the very readers this scale was enlarged for. */
@media (orientation: landscape) and (max-height: 30rem) {
  /* the names step down by redefining the token, so everything that uses it
     follows and nothing falls outside the scale */
  :root { --fs-display: calc(clamp(2.5rem, 8vh, 4rem) * var(--type-scale)); }
  .sheet__body { padding: 1rem 1.25rem; }
  .hero__names { line-height: 0.98; }
  .hero__eyebrow { margin-bottom: 0.35rem; }
  .hero__amp { margin: 0; }
  .hero__place { margin-top: 0.5rem; font-size: var(--fs-body); }
  .countdown { margin-top: 0.6rem; }
  .cd-num { font-size: var(--fs-lg); }
  .cd-label { margin-top: 0.15rem; }
}

/* ─────────── 17. PREFERENCES ─────────── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
