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

:root {
  color-scheme: light;
  --paper: #fbf7f0;
  --white: #fffdf8;
  --cream: #fff9ef;
  --ink: #392934;
  --muted: #685660;
  --rose: #a32f60;
  --pink: #fae5eb;
  --pink-line: #ecc8d5;
  --yellow: #fff1be;
  --yellow-line: #e8d49a;
  --sage: #e5ebe0;
  --line: #e8dcd4;
  --shadow: 0 14px 35px #69404b12;
  --display: Fraunces, Georgia, serif;
  --body: "DM Sans", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font: 400 1rem/1.55 var(--body);
}
h1, h2, h3, p, figure { margin: 0; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.08; }
h1 em, .brand em { color: var(--rose); font-weight: 500; }
h1 { font-size: clamp(3.1rem, 8vw, 6.25rem); letter-spacing: -.075em; }
h2 { font-size: clamp(1.55rem, 3vw, 2.04rem); letter-spacing: -.045em; }
h3 { font-size: 1.28rem; letter-spacing: -.025em; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { color: inherit; }
button:disabled { cursor: wait; }
button, summary { cursor: pointer; }
:focus-visible { outline: 3px solid var(--rose); outline-offset: 4px; }
main:focus, h1:focus { outline: none; }
img { display: block; max-width: 100%; }

.button, .quiet-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  min-height: 44px;
  border-radius: 10px;
  padding: .6rem .92rem;
  border: 1px solid transparent;
  font-weight: 700;
  font-size: .88rem;
  transition: background-color .16s, border-color .16s;
}
.primary { background: var(--rose); color: #fff; }
.primary:hover { background: #84254d; }
.secondary { border-color: var(--pink-line); background: var(--white); }
.secondary:hover { background: #f8edf0; }
.quiet-button { background: transparent; color: var(--muted); }
.quiet-button:hover { background: var(--pink); color: var(--rose); }
.form-error { color: #892249; font-size: .85rem; }

.brand-mark, .mini-mark {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 43px;
  height: 43px;
  border-radius: 13px;
  border: 1px solid var(--pink-line);
  background: var(--pink);
  color: var(--rose);
  font: 700 1.45rem/1 var(--body);
}
.polaroid {
  position: relative;
  background: var(--white);
  border: 1px solid #eddbd6;
  border-radius: 2px;
  padding: 11px 11px 9px;
  box-shadow: 0 13px 25px #7c3d5b26, 0 2px 3px #7c3d5b18;
  transform: rotate(5deg);
}
.polaroid img {
  width: 100%;
  height: auto;
  aspect-ratio: 1.43;
  object-fit: cover;
  background: var(--pink);
}
.polaroid figcaption {
  padding-top: .45rem;
  font: italic 500 clamp(1rem, 3vw, 1.23rem)/1.3 var(--display);
  color: var(--rose);
  text-align: center;
}
.polaroid figcaption span { margin-left: .25rem; }
.tape {
  position: absolute;
  z-index: 1;
  top: -10px;
  left: 35%;
  width: 30%;
  height: 23px;
  background: repeating-linear-gradient(115deg, #f5d878a8 0 4px, #f8e4a5ce 4px 8px);
  transform: rotate(-8deg);
}

.lock-page {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: clamp(1rem, 5vw, 4rem);
  background-color: var(--cream);
  background-image: radial-gradient(#bd829034 1px, transparent 1px), radial-gradient(ellipse at bottom left, #f8dce7, transparent 60%);
  background-size: 18px 18px, auto;
}
.lock-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: min(100%, 830px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: var(--white);
  box-shadow: 0 25px 65px #65503720;
}
.lock-art {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 380px;
  padding: 2.75rem 2rem;
  background: radial-gradient(circle at 20% 10%, #fff1c1, transparent 45%), #fae3eb;
}
.lock-art .polaroid { width: min(100%, 300px); transform: rotate(-8deg); }
.lock-sparkle { position: absolute; right: 12%; top: 13%; color: var(--rose); font-size: 2.4rem; }
.lock-copy { padding: clamp(1.6rem, 5vw, 4rem); }
.lock-copy h1 { margin: 1.05rem 0 .65rem; font-size: clamp(2.5rem, 6vw, 4rem); }
.lock-copy > p { margin-bottom: 1.6rem; color: var(--muted); }
.lock-copy form { display: grid; gap: .65rem; }
.lock-copy label { font-size: .86rem; font-weight: 750; }
.lock-copy input {
  width: 100%;
  min-height: 46px;
  border: 1px solid #c9aeb9;
  border-radius: 10px;
  padding: .6rem .8rem;
  color: var(--ink);
  background: #fff;
}
.lock-copy .button { margin-top: .35rem; }

.scrapbook-page {
  display: grid;
  grid-template-columns: 222px minmax(0, 1fr);
  min-height: 100svh;
}
.skip-link {
  position: fixed;
  z-index: 3;
  top: .5rem;
  left: .5rem;
  transform: translateY(-150%);
  border-radius: 8px;
  padding: .65rem;
  color: white;
  background: var(--rose);
}
.skip-link:focus { transform: none; }
.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  display: flex;
  flex-direction: column;
  height: 100svh;
  padding: 2.2rem 1.15rem 1.1rem;
  border-right: 1px solid var(--line);
  background: var(--white);
}
.brand { display: flex; align-items: center; gap: .72rem; margin: 0 .5rem 2.45rem; font: 600 1.14rem/1.04 var(--display); }
.brand em { display: inline-block; margin-top: .15rem; }
.sidebar nav { display: grid; gap: .3rem; }
.sidebar nav a {
  display: flex;
  align-items: center;
  gap: .68rem;
  padding: .58rem .75rem;
  min-height: 44px;
  border-radius: 9px;
  color: var(--muted);
  font-size: .9rem;
  font-weight: 680;
}
.sidebar nav a span, .sidebar-footer button span { width: 1.1rem; text-align: center; font-size: 1.13rem; }
.sidebar nav a:hover { background: var(--cream); }
.sidebar nav a[aria-current] { background: var(--pink); color: var(--rose); }
.sidebar-footer { margin-top: auto; padding-top: .6rem; border-top: 1px solid var(--line); }

.main-content { width: 100%; max-width: 1480px; margin-inline: auto; padding: 0 clamp(1.3rem, 4vw, 4.25rem) 4.5rem; }
.top-bar { display: flex; min-height: 77px; align-items: center; justify-content: space-between; gap: .5rem; }
.crumb { display: inline-flex; gap: .5rem; align-items: center; color: var(--muted); font-size: .82rem; font-weight: 750; }
.crumb > span:first-child { color: var(--rose); font-size: 1rem; }
.music-button { min-width: 130px; border-color: var(--line); background: var(--white); }
.music-button[aria-pressed="true"] { background: var(--sage); border-color: #cad5c2; }
.site-status { padding: .85rem 0; color: var(--muted); }

.hero {
  min-height: 413px;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  gap: clamp(.55rem, 3vw, 2.1rem);
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--pink-line);
  border-radius: 23px;
  padding: clamp(1.5rem, 4.2vw, 4rem);
  background-color: #fbe9ed;
  background-image: linear-gradient(100deg, #fceded 12%, #fceded77 42%, #f9e1e912 68%), radial-gradient(#c7859c55 1px, transparent 1px);
  background-size: auto, 18px 18px;
}
.hero-copy { position: relative; z-index: 1; }
.hero-label {
  display: inline-flex;
  align-items: center;
  gap: .42rem;
  border: 1px solid var(--yellow-line);
  border-radius: 20px;
  padding: .26rem .62rem;
  margin-bottom: .9rem;
  background: var(--yellow);
  color: #5e4634;
  font-weight: 750;
  font-size: .78rem;
}
.hero h1 { font-size: clamp(3rem, 6vw, 6.2rem); }
.hero-text { max-width: 34ch; margin: .85rem 0 1.22rem; color: var(--muted); }
.hero-actions { display: flex; flex-wrap: wrap; gap: .55rem; }
.hero-art { position: relative; max-width: 410px; margin: 0 4% 0 3%; padding: 1rem .6rem; }
.hero-art .polaroid { z-index: 1; }
.doodle { position: absolute; color: var(--rose); line-height: 1; }
.doodle-star { top: -4%; right: -8%; transform: rotate(15deg); font-size: clamp(1.8rem, 4vw, 3.15rem); }
.doodle-heart { bottom: -4%; left: -9%; transform: rotate(-17deg); font-size: clamp(2rem, 4vw, 3.5rem); }

.section-heading { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: .35rem 1rem; margin: 1.85rem 0 .8rem; }
.section-heading p, .timer-date { color: var(--muted); font-size: .83rem; }
.time-grid, .games { display: grid; gap: 1rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.note { border: 1px solid var(--line); border-radius: 17px; background: var(--white); box-shadow: var(--shadow); }
.timer { padding: clamp(.85rem, 2.1vw, 1.5rem); }
.together { background: #fcebf0; border-color: var(--pink-line); }
.anniversary { background: #fff6d7; border-color: var(--yellow-line); }
.timer-top { display: flex; align-items: center; gap: .55rem; }
.mini-mark { width: 34px; height: 34px; border-radius: 9px; font-size: 1.15rem; }
.together .mini-mark { background: #fff6f8; }
.anniversary .mini-mark, .yellow-mark { border-color: var(--yellow-line); background: var(--yellow); color: #685027; }
.timer-digits { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .4rem; margin: 1rem 0 .1rem; }
.timer-digits div { display: flex; flex-direction: column-reverse; align-items: center; border: 1px solid #ead9d5; border-radius: 9px; background: #fffdf9c9; padding: .35rem .12rem; }
.timer-digits dt { color: var(--muted); font-size: .72rem; }
.timer-digits dd { margin: 0; font: 600 clamp(1.4rem, 3.4vw, 2.35rem)/1.12 var(--display); font-variant-numeric: lining-nums tabular-nums; }
.timer-date { margin-top: .45rem; }
.letter { margin-top: 1.1rem; padding: 1.3rem 1.5rem; }
.letter h2 span { padding-left: .2rem; color: var(--rose); }
.letter summary { width: fit-content; margin-top: .65rem; color: var(--rose); font-weight: 750; }
.letter-copy { max-width: 66ch; padding-top: .8rem; }
.letter-copy p { margin-bottom: .48rem; }
.letter-copy .signature { color: var(--rose); font: italic 600 1.4rem/1.4 var(--display); margin-top: 1rem; }

.section-intro {
  border: 1px solid var(--pink-line);
  border-radius: 20px;
  background: linear-gradient(100deg, #fcebee, #fff5d8);
  padding: clamp(1.25rem, 5vw, 3rem);
  margin-bottom: 1.35rem;
}
.section-intro h1 { margin: .55rem 0 .4rem; font-size: clamp(2.8rem, 6vw, 4.7rem); }
.section-intro > p, .empty { color: var(--muted); }
.memories { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.memory { padding: .72rem; }
.memory h2 { font-size: 1.4rem; margin: .45rem 0 .22rem; }
.memory .metadata { display: block; margin-top: .7rem; color: var(--rose); font-size: .75rem; font-weight: 750; }
.memory p { color: var(--muted); font-size: .9rem; }
.memory-image {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  padding: 0;
  border: 1px solid #cad5c2;
  border-radius: 10px;
  color: #53624d;
  background: var(--sage);
}
.memory-image::before, .memory-image::after { position: absolute; z-index: 1; width: 34px; height: 34px; background: #fff1b9dc; pointer-events: none; content: ""; }
.memory-image::before { top: 0; left: 0; clip-path: polygon(0 0, 100% 0, 0 100%); }
.memory-image::after { right: 0; bottom: 0; clip-path: polygon(100% 0, 100% 100%, 0 100%); }
.memory-image img { width: 100%; height: 100%; object-fit: cover; }
.empty-frame { border-style: dashed; }
.empty-frame span { display: block; text-align: center; font-size: 1.9rem; line-height: 1; }
.empty-frame small { font-size: .72rem; }
.empty, .video-note { padding: 1.4rem; }
dialog { width: min(90vw, 740px); max-height: 90svh; padding: 1.1rem; border: 1px solid var(--pink-line); border-radius: 18px; background: var(--white); color: var(--ink); }
dialog::backdrop { background: #33202fc9; }
dialog img { width: 100%; max-height: 65svh; object-fit: contain; background: var(--paper); border-radius: 8px; }
dialog h2 { margin: .7rem 0 .2rem; }
dialog form { display: flex; justify-content: flex-end; margin-bottom: .4rem; }
.dialog-close { font-size: 1.4rem; }

.games { align-items: start; }
.game { padding: clamp(1rem, 2.5vw, 1.65rem); }
.memory-game { background: #fff8df; border-color: var(--yellow-line); }
.quiz-game { background: #fff2f5; border-color: var(--pink-line); }
.game-heading { display: flex; justify-content: space-between; align-items: center; gap: .4rem; margin-bottom: .4rem; }
.game > p { color: var(--muted); }
.game-status { margin: .65rem 0; color: var(--muted); font-size: .83rem; font-weight: 750; }
.memory-board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .45rem; }
.memory-card {
  display: grid;
  place-items: center;
  min-height: 44px;
  aspect-ratio: 1.08;
  border: 1px solid var(--pink-line);
  border-radius: 10px;
  color: var(--rose);
  background: var(--pink);
  font-size: clamp(1.15rem, 3vw, 1.8rem);
  line-height: 1;
}
.memory-card:not([aria-disabled="true"]):hover { border-color: var(--rose); }
.memory-card.flipped { background: var(--white); }
.memory-card.matched { background: var(--sage); border-color: #bdd1b7; color: #365447; }
.memory-card[aria-disabled="true"] { cursor: default; }
.quiz-options { display: grid; gap: .4rem; margin: .85rem 0; }
.quiz-option { justify-content: flex-start; text-align: left; width: 100%; border-color: var(--pink-line); background: var(--white); }
.quiz-option:not([aria-disabled="true"]):hover { border-color: var(--rose); }
.quiz-option[aria-disabled="true"] { cursor: default; }
.quiz-option.correct { border-color: #91ad8c; background: var(--sage); }
.quiz-option.incorrect { border-color: #d299a9; background: #f8dce4; }
.quiz-feedback:not(:empty) { margin-bottom: .8rem; }
.video-note video { display: block; width: 100%; max-height: 72svh; border-radius: 10px; background: #321d2b; }

@media (max-width: 1040px) {
  .scrapbook-page { grid-template-columns: 184px minmax(0, 1fr); }
  .hero { min-height: 365px; }
  .main-content { padding-inline: 1.6rem; }
  .memories { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .scrapbook-page { display: block; }
  .sidebar {
    position: relative;
    height: auto;
    padding: .8rem 1rem .55rem;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
  }
  .brand { margin: 0; }
  .sidebar nav { grid-row: 2; grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: .18rem; margin-top: .55rem; }
  .sidebar nav a { flex: 1 0 auto; justify-content: center; padding: .35rem; font-size: .8rem; gap: .3rem; }
  .sidebar nav a span { width: auto; }
  .sidebar-footer { border: 0; padding: 0; }
  .main-content { padding-inline: 1rem; }
  .top-bar { min-height: 61px; }
  .hero { min-height: 340px; }
  .lock-card { max-width: 520px; }
  .lock-art { min-height: 250px; padding: 2rem 1.2rem; }
}
@media (max-width: 500px) {
  .lock-card { grid-template-columns: 1fr; }
  .lock-art { min-height: 200px; padding: 1.5rem; }
  .lock-art .polaroid { width: min(73%, 230px); }
  .lock-copy { padding: 1.35rem 1.65rem 1.85rem; }
  .lock-copy h1 { margin-top: .7rem; }
  .lock-copy h1 br { display: none; }
  .hero { grid-template-columns: 1fr; gap: .9rem; }
  .hero-art { width: 79%; justify-self: center; margin: .25rem 0 0; }
  .time-grid, .games, .memories { grid-template-columns: 1fr; }
  .timer-digits dd { font-size: 1.9rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
