@font-face {
  font-family: Album Serif;
  src: url('./fonts/NotoSerifDisplay-Regular.woff') format('woff');
  font-display: swap;
}
@font-face {
  font-family: Album Serif;
  src: url('./fonts/NotoSerifDisplay-Italic.woff') format('woff');
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: Album Sans;
  src: url('./fonts/NotoSans-Regular.woff') format('woff');
  font-display: swap;
}
:root {
  color-scheme: light;
  --paper: #f8f2e9;
  --cream: #fffbf3;
  --ink: #371f25;
  --muted: #685058;
  --red: #873849;
  --deep-red: #67273a;
  --line: #decec3;
  --blush: #ead1ca;
  --serif: Album Serif, Georgia, serif;
  --sans: Album Sans, system-ui, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); }
body:has(dialog[open]) { overflow: hidden; }
a { color: inherit; }
button { color: inherit; font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 4px; }
img, video { display: block; max-width: 100%; }
h1, h2, p, figure { margin: 0; }
h1, h2 { font-family: var(--serif); font-weight: 400; }
h1 em, h2 em { font-weight: inherit; color: var(--red); }
.wrap { width: min(1184px, calc(100% - 112px)); margin-inline: auto; }
.site-top {
  min-height: 79px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.site-top a, .site-footer a { text-decoration: none; }
.wordmark { display: inline-flex; align-items: center; gap: 11px; font-family: var(--serif); font-size: 24px; letter-spacing: -.035em; }
.wordmark span { color: var(--red); font-size: 25px; line-height: 1; }
.site-top nav { display: flex; align-items: center; gap: clamp(18px, 4vw, 50px); font-size: 13px; color: var(--muted); }
.site-top nav a, .site-footer a { padding-block: 12px; }
.site-top nav a:hover, .site-footer a:hover { color: var(--red); text-decoration: underline; text-underline-offset: 4px; }

.cover {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  min-height: 665px;
  gap: 4px;
  padding-block: 53px 73px;
}
.cover-copy { padding-block: 16px; z-index: 1; }
.label { font-size: 11px; font-weight: 600; line-height: 1.5; letter-spacing: .16em; text-transform: uppercase; color: var(--red); }
.dedication { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-bottom: 22px; }
.dedication span { width: 25px; height: 1px; background: currentColor; margin-right: 6px; }
.dedication b { font-size: 14px; line-height: 1; font-weight: 400; }
.cover h1 { font-size: clamp(86px, 10.2vw, 154px); line-height: .85; letter-spacing: -.083em; }
.cover h1 em { display: inline-block; padding-right: .1em; }
.intro { max-width: 330px; margin-top: 30px; color: var(--muted); font-size: 16px; line-height: 1.65; }
.cover-links { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; margin-top: 27px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 17px; min-height: 48px; padding: 0 18px; background: var(--deep-red); color: var(--cream); text-decoration: none; font-size: 13px; border-radius: 2px; }
.button span { font-size: 17px; }
.button:hover { background: var(--red); }
.text-link { padding: 6px 0; color: var(--muted); font-size: 13px; text-decoration: none; }
.text-link:hover { color: var(--red); text-decoration: underline; text-underline-offset: 4px; }

.collage {
  width: 100%;
  max-width: 615px;
  justify-self: end;
  aspect-ratio: 1.04;
  position: relative;
  isolation: isolate;
}
.collage-sheet {
  position: absolute;
  z-index: -1;
  inset: 6% 3% 6% 8%;
  transform: rotate(-5deg);
  background: radial-gradient(ellipse at 33% 70%, #f6e7de55, transparent 65%), repeating-linear-gradient(0deg, transparent 0 25px, #a5536418 25px 26px), #eedad2;
  border: 1px solid #e5caca;
}
.cover-print, .side-print {
  position: absolute;
  background: var(--cream);
  padding: 12px;
  box-shadow: 0 4px 16px #4026192a;
  border: 1px solid #eaddd0;
}
.cover-print {
  inset: 3% 16% auto auto;
  width: 64%;
  transform: rotate(-5deg);
}
.cover-print img { width: 100%; height: auto; aspect-ratio: 4 / 4.65; object-fit: cover; object-position: 58% 37%; background: #d4b299; }
.cover-print figcaption, .side-print figcaption {
  padding: 12px 4px 3px;
  font: italic clamp(11px, 1.5vw, 19px)/1.15 var(--serif);
  color: var(--deep-red);
}
.side-print {
  z-index: 2;
  width: 46%;
  right: 0;
  bottom: 4.5%;
  transform: rotate(9deg);
}
.side-print img { width: 100%; height: auto; object-fit: cover; background: #caafa4; }
.side-print figcaption { text-align: right; }
.tape {
  position: absolute;
  width: 37%;
  height: 25px;
  top: -9px;
  left: 32%;
  transform: rotate(5deg);
  background: repeating-linear-gradient(115deg, #f0c2a27a 0 2px, #f5ccac9c 2px 5px);
  clip-path: polygon(2% 0, 99% 3%, 97% 27%, 100% 48%, 96% 71%, 98% 100%, 0 98%, 3% 78%, 0 55%, 3% 36%, 0 19%);
}
.doodle {
  position: absolute;
  left: 5%;
  bottom: 2%;
  font-family: Georgia, serif;
  line-height: 1;
  font-size: clamp(49px, 6vw, 91px);
  color: var(--red);
  transform: rotate(-15deg);
  pointer-events: none;
  user-select: none;
}
.album { border-top: 1px solid var(--line); padding-top: clamp(30px, 5vw, 62px); scroll-margin-top: 20px; }
.album-heading { display: flex; justify-content: space-between; gap: 14px; align-items: baseline; }
.album h2, .letter h2 { font-size: clamp(37px, 6.3vw, 85px); line-height: 1.03; letter-spacing: -.06em; }
.album-heading .label { white-space: nowrap; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-block: 23px 22px; }
.filters button {
  background: transparent;
  border: 1px solid #d8c5bb;
  border-radius: 2px;
  cursor: pointer;
  padding: 10px 14px;
  font-size: 13px;
}
.filters button:hover { border-color: var(--red); }
.filters button[aria-pressed="true"] { background: var(--deep-red); color: var(--cream); border-color: var(--deep-red); }

.photo-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.photo-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: 1px solid #e3d4c6;
  background: var(--cream);
  padding: 8px;
  cursor: zoom-in;
  text-align: left;
  transition: transform .2s ease, box-shadow .2s ease;
}
.photo-card:hover { transform: translateY(-3px); box-shadow: 0 6px 13px #523a2622; }
.photo-card img { width: 100%; aspect-ratio: 1 / 1.095; object-fit: cover; background: #e2ccbf; }
.photo-caption { min-height: 43px; display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 8px 4px 3px; font: italic clamp(13px, 1.4vw, 18px)/1.2 var(--serif); }
.photo-arrow { color: var(--red); font: 12px/1 var(--sans); }

.film { padding-top: clamp(52px, 9vw, 116px); scroll-margin-top: -24px; }
.film-inner { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 30px; background: #4c2532; color: var(--cream); padding: clamp(22px, 5vw, 64px); }
.film-copy { max-width: 520px; }
.film .label, .film h2 em { color: #edc3bf; }
.film h2 { font-size: clamp(40px, 6.5vw, 83px); line-height: .99; letter-spacing: -.07em; margin-block: 18px; }
.film-copy p:last-child { color: #f2e1db; line-height: 1.6; font-size: 15px; }
.film video { width: clamp(190px, 23vw, 295px); aspect-ratio: 9 / 16; background: #261221; }
.letter { padding-block: clamp(65px, 10vw, 126px); scroll-margin-top: -22px; }
.letter-paper {
  position: relative;
  width: min(100%, 770px);
  margin: auto;
  border: 1px solid var(--line);
  padding: clamp(30px, 6.4vw, 81px);
  background: linear-gradient(154deg, #fffaf1, #f7eade);
  box-shadow: 0 10px 35px #4932260c;
}
.letter-heart { position: absolute; top: 12%; right: 10%; color: var(--red); font: 42px/1 Georgia, serif; transform: rotate(12deg); }
.letter p { max-width: 510px; margin-top: 20px; line-height: 1.75; font-size: 16px; color: var(--muted); }
.letter .signoff { font: italic 24px/1.3 var(--serif); color: var(--deep-red); }
.site-footer { display: flex; align-items: center; justify-content: space-between; min-height: 80px; border-top: 1px solid var(--line); gap: 14px; color: var(--muted); font-size: 13px; }
.site-footer span span { color: var(--red); }

#viewer {
  width: min(1050px, 98vw);
  max-width: none;
  max-height: 100%;
  background: transparent;
  border: 0;
  color: var(--cream);
  padding: 0;
  overflow: visible;
}
#viewer::backdrop { background: #201017f5; }
.viewer-body { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; grid-template-rows: 44px auto; align-items: center; gap: 10px 12px; padding: 8px; }
.viewer-figure { grid-area: 2 / 2; }
.viewer-figure img { width: auto; max-width: 100%; max-height: min(76dvh, 760px); margin: auto; border-radius: 2px; touch-action: pan-y; }
.viewer-figure figcaption { margin-top: 10px; text-align: center; font: italic 18px/1.25 var(--serif); }
.viewer-button { width: 44px; height: 44px; background: #fff3e416; border: 1px solid #f6d4db74; color: var(--cream); cursor: pointer; font-size: 21px; border-radius: 50%; }
.viewer-button:focus-visible { outline-color: var(--cream); }
.viewer-button:hover { background: #fff3e43b; }
.viewer-close { grid-area: 1 / 3; }
.viewer-prev { grid-area: 2 / 1; }
.viewer-next { grid-area: 2 / 3; }

@media (max-width: 1020px) {
  .wrap { width: calc(100% - 72px); }
  .cover { min-height: 560px; }
  .cover h1 { font-size: clamp(80px, 12vw, 123px); }
  .photo-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
}
@media (max-width: 670px) {
  .wrap { width: calc(100% - 36px); }
  .site-top { min-height: 64px; }
  .wordmark { font-size: 21px; gap: 5px; }
  .site-top nav { gap: 16px; font-size: 12px; }
  .cover { grid-template-columns: 1fr; min-height: 0; padding-block: 36px 39px; gap: 21px; }
  .cover-copy { padding-block: 0; }
  .cover h1 { font-size: clamp(75px, 16vw, 106px); }
  .cover h1 br { display: none; }
  .dedication { margin-bottom: 18px; }
  .dedication span { width: 17px; }
  .intro { margin-top: 18px; font-size: 15px; }
  .cover-links { margin-top: 18px; }
  .collage { max-width: 430px; justify-self: center; }
  .cover-print, .side-print { padding: 8px; }
  .cover-print figcaption, .side-print figcaption { font-size: 14px; padding-top: 9px; }
  .tape { height: 18px; top: -6px; }
  .album-heading { align-items: end; }
  .album-heading .label { letter-spacing: .1em; padding-bottom: 2px; }
  .filters { margin-block: 16px; }
  .photo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .photo-card { padding: 5px; }
  .photo-caption { padding: 5px 3px 2px; min-height: 35px; font-size: 14px; }
  .film-inner { grid-template-columns: 1fr; }
  .film video { width: min(100%, 235px); margin: auto; }
  .letter-heart { font-size: 32px; top: 8%; }
  .letter p { font-size: 15px; }
  .viewer-body { grid-template-rows: 44px auto 44px; row-gap: 8px; padding: 5px; }
  .viewer-figure { grid-area: 2 / 1 / 3 / -1; }
  .viewer-figure img { max-height: 70dvh; }
  .viewer-prev { grid-area: 3 / 1; }
  .viewer-next { grid-area: 3 / 3; }
}
@media (max-width: 435px) {
  .cover h1 br { display: initial; }
}
@media (max-width: 355px) {
  .cover h1 { font-size: 64px; }
  .album h2 { font-size: 32px; }
  .dedication { letter-spacing: .09em; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}

/* New keepsakes, in the same paper-and-burgundy album. */
[hidden] { display: none !important; }
body { font-size: 16px; }
.site-top nav, .button, .text-link, .filters button, .site-footer { font-size: 14px; }
.label { font-size: 14px; letter-spacing: .1em; }
.intro, .letter p, .film-copy p:last-child { font-size: 16px; }
button.button { border: 1px solid var(--deep-red); cursor: pointer; }
.button-outline { color: var(--deep-red); background: transparent; border: 1px solid var(--deep-red); }
.button-outline:hover { color: var(--cream); background: var(--deep-red); }
.surprises { padding-block: 26px 64px; scroll-margin-top: 24px; }
.surprises h2 { font-size: clamp(38px, 5vw, 64px); line-height: 1.1; letter-spacing: -.05em; margin-top: 10px; }
.surprise-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 28px; }
.surprise-card { position: relative; display: flex; flex-direction: column; align-items: start; gap: 22px; padding: 30px; background: var(--cream); border: 1px solid var(--line); }
.surprise-symbol { color: var(--red); font: 44px/1 var(--serif); }
.surprise-card h3 { font: 28px/1.2 var(--serif); margin: 0 0 10px; letter-spacing: -.025em; }
.surprise-card p { line-height: 1.6; color: var(--muted); }
.surprise-card .button { margin-top: auto; }
.memory-card { background: #efe0da; }
.more-photos { display: flex; flex-direction: column; align-items: center; gap: 14px; padding-top: 26px; }
.more-photos p { font-size: 14px; color: var(--muted); }
.letter-label { text-align: center; margin-bottom: 20px; }
.envelope { width: min(100%, 770px); margin-inline: auto; }
.envelope summary { cursor: pointer; text-align: center; display: flex; align-items: center; flex-direction: column; gap: 14px; padding: 44px 24px; border: 1px solid #c4a29b; background: linear-gradient(145deg, #ecd3ca, #f4e3d8); list-style: none; box-shadow: 0 8px 26px #4932260c; }
.envelope summary::-webkit-details-marker { display: none; }
.envelope summary:hover { background: #eed8cf; }
.envelope-icon { font: 70px/1 Georgia, serif; color: var(--red); }
.envelope-title { font: 36px/1.2 var(--serif); letter-spacing: -.035em; }
.envelope-title em { color: var(--red); }
.envelope-hint { font-size: 14px; color: var(--muted); }
.when-open, .envelope[open] .when-closed { display: none; }
.envelope[open] .when-open { display: inline; }
.envelope[open] summary { padding: 24px; }
.envelope[open] .envelope-icon { font-size: 40px; }
.envelope[open] .envelope-title { font-size: 26px; }
.envelope .letter-paper { border-top: 0; }
.heart-shower { position: fixed; z-index: 20; inset: 0; pointer-events: none; overflow: hidden; }
.heart-shower span { position: absolute; left: var(--left); top: -50px; color: var(--red); font: 36px/1 Georgia, serif; animation: heart-fall 2s var(--delay) ease-in forwards; }
@keyframes heart-fall { to { transform: translateY(105vh) rotate(var(--turn)); opacity: 0; } }
#matching-game { width: min(680px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 0; border: 1px solid var(--line); background: var(--paper); color: var(--ink); border-radius: 4px; }
#matching-game::backdrop { background: #201017e8; }
.game-panel { padding: 24px; }
.game-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.game-close { flex-shrink: 0; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 50%; background: transparent; cursor: pointer; font-size: 24px; }
.game-panel h2 { font-size: clamp(30px, 5vw, 44px); letter-spacing: -.05em; margin-block: 8px 12px; }
#game-instructions { font-size: 16px; line-height: 1.5; color: var(--muted); }
.game-status { min-height: 24px; font-size: 14px; margin-block: 14px; color: var(--red); }
.matching-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.match-card { position: relative; padding: 0; border: 2px solid var(--line); border-radius: 3px; background: var(--deep-red); aspect-ratio: 1; cursor: pointer; overflow: hidden; }
.match-card span { display: grid; place-items: center; position: absolute; inset: 0; color: #f4dcd1; font: 42px/1 var(--serif); }
.match-card img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .18s; }
.match-card.is-flipped img { opacity: 1; }
.match-card.is-matched { border-color: var(--red); opacity: .8; cursor: default; }
.game-actions { margin-top: 20px; display: flex; flex-wrap: wrap; gap: 12px; }
@media (max-width: 670px) {
  .site-top { padding-block: 13px; gap: 8px; flex-direction: column; align-items: start; }
  .site-top nav { font-size: 14px; gap: 25px; }
  .site-top nav a { padding-block: 5px; }
  .surprises { padding-block: 12px 40px; }
  .surprise-cards { grid-template-columns: 1fr; gap: 14px; }
  .surprise-card { padding: 24px; gap: 18px; }
  .surprise-card h3 { font-size: 26px; }
  .label { font-size: 14px; letter-spacing: .06em; }
  .album-heading { align-items: start; flex-direction: column; gap: 10px; }
  .game-panel { padding: 16px; }
  .matching-grid { gap: 6px; }
  .envelope-title { font-size: 30px; }
}
@media (prefers-reduced-motion: reduce) {
  .heart-shower { display: none; }
  *, *::before, *::after { animation: none !important; }
}

.match-card.is-flipped span { visibility: hidden; }
.letter .letter-label { max-width: none; margin: 0 0 20px; }
