/* ==========================================================================
   Design tokens · base · shared components
   ========================================================================== */
:root {
  /* Colour — taken from the printed invitation */
  --brown-900: #4B2A13;   /* deep chocolate */
  --brown-800: #643813;   /* passport brown — strongest brand colour */
  --brown-700: #76502F;   /* warm brown */
  --caramel:   #A4774F;
  --gold:      #C3A06B;
  --cream:     #F5DFC2;
  --cream-100: #F9EBD7;
  --ivory:     #FFF9F1;
  --paper:     #FFFDF8;
  --ink:       #4B2E1B;
  --ink-soft:  #6B4A30;
  --line:      rgba(118, 80, 47, .28);

  /* Type */
  --font-serif:  "Cormorant Garamond", "Times New Roman", Georgia, serif;
  --font-script: "Great Vibes", "Snell Roundhand", cursive;
  --font-sans:   "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif;

  --fs-label: .75rem;                                 /* 12px */
  --fs-body: 1.125rem;                                /* 18px serif reads like 16px sans */
  --fs-lead: clamp(1.2rem, 1.1rem + .5vw, 1.4rem);
  --fs-title: clamp(1.9rem, 1.5rem + 2vw, 3.25rem);
  --fs-script: clamp(2.6rem, 2rem + 3vw, 4rem);
  --tracking: .15em;

  /* Space & shape */
  --gutter: 20px;
  --section-y: clamp(72px, 14vw, 132px);
  --max: 1120px;
  --radius-sm: 8px;
  --radius: 14px;
  --radius-pill: 999px;
  --shadow: 0 10px 30px -14px rgba(75, 42, 19, .35);
  --shadow-lift: 0 22px 44px -18px rgba(40, 20, 8, .55);

  /* Motion */
  --ease: cubic-bezier(.22, .61, .36, 1);
  --dur: .8s;

  /* Textures */
  --tex-paper: url("../assets/textures/paper.svg");
  --tex-leather: url("../assets/textures/leather.svg");
  --map-brown: url("../assets/textures/world-map-brown.svg");
  --map-cream: url("../assets/textures/world-map-cream.svg");
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 64px; }
body {
  margin: 0;
  font-family: var(--font-serif);
  font-size: var(--fs-body);
  font-weight: 500;
  line-height: 1.7;
  color: var(--ink);
  background: var(--brown-900);
  font-variant-numeric: lining-nums;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
.js body.is-locked { overflow: hidden; }
img, svg { display: block; max-width: 100%; }
img { height: auto; }
h1, h2, h3, p, figure, dl, dd, ol, ul { margin: 0; }
ol, ul { padding: 0; list-style: none; }
a { color: inherit; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--caramel); outline-offset: 3px; border-radius: 4px; }
[data-theme="dark"] :focus-visible { outline-color: var(--gold); }
.site-menu__close:focus-visible, .lightbox__btn:focus-visible, .topbar__menu:focus-visible, .scroll-cue:focus-visible { border-radius: 50%; outline-color: var(--gold); }
[hidden] { display: none !important; }
[tabindex="-1"]:focus { outline: none; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; left: 12px; top: -60px; z-index: 200;
  padding: 10px 16px; background: var(--ivory); color: var(--ink);
  border-radius: var(--radius-sm); font-family: var(--font-sans); font-size: .85rem;
}
.skip-link:focus { top: 12px; }

.icon { width: 1.25em; height: 1.25em; flex: none; }
.icon--inline { display: inline-block; vertical-align: -.1em; width: .7em; height: .7em; }

/* ---------- Typography ---------- */
.script { font-family: var(--font-script); font-weight: 400; line-height: 1.15; letter-spacing: 0; }
.label, .eyebrow {
  font-family: var(--font-sans); font-size: var(--fs-label); font-weight: 500;
  letter-spacing: var(--tracking); text-transform: uppercase;
}
.eyebrow { color: var(--brown-700); margin-bottom: .5rem; }
.title {
  font-family: var(--font-serif); font-size: var(--fs-title); font-weight: 500;
  line-height: 1.1; letter-spacing: .12em; text-transform: uppercase; color: var(--brown-800);
}
.title-script { font-size: var(--fs-script); color: var(--brown-800); }
.subtitle { font-style: italic; color: var(--ink-soft); margin-top: .5rem; font-size: 1.15rem; }
.lead { font-size: var(--fs-lead); }
.center { text-align: center; }
.letter__text p + p, .center + .center { margin-top: 1rem; }

