@font-face {
  font-family: Album Serif;
  src: url("assets/serif.woff2") format("woff2");
  font-weight: 400 900;
  font-display: swap;
}
@font-face {
  font-family: Bad Script;
  src: url("assets/bad-script.woff2") format("woff2");
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #fff9f5;
  --white: #fffcfa;
  --pink: #f9edee;
  --line: #e6d3d6;
  --berry: #89455f;
  --ink: #38292d;
  --muted: #6b565b;
  --serif: "Album Serif", Georgia, serif;
  --sans: system-ui, sans-serif;
  scroll-behavior: smooth;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 1rem/1.65 var(--sans); }
h1, h2, h3, p, figure, dl, dd { margin: 0; }
a { color: inherit; }
button { font: inherit; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--berry); outline-offset: 4px; }
section[id] { scroll-margin-top: 4.25rem; }
.hand { font: 400 1.45rem/1.42 "Bad Script", var(--serif); color: var(--berry); }

.site-header { position: sticky; z-index: 5; top: 0; border-bottom: 1px solid var(--line); background: #fff9f5fa; }
.header-inner { width: min(88%, 1120px); height: 67px; margin: auto; display: flex; justify-content: space-between; align-items: center; }
.wordmark { font: 1.6rem/1 var(--serif); text-decoration: none; white-space: nowrap; }
.site-header nav { display: flex; gap: clamp(.8rem, 3.4vw, 2.6rem); align-items: center; }
.site-header nav a { padding-block: .65rem; text-decoration: none; color: var(--muted); font-size: .875rem; white-space: nowrap; }
.site-header nav a:is(:hover, [aria-current]) { color: var(--berry); text-decoration: underline; text-underline-offset: .42rem; text-decoration-thickness: 1px; }

.cover { display: grid; align-items: center; min-height: min(690px, calc(100svh - 68px)); }
.cover-inner { width: min(88%, 1120px); padding: clamp(3.2rem, 7vw, 6.4rem) 0; margin: auto; display: grid; grid-template-columns: minmax(0, 1.02fr) minmax(0, 1fr); align-items: center; gap: clamp(2rem, 6vw, 6.2rem); }
.cover-copy { animation: arrive .55s ease-out both; }
.cover-dedication { margin-bottom: .9rem; }
h1 { max-width: 8em; font: 400 clamp(3.45rem, 7.2vw, 6.5rem)/.92 var(--serif); letter-spacing: -.058em; }
h1 span { white-space: nowrap; }
.cover-subtitle { max-width: 26ch; color: var(--muted); margin-top: 1.35rem; }
.open-button { display: inline-flex; min-height: 48px; align-items: center; justify-content: center; gap: .55rem; margin-top: 1.55rem; padding: .58rem 1.12rem; background: var(--berry); border: 1px solid var(--berry); color: var(--white); border-radius: 4px; font-size: .9rem; font-weight: 500; text-decoration: none; transition: background .2s; }
.open-button span { font: 1.18rem/1 Georgia, serif; }
.open-button:hover { background: #71384e; }
.cover-photo { padding: .62rem .62rem 1.6rem; background: var(--white); border: 1px solid #e0cfce; box-shadow: 0 7px 16px #56363e0b; animation: arrive .6s .08s ease-out both; }
.cover-photo img { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; }

.section-heading { text-align: center; }
h2 { font: 400 clamp(2.45rem, 4.4vw, 4.1rem)/1 var(--serif); letter-spacing: -.04em; }
.together { text-align: center; padding: clamp(3.7rem, 8vw, 6.5rem) 1.25rem; border-block: 1px solid var(--line); background: var(--pink); }
.together:focus { outline: 0; }
.timer-card { width: min(100%, 690px); margin: 2rem auto 1.35rem; padding: 1.75rem 1rem; border: 1px solid var(--line); background: var(--white); border-radius: 4px; }
.timer { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.timer div { display: flex; flex-direction: column-reverse; align-items: center; }
.timer div + div { border-left: 1px solid var(--line); }
.timer dd { color: var(--berry); font: 400 clamp(2.6rem, 6vw, 4.4rem)/1 var(--serif); letter-spacing: -.04em; font-variant-numeric: lining-nums tabular-nums; }
.timer dt { margin-top: .52rem; font-size: .875rem; color: var(--muted); }
.timer-note { color: var(--muted); }
.just-opened .section-heading, .just-opened .timer-card, .just-opened .timer-note { animation: arrive .55s .12s ease-out both; }
.just-opened .timer-card { animation-delay: .19s; }
.just-opened .timer-note { animation-delay: .25s; }

.story { padding: clamp(3.7rem, 8vw, 6.4rem) 0; }
.story-layout { width: min(88%, 930px); display: grid; grid-template-columns: minmax(245px, .85fr) minmax(0, 1.15fr); gap: clamp(2rem, 6vw, 5.5rem); margin: 2.65rem auto 0; align-items: start; }
.timeline { list-style: none; position: relative; margin: 0; padding: 0 0 0 1.45rem; }
.timeline::before { content: ""; width: 1px; background: #d8b7c1; position: absolute; top: 33px; bottom: 33px; left: 4px; }
.timeline li + li { margin-top: .35rem; }
.timeline button { position: relative; text-align: left; padding: .65rem .8rem; min-height: 66px; border: 1px solid transparent; display: grid; width: 100%; gap: .16rem; background: transparent; cursor: pointer; border-radius: 4px; color: var(--ink); transition: background .18s, border-color .18s; }
.timeline button::before { content: ""; position: absolute; top: 50%; left: -1.48rem; translate: 0 -50%; width: 10px; height: 10px; border: 1px solid var(--berry); border-radius: 50%; background: var(--paper); }
.timeline button[aria-pressed="true"]::before { background: var(--berry); }
.timeline button:is(:hover, [aria-pressed="true"]) { background: var(--pink); border-color: var(--line); }
.timeline .event-title { font: 400 1.4rem/1.12 var(--serif); }
.event-date { color: var(--berry); font-size: .875rem; }
.memory { min-width: 0; min-height: 13rem; padding: clamp(1.4rem, 3.6vw, 2.5rem); background: var(--white); border: 1px solid var(--line); border-radius: 4px; }
.memory h3 { margin: .4rem 0 .65rem; font: 400 clamp(1.65rem, 3vw, 2.35rem)/1.05 var(--serif); letter-spacing: -.03em; }
#memory-text { color: var(--muted); }
.memory-caption { margin-top: 1.35rem; }
.photos { padding: clamp(3.7rem, 8vw, 6.4rem) 0; background: var(--pink); border-top: 1px solid var(--line); }
.photo-collage { --photo-gap: clamp(.65rem, 2vw, 1.15rem); width: min(88%, 930px); margin: 2.65rem auto 0; display: flex; flex-wrap: wrap; justify-content: center; gap: var(--photo-gap); }
.photo-collage figure { width: calc((100% - 3 * var(--photo-gap)) / 4); min-width: 0; padding: clamp(.3rem, 1vw, .6rem); border: 1px solid var(--line); background: var(--white); }
.photo-collage img { width: 100%; aspect-ratio: 3 / 4; object-fit: contain; background: var(--white); }
.site-footer { text-align: center; padding: 2.5rem 1rem; border-top: 1px solid var(--line); }
.site-footer p { margin-bottom: .55rem; }
.site-footer a { color: var(--berry); font-size: .875rem; text-underline-offset: 4px; }

@keyframes arrive { from { opacity: 0; translate: 0 8px; } to { opacity: 1; translate: 0 0; } }

@media (max-width: 700px) {
  .header-inner { height: 55px; width: 90%; }
  .wordmark { font-size: 1.24rem; }
  section[id] { scroll-margin-top: 3.5rem; }
  .cover { min-height: min(720px, calc(100svh - 56px)); }
  .cover-inner { width: min(88%, 430px); padding: 3.4rem 0; grid-template-columns: 1fr; gap: 1.9rem; }
  .cover-dedication { margin-bottom: .6rem; }
  h1 { max-width: none; font-size: clamp(2.63rem, 10.5vw, 4.45rem); }
  .cover-subtitle { margin-top: .75rem; }
  .open-button { margin-top: 1.05rem; }
  .cover-photo { padding: .48rem .48rem 1.18rem; }
  .story-layout { grid-template-columns: 1fr; width: min(88%, 430px); gap: 1.4rem; margin-top: 1.7rem; }
  .photo-collage { width: min(88%, 500px); margin-top: 1.7rem; }
  .photo-collage figure { width: calc((100% - var(--photo-gap)) / 2); }
  .together { padding-inline: 1rem; }
  .timer-card { padding: 1.1rem .4rem; margin-top: 1.55rem; }
  .timer dd { font-size: clamp(1.9rem, 8vw, 3rem); }
}
@media (max-width: 540px) {
  .header-inner { height: auto; min-height: 75px; padding-top: .55rem; flex-direction: column; justify-content: center; gap: .05rem; }
  .site-header nav { gap: .75rem; }
  .site-header nav a { font-size: .82rem; }
  section[id] { scroll-margin-top: 4.75rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
