@import url('https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:wght@400;500;600;700;800&family=Baloo+2:wght@600;700;800&display=swap');

:root {
  color-scheme: light;
  --ink: #362344;
  --muted: #67536b;
  --pink: #f9b9d4;
  --berry: #ac3062;
  --lilac: #e3d5ff;
  --yellow: #ffe092;
  --mint: #c1e9d2;
  --cream: #fff9ee;
  --line: #e6d5da;
  --head: "Baloo 2", "Be Vietnam Pro", system-ui, sans-serif;
  --body: "Be Vietnam Pro", system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100svh;
  color: var(--ink);
  font: 15px/1.65 var(--body);
  background: radial-gradient(ellipse at 84% 24%, #ffe6ed 0, transparent 42%),
              radial-gradient(ellipse at 12% 82%, #fff1c8 0, transparent 40%),
              radial-gradient(#e7cfc280 1px, transparent 1px) 0 0 / 18px 18px,
              var(--cream);
}
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; color: inherit; }
button:disabled { cursor: default; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 3px solid #9853ac; outline-offset: 4px; }
h1:focus, h2:focus, h3:focus { outline: none; }
h1, h2, h3 { margin: 0; font-family: var(--head); font-weight: 800; line-height: .98; }
h2 { font-size: clamp(48px, 6.9vw, 88px); letter-spacing: -.065em; }
h2 em { font-style: normal; color: var(--berry); }
p { margin: 0; }
.shell { width: min(1120px, calc(100% - 80px)); margin-inline: auto; }
.top {
  height: 83px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 9px; font: 800 23px/1 var(--head); }
.brand span {
  display: grid; place-items: center; background: var(--pink); border-radius: 12px;
  width: 35px; height: 35px; transform: rotate(-10deg); font: 700 29px/1 var(--head);
}
.sound {
  background: #fffcf6; border: 1px solid var(--line); border-radius: 99px;
  min-height: 40px; padding: 6px 14px; display: inline-flex; gap: 7px; align-items: center;
  font-size: 12px; font-weight: 600;
}
.sound[aria-pressed="true"] { background: var(--mint); }
.sound > span:first-child { font-size: 17px; color: var(--berry); }
.screen:not([hidden]) { animation: appear .44s cubic-bezier(.22,.7,.3,1) both; }
@keyframes appear { from { opacity: 0; transform: translateY(11px); } to { opacity: 1; transform: none; } }
.splash { min-height: min(654px, calc(100svh - 155px)); display: grid; grid-template-columns: .86fr 1.14fr; align-items: center; padding: 35px 0 48px; }
.hero-copy { z-index: 1; }
.kicker {
  color: var(--berry); font: 800 11px/1.45 var(--body); letter-spacing: .15em;
  margin: 0 0 18px; display: flex; align-items: center; gap: 8px;
}
.hero-copy .kicker {
  display: inline-flex; color: #793556; background: #fce3ee; border: 1px solid #f2bed4;
  padding: 7px 11px; border-radius: 7px; transform: rotate(-3deg);
}
h1 { font-size: clamp(67px, 9vw, 130px); letter-spacing: -.067em; line-height: .84; }
h1 em { color: var(--berry); font-style: normal; white-space: nowrap; }
.intro { max-width: 365px; color: var(--muted); margin: 27px 0 23px; font-size: 15px; }
.button {
  min-height: 47px; display: inline-flex; align-items: center; justify-content: center; gap: 16px;
  border: 1.5px solid #4b2c53; border-radius: 12px; padding: 10px 17px; line-height: 1.35;
  box-shadow: 0 3px 0 #4b2c53; font-size: 14px; font-weight: 700;
  transition: transform .18s, box-shadow .18s, background-color .18s;
}
.button:hover { transform: translateY(-2px); box-shadow: 0 5px 0 #4b2c53; }
.button:active { transform: translateY(2px); box-shadow: 0 1px 0 #4b2c53; }
.primary { background: var(--pink); }
.outline { background: #fffdfa; }
.text-button { border: 0; background: transparent; color: #923057; padding: 8px; font-weight: 600; text-decoration: underline; text-underline-offset: 4px; }
.gift-scene {
  isolation: isolate; position: relative; width: 100%; max-width: 585px; justify-self: end; aspect-ratio: 1.17;
  container-type: inline-size;
}
.gift-scene::before {
  content: ""; position: absolute; inset: 9% 7% 8% 12%; transform: rotate(-7deg); border-radius: 46% 52% 43% 48%;
  background: linear-gradient(140deg, #f7d5e5, #ebdffd 70%, #f3def5);
  border: 2px dashed #fff8ee; box-shadow: 0 0 0 5px #efcde6;
}
.photo-print {
  position: absolute; width: 29%; padding: 1.8% 1.8% 5%; background: #fffdf8;
  border: 1px solid #ebd9d5; box-shadow: 2px 7px 12px #4e235739; z-index: 1;
}
.photo-print img { width: 100%; aspect-ratio: 1.1; object-fit: cover; }
.print-a { inset: 11% auto auto 10%; transform: rotate(-16deg); }
.print-b { inset: 10% 11% auto auto; transform: rotate(13deg); }
.print-c { inset: auto 5% 23% auto; transform: rotate(19deg); width: 23%; }
.sticker {
  display: grid; place-items: center; position: absolute; z-index: 3;
  border: 3px solid #fff9ef; box-shadow: 1px 4px 5px #4e23572b; width: 11%; aspect-ratio: 1;
  border-radius: 33%; font: 800 clamp(22px, 7.5cqw, 46px)/1 var(--head);
}
.heart-sticker { top: 3%; left: 43%; background: var(--pink); color: #96305a; transform: rotate(-12deg); }
.flower-sticker { bottom: 14%; right: 6%; background: var(--mint); color: #28644e; transform: rotate(15deg); }
.smile-sticker { bottom: 27%; left: 6%; background: var(--yellow); transform: rotate(13deg); }
.smile-sticker i {
  position: relative; width: 42%; height: 46%; background: radial-gradient(circle at 28% 22%, var(--ink) 0 7%, transparent 10%),
    radial-gradient(circle at 76% 22%, var(--ink) 0 7%, transparent 10%);
}
.smile-sticker i::after { content: ""; position: absolute; left: 22%; width: 56%; height: 45%; bottom: 2%; border-bottom: 2px solid var(--ink); border-radius: 50%; }
.gift-confetti { position: absolute; inset: 0; z-index: 4; pointer-events: none; }
.gift-confetti i {
  position: absolute; top: 50%; left: 50%; width: 10px; height: 14px;
  border-radius: 3px; background: var(--berry); opacity: 0;
}
.gift-confetti i:nth-child(1) { --x: -115px; --y: -103px; background: #b770d9; }
.gift-confetti i:nth-child(2) { --x: 120px; --y: -90px; background: #eaa62e; }
.gift-confetti i:nth-child(3) { --x: -63px; --y: -134px; background: #39a883; }
.gift-confetti i:nth-child(4) { --x: 51px; --y: -145px; }
.gift-confetti i:nth-child(5) { --x: 86px; --y: -104px; background: #b770d9; }
.gift-confetti i:nth-child(6) { --x: -88px; --y: -75px; background: #eaa62e; }
.gift-scene.opening .gift-confetti i { animation: confetti .52s .03s ease-out both; }
@keyframes confetti {
  20% { opacity: 1; }
  85% { opacity: 1; }
  to { opacity: 0; transform: translate(var(--x), var(--y)) rotate(220deg); }
}
.gift-shadow { position: absolute; width: 55%; height: 9%; left: 23%; bottom: 13%; background: #8b5c9d40; border-radius: 50%; filter: blur(9px); }
.gift {
  position: absolute; z-index: 2; width: 50%; height: 54%; left: 25%; bottom: 15%;
  padding: 0; border: 0; background: transparent; transform: rotate(-5deg);
  transition: transform .25s;
}
.gift:hover { transform: rotate(-2deg) translateY(-5px); }
.gift-body {
  position: absolute; inset: 35% 3% 0; border: 2px solid #684a78; border-radius: 0 0 10% 10%;
  background: linear-gradient(90deg, transparent 41%, #e784b3 41% 59%, transparent 59%),
              repeating-linear-gradient(135deg, #e6d8fd 0 15px, #dac4fa 15px 30px);
  box-shadow: inset 0 9px 0 #7c528735, inset -12px 0 #956db72a, 2px 5px 0 #684a7860;
}
.gift-lid {
  position: absolute; z-index: 1; inset: 29% -1% auto; height: 18%;
  background: linear-gradient(90deg, transparent 42%, #ed94be 42% 58%, transparent 58%), #eee0ff;
  border: 2px solid #684a78; border-radius: 9px; box-shadow: 0 4px 0 #684a7850;
}
.bow {
  position: absolute; bottom: 100%; width: 27%; height: 156%; border: 2px solid #684a78;
  background: #f4a5ca; box-shadow: inset 0 -8px #a946712d;
}
.bow.left { right: 50%; border-radius: 72% 105% 10% 90%; transform: rotate(15deg); transform-origin: bottom right; }
.bow.right { left: 50%; border-radius: 105% 72% 90% 10%; transform: rotate(-15deg); transform-origin: bottom left; }
.bow-knot { position: absolute; bottom: 91%; width: 14%; height: 67%; left: 43%; background: #e787b5; border: 2px solid #684a78; border-radius: 32%; }
.gift-tag {
  position: absolute; z-index: 2; left: 59%; top: 59%; transform: rotate(15deg);
  color: #73415c; background: #ffe7a7; border: 1px solid #926b52;
  padding: 4% 5%; border-radius: 4px 4px 8px 8px; font: 700 clamp(12px, 3.5cqw, 21px)/1 var(--head);
  box-shadow: 1px 3px 0 #80496138;
}
.gift-tag::before { content: ""; position: absolute; bottom: 100%; left: 15%; height: 47%; border-left: 1px solid #80516f; transform: rotate(-18deg); }
.gift-scene.opening .gift-lid { animation: lift .56s ease-out both; }
.gift-scene.opening .photo-print { animation: print-pop .5s ease both; }
.gift-scene.opening .print-b { animation-delay: 45ms; }
.gift-scene.opening .print-c { animation-delay: 85ms; }
@keyframes lift { 70%, 100% { transform: translate(-13%, -150%) rotate(-19deg); } }
@keyframes print-pop { 65% { scale: 1.12; translate: 0 -15%; } }
.paper { background: #fffdf7; border: 1px solid #e0c5cb; box-shadow: 5px 7px 0 #f0d5e6; border-radius: 21px; }
.date-screen { min-height: 600px; padding: 57px 0 63px; display: grid; place-items: center; }
.date-card { position: relative; width: min(100%, 500px); padding: 33px 34px 24px; text-align: center; }
.date-card .kicker, .letter-bundle .kicker, .memory-intro .kicker { justify-content: center; }
.date-card h2 { font-size: clamp(44px, 7vw, 69px); }
.date-card > p:not(.kicker) { color: var(--muted); margin-top: 15px; }
.lock-sticker {
  position: absolute; right: 4%; top: -15px; background: var(--lilac); width: 51px; height: 51px;
  border: 3px solid #fff9ef; border-radius: 16px; box-shadow: 1px 3px 4px #47304733;
  font: 800 30px/1.5 var(--head); transform: rotate(13deg); color: #7c44a1;
}
.date-fields { display: grid; grid-template-columns: 1fr 1fr 1.3fr; gap: 8px; margin: 21px 0 0; }
.date-fields label { display: grid; gap: 5px; text-align: left; color: var(--muted); font-weight: 700; font-size: 12px; }
select, input { border: 1px solid #c9a9bd; border-radius: 9px; background: #fcf3f9; color: var(--ink); padding: 9px; max-width: 100%; }
.date-fields select { width: 100%; min-height: 48px; font-weight: 600; font-size: 16px; }
.date-card .date-status { min-height: 28px; font-size: 12px; margin: 7px 0 4px; color: #923057; }
.demo { display: block; margin: 8px auto 0; font-size: 12px; }
.story { padding: 58px 0 15px; }
.story-top { margin-bottom: 28px; }
.story-top p:last-child, .album-head p:last-child { color: var(--muted); margin-top: 12px; }
.scrapbook {
  background: #ffeaf2; border: 1px solid #e1bacd; border-radius: 18px; padding: clamp(12px, 3vw, 24px);
  box-shadow: 4px 6px 0 #e6c6d8; position: relative;
}
.year-pages { display: grid; gap: clamp(42px, 12vh, 115px); }
.year-page { display: grid; background: #ffeaf2; }
.year-2 { background: #fff0c9; border-color: #ead6a3; box-shadow: 4px 6px 0 #e9d6ae; }
.year-3 { background: #ede3fc; border-color: #dec9ef; box-shadow: 4px 6px 0 #dfcce9; }
.year-tab {
  display: inline-flex; padding: 6px 11px; border-radius: 7px;
  color: #793556; background: var(--pink); transform: rotate(-2deg);
}
.year-2 .year-tab { background: var(--yellow); }
.year-3 .year-tab { background: var(--lilac); }
.page {
  min-height: 278px; background: linear-gradient(90deg, #cf9faa21 1px, transparent 1px) 0 0/17px 17px,
    linear-gradient(#cf9faa21 1px, transparent 1px) 0 0/17px 17px, #fff9ec;
  border: 1px solid #eed3cd; border-radius: 10px; overflow: hidden; display: grid; align-items: center;
}
.page-open {
  display: grid; grid-template-columns: minmax(0,.85fr) minmax(0,1.15fr);
  align-items: center; gap: 20px; padding: clamp(24px, 5vw, 56px);
  min-height: min(52svh, 470px);
}
.page-copy h3 { font-size: clamp(31px, 4.6vw, 56px); letter-spacing: -.045em; }
.page-copy > p:last-child { color: var(--muted); margin-top: 11px; }
.page-photos { display: flex; align-items: center; justify-content: center; padding: 9px; gap: 2%; }
.page-photos button {
  width: min(50%, 250px); padding: 5px 5px 14px; border: 1px solid #e8cacd;
  background: #fffef9; box-shadow: 2px 4px 5px #63375532; transform: rotate(-7deg);
}
.page-photos button:nth-child(2) { transform: rotate(6deg); }
.page-photos button:hover { transform: rotate(0); z-index: 1; }
.page-photos img { aspect-ratio: 1.1; object-fit: cover; width: 100%; }
.revisit {
  text-align: center; margin: clamp(65px, 13vh, 160px) 0 57px;
  padding: clamp(25px, 7vw, 70px); background: #fff1f6;
}
.revisit-heart, .letter-heart {
  display: inline-grid; place-items: center; width: 45px; height: 45px;
  border: 2px solid #fff9ee; border-radius: 13px; background: var(--pink);
  box-shadow: 1px 3px 0 #754e7039; transform: rotate(-9deg);
  color: var(--berry); font: 800 31px/1 var(--head);
}
.revisit-heart { margin-bottom: 21px; }
.revisit h2 { font-size: clamp(36px, 6vw, 76px); margin-bottom: 25px; }
.memory-intro { padding: clamp(30px, 8vh, 76px) 0 27px; text-align: center; }
.back-to-book { display: inline-block; margin-bottom: 18px; font-size: 13px; }
.memory-intro > p:not(.kicker) { margin-top: 15px; color: var(--muted); }
.memory-intro .sample-note { font-size: 12px; }
.album-tools { margin: 15px 0 0; }
.album-tools summary { width: fit-content; margin: 0 auto; cursor: pointer; color: #923057; font-size: 13px; padding: 8px; }
.album {
  margin-top: 11px; padding: 19px; text-align: left; background: #fffdf7;
  border: 1px solid var(--line); border-radius: 13px;
}
.album-head h2 { font-size: 33px; }
.memory-row {
  border-bottom: 1px dashed #dfbfc6;
}
.memory-row::after {
  content: "";
  display: block;
  height: clamp(180px, 46svh, 440px);
}
.memory-spread {
  position: sticky;
  top: clamp(12px, 6svh, 60px);
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr);
  align-items: center; gap: clamp(22px, 7vw, 88px); min-height: 76svh;
  padding: clamp(22px, 4vh, 46px) clamp(8px, 4vw, 40px);
}
.memory-row:nth-child(even) .memory-spread { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); }
.memory-row:nth-child(even) .memory-frame { order: 1; }
.memory-frame { min-width: 0; }
.memory-frame button {
  --tilt: -3deg;
  width: 100%; display: block; padding: 9px 9px 29px; border: 1px solid var(--line);
  background: #fffdf8; border-radius: 7px; box-shadow: 3px 7px 0 #74456322;
  transform: translateY(var(--photo-rise, 24px)) rotate(var(--tilt)) scale(var(--photo-scale, .38));
  transform-origin: center;
}
.memory-row:nth-child(even) .memory-frame button { --tilt: 3deg; }
.memory-frame button:focus-visible { transform: rotate(var(--tilt)); }
.memory-frame img { width: 100%; max-height: 66svh; aspect-ratio: 4/3; object-fit: cover; border-radius: 2px; }
.memory-copy .kicker { margin-bottom: 10px; }
.memory-date {
  display: inline-block; padding: 4px 9px; margin-bottom: 12px;
  background: var(--yellow); border-radius: 6px; font-size: 12px; font-weight: 700;
}
.memory-row:nth-child(3n + 2) .memory-date { background: var(--mint); }
.memory-row:nth-child(3n) .memory-date { background: var(--lilac); }
.memory-copy h3 { font-size: clamp(34px, 5vw, 68px); letter-spacing: -.045em; overflow-wrap: anywhere; }
.memory-note { margin-top: 12px; color: var(--muted); white-space: pre-wrap; overflow-wrap: anywhere; }
.album-head { margin-bottom: 21px; }
.toolbar, .filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.toolbar { justify-content: space-between; }
.filters button, .viewer-controls button, .close-viewer, .dialog-heading button, #remove, #edit-photo {
  border: 1px solid #d8b7c5; border-radius: 9px; min-height: 41px; background: #fffaf5; padding: 7px 12px;
}
.filters button[aria-pressed="true"] { border-color: #a35c80; background: #f9d0e3; font-weight: 700; }
.album-status { margin: 14px 0; font-size: 12px; color: var(--muted); }
.gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.gallery button {
  background: #fffdf9; padding: 7px 7px 24px; border: 1px solid #e8ced3; border-radius: 5px;
  box-shadow: 2px 4px 0 #6d406f1c; transform: rotate(-1.15deg); transition: transform .18s; overflow: hidden;
}
.gallery button:nth-child(even) { transform: rotate(1.1deg); }
.gallery button:hover { transform: rotate(0) translateY(-4px); }
.gallery img { width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.letter-screen { padding: 53px 0 55px; min-height: min(78svh, 600px); }
.letter-bundle { text-align: center; }
.envelope {
  position: relative; isolation: isolate; display: block; perspective: 850px;
  width: min(100%, 370px); aspect-ratio: 1.64; margin: 38px auto 3px;
  padding: 0; border: 0; border-radius: 14px; background: transparent;
  transition: transform .2s ease;
}
.envelope:not([data-open]):hover { transform: translateY(-4px) rotate(-2deg); }
.envelope[aria-disabled="true"] { cursor: default; }
.envelope > span { position: absolute; pointer-events: none; }
.envelope-back {
  inset: 0; border: 2px solid #b87096; border-radius: inherit; background: #ed9bc2;
  box-shadow: 5px 7px 0 #d9abc4;
}
.envelope-card {
  inset: 10% 8%; z-index: 2; padding: 7% 8%; border: 1px solid #e4c0cd; border-radius: 8px;
  background: repeating-linear-gradient(transparent 0 17px, #efdce4 17px 18px) 0 16px / 100% 100%,
    #fff8ee;
  color: var(--berry); text-align: left; font: 800 35px/1 var(--head);
  opacity: 0; transition: transform .38s ease, opacity .2s ease;
}
.envelope-pocket {
  inset: 2px; z-index: 3; border-radius: 12px;
  clip-path: polygon(0 4%, 50% 57%, 100% 4%, 100% 100%, 0 100%);
  background: linear-gradient(148deg, transparent 49%, #f0acce 50%) top left / 50% 100% no-repeat,
    linear-gradient(212deg, transparent 49%, #f5b6d4 50%) top right / 50% 100% no-repeat,
    #f8c6de;
}
.envelope-flap {
  inset: 2px 2px 44%; z-index: 4; border-radius: 12px 12px 0 0;
  clip-path: polygon(0 0, 100% 0, 50% 100%); background: #fce1ed;
  transform-origin: top center;
  transition: transform .43s cubic-bezier(.4,.1,.2,1), z-index 0s .21s;
}
.envelope-seal {
  z-index: 5; top: 49%; left: 50%; translate: -50% -10%;
  display: grid; place-items: center; width: 44px; aspect-ratio: 1;
  background: #ae406d; border: 2px solid #98345d; border-radius: 50%;
  box-shadow: 2px 3px 0 #993f6955; color: #fff4f8; font: 800 24px/1 var(--head);
  transition: transform .24s ease, opacity .24s ease;
}
.envelope-label {
  z-index: 5; bottom: 13px; inset-inline: 5px; color: #743550;
  font-size: 14px; font-weight: 800;
}
.envelope[data-open] .envelope-flap { transform: rotateX(171deg); z-index: 1; }
.envelope[data-open] .envelope-card {
  transform: translateY(-56%) rotate(-6deg); opacity: 1;
  transition: transform .48s cubic-bezier(.2,.75,.25,1) .34s, opacity .16s ease .34s;
}
.envelope[data-open] .envelope-seal { transform: translateY(-13px) scale(.55); opacity: 0; }
.letter-heart { position: absolute; right: 22px; top: -16px; transform: rotate(9deg); }
.letter-paper {
  position: relative; width: min(100%, 640px); margin: 39px auto 0;
  padding: 27px clamp(18px, 5vw, 43px); text-align: left; scroll-margin-top: 28px;
}
.letter-paper:not([hidden]) { animation: unfold-letter .45s cubic-bezier(.2,.75,.3,1) both; }
@keyframes unfold-letter {
  from { opacity: 0; transform: translateY(-22px) scale(.96); }
  to { opacity: 1; transform: none; }
}
.letter-paper h3 { font: 800 clamp(31px, 5.5vw, 47px)/1 var(--head); color: var(--berry); }
.letter-paper p { color: var(--muted); margin-top: 15px; }
.letter-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 20px; }
.bottom { border-top: 1px solid var(--line); padding: 13px 0 20px; }
.steps { display: flex; align-items: center; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }
.steps li { display: flex; align-items: center; }
.steps li + li::before { content: "·"; color: #9d738a; padding: 0 4px; }
.steps button { background: transparent; border: 0; padding: 6px; min-height: 32px; font-size: 11px; font-weight: 600; }
.steps button:disabled { color: #796877; }
.steps [aria-current="step"] button { color: #7a204a; background: #fce0eb; border-radius: 6px; }
dialog {
  width: min(460px, 94vw); max-width: 94vw; padding: 21px; border: 1px solid #bd83a1;
  border-radius: 15px; background: #fff8f5; color: var(--ink); box-shadow: 5px 7px 0 #a05c8966;
}
dialog::backdrop { background: #382442c4; }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dialog-heading h2 { font-size: 37px; }
#upload p, #edit p { color: var(--muted); margin: 6px 0; font-size: 13px; }
#upload label, #edit label { display: block; margin: 15px 0 6px; font-size: 13px; font-weight: 600; }
#upload .button, #edit .button { margin-top: 6px; }
#viewer { width: max-content; text-align: center; padding: 43px 14px 14px; }
.close-viewer { position: absolute; right: 6px; top: 4px; min-height: 34px; }
figure { margin: 0; }
figure img { max-width: 86vw; max-height: 66svh; object-fit: contain; border-radius: 4px; }
figcaption { margin: 6px 0 10px; overflow-wrap: anywhere; color: var(--muted); }
.viewer-controls { display: flex; justify-content: center; align-items: center; gap: 12px; }
.viewer-controls button:disabled { opacity: .45; }
.viewer-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
#remove { color: var(--berry); }
#edit input, #edit textarea { width: 100%; }
#edit textarea {
  border: 1px solid #c9a9bd; border-radius: 9px; background: #fcf3f9; color: var(--ink);
  font: inherit; padding: 9px; resize: vertical;
}
@media (max-width: 780px) {
  .shell { width: calc(100% - 40px); }
  .splash { min-height: 560px; }
  .gallery { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 585px) {
  .shell { width: calc(100% - 32px); }
  .top { height: 60px; }
  .brand { font-size: 19px; }
  .brand span { width: 29px; height: 29px; font-size: 24px; border-radius: 8px; }
  .sound { min-height: 35px; padding-inline: 9px; font-size: 10px; }
  .splash { display: flex; flex-direction: column; align-items: stretch; padding: 29px 0 16px; gap: 6px; }
  .hero-copy { text-align: center; }
  h1 { font-size: clamp(63px, 14vw, 91px); }
  .intro { margin: 16px auto 16px; font-size: 13px; }
  .gift-scene { width: min(100%, 385px); align-self: center; }
  .date-screen { min-height: 0; padding: 45px 0; }
  .date-card { padding: 30px 15px 17px; }
  .story, .letter-screen { padding-top: 35px; }
  .page-open { grid-template-columns: 1fr; gap: 10px; padding: 19px 14px; }
  .page-photos { justify-content: flex-start; }
  .page-copy > p:last-child { font-size: 13px; }
  .memory-spread, .memory-row:nth-child(even) .memory-spread {
    top: 4svh; grid-template-columns: 1fr; align-content: center;
    min-height: 72svh; gap: 20px; padding: 20px 9px 28px;
  }
  .memory-row:nth-child(even) .memory-frame { order: initial; }
  .memory-frame img { max-height: 55svh; }
  .memory-frame button { padding: 6px 6px 18px; }
  .album { padding: 16px 11px; }
  .gallery { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .gallery button { padding: 5px 5px 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .memory-row::after { display: none; }
  .memory-spread { position: static; min-height: 0; }
  .memory-frame button { transform: rotate(var(--tilt)); }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
