/* ═══════════════════════════════════════════════════════════════════
   Aria Snow — Christening invitation
   Layout and styling only. All event copy lives in index.html.
   ═══════════════════════════════════════════════════════════════════ */

/* ── Fonts ──────────────────────────────────────────────────────────
   Self-hosted OFL subsets (see fonts/*-OFL.txt). Fallback metrics are
   measured, not guessed: Cormorant's x-height is 80.2% of Georgia's,
   so size-adjust holds the line length steady across the font swap. */

@font-face {
  font-family: "Cormorant Garamond";
  src: url("fonts/cormorant-garamond-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Cormorant Garamond";
  src: url("fonts/cormorant-garamond-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Parisienne";
  src: url("fonts/parisienne-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Cormorant Fallback";
  src: local("Georgia"), local("Times New Roman"), local("serif");
  size-adjust: 80.2%;
  ascent-override: 115.2%;
  descent-override: 35.8%;
  line-gap-override: 0%;
}
@font-face {
  font-family: "Parisienne Fallback";
  src: local("Snell Roundhand"), local("Georgia"), local("serif");
  size-adjust: 73.3%;
  ascent-override: 124.9%;
  descent-override: 60.9%;
  line-gap-override: 0%;
}

/* ── Tokens ─────────────────────────────────────────────────────── */

:root {
  /* Ground and ink */
  --cream:      #faf6ef;
  --card:       #fdfaf4;
  --ink:        #4a3626;
  --ink-body:   #5c4633;
  --ink-quiet:  #7a6552;

  /* Gold: --gold-ink is the text-safe tone (4.7:1 on card),
     --gold is decorative only (rules, cross, frame). */
  --gold-ink:   #8a6d24;
  --gold:       #b08d3f;
  --gold-soft:  #ddc9a0;

  /* Pastels — the attire palette, also the bloom wash */
  --blush:      #f2c9ce;
  --butter:     #f7e9c3;
  --sage:       #cfd8b4;

  /* Type */
  --serif:  "Cormorant Garamond", "Cormorant Fallback", Georgia, serif;
  --script: "Parisienne", "Parisienne Fallback", "Snell Roundhand", cursive;

  /* Metrics */
  --nav-h:   3rem;
  --measure: 34rem;
  --frame:   clamp(0.75rem, 3vw, 1.5rem);

  /* Derived tints. Written out rather than computed with relative-colour
     syntax, which older phone browsers do not support. Each notes its source. */
  --veil:          rgba(250, 246, 239, 0.92);  /* --cream  @ 92% */
  --hairline:      rgba(176, 141, 63, 0.28);   /* --gold   @ 28% */
  --hairline-soft: rgba(176, 141, 63, 0.35);   /* --gold   @ 35% */
  --chip-ring:     rgba(74, 54, 38, 0.16);     /* --ink    @ 16% */
  --bloom-blush:   rgba(242, 201, 206, 0.42);  /* --blush  @ 42% */
  --bloom-blush-2: rgba(242, 201, 206, 0.34);  /* --blush  @ 34% */
  --bloom-butter:  rgba(247, 233, 195, 0.48);  /* --butter @ 48% */
  --bloom-sage:    rgba(207, 216, 180, 0.36);  /* --sage   @ 36% */
  --white:         #ffffff;
  --on-gold:       #fffdf8;

  /* Motion. One curve for everything: a confident arrival that decelerates
     hard and never overshoots. Bounce would be wrong for an invitation.

     Tempo lives here — every entrance reads from these, so the whole page
     can be slowed or quickened from one place. Hover feedback is
     deliberately NOT in this set: it must stay quick or it feels like lag. */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);

  --dur-reveal:   950ms;   /* a content group arriving          */
  --dur-hero:    1250ms;   /* each step of the hero cascade     */
  --dur-settle:  1600ms;   /* the name coming into focus        */
  --dur-frame:   1500ms;   /* the card frame composing itself   */
  --step-group:    90ms;   /* per group, down a card            */
  --step-stagger:  70ms;   /* per item, in a genuine list       */
  --step-hero:    115ms;   /* per element, in the hero cascade  */

  /* Escape hatch: point this at a floral border image to replace the
     CSS wash entirely — see design.md Decision 4. Nothing else changes. */
  --floral-border: none;
}

/* ── Reset ──────────────────────────────────────────────────────── */

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

html {
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink-body);
  font-family: var(--serif);
  font-size: clamp(1.0625rem, 1rem + 0.5vw, 1.25rem);
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }

a { color: inherit; }

/* Browser surfaces we did not draw still belong to the design. */
::selection {
  background: var(--blush);
  color: var(--ink);
}
body { caret-color: var(--gold-ink); }

@supports (scrollbar-color: auto) {
  html { scrollbar-color: var(--gold-soft) transparent; scrollbar-width: thin; }
}
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--gold-soft);
  border: 3px solid var(--cream);
  border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover { background: var(--gold); }

