:root {
  color-scheme: light;
  --cream: #fff7f0;
  --ink: #502235;
  --rose: #8c304f;
  --gold: #97561d;
  --serif: 'Palatino Linotype', Palatino, Georgia, serif;
  font: 100%/1.6 system-ui, sans-serif;
  color: var(--ink);
  background: var(--cream);
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
a { color: inherit; text-underline-offset: .23em; }
:focus-visible { outline: 3px solid var(--rose); outline-offset: 4px; }
.top {
  display: flex; align-items: center; gap: clamp(.6rem, 3vw, 2rem);
  max-width: 78rem; margin: auto; padding: .8rem clamp(.75rem, 4vw, 3rem);
}
.brand { margin-right: auto; font: italic 1.6rem var(--serif); text-decoration: none; }
.brand span { color: var(--gold); font-size: .9rem; }
nav { display: flex; gap: clamp(.6rem, 3vw, 1.6rem); font-size: .875rem; }
nav a { text-decoration: none; }
nav a:hover { text-decoration: underline; }
.languages { display: flex; padding: .2rem; border: 1px solid #dfafbd; border-radius: 2rem; }
.languages button {
  padding: .45rem .62rem; border: 0; border-radius: 2rem;
  background: transparent; color: var(--ink); font: 700 .875rem system-ui; cursor: pointer;
}
.languages button[aria-pressed="true"] { background: var(--rose); color: white; }
.hero {
  display: grid; grid-template-columns: 1fr 1fr; align-items: center;
  min-height: 36rem; max-width: 78rem; margin: auto;
  padding: clamp(1.5rem, 5vw, 5rem);
  background: radial-gradient(ellipse at 82% 45%, #fbd2dc, transparent 62%), #fbe4e5;
  border-radius: 2rem; overflow: hidden;
}
.eyebrow { margin: 0; font-size: .875rem; font-weight: 750; letter-spacing: .14em; text-transform: uppercase; color: var(--rose); }
h1, h2 { font-family: var(--serif); font-weight: 400; line-height: 1; }
h1 { margin: .7rem 0 1.2rem; font-size: clamp(3rem, 8.9vw, 7.2rem); letter-spacing: -.065em; }
h1 em { display: block; color: var(--rose); }
time { font-weight: 650; }
.countdown { margin-top: 1.05rem; min-height: 3rem; }
#countdown-caption { letter-spacing: .08em; }
#countdown-value { margin: 0; font-variant-numeric: tabular-nums; }
.album-link { display: inline-block; margin-top: 1.15rem; padding: .65rem 1rem; color: white; background: var(--rose); border-radius: 2rem; text-decoration: none; font-weight: 650; }
.hero-art {
  position: relative; display: grid; place-items: center;
  isolation: isolate; padding: .5rem 0;
}
.hero-art::before {
  content: ''; position: absolute; inset: 6%; z-index: -1;
  background: radial-gradient(ellipse, #fff4da 2%, #ffd3c8 40%, transparent 70%);
  transform: rotate(-15deg);
}
.hero-art .hero-portrait {
  width: min(78%, 23rem);
  box-shadow: 0 1rem 2.5rem #70293f38;
}
.hero-portrait img { display: block; width: 100%; height: auto; object-fit: contain; }
.star { position: absolute; color: var(--gold); font-size: clamp(1.2rem, 3vw, 2.6rem); animation: shimmer 3s ease-in-out 2; }
.star-one { top: 8%; left: 2%; }
.star-two { top: 16%; right: 1%; animation-delay: .3s; }
.star-three { bottom: 10%; right: 2%; animation-delay: .6s; }
.star-four { bottom: 12%; left: 1%; animation-delay: .9s; }
@keyframes shimmer { 50% { transform: scale(1.25) rotate(12deg); } }
.letter, .album, .dedication { padding: clamp(3rem, 7vw, 6rem) 1.25rem; text-align: center; }
.letter {
  background:
    radial-gradient(ellipse at 12% 24%, #f8dce2 0, transparent 47%),
    radial-gradient(ellipse at 90% 80%, #f9d7d1 0, transparent 48%), var(--cream);
}
.letter-inner {
  position: relative; max-width: 44rem; margin: .75rem auto 0;
  padding: clamp(2rem, 5vw, 3.25rem) clamp(1rem, 5vw, 3rem);
  border: 1px solid #e7bdab; border-radius: .35rem .55rem 1.25rem .55rem;
  background: #fffaf2; box-shadow: 0 .75rem 1.8rem #7d34441c;
}
.letter-inner::before {
  content: ''; position: absolute; width: 7rem; height: 1.65rem;
  top: -.9rem; left: 50%; transform: translateX(-50%) rotate(-5deg);
  background: repeating-linear-gradient(135deg, #e9a4b6 0 5px, #f8c5cc 5px 10px);
  clip-path: polygon(2% 0, 98% 0, 96% 26%, 100% 51%, 97% 73%, 99% 100%, 0 100%, 3% 74%, 0 51%, 4% 24%);
}
h2 { margin: .6rem 0 1.2rem; font-size: clamp(2.5rem, 5.6vw, 4.8rem); letter-spacing: -.045em; }
.letter p:not(.eyebrow, .signature) { font-size: 1.1rem; }
.signature { color: var(--rose); font: italic 2rem var(--serif); margin: 1.2rem 0 0; }
.family-notes {
  position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1.5rem, 4vw, 3rem); max-width: 51rem; margin: 2.5rem auto 0;
  padding: 1.5rem .5rem .3rem; text-align: left;
}
.family-notes::before {
  content: ''; position: absolute; inset: 0 0 auto; height: 2rem;
  border-bottom: 2px solid #ac7548; border-radius: 0 0 50% 50%;
}
.family-note {
  position: relative; padding: 1.65rem clamp(1rem, 3vw, 1.65rem) 1.35rem;
  border: 1px solid #e6aeb9; border-radius: .45rem .45rem 1.15rem .45rem;
  background: #ffe7ed; box-shadow: 0 .55rem 1.25rem #7d344424;
  transform: rotate(-2deg);
}
.family-note:nth-child(2) {
  background: #fff0d9; border-color: #e9c69d; transform: rotate(2deg);
}
.family-note::before {
  content: ''; position: absolute; top: -.8rem; left: calc(50% - .4rem);
  width: .8rem; height: 1.65rem; border: 1px solid #ab784b; border-radius: .23rem;
  background: linear-gradient(90deg, #c4905f, #f7d7a5 43%, #d9a574);
  box-shadow: 1px 2px 3px #713d3260; transform: rotate(5deg);
}
.family-note:nth-child(2)::before { transform: rotate(-5deg); }
@media (max-width: 42rem) {
  .family-notes { grid-template-columns: 1fr; max-width: 28rem; }
  .family-notes::before { display: none; }
  .family-note { transform: rotate(-1deg); }
  .family-note:nth-child(2) { transform: rotate(1deg); }
}
.family-note h3 { margin: 0; color: var(--rose); font: 1.65rem var(--serif); }
.note-signature { margin-bottom: 0; color: var(--rose); font-weight: 650; }
.album { background: #f9e1e5; }
.album-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; max-width: 68rem; margin: 2rem auto 0; }
.placeholder, figure, .album-photo { margin: 0; background: #fff6ef; border-radius: 1rem; border: 1px solid #e6b5b5; padding: .55rem; }
.album-photo { min-width: 0; cursor: zoom-in; }
.album-photo:hover { box-shadow: 0 .55rem 1.4rem #7d34445c; }
.placeholder { display: grid; place-items: center; aspect-ratio: 4 / 3; color: var(--gold); font-size: 2rem; background: radial-gradient(ellipse, #fff6ef 28%, #f7d4d5); }
.album-grid img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: contain; }
.photo-frame {
  --frame-inset: clamp(.8rem, 2vw, 1.25rem);
  position: relative; padding: var(--frame-inset);
  border: 3px double #8c5328; border-radius: .7rem;
  background:
    linear-gradient(#fff7e8, #fff7e8) content-box,
    radial-gradient(circle, #fdf0bb 0 1px, #9c642e 1.5px 2px, transparent 2.5px)
      center / 9px 9px padding-box,
    linear-gradient(135deg, #fff1ba, #c38c47 32%, #ffe8ac 62%, #a96932) padding-box;
  box-shadow: 0 .35rem .9rem #7d34442a;
}
.photo-frame::before, .photo-frame::after {
  content: '❧ ✿ ❧'; position: absolute; inset-inline-start: 50%;
  padding: .06em .55em; border: 1px solid #a36b38; border-radius: 100% 100% 75% 75%;
  background: linear-gradient(#fff2c1, #e6b66b);
  color: #6c3216; font: 700 clamp(.65rem, 1.5vw, 1rem)/1 Georgia, serif;
  white-space: nowrap; text-shadow: 0 1px #fff0bb;
  box-shadow: 0 1px 2px #713d3255; pointer-events: none;
}
.photo-frame::before { top: 0; transform: translateX(-50%); }
.photo-frame::after { bottom: 0; transform: translateX(-50%) rotate(180deg); }
body:has(#photo-viewer[open]) { overflow: hidden; }
#photo-viewer {
  position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none;
  border: 0; margin: 0; padding: 0;
  background: #21121a; color: #fff7f0;
}
.viewer-header, .viewer-navigation {
  position: absolute; z-index: 1;
  left: max(.75rem, env(safe-area-inset-left)); right: max(.75rem, env(safe-area-inset-right));
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  pointer-events: none;
}
.viewer-header { top: max(.75rem, env(safe-area-inset-top)); }
.viewer-navigation { bottom: max(.75rem, env(safe-area-inset-bottom)); }
.viewer-header p {
  margin: 0; padding: .25rem .65rem; border-radius: 2rem;
  background: #21121ade; font-variant-numeric: tabular-nums;
}
#photo-viewer[open] { display: grid; place-items: center; }
.viewer-frame { --frame-inset: .78rem; }
.viewer-frame::before, .viewer-frame::after { font-size: .65rem; }
#viewer-photo {
  display: block; width: auto; height: auto;
  max-width: calc(100vw - 2 * var(--frame-inset) - 6px);
  max-height: calc(100dvh - 2 * var(--frame-inset) - 6px);
  object-fit: contain;
}
#photo-viewer button {
  min-height: 44px; border: 1px solid #dbadbd; border-radius: 2rem; padding: .45rem .9rem;
  color: inherit; background: #613349f2; font: inherit; cursor: pointer; pointer-events: auto;
}
#photo-viewer button:focus-visible { outline-color: #ffdfb6; }
.dedication { background: #80314e; color: var(--cream); }
.dedication span { color: #ffd3a6; font-size: 2rem; }
.dedication p { margin-bottom: 0; }
@media (max-width: 42rem) {
  .hero { grid-template-columns: 1fr; text-align: center; min-height: auto; border-radius: 0 0 1.5rem 1.5rem; }
  .hero-art { width: min(100%, 20rem); margin: 1.25rem auto 0; }
  .album-grid { gap: .55rem; }
  .album-grid:has(.album-photo) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  .star { animation: none; }
}
