@font-face {
  font-family: Cormorant;
  src: url("fonts/display-regular.woff2") format("woff2");
  font-weight: 400 600;
  font-display: swap;
}

@font-face {
  font-family: Cormorant;
  src: url("fonts/display-italic.woff2") format("woff2");
  font-weight: 400 600;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "DM Sans";
  src: url("fonts/body-regular.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

:root {
  color-scheme: light;
  --ink: #38232d;
  --muted: #69505a;
  --wine: #8f3654;
  --dark-wine: #722640;
  --cream: #fffaf4;
  --paper: #fffcf7;
  --blush: #f7e1de;
  --line: #dec3bd;
  --display: Cormorant, Georgia, serif;
  --body: "DM Sans", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--cream); font: 1rem/1.6 var(--body); }
body:has(dialog[open]) { overflow: hidden; }
img { display: block; max-width: 100%; }
figure, h1, h2, p { margin: 0; }
a { color: inherit; }
button { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--wine); outline-offset: 5px; }

.wrap { width: min(1120px, calc(100% - 80px)); margin-inline: auto; }
.site-header {
  position: relative;
  z-index: 1;
  background: #faf0e9;
  border-bottom: 1px solid var(--line);
}
.header-inner, .footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.header-inner { min-height: 76px; }
.brand { display: inline-flex; align-items: center; gap: 8px; font: 600 1.55rem/1 var(--display); }
.brand span { color: var(--wine); font: 1.5rem/1 var(--body); }
.site-header a, .site-footer a { text-decoration: none; min-height: 44px; }
nav { display: flex; gap: clamp(16px, 3vw, 40px); }
nav a, .site-footer a { display: inline-flex; align-items: center; color: var(--muted); font-size: .92rem; font-weight: 600; }
nav a:hover, .site-footer a:hover { text-decoration: underline; text-underline-offset: 5px; }