:focus-visible {
  outline: 2px solid var(--gold-ink);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ── Quickjump nav ──────────────────────────────────────────────────
   position: sticky, not fixed — it stays in flow so the hero begins
   beneath it and the full-height maths stay honest (design Decision 11). */

.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--veil);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--hairline);
}

.nav--hidden { transform: translateY(-100%); }

.nav__list {
  display: flex;
  align-items: center;
  gap: clamp(0.85rem, 4vw, 2rem);
  /* Any overflow scrolls inside the bar — never widens the document. */
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 0 1rem;
}
.nav__list::-webkit-scrollbar { display: none; }

.nav__link {
  display: block;
  white-space: nowrap;
  font-size: 0.8125rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  padding: 0.35rem 0;
  /* The underline is drawn by ::after in the motion section, not a border —
     a border here would sit under the sweep and read as a double rule. */
}

.nav__link--rsvp {
  color: var(--gold-ink);
  font-weight: 600;
}

/* ── Card shell ─────────────────────────────────────────────────── */

.card {
  position: relative;
  min-height: 100vh;          /* fallback first */
  min-height: 100svh;         /* small-viewport unit: no mobile URL-bar jump */
  display: grid;
  place-items: center;
  padding: clamp(2.5rem, 8vw, 4.5rem) clamp(1.25rem, 5vw, 3rem);
  background:
    radial-gradient(60% 42% at 8% 4%,   var(--bloom-blush), transparent 70%),
    radial-gradient(52% 38% at 96% 10%, var(--bloom-butter), transparent 70%),
    radial-gradient(55% 40% at 4% 97%,  var(--bloom-sage), transparent 70%),
    radial-gradient(58% 42% at 92% 94%, var(--bloom-blush-2), transparent 70%),
    var(--card);
  /* Anchor targets clear the returning nav bar. */
  scroll-margin-top: calc(var(--nav-h) + 0.75rem);
}

/* The hero sits below the nav, so it gets the remaining height —
   otherwise its centred content is pushed below the fold on load. */
.card:first-of-type {
  min-height: calc(100vh - var(--nav-h));
  min-height: calc(100svh - var(--nav-h));
}

/* Short viewports (landscape phones): let content set the height. */
@media (max-height: 600px) {
  .card, .card:first-of-type { min-height: auto; }
}

/* Optional floral artwork overlay — off by default. */
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--floral-border);
  background-size: cover;
  background-position: center;
  pointer-events: none;
}

/* Hairline inset frame, as on the reference cards. */
.card::after {
  content: "";
  position: absolute;
  inset: var(--frame);
  border: 1px solid var(--hairline-soft);
  pointer-events: none;
}

.card__inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--measure);
  margin-inline: auto;
  text-align: center;
}

/* ── Shared type ────────────────────────────────────────────────── */

.script {
  font-family: var(--script);
  font-weight: 400;
  color: var(--gold-ink);
  line-height: 1.25;
}
.script--lg { font-size: clamp(2.25rem, 9vw, 3.5rem); }
.script--md { font-size: clamp(1.75rem, 6vw, 2.5rem); }
.script--sm { font-size: clamp(1.5rem, 5vw, 1.875rem); }