.section-head { text-align: center; margin-bottom: clamp(36px, 8vw, 56px); }
.section-head--light .title, .section-head--light .eyebrow { color: var(--cream); }
.divider-label {
  display: flex; align-items: center; gap: 12px; margin-bottom: 24px;
  font-family: var(--font-sans); font-size: var(--fs-label); font-weight: 600;
  letter-spacing: var(--tracking); text-transform: uppercase; color: var(--brown-700);
}
.divider-label::before, .divider-label::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---------- Layout & section surfaces ---------- */
.container { position: relative; z-index: 1; width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.narrow { max-width: 600px; }

.section { position: relative; padding-block: var(--section-y); overflow: hidden; isolation: isolate; }
.section--paper {
  background:
    radial-gradient(120% 80% at 50% 0%, transparent 55%, rgba(164, 119, 79, .12)),
    var(--tex-paper), var(--ivory);
}
.section--cream {
  background:
    radial-gradient(120% 80% at 50% 100%, transparent 50%, rgba(164, 119, 79, .14)),
    var(--tex-paper), var(--cream-100);
}
.section--leather {
  color: var(--cream);
  background:
    radial-gradient(90% 60% at 50% 40%, rgba(164, 119, 79, .22), transparent 70%),
    var(--tex-leather), var(--brown-800);
}
.section--map::before {
  content: ""; position: absolute; inset: 8% -10%; z-index: -1;
  background: var(--map-brown) center / contain no-repeat; opacity: .07;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 12px 26px;
  font-family: var(--font-sans); font-size: .82rem; font-weight: 500;
  letter-spacing: .14em; text-transform: uppercase; text-decoration: none;
  border: 1px solid transparent; border-radius: var(--radius-pill);
  background: none; transition: background-color .3s, color .3s, border-color .3s, transform .3s var(--ease);
}
.btn:active { transform: scale(.98); }
.btn .icon { width: 18px; height: 18px; }
.btn__end { margin-left: auto; }
.btn--solid { background: var(--brown-900); color: var(--cream); box-shadow: var(--shadow); }
.btn--solid:hover { background: var(--brown-800); }
.btn--outline { border-color: var(--brown-800); color: var(--brown-800); }
.btn--outline:hover { background: rgba(100, 56, 19, .06); }
.btn--outline-light { border-color: var(--cream); color: var(--cream); }
.btn--outline-light:hover { background: rgba(245, 223, 194, .1); }
.btn--ghost-light { color: var(--cream); opacity: .85; }
.btn--ghost-light:hover { opacity: 1; }
.btn--block { width: 100%; }
.btn-stack { display: grid; gap: 14px; max-width: 420px; margin: 28px auto 0; }
.btn-stack .btn { justify-content: flex-start; padding-inline: 24px; }
.btn-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 36px; }

.card {
  background: var(--tex-paper), var(--paper);
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: clamp(22px, 6vw, 36px);
}

/* ---------- Top bar & menu ---------- */
.topbar {
  position: fixed; inset: 0 0 auto; z-index: 50;
  display: flex; align-items: center; justify-content: center;
  height: 60px; padding: 0 var(--gutter); padding-top: env(safe-area-inset-top);
  color: var(--cream); transition: color .4s, background-color .4s, transform .5s var(--ease);
}
.topbar.is-light { color: var(--brown-800); }
.topbar.is-solid { background: rgba(75, 42, 19, .92); }
.topbar.is-solid.is-light { background: rgba(255, 249, 241, .94); box-shadow: 0 1px 0 var(--line); }
.js body.is-locked .topbar { transform: translateY(-100%); }
.topbar__mark {
  font-family: var(--font-serif); font-size: .95rem; font-weight: 600;
  letter-spacing: .3em; text-decoration: none; margin: 0;
}
.topbar__menu {
  position: absolute; right: calc(var(--gutter) - 10px); top: 50%; translate: 0 -50%;
  margin-top: calc(env(safe-area-inset-top) / 2);
  display: grid; place-items: center; width: 44px; height: 44px;
  background: none; border: 0; color: inherit;
}

/* Music toggle — equaliser bars while playing, crossed note when paused */
.topbar__music {
  position: absolute; left: calc(var(--gutter) - 10px); top: 50%; translate: 0 -50%;
  margin-top: calc(env(safe-area-inset-top) / 2);
  display: grid; place-items: center; width: 44px; height: 44px;
  background: none; border: 0; color: inherit; border-radius: 50%;
}
.topbar__music .eq { display: none; align-items: flex-end; gap: 2.5px; height: 16px; }
.topbar__music .eq i { width: 2.5px; height: 100%; background: currentColor; border-radius: 2px; transform-origin: bottom; animation: eq 1s ease-in-out infinite; }
.topbar__music .eq i:nth-child(2) { animation-delay: -.3s; }
.topbar__music .eq i:nth-child(3) { animation-delay: -.6s; }
.topbar__music .eq i:nth-child(4) { animation-delay: -.15s; }
.topbar__music.is-playing .eq { display: flex; }
.topbar__music.is-playing .topbar__music-off { display: none; }
@keyframes eq { 0%, 100% { transform: scaleY(.3); } 50% { transform: scaleY(1); } }
.topbar__music:focus-visible { border-radius: 50%; outline-color: var(--gold); }