.hero {
  overflow: clip;
  background: radial-gradient(ellipse at 76% 45%, #f2d1d3 0%, transparent 57%),
    linear-gradient(120deg, #fbf2e8, #f8e5e0);
  border-bottom: 1px solid var(--line);
}
.hero-inner { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 24px; padding-block: 62px 72px; }
.hero-copy { animation: arrive .7s ease-out both; }
.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--dark-wine);
  font-weight: 700;
  font-size: .78rem;
  line-height: 1.5;
  letter-spacing: .17em;
  text-transform: uppercase;
}
.eyebrow span { font-size: 1.05rem; }
h1, h2 { font-family: var(--display); font-weight: 600; }
h1 { margin-block: 20px 23px; font-size: clamp(4.65rem, 8.35vw, 8.15rem); line-height: .81; letter-spacing: -.055em; }
h1 em, h2 em { color: var(--wine); font-weight: 500; }
h2 { font-size: clamp(3rem, 5.6vw, 5.15rem); line-height: .98; letter-spacing: -.035em; text-wrap: balance; }
.hero-message { max-width: 32ch; margin-bottom: 29px; color: var(--muted); font-size: clamp(1rem, 1.55vw, 1.16rem); }
.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  min-height: 50px;
  padding: 11px 23px;
  border: 1px solid transparent;
  border-radius: 100px;
  text-decoration: none;
  font-size: .91rem;
  font-weight: 700;
  transition: background-color .2s ease, transform .2s ease;
}
.button:hover { transform: translateY(-2px); }
.button:active { transform: translateY(1px); }
.primary { color: #fffaf6; background: var(--wine); }
.primary:hover { background: var(--dark-wine); }
.music audio { max-width: 100%; }
.music-note { max-width: 35ch; min-height: 2.8em; margin-top: 9px; color: var(--muted); font-size: .9rem; line-height: 1.4; }

.collage {
  position: relative;
  width: min(100%, 530px);
  margin-inline: auto;
  aspect-ratio: 1.07;
  animation: arrive .85s .12s ease-out both;
}
.collage::before {
  position: absolute;
  inset: 1% 7% 3% 16%;
  border: 1px solid #ae677b50;
  border-radius: 49% 51% 51% 49%;
  transform: rotate(-16deg);
  content: "";
}
.polaroid {
  position: absolute;
  padding: 10px 10px 0;
  background: var(--paper);
  border: 1px solid #e8d6cb;
  box-shadow: 0 17px 40px #62263730;
}
.polaroid img { width: 100%; height: auto; object-fit: cover; }
.polaroid figcaption { padding-block: 7px 9px; text-align: center; font: italic 600 clamp(.94rem, 2.2vw, 1.46rem)/1.15 var(--display); }
.hero-photo { width: 60%; top: 1%; left: 17%; transform: rotate(-8deg); }
.hero-photo img { aspect-ratio: 4 / 5; object-position: center 38%; }
.hero-photo figcaption { padding-inline-start: 11%; text-align: left; }
.cat-photo { width: 36%; right: 2%; bottom: 1%; transform: rotate(12deg); }
.cat-photo img { aspect-ratio: 1; object-position: center 31%; }
.sparkle { position: absolute; color: var(--wine); line-height: 1; }
.sparkle-top { top: 8%; right: 7%; font-size: clamp(2rem, 4.5vw, 4rem); }
.sparkle-bottom { bottom: 9%; left: 3%; font-size: clamp(1.3rem, 3vw, 2.4rem); }

.album { padding-block: 74px 82px; text-align: center; }
.section-intro { margin-bottom: 32px; }
.section-intro .eyebrow { justify-content: center; margin-bottom: 10px; }
.photo-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(12px, 2vw, 24px); }
.memory {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 8px 8px 0;
  text-decoration: none;
  background: var(--paper);
  border: 1px solid #e8d6cb;
  box-shadow: 0 7px 17px #56293a12;
  transition: transform .25s ease, box-shadow .25s ease;
}
.memory:hover { transform: translateY(-5px) rotate(-1deg); box-shadow: 0 13px 20px #56293a25; }
.memory img { width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; object-position: center 33%; background: var(--blush); }
.memory > span {
  display: grid;
  place-items: center;
  flex: 1;
  padding: 10px 5px 12px;
  color: var(--muted);
  font: italic 600 clamp(1rem, 2vw, 1.36rem)/1.12 var(--display);
  text-wrap: balance;
}
.slideshow {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  isolation: isolate;
  overflow: clip;
  width: min(100%, 920px);
  margin-inline: auto;
  padding-block: 36px 37px;
  border-block: 1px solid #ead5cf;
  background: radial-gradient(ellipse at 50% 48%, #efd0d2 0%, #f9e9e3 57%, transparent 86%);
}
.slideshow .memory {
  position: relative;
  grid-area: 1 / 1;
  width: clamp(176px, 48%, 317px);
  margin: 0;
  padding: 10px 10px 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12%) scale(.78);
  pointer-events: none;
  transition: transform .65s cubic-bezier(.2,.75,.3,1), opacity .55s ease, visibility .65s;
}
.slideshow .memory[data-position="current"] {
  z-index: 2;
  opacity: 1;
  visibility: visible;
  transform: translateY(0) rotate(-2deg);
  pointer-events: auto;
  box-shadow: 0 14px 32px #56293a2a;
}
.slideshow .memory[data-position="current"]::before {
  position: absolute;
  inset: -10px auto auto 50%;
  width: 32%;
  height: 22px;
  transform: translateX(-50%) rotate(-5deg);
  background: repeating-linear-gradient(135deg, #efd7c2db 0 5px, #f6e7d6db 5px 10px);
  clip-path: polygon(0 7%, 100% 0, 97% 28%, 100% 56%, 97% 82%, 100% 100%, 0 94%, 3% 77%, 0 53%, 3% 27%);
  content: "";
}
.slideshow .memory[data-position="previous"], .slideshow .memory[data-position="next"] {
  z-index: 1;
  opacity: .75;
  visibility: visible;
  pointer-events: auto;
}
.slideshow .memory[data-position="previous"] { transform: translateX(-80%) translateY(4%) rotate(-12deg) scale(.84); }
.slideshow .memory[data-position="next"] { transform: translateX(80%) translateY(4%) rotate(11deg) scale(.84); }
.slideshow .memory[data-position="previous"]:hover, .slideshow .memory[data-position="next"]:hover { opacity: .94; }
.slideshow .memory > span { min-height: 3.1rem; }
.album-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: min(100%, 280px);
  margin: 14px auto 0;
}
.album-count { color: var(--muted); font-size: .88rem; }
.album-progress {
  width: min(65%, 190px);
  height: 3px;
  margin: 4px auto 0;
  border-radius: 100px;
  background: #ebd1ca;
}
.album-progress::before {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--wine);
  transform: scaleX(var(--progress, 0));
  transform-origin: left;
  transition: transform .45s ease;
  content: "";
}
.album-toggle {
  min-height: 44px;
  padding: 0 9px;
  border: 0;
  background: transparent;
  color: var(--dark-wine);
  font-weight: 600;
  font-size: .91rem;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.letter-section { background: #f8e5e2; border-block: 1px solid var(--line); }
.letter-layout { display: grid; grid-template-columns: .65fr 1.35fr; align-items: start; gap: clamp(26px, 6vw, 85px); padding-block: 72px 79px; }
.letter-copy { align-self: center; }
.letter-copy h2 { margin-block: 9px 14px; }
.letter-paper {
  max-width: 68ch;
  margin-top: 22px;
  padding: clamp(19px, 4vw, 35px);
  border: 1px solid var(--line);
  background: var(--paper);
  box-shadow: 0 8px 24px #56293a13;
}
.letter-arrived { animation: arrive .65s ease-out; }
.letter-paper p + p { margin-top: 14px; }
.salutation, .signature { color: var(--wine); font: italic 600 1.85rem/1.1 var(--display); }

.envelope-art {
  position: relative;
  width: min(68%, 268px);
  aspect-ratio: 1.25;
  align-self: start;
  margin: 18px auto 0;
  transform: rotate(-7deg);
}
.envelope {
  position: absolute;
  inset: 34% 0 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid #bf8894;
  border-radius: 5px;
  background: linear-gradient(28deg, #e9b5b9 49.5%, #c58d99 50%, transparent 51%) bottom left / 52% 100% no-repeat,
    linear-gradient(-28deg, #efbec1 49.5%, #c58d99 50%, transparent 51%) bottom right / 52% 100% no-repeat,
    #f5d3d1;
  box-shadow: 0 14px 30px #56293a1c;
}
.envelope::before { position: absolute; inset: 0 0 38%; background: #f9ddd6; clip-path: polygon(0 0, 100% 0, 50% 100%); content: ""; }
.seal { z-index: 1; display: grid; place-items: center; width: 43px; aspect-ratio: 1; margin-top: 7%; border-radius: 50%; background: var(--wine); color: var(--paper); font-size: 1.65rem; line-height: 1; }
.cat { position: absolute; top: 11%; left: 38%; width: 32%; aspect-ratio: 1.3; border: 2px solid var(--dark-wine); border-radius: 43%; background: #fae8e3; transform: rotate(8deg); }
.cat i, .cat b { position: absolute; top: -22%; width: 29%; height: 48%; border: 2px solid var(--dark-wine); background: #fae8e3; border-radius: 4px 8px 0 0; }
.cat i { left: 4%; transform: rotate(-24deg); }
.cat b { right: 4%; transform: rotate(24deg); }
.cat span { position: absolute; inset: 3% 0 0; border-radius: inherit; background: radial-gradient(circle at 30% 39%, var(--dark-wine) 5%, transparent 6%), radial-gradient(circle at 70% 39%, var(--dark-wine) 5%, transparent 6%), #fae8e3; }
.cat span::after { position: absolute; top: 46%; left: 45%; width: 11%; aspect-ratio: 1.3; border-radius: 50% 50% 60% 60%; background: var(--wine); content: ""; }
.letter-star { position: absolute; right: 1%; top: 11%; color: var(--wine); font-size: 2rem; line-height: 1; }
.site-footer { padding-block: 17px; }
.site-footer p { color: var(--wine); font: italic 600 1.25rem/1.2 var(--display); }

.lightbox {
  width: min(94vw, 680px);
  max-width: none;
  max-height: 96dvh;
  padding: clamp(11px, 2.5vw, 21px);
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  background: var(--paper);
}
.lightbox[open] { animation: arrive .22s ease-out; }
.lightbox::backdrop { background: #281622d9; }
.lightbox-inner { position: relative; }
.lightbox-photo {
  width: 100%;
  height: min(68dvh, 670px);
  border-radius: 7px;
  object-fit: contain;
  background: #33212b;
}
.lightbox-controls { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; }
.lightbox-caption { display: grid; gap: 3px; text-align: center; line-height: 1.15; }
.lightbox-caption strong { font: italic 600 clamp(1.1rem, 4vw, 1.65rem)/1.05 var(--display); text-wrap: balance; }
.lightbox-caption span { color: var(--muted); font-size: .84rem; }
.icon-button {
  display: grid;
  place-items: center;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid #b67c8b;
  border-radius: 50%;
  background: var(--paper);
  color: var(--dark-wine);
  font: 1.65rem/1 var(--body);
}
.icon-button:hover { background: var(--blush); }
.close { position: absolute; z-index: 1; top: 8px; right: 8px; }

@keyframes arrive {
  from { opacity: 0; translate: 0 10px; }
  to { opacity: 1; translate: 0 0; }
}
@media (max-width: 820px) {
  .wrap { width: calc(100% - 48px); }
  h1 { font-size: clamp(3.45rem, 10vw, 5.5rem); }
  .polaroid { padding: 7px 7px 0; }
  .album { padding-block: 60px; }
}

@media (max-width: 640px) {
  .wrap { width: calc(100% - 36px); }
  .header-inner { min-height: 62px; gap: 8px; }
  .brand { font-size: 1.22rem; gap: 5px; }
  .brand span { font-size: 1.2rem; }
  nav { gap: clamp(8px, 3.5vw, 18px); }
  nav a { font-size: .85rem; }
  .hero-inner, .letter-layout { grid-template-columns: 1fr; text-align: center; }
  .hero-inner { padding-block: 43px 29px; gap: 25px; }
  .hero-copy .eyebrow, .letter-copy .eyebrow { justify-content: center; }
  h1 { font-size: clamp(3.8rem, 14vw, 5.65rem); margin-block: 15px 18px; }
  .hero-message { margin-inline: auto; margin-bottom: 20px; }
  .music-note { margin-inline: auto; }
  .collage { width: min(100%, 390px); }
  .photo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .slideshow { grid-template-columns: minmax(0, 1fr); padding-block: 25px 28px; }
  .slideshow .memory { width: 61%; padding: 7px 7px 0; }
  .slideshow .memory[data-position="previous"] { transform: translateX(-58%) translateY(3%) rotate(-13deg) scale(.82); }
  .slideshow .memory[data-position="next"] { transform: translateX(58%) translateY(3%) rotate(12deg) scale(.82); }
  .section-intro { margin-bottom: 22px; }
  .letter-layout { padding-block: 35px 55px; gap: 24px; }
  .envelope-art { width: min(53%, 200px); margin-top: 0; }
  .letter-paper { margin-inline: auto; text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