.section-title {
  font-size: clamp(1.75rem, 6.5vw, 2.75rem);
  font-weight: 600;
  letter-spacing: 0.16em;
  color: var(--ink);
  margin-bottom: 1.5rem;
}

.eyebrow {
  font-style: italic;
  color: var(--ink-quiet);
  font-size: 1.0625rem;
}

.prose {
  max-width: 30rem;
  margin-inline: auto;
  margin-bottom: 1.25rem;
  text-wrap: pretty;
}
.prose strong { font-weight: 600; color: var(--ink); }
.prose--quiet {
  font-style: italic;
  color: var(--ink-quiet);
  font-size: 0.9375em;
}

.rule {
  width: min(9rem, 45%);
  height: 1px;
  margin: clamp(1.5rem, 4vw, 2.25rem) auto;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.cross {
  width: clamp(1.35rem, 4vw, 1.75rem);
  height: auto;
  fill: var(--gold);
  margin-bottom: 1.5rem;
}
.cross--sm { width: 1.125rem; margin-bottom: 1.25rem; }

/* ── Hero ───────────────────────────────────────────────────────── */

.hero__occasion { margin: 0.35rem 0 0.5rem; }
.hero__occasion .script { display: block; margin-bottom: -0.35rem; }

.hero__baptism {
  display: block;
  font-size: clamp(2rem, 9vw, 3.25rem);
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--ink);
  line-height: 1.1;
}

.hero__relation {
  font-style: italic;
  color: var(--ink-quiet);
  margin-top: 0.75rem;
}

.hero__name {
  font-size: clamp(2.5rem, 12vw, 4.25rem);
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--ink);
  line-height: 1.08;
  margin-top: 0.35rem;
}

.hero__date {
  font-weight: 600;
  font-size: clamp(1.25rem, 4.5vw, 1.5rem);
  letter-spacing: 0.1em;
  color: var(--ink);
  text-transform: uppercase;
}
.hero__time {
  font-style: italic;
  color: var(--ink-quiet);
  margin-bottom: 1.75rem;
}

.hero__venue { margin-bottom: 1.25rem; }
.hero__venue-name {
  display: block;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--ink);
  text-transform: uppercase;
  font-size: 1.0625rem;
}
.hero__venue-address,
.hero__reception-lead {
  display: block;
  font-style: italic;
  color: var(--ink-quiet);
  font-size: 0.9375rem;
}
.hero__reception-lead { margin-bottom: 0.25rem; }

/* ── Attire swatches ────────────────────────────────────────────── */

.swatches {
  display: flex;
  justify-content: center;
  gap: clamp(1.5rem, 7vw, 3rem);
  margin: 1.75rem 0 0.5rem;
}
.swatch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
}
.swatch__chip {
  width: clamp(2.5rem, 9vw, 3.25rem);
  aspect-ratio: 1;
  border-radius: 50%;
  display: block;
  box-shadow: inset 0 0 0 1px var(--chip-ring);
}
.swatch__chip--pink  { background: var(--blush); }
.swatch__chip--white { background: var(--white); }

.swatch__label {
  font-size: 0.875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
}

/* ── Health protocols ───────────────────────────────────────────── */

.protocols {
  display: grid;
  gap: 0.85rem;
  max-width: 26rem;
  margin: 1.5rem auto 0;
  text-align: left;
}
.protocol {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.75rem;
  align-items: baseline;
}
.protocol__icon {
  color: var(--gold);
  font-size: 0.5rem;
  line-height: 2.4;
}

/* ── Venues ─────────────────────────────────────────────────────── */

.venues {
  display: grid;
  gap: clamp(1.5rem, 5vw, 2.5rem);
  margin-top: 1.5rem;
}
@media (min-width: 40rem) {
  .venues { grid-template-columns: 1fr 1fr; }
}

