/* Luma & Adrien: wedding memories.
   Stationery by daylight (light) and by candlelight (dark), from the wedding palette. */

@font-face {
  font-family: "EB Garamond";
  src: url("/fonts/eb-garamond-latin-400-normal.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "EB Garamond";
  src: url("/fonts/eb-garamond-latin-500-normal.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "EB Garamond";
  src: url("/fonts/eb-garamond-latin-400-italic.woff2") format("woff2");
  font-weight: 400; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "Wedding Script";
  src: url("/fonts/mrs-saint-delafield-latin-400-normal.woff2") format("woff2");
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #fffdfb;
  --paper-2: #f8f3ef;
  --paper-3: #f1e9e3;
  --ink: #857465;          /* taupe: main text, buttons, rules */
  --ink-strong: #6e5f52;
  --ink-soft: #978779;     /* secondary text (taupe-light is too faint for text) */
  --line: #b9aea6;         /* taupe-light: borders, rules */
  --line-soft: #e6ddd6;
  --copper: #b86850;
  --copper-a: #a85848;
  --copper-b: #c87860;
  --on-copper: #fff;
  --shadow: 0 1px 2px rgb(80 60 45 / 0.08), 0 8px 30px rgb(80 60 45 / 0.08);
  --scrim: #14100e;

  --serif: "EB Garamond", "Cormorant Garamond", Garamond, "Times New Roman", serif;
  --script: "Wedding Script", "Snell Roundhand", "Apple Chancery", cursive;
  --gutter: 16px;
  --row-h: 150px;
  --radius: 3px;
}

/* Dark: the same stationery by candlelight. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #1a1512;
    --paper-2: #221c18;
    --paper-3: #2b231e;
    --ink: #dccfc4;
    --ink-strong: #efe5dc;
    --ink-soft: #b3a497;
    --line: #6f6158;
    --line-soft: #3a302a;
    --copper: #e0957a;
    --copper-a: #cf7f66;
    --copper-b: #f0b195;
    --on-copper: #1a1512;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 10px 30px rgb(0 0 0 / 0.35);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #1a1512;
  --paper-2: #221c18;
  --paper-3: #2b231e;
  --ink: #dccfc4;
  --ink-strong: #efe5dc;
  --ink-soft: #b3a497;
  --line: #6f6158;
  --line-soft: #3a302a;
  --copper: #e0957a;
  --copper-a: #cf7f66;
  --copper-b: #f0b195;
  --on-copper: #1a1512;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 10px 30px rgb(0 0 0 / 0.35);
}

@media (min-width: 700px) {
  :root { --gutter: 32px; --row-h: 210px; }
}
@media (min-width: 1200px) {
  :root { --row-h: 250px; }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 72px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.1875rem;
  line-height: 1.55;
  font-variant-numeric: oldstyle-nums;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  transition: background-color .4s ease, color .4s ease;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--copper); outline-offset: 3px; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ── Type ─────────────────────────────────────────────── */
.script {
  font-family: var(--script);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: 0;
  color: var(--copper);
  background: linear-gradient(100deg, var(--copper-a), var(--copper-b) 55%, var(--copper-a));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  /* script swashes overflow their box; give them room */
  padding: 0.15em 0.35em 0.3em;
  margin-inline: -0.35em;
}
.caps {
  font-variant: small-caps;
  font-variant-numeric: lining-nums;
  text-transform: lowercase;
  letter-spacing: 0.2em;
  font-weight: 500;
}
.caps-upper {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-variant-numeric: lining-nums;
  font-weight: 500;
}

/* ── Buttons ──────────────────────────────────────────── */
.nowrap { white-space: nowrap; }
.icon-btn {
  display: inline-grid; place-items: center;
  width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid var(--line-soft);
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--ink); cursor: pointer;
  transition: border-color .2s, color .2s, transform .2s;
}
.icon-btn:hover { border-color: var(--line); color: var(--copper); }
.icon-btn svg { width: 20px; height: 20px; }
.theme-toggle .moon { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .sun { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .moon { display: block; }
}

/* ── Monogram colouring ───────────────────────────────── */
.mono-a { fill: var(--copper); }
.mono-l { fill: var(--ink-soft); }
.mono-knock { fill: var(--paper); transition: fill .4s ease; }

/* ── Hero ─────────────────────────────────────────────── */
.hero {
  position: relative;
  text-align: center;
  padding: 72px var(--gutter) 24px;
  max-width: 980px;
  margin: 0 auto;
}
.hero__toggle { position: absolute; top: 14px; right: var(--gutter); }
.hero__mono { width: 82px; margin: 0 auto 8px; }
.hero__mono svg { width: 100%; height: auto; }
.hero__script {
  display: block;
  font-size: clamp(3.4rem, 16vw, 7.5rem);
  margin: 0 auto -0.2em;
  transform: rotate(-4deg);
}
.hero__names {
  margin: 0;
  font-weight: 500;
  font-size: clamp(2.1rem, 9.5vw, 4.6rem);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.1;
  color: var(--ink);
}
.hero__names .amp { font-style: italic; text-transform: none; font-weight: 400; color: var(--copper); }
.hero__meta {
  margin: 14px 0 0;
  font-size: clamp(0.95rem, 3.6vw, 1.2rem);
  color: var(--ink-soft);
}
.hero__meta .dot { color: var(--copper); padding: 0 .35em; }
@media (max-width: 599px) {
  .hero__meta .date { display: block; margin-bottom: 2px; }
  .hero__meta .dot--first { display: none; }
}

.hero__photo {
  margin: 36px calc(var(--gutter) * -1) 0;
  position: relative;
}
.hero__photo img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  object-position: var(--focus, 50% 50%);
}
@media (min-width: 700px) {
  .hero__photo { margin: 44px 0 0; }
  .hero__photo img { border-radius: var(--radius); box-shadow: var(--shadow); }
}
.hero__intro {
  max-width: 34em;
  margin: 36px auto 0;
  font-size: 1.15em;
}
.married-for { margin: 24px 0 0; color: var(--ink-soft); font-size: .95rem; }
.married-for b { color: var(--copper); font-weight: 500; }

.jump {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 22px;
  margin: 30px 0 0; padding: 0; list-style: none;
  font-size: 1.02rem;
}
.jump a {
  text-decoration: none;
  padding: 6px 2px;
  border-bottom: 1px solid transparent;
  transition: border-color .2s, color .2s;
}
.jump a:hover { color: var(--copper); border-color: var(--copper); }

/* ── Ornamental divider ───────────────────────────────── */
.flourish {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  margin: 56px auto; color: var(--line); max-width: 360px; padding: 0 var(--gutter);
}
.flourish::before, .flourish::after {
  content: ""; flex: 1; height: 1px;
  background: linear-gradient(90deg, transparent, var(--line));
}
.flourish::after { background: linear-gradient(270deg, transparent, var(--line)); }
.flourish svg { width: 22px; height: 22px; color: var(--copper); }

/* ── Section heads ────────────────────────────────────── */
.section { padding: 0 var(--gutter); max-width: 1400px; margin: 0 auto; }
.section__head { text-align: center; max-width: 36em; margin: 0 auto 26px; }
.section__kicker { margin: 0; color: var(--ink-soft); font-size: .95rem; }
.section__title { margin: 0; font-size: clamp(2.8rem, 12vw, 4.4rem); }
.section__intro { margin: 8px 0 0; }

.todo {
  display: block;
  margin: 12px auto 0;
  padding: 10px 14px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--ink-soft);
  font-style: italic;
  font-size: .95rem;
  max-width: 32em;
  background: color-mix(in srgb, var(--paper-2) 60%, transparent);
}
.todo::before { content: "✎ "; font-style: normal; color: var(--copper); }

