* { box-sizing: border-box; }

body {
  margin: 0;
  background: #000;
  color: #ffdedc;
}

.scene {
  --stage-width: min(100vw, 250svh);
  --envelope-width: calc(var(--stage-width) * .49);
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: 100svh;
  place-items: center;
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
  isolation: isolate;
}

.envelope-stage {
  position: relative;
  width: var(--stage-width);
  aspect-ratio: 1672 / 941;
}

.envelope-art {
  display: block;
  width: 100%;
  height: auto;
  transition: opacity 220ms ease;
}

.envelope {
  position: absolute;
  top: 15.9%;
  left: 24.5%;
  width: var(--envelope-width);
  aspect-ratio: 817 / 588;
  perspective: 900px;
}

.opening .envelope {
  background: linear-gradient(#29040d, #700a21 70%);
}

.envelope-paper, .recipient { opacity: 0; }
.opening .envelope-paper, .opening .recipient { opacity: 1; }
.opening .envelope-art { opacity: 0; }

.envelope-paper, .flap {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.recipient {
  position: absolute;
  top: calc(88% + 5px);
  left: 19%;
  margin: 0;
  color: #b69874;
  font: 400 max(.56rem, calc(var(--envelope-width) * .030)) / 1.15
    "Segoe Script", "Apple Chancery", "Lucida Handwriting", cursive;
  white-space: nowrap;
}

.flap {
  visibility: hidden;
  background: url("envelope-dourado.png") center / 100% 100%;
  clip-path: polygon(0 0, 100% 0, 98% 14%, 94% 20%, 60% 51%, 59% 61%, 54% 68%, 47% 68%, 42% 62%, 41% 52%, 7% 21%, 2% 14%);
  transform-origin: top;
  transition: transform 480ms ease-in-out;
  backface-visibility: hidden;
}

.seal {
  position: absolute;
  top: 55%;
  left: 50.5%;
  translate: -50% -50%;
  width: max(44px, 19%);
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

.seal:focus-visible { outline: 2px solid #ffdfa3; outline-offset: 3px; }

.seal::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(115deg, transparent 40%, #fff4cb70 50%, transparent 60%) 100% 0 / 240% 100% no-repeat;
  animation: seal-glint 2s ease-in-out infinite;
}

.opening .seal { opacity: 0; }
.opening .seal::after { animation: none; }
.opening .envelope-paper { clip-path: polygon(0 0, 2% 14%, 7% 21%, 41% 52%, 42% 62%, 47% 68%, 54% 68%, 59% 61%, 60% 51%, 94% 20%, 98% 14%, 100% 0, 100% 100%, 0 100%); }
.opening .flap { visibility: visible; transform: rotateX(172deg); }
.opening .envelope { animation: approach 1200ms cubic-bezier(.65, .05, .95, .47) forwards; }

.inside {
  --paper-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='grain'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Cpath d='M0 0h160v160H0z' filter='url(%23grain)' opacity='.48'/%3E%3C/svg%3E");
  position: absolute;
  inset: 0;
  overflow: auto;
  background: radial-gradient(ellipse at center, #6a1628, #21070e 75%);
  text-align: center;
  font-family: Georgia, serif;
}

.inside:not([hidden]) {
  display: grid;
  place-items: center;
  padding: 1.5rem;
}

.sheet-chooser {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.sheet-chooser h1 {
  position: relative;
  z-index: 2;
  margin: clamp(.5rem, 3svh, 1.5rem) 1rem 0;
  color: #f6dec0;
  font-size: clamp(1.5rem, 5vw, 2.5rem);
  font-weight: normal;
}

.sheet-fan {
  --sheet-width: clamp(46vw, 55svh, 55vw);
  --cover-copy-space: clamp(6rem, 16svh, 9rem);
  --heart-size: min(calc(var(--sheet-width) * 1.32), calc((84svh - var(--cover-copy-space)) / .85));
  position: absolute;
  top: clamp(14%, calc(100% - var(--heart-size) * .85 - var(--cover-copy-space)), 41%);
  inset-inline: 0;
  animation: reveal-sheet 420ms ease-out both;
}

.sheet, .letter {
  border: 1px solid #ead1a8;
  border-radius: .2rem;
  background: linear-gradient(145deg, #fff3d8, #ecd5ac);
  color: #672539;
  box-shadow: 0 .45rem 1.4rem #21070e66;
}

.sheet {
  --offset: 0%;
  --tilt: 0deg;
  position: absolute;
  top: 0;
  left: 50%;
  width: var(--sheet-width);
  min-height: 90svh;
  aspect-ratio: 3 / 4;
  padding: clamp(.85rem, 4vw, 2.5rem);
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  transform: translateX(calc(-50% + var(--offset))) rotate(var(--tilt));
  transform-origin: 50% 25%;
  transition: transform 520ms cubic-bezier(.25, .6, .3, 1), translate 300ms ease;
  font: italic clamp(.83rem, 3.6vw, 1.12rem) Georgia, serif;
  cursor: pointer;
}

.sheet:first-child { --offset: -40%; --tilt: -14deg; }
.sheet:nth-child(2) { justify-content: center; z-index: 1; }
.sheet:last-child { --offset: 40%; --tilt: 14deg; justify-content: flex-end; }
.sheet.photo-cover {
  z-index: 0;
  transition:
    transform 520ms cubic-bezier(.25, .6, .3, 1),
    box-shadow 450ms ease,
    filter 450ms ease,
    z-index 0s 260ms;
}

.sheet-fan:has(.photo-cover:focus-visible) > .photo-cover {
  z-index: 2;
  transition-delay: 0s, 0s, 0s, 150ms;
  transform: translate(-95%, -.7rem) rotate(-10deg);
  box-shadow: 0 .8rem 2rem #21070e99;
  filter: brightness(1.1);
}

.sheet-fan:has(.photo-cover:focus-visible) > .letter-cover { --offset: 7%; --tilt: 2deg; }
.sheet-fan:has(.photo-cover:focus-visible) > .report-cover { --offset: 44%; --tilt: 16deg; }

@media (hover: hover) {
  .sheet:not(.photo-cover):hover { translate: 0 -.65rem; }

  .sheet-fan:has(.photo-cover:hover) > .photo-cover {
    z-index: 2;
    transition-delay: 0s, 0s, 0s, 150ms;
    transform: translate(-95%, -.7rem) rotate(-10deg);
    box-shadow: 0 .8rem 2rem #21070e99;
    filter: brightness(1.1);
  }

  .sheet-fan:has(.photo-cover:hover) > .letter-cover { --offset: 7%; --tilt: 2deg; }
  .sheet-fan:has(.photo-cover:hover) > .report-cover { --offset: 44%; --tilt: 16deg; }
}
.sheet:focus-visible, .back-to-sheets:focus-visible { outline: 2px solid #eab976; outline-offset: 3px; }

.letter-cover, .love-letter {
  border-color: #a84052;
  background: radial-gradient(ellipse at 28% 0%, #ab263e, transparent 65%),
    linear-gradient(148deg, #8e1831, #620d25);
  color: #ffdfa1;
}

.sheet.letter-cover {
  background: var(--paper-grain),
    radial-gradient(ellipse at 28% 0%, #ab263e, transparent 65%),
    linear-gradient(148deg, #8e1831, #620d25);
  background-blend-mode: soft-light, normal, normal;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: clamp(.35rem, 1.2svh, .8rem);
  padding: clamp(.75rem, 3svh, 1.75rem) .65rem;
}

.cover-kitty {
  position: absolute;
  top: .45rem;
  right: .45rem;
  width: clamp(3rem, 8.4vw, 7.2rem);
  color: #f2c67c;
  opacity: .58;
  rotate: 10deg;
  pointer-events: none;
}

.cover-title {
  font: italic clamp(1.15rem, 4vw, 2.5rem) / 1.15 Georgia, serif;
}

.cover-preview {
  max-width: 26ch;
  font: clamp(.85rem, 2.2vw, 1.1rem) / 1.35 Georgia, serif;
}

.cover-art {
  position: relative;
  width: 100%;
}

.cover-bouquet {
  position: absolute;
  top: 0;
  left: 13%;
  width: clamp(2.2rem, 6.8vw, 5.5rem);
  color: #f2c67c;
  opacity: .58;
  rotate: -16deg;
  pointer-events: none;
}

.image-filters { position: absolute; }

.cover-furia, .cover-flamengo {
  position: absolute;
  width: clamp(2rem, 6vw, 5.1rem);
  filter: url("#gold-logo-outline");
  opacity: .58;
  pointer-events: none;
}

.cover-furia {
  bottom: .1rem;
  left: .15rem;
  rotate: -10deg;
}

.cover-flamengo {
  bottom: 10%;
  right: 18%;
  z-index: 1;
  rotate: 16deg;
}

.cover-dog, .cover-cat {
  position: absolute;
  width: clamp(1.9rem, 5.8vw, 4.7rem);
  color: #f2c67c;
  opacity: .58;
  pointer-events: none;
}

.cover-dog { top: 51%; left: 3%; rotate: -13deg; }
.cover-cat { top: 37%; right: 4%; rotate: 12deg; }

.sequin-heart {
  display: block;
  color: #e6b153;
  font: 900 var(--heart-size) / .85 Arial, sans-serif;
  background:
    radial-gradient(circle at 35% 25%, #fff8cf 9%, #f9d47e 21%, #cf9134 40%, #6b3817 48%, transparent 53%) 0 0 / .48rem .48rem,
    radial-gradient(circle at 35% 25%, #ffec9c 13%, #d9a044 37%, #754018 49%, transparent 54%) .24rem .24rem / .48rem .48rem,
    linear-gradient(125deg, #d1933d, #fff0a2 45%, #a66022 85%);
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 .13rem .12rem #3d0817);
}

.sheet-reader { width: min(100%, 30rem); }
.sheet-reader:has(.love-letter:not([hidden])) {
  position: relative;
  width: min(100%, 42rem);
  align-self: safe center;
}

.inside:has(.love-letter:not([hidden])) {
  background: var(--paper-grain),
    radial-gradient(ellipse at 15% 72%, #71332830, transparent 55%),
    radial-gradient(ellipse at 50% 18%, #52101b, #200408 75%);
  background-blend-mode: soft-light, normal, normal;
}

.draft-notes { display: none; }

.love-letter:not([hidden]) + .draft-notes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  padding: 1.25rem .35rem .5rem;
}

.draft-note {
  position: relative;
  z-index: 1;
  margin: 0;
  padding: 1rem .65rem;
  background: var(--paper-grain),
    radial-gradient(ellipse at 13% 86%, #2c090f80, transparent 60%),
    linear-gradient(155deg, #62252c, #411019);
  background-blend-mode: soft-light, normal, normal;
  border: 1px solid #73283280;
  box-shadow: 0 .5rem .85rem #19020877;
  color: #be8287;
  font: italic clamp(.85rem, 2vw, 1.15rem) / 1.5 "Segoe Script", "Apple Chancery", cursive;
}

.draft-note:nth-child(1) { rotate: -11deg; }
.draft-note:nth-child(2) { rotate: 4deg; }
.draft-note:nth-child(3) { rotate: 7deg; }
.draft-note:nth-child(4) { rotate: -4deg; }
.draft-note s { text-decoration-thickness: 1px; }
.draft-note { pointer-events: auto; transition: rotate 300ms ease, translate 300ms ease; }

@media (hover: hover) {
  .draft-note:hover { rotate: 0deg; translate: 0 -.3rem; }
}
.draft-note span[aria-hidden] { display: block; }
.draft-scribble { text-decoration: line-through; }

.draft-notes { position: relative; }

.draft-marks {
  position: absolute;
  inset: 0;
  color: #a9646a;
  opacity: .34;
  pointer-events: none;
}

.draft-marks span { position: absolute; display: block; }

.draft-mark-crossout, .draft-mark-tangle {
  background:
    linear-gradient(11deg, transparent 48%, currentColor 50%, transparent 54%),
    linear-gradient(-15deg, transparent 47%, currentColor 49%, transparent 53%),
    repeating-linear-gradient(139deg, transparent 0 7px, currentColor 8px, transparent 9px 13px);
}

.draft-mark-crossout {
  top: 4%;
  left: 7%;
  width: 4.5rem;
  height: .8rem;
  rotate: -9deg;
}

.draft-mark-hatch {
  top: 2%;
  right: 12%;
  width: 2.6rem;
  height: 1.25rem;
  rotate: 8deg;
  background: repeating-linear-gradient(132deg, transparent 0 6px, currentColor 7px, transparent 8px 11px);
}

.draft-mark-tangle {
  top: 48%;
  left: 11%;
  width: 2rem;
  height: .85rem;
  rotate: 17deg;
}

.draft-mark-heart, .draft-mark-arrow { font: 1.8rem / 1 Georgia, serif; }
.draft-mark-heart { top: 46%; right: 12%; rotate: 14deg; }
.draft-mark-arrow { bottom: 0; right: 51%; rotate: 18deg; }

.draft-margin {
  position: absolute;
  inset-block: 0;
  width: 48%;
}

.draft-margin-left { left: 0; }
.draft-margin-right { right: 0; }

.draft-margin span {
  inset: var(--y) auto auto var(--x);
  rotate: var(--angle);
}

.draft-margin .draft-mark-crossout { width: clamp(1.6rem, 4vw, 3.8rem); }
.draft-margin .draft-mark-hatch { width: clamp(1.2rem, 3vw, 2.6rem); }

.draft-keepsakes {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: .45rem;
  color: #a9646a;
}

.portrait-sketch {
  display: block;
  width: clamp(4.25rem, 10vw, 8rem);
  aspect-ratio: 1;
  background: currentColor;
  mask: var(--portrait-image) center / contain no-repeat;
  pointer-events: none;
}

.draft-car-portrait {
  --portrait-image: url("isabelly-carro.png");
  color: #c5848c;
  opacity: .42;
  rotate: 11deg;
}

.draft-table-portrait {
  --portrait-image: url("isabelly-taca.png");
  color: #c5848c;
  opacity: .44;
  rotate: -9deg;
}

.draft-kuromi {
  width: clamp(3.5rem, 8vw, 7rem);
  rotate: -7deg;
  opacity: .68;
}

.draft-date, .draft-number, .draft-bts, .draft-name {
  font: italic clamp(.95rem, 1.4vw, 1.3rem) / 1.1 "Segoe Script", "Apple Chancery", cursive;
  white-space: nowrap;
}

.draft-date {
  padding-bottom: .15em;
  border-bottom: 1px solid currentColor;
  rotate: -8deg;
}

.draft-number { rotate: 10deg; opacity: .72; }
.draft-bts { rotate: -12deg; opacity: .7; }
.draft-name {
  display: grid;
  gap: .2em;
  padding: .35rem;
  text-align: left;
  rotate: 6deg;
}

.draft-name s { opacity: .68; text-decoration-thickness: 1px; }

@media (max-width: 899px) {
  .draft-note:nth-child(2) { margin: .8rem -.2rem -.25rem .35rem; }
  .draft-note:nth-child(3) { margin: .4rem .35rem 0 0; }
  .draft-note:nth-child(4) { margin: .9rem 0 0 .15rem; }
}

@media (min-width: 900px) {
  .sheet-reader:has(.love-letter:not([hidden])) { width: min(50vw, 42rem); }

  .love-letter:not([hidden]) + .draft-notes {
    position: absolute;
    inset: 0;
    display: block;
    padding: 0;
    pointer-events: none;
  }

  .draft-note {
    position: absolute;
    width: min(18vw, 15rem);
    padding: 1.35rem .65rem;
  }

  .draft-note:nth-child(1) { top: 9%; right: calc(100% + 3.5vw); }
  .draft-note:nth-child(2) { top: 19%; left: calc(100% + 1.6vw); }
  .draft-note:nth-child(3) { top: 53%; right: calc(100% + 1.8vw); }
  .draft-note:nth-child(4) { top: 64%; left: calc(100% + 3vw); }

  .draft-mark-crossout { left: -32%; top: 2%; }
  .draft-mark-hatch { right: -26%; top: 8%; }
  .draft-mark-tangle { left: -20%; top: 39%; }
  .draft-mark-heart { right: -20%; top: 49%; }
  .draft-mark-arrow { right: -34%; bottom: 4%; }
  .draft-margin { width: min(23vw, 19rem); }
  .draft-margin-left { left: auto; right: calc(100% + 1.1vw); }
  .draft-margin-right { right: auto; left: calc(100% + 1.1vw); }

  .draft-keepsakes { position: absolute; inset: 0; }
  .draft-car-portrait { position: absolute; top: 40%; left: calc(100% + 6vw); }
  .draft-table-portrait { position: absolute; top: 72%; right: calc(100% + 6vw); }
  .draft-kuromi { position: absolute; top: 38%; right: calc(100% + 5vw); }
  .draft-date { position: absolute; bottom: 7%; left: calc(100% + 8vw); }
  .draft-number { position: absolute; top: 54%; left: calc(100% + 2vw); }
  .draft-bts { position: absolute; bottom: 8%; right: calc(100% + 12vw); }
  .draft-name { position: absolute; top: 4%; left: calc(100% + 8vw); }
}

.sheet.photo-cover, .letter.photo-letter {
  border-color: #5c725e;
  background: linear-gradient(150deg, #304a3a, #16291f);
  color: #f0d9a6;
}

.sheet.photo-cover {
  flex-direction: column;
  background: var(--paper-grain), linear-gradient(150deg, #304a3a, #16291f);
  background-blend-mode: soft-light, normal;
  gap: .65rem;
  padding-inline: clamp(.5rem, 2vw, 1.5rem);
  overflow: hidden;
}

.photo-cover-title {
  font-size: clamp(1rem, 3vw, 2rem);
  white-space: nowrap;
}

.photo-cover img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  background: #fff;
  border: 1px solid #bca471;
}

.sheet-reader:has(.photo-letter:not([hidden])) {
  position: relative;
  width: min(100%, 46rem);
  align-self: safe center;
}

.letter.photo-letter {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

.gallery-doodles { display: none; }

.photo-letter:not([hidden]) + .gallery-doodles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .6rem;
  margin-top: .7rem;
  color: #d49b9a;
  pointer-events: none;
}

.gallery-doodle-left, .gallery-doodle-right {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-around;
  gap: 1.5rem;
  min-width: 0;
  padding: 1rem 0;
}

.gallery-portrait {
  position: relative;
  display: block;
  flex: none;
  width: min(86%, 12rem);
  aspect-ratio: 1;
  object-fit: contain;
  filter: grayscale(1) sepia(.35);
  opacity: .78;
  animation: gallery-portrait-in 1.1s ease-out backwards;
}

.gallery-car, .gallery-table { animation-delay: .23s; }
.gallery-selfie { animation-delay: .42s; }

.falling-petal {
  position: absolute;
  top: 3%;
  left: var(--petal-x);
  width: .65rem;
  height: 1.1rem;
  scale: var(--petal-size, 1);
  border-radius: 75% 20% 68% 35%;
  background: linear-gradient(145deg, #e4a0a5, #9d3b57);
  opacity: 0;
  animation: gallery-petal-fall 3.4s ease-in-out var(--petal-delay) both;
}

.gallery-drawn-heart {
  position: absolute;
  top: 34%;
  right: 22%;
  width: clamp(1.65rem, 3.5vw, 3rem);
  fill: none;
  stroke: #d49b9a;
  stroke-width: 1.2;
  opacity: .64;
  rotate: -12deg;
}

.gallery-doodle-right .gallery-drawn-heart { top: 60%; right: 34%; rotate: 15deg; }
.gallery-drawn-heart path { animation: draw-gallery-heart 1.25s .35s ease-out both; }
.gallery-doodle-right .gallery-drawn-heart path { animation-delay: .85s; }

.gallery-doodles .gallery-drawn-extra {
  position: absolute;
  inset: var(--draw-y) auto auto var(--draw-x);
  width: clamp(1rem, 2.5vw, 2.3rem);
  fill: none;
  stroke: #d49b9a;
  stroke-width: 1.25;
  stroke-linecap: round;
  opacity: .55;
  rotate: var(--draw-angle);
}

.gallery-doodles .gallery-drawn-leaf { stroke: #d0a783; }
.gallery-doodles .gallery-drawn-extra path { animation: draw-gallery-heart 1.35s var(--draw-delay) ease-out both; }

@keyframes gallery-portrait-in {
  from { opacity: 0; scale: .95; }
  to { opacity: .78; scale: 1; }
}

@keyframes gallery-petal-fall {
  0% { top: 3%; opacity: 0; transform: rotate(-28deg); }
  20%, 70% { opacity: .74; }
  53% { transform: translateX(1.1rem) rotate(75deg); }
  100% { top: 91%; opacity: 0; transform: translateX(-.35rem) rotate(170deg); }
}

@keyframes draw-gallery-heart {
  from { stroke-dasharray: 1; stroke-dashoffset: 1; }
  to { stroke-dasharray: 1; stroke-dashoffset: 0; }
}

.gallery-mirror {
  align-self: flex-start;
  translate: 9% -12%;
  clip-path: polygon(evenodd, 0 0, 100% 0, 100% 100%, 0 100%, 0 0,
    30.8% 49.8%, 36.5% 48.7%, 37.8% 54.8%, 32.3% 56.1%, 30.8% 49.8%, 0 0);
  rotate: -10deg;
}

.gallery-selfie { align-self: flex-end; width: min(83%, 11rem); translate: 0 12%; rotate: 12deg; }
.gallery-car { align-self: flex-end; width: min(68%, 9rem); translate: -8% 18%; rotate: 17deg; }
.gallery-table { align-self: flex-start; width: min(62%, 8rem); translate: 21% -16%; rotate: -15deg; }

.gallery-doodles :is(.draft-mark-crossout, .draft-mark-hatch, .draft-mark-tangle,
  .gallery-doodle-heart, .gallery-doodle-arrow, .gallery-doodle-stars, .gallery-petal) {
  position: absolute;
  opacity: .48;
}

.gallery-doodles .draft-mark-crossout { top: 5%; left: 7%; width: 2.8rem; }
.gallery-doodles .draft-mark-hatch { top: 7%; right: 7%; width: 1.5rem; }
.gallery-doodles .draft-mark-tangle { top: auto; bottom: 5%; left: 10%; }
.gallery-doodle-heart { top: 42%; right: 12%; font-size: 2rem; rotate: 15deg; }
.gallery-doodle-stars { bottom: 3%; right: 12%; rotate: -10deg; }
.gallery-doodle-arrow { top: 47%; left: 13%; font-size: 1.7rem; rotate: 11deg; }

.gallery-petal {
  width: .8rem;
  height: 1.4rem;
  border: 1px solid currentColor;
  border-radius: 75% 20% 65% 40%;
  background: #b2516640;
  box-shadow: .7rem .8rem 0 -.19rem #ba637a8c, -.55rem .95rem 0 -.23rem #ba637a80;
}

.gallery-petal-one { top: 49%; left: 12%; rotate: -28deg; }
.gallery-petal-two { top: 52%; right: 15%; rotate: 32deg; }

.gallery-doodles .gallery-extra {
  position: absolute;
  inset: var(--y) auto auto var(--x);
  rotate: var(--angle);
  opacity: .4;
}

.gallery-extra.draft-mark-crossout { width: clamp(1.25rem, 3vw, 2.6rem); }
.gallery-extra.draft-mark-hatch { width: 1.25rem; }
.gallery-flower { font-size: clamp(1.15rem, 2vw, 2rem); }
.gallery-small-heart { font-size: clamp(.85rem, 1.6vw, 1.45rem); }

@media (min-width: 980px) {
  .inside:has(.photo-letter:not([hidden])) {
    overflow-x: hidden;
  }

  .photo-letter:not([hidden]) + .gallery-doodles {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100vw;
    height: max(100svh, 100%);
    translate: -50% -50%;
    display: block;
    margin: 0;
  }

  .gallery-doodle-left, .gallery-doodle-right {
    position: absolute;
    inset-block: 0;
    width: calc((100% - 46rem) / 2 - .75rem);
    display: block;
  }

  .gallery-doodle-left { left: 0; }
  .gallery-doodle-right { right: 0; }

  .gallery-doodles .gallery-portrait {
    position: absolute;
    width: min(var(--sketch-size), 60%);
    translate: none;
  }

  .gallery-mirror { --sketch-size: 15rem; left: 10%; top: 9%; }
  .gallery-table { --sketch-size: 12rem; right: 10%; bottom: 12%; }
  .gallery-car { --sketch-size: 10rem; right: 12%; top: 21%; }
  .gallery-selfie { --sketch-size: 16rem; left: 8%; bottom: 5%; }

  .gallery-doodle-left .draft-mark-crossout { top: 37%; left: 13%; }
  .gallery-doodle-heart { top: 41%; right: 15%; }
  .gallery-petal-one { top: 58%; left: 22%; }
  .gallery-petal-two { top: 61%; right: 12%; }
  .gallery-doodle-arrow { top: 34%; left: 15%; }
}

.photo-letter::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: url("isabelly-contorno.png") left top / clamp(6rem, 15vw, 10rem) auto no-repeat;
  opacity: .42;
  pointer-events: none;
}
.photo-letter h2 {
  min-height: clamp(4rem, 10vw, 6.5rem);
  align-content: center;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 9rem), 1fr));
  gap: .75rem;
  margin-top: 1rem;
}

.photo-grid img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: contain;
  border: 1px solid #bca471;
  background: #16291f;
}

.photo-thumb {
  display: block;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.photo-thumb:focus-visible { outline: 2px solid #f4d898; outline-offset: 3px; }

.photo-lightbox {
  width: max-content;
  max-width: min(92vw, 52rem);
  max-height: 92svh;
  padding: .7rem;
  border: 1px solid #aa8251;
  border-radius: .45rem;
  background: #241318;
  color: #f6dec0;
  text-align: center;
}

.photo-lightbox::backdrop { background: #0d0308dd; }
.photo-lightbox form { text-align: right; }
.photo-lightbox figure { margin: 0; }
.photo-lightbox figcaption { padding: .65rem .35rem .25rem; }
.photo-large { display: block; max-width: 100%; max-height: 72svh; margin: auto; object-fit: contain; }

.photo-close {
  margin-bottom: .35rem;
  padding: .2rem .65rem;
  border: 1px solid #aa8251;
  border-radius: .25rem;
  background: transparent;
  color: inherit;
  font-size: 1.2rem;
  cursor: pointer;
}

.letter {
  min-height: min(24rem, 58svh);
  padding: clamp(1.25rem, 5vw, 2.5rem);
  animation: reveal-sheet 320ms ease-out both;
}

.letter h2 { margin: 0; font-weight: normal; font-style: italic; }

.love-letter {
  background: var(--paper-grain),
    radial-gradient(ellipse at 75% 100%, #4d0b1fa0, transparent 67%),
    radial-gradient(ellipse at 28% 0%, #ab263e, transparent 65%),
    linear-gradient(148deg, #8e1831, #620d25);
  background-blend-mode: soft-light, normal, normal, normal;
  text-align: left;
  font-size: clamp(1rem, 2.3vw, 1.125rem);
  line-height: 1.65;
  animation-name: open-letter;
  transform-origin: top center;
}

.love-letter h2 { text-align: center; }
.love-letter p { margin: 1em 0 0; }
.love-letter .letter-signature { text-align: right; font-style: italic; }

.report-cover, .report {
  border-color: #b8a17a;
  background: #dcc9a5;
  color: #302b26;
}

.sheet.report-cover {
  background: var(--paper-grain), linear-gradient(150deg, #dcc9a5, #cbb388);
  background-blend-mode: multiply, normal;
}

.report-stamp {
  border: 2px solid currentColor;
  padding: .3em .4em;
  color: #8b3036;
  font: 700 clamp(.55rem, 1.8vw, 1.25rem) monospace;
  text-transform: uppercase;
  rotate: -8deg;
}

.report { text-align: left; }
.report h2 { font-weight: bold; font-style: normal; }
.report dt { font-weight: bold; }
.report dd { margin: .15rem 0 .8rem; }

.report-reveal {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 7rem;
  overflow: hidden;
  background: #cdb88f;
  border-radius: .35rem;
  text-align: center;
}

.hug-message { margin: 0; padding: .75rem; color: #302b26; }

.hug-stamp:not([hidden]) {
  display: table;
  margin: 1rem auto .25rem;
  padding: .35rem .6rem;
  border: 2px solid currentColor;
  color: #8b3036;
  font: 700 clamp(.72rem, 2.2vw, .95rem) monospace;
  text-transform: uppercase;
  transform: rotate(-7deg);
  animation: stamp-hug .28s .15s ease-out both;
}

@keyframes stamp-hug {
  from { opacity: 0; scale: 1.45; }
  70% { opacity: 1; scale: .96; }
  to { opacity: 1; scale: 1; }
}

.report-sticker {
  --warning-yellow: #ffd323;
  --warning-black: #131109;
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-rows: auto 1fr .9rem;
  width: 100%;
  padding: 0;
  border: 0;
  background: var(--warning-yellow);
  color: var(--warning-black);
  font: 900 clamp(.82rem, 3.8vw, 1.4rem) / 1.1 Arial, sans-serif;
  text-transform: uppercase;
  cursor: grab;
  touch-action: pan-y;
  user-select: none;
  translate: var(--sticker-pull, 0px);
  opacity: var(--sticker-opacity, 1);
  transition: translate 250ms ease, opacity 250ms ease;
}

.sticker-heading, .sticker-warning {
  display: grid;
  place-content: center;
  padding: .4rem .25rem;
}

.sticker-heading {
  grid-auto-flow: column;
  align-items: center;
  gap: .45em;
  background: var(--warning-black);
  color: var(--warning-yellow);
}

.sticker-icon {
  width: 1.35em;
  padding-top: .27em;
  background: var(--warning-yellow);
  color: var(--warning-black);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}

.report-sticker::after {
  content: "";
  background: repeating-linear-gradient(-55deg, var(--warning-black) 0 12px, var(--warning-yellow) 12px 24px);
}

.report-sticker:focus-visible { outline: 2px dashed #fff; outline-offset: -4px; }
.report-sticker.dragging { cursor: grabbing; transition: none; }
.report-sticker.removed { translate: var(--sticker-exit, 110%); opacity: 0; pointer-events: none; }

.back-to-sheets {
  margin-top: 1rem;
  padding: .65rem 1rem;
  border: 1px solid #eab97688;
  border-radius: .3rem;
  background: transparent;
  color: #f6dec0;
  font: 1rem Georgia, serif;
  cursor: pointer;
}

@keyframes reveal-sheet {
  from { opacity: 0; translate: 0 1rem; }
  to { opacity: 1; translate: 0 0; }
}

@keyframes open-letter {
  from { opacity: 0; transform: translateY(1rem) scale(.94); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes approach {
  0%, 17% { transform: scale(1); }
  100% { transform: translateY(-35%) scale(18); }
}

@keyframes seal-glint {
  0%, 65% { background-position: 100% 0; opacity: 0; }
  82% { opacity: 1; }
  100% { background-position: 0 0; opacity: 0; }
}

@media (max-width: 640px) {
  .scene { --stage-width: min(160vw, calc(100svh * 1672 / 941)); }
  .sheet-fan { --sheet-width: 56vw; }
  .sheet:first-child, .sheet:last-child { padding-top: 2.75rem; }
}

@media (prefers-reduced-motion: reduce) {
  .opening .envelope { animation-duration: 1ms; }
  .flap, .envelope-art { transition: none; }
  .seal::after { animation: none; }
  .sheet-fan, .letter { animation: none; }
  .sheet, .sheet.photo-cover { transition: none; }
  .report-sticker { transition: none; }
  .gallery-portrait, .falling-petal, .gallery-drawn-heart path, .gallery-doodles .gallery-drawn-extra path, .hug-stamp:not([hidden]) { animation: none; }
  .draft-note { transition: none; }
}