.venue__role {
  font-style: italic;
  color: var(--ink-quiet);
  font-size: 0.9375rem;
}
.venue__name {
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  font-size: 1.0625rem;
  margin-top: 0.15rem;
}
.venue__address {
  font-style: italic;
  color: var(--ink-quiet);
  font-size: 0.9375rem;
  margin-bottom: 0.6rem;
}
.venue__map {
  display: inline-block;
  font-size: 0.8125rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-ink);
  text-decoration: none;
  padding-bottom: 2px;
  /* Underline drawn by ::after in the motion section. */
}

/* ── Godparents ─────────────────────────────────────────────────── */

.godparents {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1.25rem, 5vw, 3rem);
  margin-top: 1rem;
}
.godparents__group {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.godparents__group h3 { margin-bottom: 0.5rem; }

/* Names read left-aligned inside a centred block, so the numerals form a
   clean column the way they do on the printed reference cards. */
.names {
  counter-reset: n;
  text-align: left;
}
.names li {
  counter-increment: n;
  font-size: clamp(0.9375rem, 3.4vw, 1.0625rem);
  line-height: 1.6;
  color: var(--ink-body);
  padding-left: 1.6em;
  text-indent: -1.6em;
}
.names li::before {
  content: counter(n) ".";
  display: inline-block;
  width: 1.35em;
  margin-right: 0.25em;
  text-align: right;
  color: var(--gold-ink);
  font-size: 0.8em;
}

.placeholder-note {
  margin-top: 1.75rem;
  font-style: italic;
  font-size: 0.875rem;
  color: var(--ink-quiet);
}

/* ── Closing ────────────────────────────────────────────────────── */

.card__inner--center { display: grid; justify-items: center; }

.closing__line { margin-bottom: 1.25rem; }

.closing__signoff { margin-bottom: 2rem; }
.closing__love {
  display: block;
  font-style: italic;
  color: var(--ink-quiet);
}
.closing__name {
  display: block;
  font-weight: 600;
  font-size: clamp(1.375rem, 5vw, 1.75rem);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
}

.btn {
  display: inline-block;
  padding: 0.85rem 2.5rem;
  font-size: 0.875rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  border: 1px solid var(--gold);
  background: transparent;
}
/* Hover fill uses --gold-ink, not --gold: cream on --gold measures 3.07:1,
   which fails AA for the button's small-caps label. --gold-ink gives 4.87:1. */
.btn:hover {
  background: var(--gold-ink);
  border-color: var(--gold-ink);
  color: var(--on-gold);
}

/* ── Unconfigured links ─────────────────────────────────────────────
   Applied by main.js while an href is still a #TODO- placeholder, so a
   dead link looks unfinished rather than broken. */

[aria-disabled="true"] {
  opacity: 0.42;
  cursor: not-allowed;
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}
.btn[aria-disabled="true"]:hover {
  background: transparent;
  color: var(--ink);
}

/* ═══════════════════════════════════════════════════════════════════
   Motion

   One idea, stated once and then whispered: things arrive slightly out
   of focus and settle. The hero says it loudly — the name resolves from
   a blur with its tracking easing in — and everywhere else it is a short
   rise and fade.

   Content is fully visible by default. The starting states below are
   scoped to `.js`, so a script failure leaves an un-animated page rather
   than a blank one.
   ═══════════════════════════════════════════════════════════════════ */

/* Smooth anchor scrolling runs unconditionally, by request. It is a
   short in-page traversal, not a decorative effect. */
html { scroll-behavior: smooth; }

.js [data-reveal] {
  opacity: 0;
  --dur: var(--dur-reveal);
  --delay: calc(var(--i, 0) * var(--step-group) + var(--j, 0) * var(--step-stagger));
  transform: translateY(var(--rise, 18px));
  transition:
    opacity        var(--dur) var(--ease) var(--delay, 0ms),
    transform      var(--dur) var(--ease) var(--delay, 0ms),
    filter         var(--dur) var(--ease) var(--delay, 0ms),
    letter-spacing var(--dur) var(--ease) var(--delay, 0ms);
}

.js .is-revealed [data-reveal] {
  opacity: 1;
  transform: none;
}

/* Items inside a genuine list carry --j; everything else leaves it unset
   and simply follows its group's place in the cascade. */

/* ── The authored moment: the name settling into focus ────────────── */

.js #hero [data-reveal] {
  --dur: var(--dur-hero);
  --step-group: var(--step-hero);
}