/* ── Favourites strip ─────────────────────────────────── */
.strip {
  display: flex; gap: 10px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 4px var(--gutter) 16px;
  margin: 0 calc(var(--gutter) * -1);
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
  overscroll-behavior-x: contain;
}
.strip .tile {
  flex: 0 0 auto;
  height: min(56vh, 440px);
  aspect-ratio: var(--ar);
  scroll-snap-align: center;
}
@media (min-width: 700px) { .strip { padding-inline: 0; margin: 0; } }

/* ── Timeline (sticky chapter index) ──────────────────── */
.timeline {
  position: sticky; top: 0; z-index: 15;
  background: color-mix(in srgb, var(--paper) 90%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-block: 1px solid var(--line-soft);
  margin-top: 24px;
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center;
  gap: 4px; padding: 0 calc(var(--gutter) - 6px);
}
.timeline__mono { display: block; flex: none; padding: 4px 2px; }
.timeline__mono svg { width: 28px; height: 36px; display: block; }
.timeline .icon-btn { width: 38px; height: 38px; background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; }
.timeline ol {
  display: flex; gap: 0;
  margin: 0 auto; padding: 0;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 14px, #000 calc(100% - 14px), transparent);
  mask-image: linear-gradient(90deg, transparent, #000 14px, #000 calc(100% - 14px), transparent);
  list-style: none;
  overflow-x: auto;
  scrollbar-width: none;
  max-width: 100%;
  justify-content: safe center;
}
.timeline ol::-webkit-scrollbar { display: none; }
.timeline li { flex: 0 0 auto; position: relative; }
.timeline li a {
  display: flex; flex-direction: column; align-items: center;
  padding: 9px 14px 8px;
  text-decoration: none;
  white-space: nowrap;
  color: var(--ink-soft);
  transition: color .2s;
}
.timeline .t-time { font-size: .72rem; letter-spacing: .14em; font-variant-numeric: lining-nums; }
.timeline .t-name { font-size: 1rem; line-height: 1.2; }
.timeline li a::after {
  content: ""; width: 5px; height: 5px; border-radius: 50%;
  background: currentColor; margin-top: 4px; opacity: .35;
  transition: transform .25s, opacity .25s, background-color .25s;
}
.timeline li a:hover, .timeline li a[aria-current="true"] { color: var(--copper); }
.timeline li a[aria-current="true"]::after { opacity: 1; transform: scale(1.5); }

/* ── Chapters ─────────────────────────────────────────── */
.chapter { padding-top: 56px; }
.chapter + .chapter { padding-top: 72px; }
.chapter__head { text-align: center; max-width: 36em; margin: 0 auto 22px; }
.chapter__num { color: var(--ink-soft); font-size: .88rem; margin: 0; }
.chapter__title { margin: 0; font-size: clamp(2.7rem, 11vw, 4.2rem); }
.chapter__time { margin: 0; font-size: .95rem; color: var(--ink-soft); }

/* Justified rows that keep the order of the day (no column shuffling). */
.grid {
  display: flex; flex-wrap: wrap; gap: 4px;
}
.grid::after { content: ""; flex: 999 1 0; }
@media (min-width: 700px) { .grid { gap: 8px; } }
.grid .tile {
  flex: var(--ar) 1 calc(var(--ar) * var(--row-h));
  aspect-ratio: var(--ar);
  max-height: calc(var(--row-h) * 1.6);
}
.grid.is-collapsed .tile:nth-child(n + 25) { display: none; }
@media (min-width: 700px) { .grid.is-collapsed .tile:nth-child(n + 25) { display: block; } .grid.is-collapsed .tile:nth-child(n + 31) { display: none; } }

.tile {
  position: relative;
  display: block;
  overflow: hidden;
  background: var(--c, var(--paper-3));
  border-radius: 2px;
  cursor: zoom-in;
}
.tile img, .tile picture { width: 100%; height: 100%; }
.tile img { object-fit: cover; transition: transform .6s cubic-bezier(.2,.7,.2,1), opacity .5s; }
.tile img[data-loading] { opacity: 0; }
@media (hover: hover) { .tile:hover img { transform: scale(1.025); } }

.more {
  display: flex; justify-content: center; margin: 22px 0 0;
}
.btn {
  display: inline-flex; align-items: center; gap: .55em;
  padding: 11px 22px;
  border: 1px solid var(--ink);
  border-radius: 2px;
  background: transparent;
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
  font-size: 1rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-variant-numeric: lining-nums;
  transition: background-color .2s, color .2s, border-color .2s;
}
.btn:hover { background: var(--ink); color: var(--paper); }
.btn--solid { background: var(--ink); color: var(--paper); }
.btn--solid:hover { background: var(--ink-strong); border-color: var(--ink-strong); }
.btn svg { width: 18px; height: 18px; }

/* ── Films ────────────────────────────────────────────── */
.films {
  display: grid; gap: 34px;
  grid-template-columns: 1fr;
  max-width: 1100px; margin: 0 auto;
}
@media (min-width: 900px) {
  .films { grid-template-columns: 1fr 1fr; }
  .film--feature { grid-column: 1 / -1; }
}
.film__frame {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--paper-3);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.film__frame video { width: 100%; height: 100%; display: block; background: #000; }
.film__soon {
  position: absolute; inset: 0;
  display: grid; place-content: center; justify-items: center; gap: 4px;
  text-align: center; color: var(--ink-soft);
  background:
    radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--copper) 10%, transparent), transparent 60%),
    var(--paper-2);
}
.film__soon svg { width: 46px; height: auto; opacity: .8; }
.film__soon .script { font-size: 2.2rem; }
.film__title { margin: 14px 0 0; font-size: 1.35rem; font-weight: 500; }
.film__meta { margin: 2px 0 0; color: var(--ink-soft); font-size: .95rem; }
.film__meta a { color: var(--copper); }