.site-menu {
  width: 100%; max-width: 100%; height: 100%; max-height: 100%; margin: 0; border: 0;
  padding: 88px 28px 40px; color: var(--cream);
  background: var(--tex-leather), var(--brown-900);
}
.site-menu::backdrop { background: rgba(30, 15, 6, .6); }
.site-menu[open] { animation: fade-in .4s var(--ease); }
.site-menu .label { color: var(--gold); margin-bottom: 18px; text-align: center; }
.site-menu__close {
  position: absolute; top: 8px; right: 10px; width: 44px; height: 44px;
  display: grid; place-items: center; background: none; border: 0; color: var(--cream);
}
.site-menu__list { counter-reset: m; max-width: 420px; margin-inline: auto; }
.site-menu__list a {
  counter-increment: m; display: flex; align-items: baseline; gap: 14px;
  min-height: 52px; padding: 10px 4px; text-decoration: none;
  border-bottom: 1px solid rgba(245, 223, 194, .14); font-size: 1.3rem;
}
.site-menu__list a::before { content: counter(m, decimal-leading-zero); font-family: var(--font-sans); font-size: .7rem; color: var(--gold); letter-spacing: .1em; }
.site-menu__list span { margin-left: auto; font-family: var(--font-sans); font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; opacity: .6; }

/* ---------- Ornaments, stamps, compass ---------- */
.hero__map, .hero__compass, .corner-compass { pointer-events: none; }
.corner-compass { position: absolute; top: 18px; left: 14px; width: 54px; height: 54px; color: var(--brown-700); opacity: .55; z-index: 0; }
[data-theme="dark"] .corner-compass, .corner-compass--bl { color: var(--gold); }
.corner-compass--bl { top: auto; bottom: 22px; left: 16px; width: 70px; height: 70px; opacity: .35; }

.ornament { position: absolute; width: 120px; height: 60px; color: var(--brown-700); pointer-events: none; }
.ornament svg { width: 100%; height: 100%; overflow: visible; }
.ornament--top-right { top: 64px; right: 10px; color: var(--gold); opacity: .8; }
/* Full-width flight path across the top of the opening screen; draws itself in on load */
.ornament--wide { left: 0; right: 8px; width: auto; height: auto; max-width: 760px; margin-left: auto; top: calc(52px + env(safe-area-inset-top)); }
.ornament--wide svg { display: block; width: 100%; height: auto; }
.ornament--wide .trail-mask { stroke-dasharray: 1; stroke-dashoffset: 1; animation: trail-draw 2.6s cubic-bezier(.45, .05, .3, 1) .4s forwards; }
.ornament--wide .trail-plane { opacity: 0; animation: fade-in .6s ease 2.6s forwards; }
@keyframes trail-draw { to { stroke-dashoffset: 0; } }
.ornament--top-left { top: 14px; left: 12px; width: 96px; height: 48px; transform: scaleX(-1); opacity: .75; }
.ornament--top-left + .container { padding-top: 36px; }
.trail-path { fill: none; stroke: currentColor; stroke-width: 1.4; stroke-dasharray: 2.6 4.4; stroke-linecap: round; }
.trail-plane use { fill: currentColor; }

.stamp { display: block; width: 100%; height: 100%; color: var(--brown-700); }
.stamp text { font-family: var(--font-sans); font-weight: 600; letter-spacing: .18em; fill: currentColor; }
.stamp .stamp__mono { font-family: var(--font-serif); font-weight: 600; letter-spacing: 0; }

/* Heart-loop plane trail, drawn in when revealed */
.heart-trail { display: block; width: 170px; height: 86px; margin: 0 auto; color: var(--caramel); }
.heart-trail svg { width: 100%; height: 100%; overflow: visible; }
.heart-trail .trail-mask { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 2s cubic-bezier(.45, .05, .3, 1) .2s; }
.heart-trail .trail-plane { opacity: 0; transform: translate(-10px, 14px); transition: opacity .5s ease 1.9s, transform .9s var(--ease) 1.9s; }
.heart-trail.is-visible .trail-mask, .is-visible .heart-trail .trail-mask { stroke-dashoffset: 0; }
.heart-trail.is-visible .trail-plane, .is-visible .heart-trail .trail-plane { opacity: 1; transform: none; }
.heart-trail--light { color: var(--gold); }

/* ---------- Scroll reveal ---------- */
.js [data-reveal] { opacity: 0; transform: translateY(26px); transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease); }
.js [data-reveal="scale"] { transform: scale(.94); }
.js [data-reveal].is-visible { opacity: 1; transform: none; }

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes stamp-in { 0% { opacity: 0; transform: scale(1.5) rotate(-18deg); } 70% { opacity: .9; } 100% { opacity: .85; transform: scale(1) rotate(-12deg); } }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 120;
  translate: -50% 20px; opacity: 0; pointer-events: none;
  padding: 12px 22px; border-radius: var(--radius-pill);
  background: var(--brown-900); color: var(--cream); font-family: var(--font-sans); font-size: .85rem;
  box-shadow: var(--shadow-lift); transition: opacity .3s, translate .3s var(--ease);
}
.toast.is-shown { opacity: 1; translate: -50% 0; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .js [data-reveal] { opacity: 1; transform: none; }
}