.js [data-settle] {
  --dur: var(--dur-settle);
  --rise: 10px;
  filter: blur(9px);
  letter-spacing: 0.3em;
}
.js .is-revealed [data-settle] {
  filter: blur(0);
  letter-spacing: 0.06em;   /* matches .hero__name resting tracking */
}

/* The frame eases in from just outside its resting inset, so the card
   composes itself around the name rather than being there first. */
.js #hero.card::after {
  opacity: 0;
  transform: scale(1.012);
  transition: opacity var(--dur-frame) var(--ease) 150ms, transform var(--dur-frame) var(--ease) 150ms;
}
.js #hero.is-revealed.card::after {
  opacity: 1;
  transform: none;
}

/* ── Micro-interactions ───────────────────────────────────────────── */

/* Nav underline sweeps from the centre — same hairline material as the
   card frame, so the interaction belongs to the world. */
.nav__link {
  position: relative;
}
.nav__link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--gold);
  transform: scaleX(0);
  transition: transform 260ms var(--ease);
}
.nav__link:hover::after,
.nav__link:focus-visible::after,
.nav__link[aria-current="true"]::after {
  transform: scaleX(1);
}
.nav__link[aria-current="true"] { color: var(--gold-ink); }
.nav__link[aria-disabled="true"]::after { display: none; }

/* The RSVP fill rises from the baseline rather than switching on. */
.btn {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  transition: color 240ms var(--ease), border-color 240ms var(--ease);
}
.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--gold-ink);
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform 320ms var(--ease);
}
.btn:hover::before,
.btn:focus-visible::before { transform: scaleY(1); }
.btn:hover, .btn:focus-visible { border-color: var(--gold-ink); }
.btn[aria-disabled="true"]::before { display: none; }

/* Map links share the nav's underline material. */
.venue__map { position: relative; }
.venue__map::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--gold-soft);
  transform: scaleX(1);
  transform-origin: left;
  transition: transform 260ms var(--ease), background-color 260ms var(--ease);
}
.venue__map:hover::after,
.venue__map:focus-visible::after { background: var(--gold-ink); }
.venue__map[aria-disabled="true"]::after { display: none; }

/* Nav bar itself. */
.nav { transition: transform 320ms var(--ease); }

/* ── Reduced motion ───────────────────────────────────────────────────
   Not "no motion" — fewer and gentler. Opacity still carries the arrival
   and every hover still confirms itself; what goes is the spatial travel,
   the blur, and the tracking shift, which are what actually provoke
   vestibular discomfort. Smooth scrolling stays on by explicit request. */

@media (prefers-reduced-motion: reduce) {
  /* Keep the tempo close to the standard path — a noticeably faster page
     under this setting reads as a different, snappier design rather than a
     calmer one. What changes is the movement, not the pace. */
  :root {
    --dur-reveal:   800ms;
    --dur-hero:    1000ms;
    --dur-settle:  1100ms;
    --dur-frame:   1000ms;
    --step-group:    75ms;
    --step-stagger:  55ms;
    --step-hero:     90ms;
  }

  .js [data-reveal] {
    --rise: 0px;
    transform: none;
  }

  .js [data-settle] {
    filter: none;
    letter-spacing: 0.06em;
  }
  .js #hero.card::after {
    transform: none;
    transition: opacity var(--dur-frame) var(--ease) 150ms;
  }

  .nav { transition: transform 220ms var(--ease); }
  .nav__link::after { transition: transform 200ms var(--ease); }
  .btn::before { transition: transform 220ms var(--ease); }
}