/* ── Downloads ────────────────────────────────────────── */
.downloads {
  max-width: 640px; margin: 0 auto;
  display: grid; gap: 10px;
  padding: 0; list-style: none;
}
.downloads a {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 18px;
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  text-decoration: none;
  background: var(--paper-2);
  transition: border-color .2s, transform .2s;
}
.downloads a:hover { border-color: var(--copper); transform: translateY(-1px); }
.downloads .size { color: var(--ink-soft); font-size: .92rem; white-space: nowrap; font-variant-numeric: lining-nums; }
.downloads svg { width: 18px; height: 18px; color: var(--copper); flex: none; }
.note { text-align: center; color: var(--ink-soft); font-size: .98rem; max-width: 34em; margin: 18px auto 0; }

/* ── Footer ───────────────────────────────────────────── */
.footer {
  text-align: center;
  padding: 40px var(--gutter) 64px;
  color: var(--ink-soft);
  font-size: .95rem;
}
.footer__mono { width: 46px; margin: 0 auto 10px; display: block; }
.footer__mono svg { width: 100%; height: auto; }
.footer p { margin: 4px 0; }
.footer a { color: var(--ink); }

/* ── Lightbox ─────────────────────────────────────────── */
.lightbox {
  position: fixed; inset: 0; z-index: 100;
  width: 100%; height: 100%; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0;
  background: var(--scrim);
  --copper-a: #cf7f66; --copper-b: #f0b195; --copper: #e0957a;
  color: #efe5dc;
  overscroll-behavior: contain;
}
.lightbox::backdrop { background: transparent; }
.lightbox[open] { display: grid; grid-template-rows: auto 1fr auto; }
.lb__bar {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: max(8px, env(safe-area-inset-top)) 10px 8px;
  font-size: .9rem;
}
.lb__count { letter-spacing: .14em; font-variant-numeric: lining-nums; opacity: .8; padding-left: 8px; }
.lb__actions { display: flex; gap: 6px; }
.lightbox .icon-btn { background: rgb(255 255 255 / 0.06); border-color: rgb(255 255 255 / 0.14); color: #efe5dc; }
.lightbox .icon-btn:hover { color: #f0b195; border-color: rgb(255 255 255 / 0.3); }
.lb__stage {
  position: relative; overflow: hidden;
  display: grid; place-items: center;
  touch-action: pan-y pinch-zoom;
  user-select: none; -webkit-user-select: none;
}
.lb__stage picture { display: contents; }
.lb__stage img {
  max-width: 100%; max-height: 100%;
  width: auto; height: auto;
  object-fit: contain;
  transition: transform .28s cubic-bezier(.2,.7,.2,1), opacity .2s;
  will-change: transform;
}
.lb__stage img.is-dragging { transition: none; }
.lb__nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 48px; height: 64px;
  border: 0; background: transparent; color: #efe5dc; cursor: pointer; opacity: .75;
  display: none;
}
.lb__nav:hover { opacity: 1; color: #f0b195; }
.lb__nav svg { width: 30px; height: 30px; }
.lb__nav--prev { left: 6px; }
.lb__nav--next { right: 6px; }
@media (hover: hover) and (min-width: 700px) { .lb__nav { display: grid; place-items: center; } }
.lb__foot {
  display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 12px max(14px, env(safe-area-inset-bottom));
  text-align: center;
}
.lb__caption { margin: 0; font-size: .95rem; opacity: .85; width: 100%; }
.lb__caption .script { font-size: 1.7rem; padding: 0 .2em; margin: 0; vertical-align: -0.12em; }
.lightbox .btn { border-color: rgb(239 229 220 / .5); color: #efe5dc; font-size: .88rem; padding: 9px 16px; }
.lightbox .btn:hover { background: #efe5dc; color: #1a1512; }
.toast {
  position: fixed; left: 50%; bottom: 90px; transform: translate(-50%, 10px);
  background: #efe5dc; color: #1a1512; padding: 8px 16px; border-radius: 30px;
  font-size: .95rem; opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none; z-index: 101;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ── Reveal on scroll ─────────────────────────────────── */
@media (prefers-reduced-motion: no-preference) {
  .js .reveal { opacity: 0; transform: translateY(14px); transition: opacity .8s ease, transform .8s ease; }
  .js .reveal.is-in { opacity: 1; transform: none; }
}

/* ── 404 ──────────────────────────────────────────────── */
.lost { min-height: 80vh; display: grid; place-content: center; text-align: center; padding: var(--gutter); }
.lost .script { font-size: clamp(3rem, 14vw, 5rem); }
