.gift-scene {
  --gift-dark: #221914;
  --gift-paper: #fff4e4;
  --gift-foil: #e8c695;
  --gift-line: #785c45;
  position: relative;
  width: 100%;
  box-sizing: border-box;
  overflow: clip;
  color: var(--gift-paper);
  border: 1px solid var(--gift-line);
  background: radial-gradient(ellipse at 48% 25%, #584032, #30211a 61%, #211813);
  box-shadow: 0 24px 58px #130b0790;
  font: 1rem/1.55 Manrope, system-ui, sans-serif;
}
.gift-scene *, .gift-scene *::before, .gift-scene *::after { box-sizing: border-box; }
.gift-scene [hidden] { display: none !important; }
.gift-seal {
  position: relative;
  display: grid;
  place-items: center;
  gap: clamp(10px, 2.6vw, 24px);
  padding: clamp(26px, 5vw, 55px) clamp(18px, 4vw, 44px) clamp(24px, 4vw, 45px);
  text-align: center;
  cursor: pointer;
  list-style: none;
  isolation: isolate;
}
.gift-seal::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: 11px;
  border: 1px solid #e8c69540;
  pointer-events: none;
}
.gift-seal::-webkit-details-marker, .gift-seal::after { display: none; }
.gift-seal:focus-visible, .gift-player :focus-visible { outline: 2px solid #fff2dc; outline-offset: -5px; }
.gift-recipient {
  position: relative;
  z-index: 1;
  font: italic 400 clamp(2.25rem, 5.6vw, 4rem)/.99 var(--serif, 'Cormorant Garamond', Georgia, serif);
  overflow-wrap: anywhere;
}
.gift-envelope {
  position: relative;
  display: block;
  width: min(88%, 365px);
  aspect-ratio: 1.58;
  perspective: 800px;
  border-radius: 6px;
  margin-block: 8px 4px;
  background: #8c6257;
  box-shadow: 0 20px 33px #09050380, 0 53px 75px -50px #110b07;
  transform: rotate(-4deg);
  transition: transform .5s ease;
}
.gift-seal:hover .gift-envelope, .gift-scene[open] .gift-envelope { transform: rotate(0deg); }
.gift-envelope-pocket, .gift-envelope-flap {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: 6px;
  pointer-events: none;
}
.gift-envelope-pocket {
  z-index: 3;
  clip-path: polygon(0 0, 50% 67%, 100% 0, 100% 100%, 0 100%);
  background:
    repeating-linear-gradient(124deg, #fff4db09 0 1px, transparent 1px 3px),
    conic-gradient(from -55deg at 50% 67%, #a86959 0 110deg, #c28b74 110deg 166deg, #dba98c 167deg 193deg, #c9927a 194deg 250deg, #a5695a 251deg);
  box-shadow: inset 0 0 1px 1px #ffebc777;
}
.gift-envelope-flap {
  z-index: 4;
  clip-path: polygon(0 0, 100% 0, 51.5% 68%, 48.5% 68%);
  transform-origin: center top;
  backface-visibility: visible;
  background: repeating-linear-gradient(126deg, #fff2dc0b 0 1px, transparent 1px 3px),
    linear-gradient(159deg, #f5ccb0, #d6a089 48%, #bc7e68);
  box-shadow: inset 0 1px 1px #fff7daaa;
}
.gift-envelope-insert {
  position: absolute;
  z-index: 2;
  inset: 6% 8% 12%;
  display: grid;
  align-content: start;
  justify-items: center;
  padding-top: 9%;
  color: #785132;
  background: linear-gradient(135deg, #fff9eb, #e9d4b6);
  box-shadow: 0 4px 13px #34201266, inset 0 0 0 5px #fff9ec85;
  font-size: clamp(.55rem, 1.5vw, .75rem);
  font-weight: 800;
  letter-spacing: .23em;
}
.gift-envelope-insert i {
  display: block;
  width: 44%;
  height: 16px;
  margin-top: 6px;
  border-top: 1px solid #ad8057;
  border-bottom: 1px solid #ad8057;
  border-radius: 50%;
}
.gift-wax {
  position: absolute;
  z-index: 5;
  top: 59%;
  left: 50%;
  display: grid;
  place-items: center;
  width: 18%;
  aspect-ratio: 1;
  border: 1px solid #f1cba0;
  border-radius: 47% 54% 48% 53%;
  transform: translate(-50%, -50%);
  color: #58351f;
  background: radial-gradient(circle at 34% 24%, #f5d6b2, #d8ac77 53%, #9c6038);
  box-shadow: 0 5px 12px #4d261d96, inset 0 0 0 4px #f5c89ba0, inset 0 0 0 6px #8e5a3770;
  font: italic 400 clamp(1.4rem, 5vw, 2.45rem)/1 var(--serif, 'Cormorant Garamond', Georgia, serif);
}
.gift-open-label, .gift-close-label {
  position: relative;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 13px;
  min-height: 42px;
  padding: 8px 16px;
  border: 1px solid #dfbb87aa;
  font-size: .87rem;
  font-weight: 750;
}
.gift-seal:hover .gift-open-label, .gift-seal:hover .gift-close-label { background: #eccda4; color: #2d231b; }
.gift-close-label, .gift-scene[open] .gift-open-label { display: none; }
.gift-scene[open] .gift-close-label { display: inline-flex; }
.gift-scene[open] .gift-envelope-flap { animation: lift-flap .58s cubic-bezier(.2,.7,.22,1) both; }
.gift-scene[open] .gift-envelope-insert { animation: rise-paper .75s .19s cubic-bezier(.2,.72,.22,1) both; }
.gift-scene[open] .gift-wax { animation: release-wax .34s ease both; }
@keyframes lift-flap {
  0% { transform: rotateX(0); z-index: 4; }
  48% { z-index: 4; }
  49%, 100% { z-index: 1; }
  100% { transform: rotateX(158deg); }
}
@keyframes rise-paper { to { transform: translateY(-31%); } }
@keyframes release-wax { to { opacity: 0; transform: translate(-50%, -42%) scale(.7); } }

.gift-inside {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr);
  align-items: center;
  gap: clamp(12px, 3.5vw, 34px);
  margin: 0 clamp(12px, 3.5vw, 32px) clamp(13px, 4vw, 37px);
  padding: clamp(19px, 4vw, 37px);
  border: 1px solid #f4ddaf;
  color: #38251d;
  background: repeating-linear-gradient(128deg, #aa85520a 0 1px, transparent 1px 4px), linear-gradient(135deg, #fff8e9, #eddfc7);
  outline: 1px solid #b08a59a0;
  outline-offset: -8px;
  box-shadow: 0 19px 35px #10090577;
}
.gift-scene[open] .gift-inside { animation: present-card .62s .27s cubic-bezier(.2,.72,.22,1) both; }
@keyframes present-card { from { opacity: 0; transform: translateY(19px) scale(.96); } }
.gift-record { position: relative; width: min(100%, 325px); aspect-ratio: 1.20; isolation: isolate; margin: 0 auto; }
.gift-disc { position: absolute; left: 4%; top: 2%; width: 80%; aspect-ratio: 1; }
.gift-scene[open] .gift-disc { animation: gift-disc-slide .7s .58s cubic-bezier(.2,.72,.22,1) both; }
@keyframes gift-disc-slide { to { transform: translateX(20%); } }
.gift-vinyl {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid #796158;
  background: radial-gradient(circle, #362317 3%, #d8aa86 4% 18%, transparent 19%),
    repeating-radial-gradient(#ffffff00 0 3px, #c7ae9138 3px 4px),
    conic-gradient(from 26deg, #211813, #645043, #241b15, #5e493c, #211813);
  animation: gift-spin 4s linear infinite paused;
}
.gift-scene.is-playing .gift-vinyl { animation-play-state: running; }
@keyframes gift-spin { to { transform: rotate(1turn); } }
.gift-sleeve {
  position: absolute;
  left: 0;
  top: 5%;
  width: 74%;
  aspect-ratio: 1;
  display: grid;
  align-content: end;
  padding: 8%;
  border: 1px solid #c2a27d;
  background:
    radial-gradient(ellipse at 49% 29%, #ead0af, transparent 44%),
    conic-gradient(from 90deg at 50% 34%, #3c251e, #95644c, #cfaa80, #6c4938, #3c251e);
  box-shadow: 0 10px 14px #301b1555;
}
.gift-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.gift-sleeve-title { z-index: 1; color: #fff2df; font: italic 400 clamp(1rem, 2.3vw, 1.85rem)/1.1 var(--serif, 'Cormorant Garamond', Georgia, serif); overflow-wrap: anywhere; text-shadow: 0 2px 7px #1b130e; }
.gift-sleeve:has(.gift-photo:not([hidden])) .gift-sleeve-title { display: none; }
.gift-letter { min-width: 0; }
.gift-letter p { margin: 0 0 10px; overflow-wrap: anywhere; }
.gift-letter .gift-letter-label { font-size: .65rem; font-weight: 800; color: #835738; letter-spacing: .18em; }
.gift-letter h2 { margin: 0 0 11px; font: 500 clamp(2.15rem, 4.3vw, 3.8rem)/.94 var(--serif, 'Cormorant Garamond', Georgia, serif); color: #38251d; overflow-wrap: anywhere; }
.gift-dedication { color: #4c372d; white-space: pre-wrap; font-size: .94rem; }
.gift-sender { color: #764d34; font: italic 500 1.30rem/1.3 var(--serif, 'Cormorant Garamond', Georgia, serif); }
.gift-audio { display: block; margin-top: 15px; width: 100%; min-width: 0; }
.gift-player { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 9px; margin-top: 15px; }
.gift-play { display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid #5c3c2b; border-radius: 50%; color: #fff0d7; background: #462d23; cursor: pointer; }
.gift-play:hover { background: #6f4938; }
.gift-play span { margin-inline-start: 3px; border: 7px solid transparent; border-inline: 9px solid currentColor; border-inline-end: 0; }
.gift-scene.is-playing .gift-play span { width: 9px; height: 13px; margin: 0; border: 0; border-inline: 2px solid currentColor; }
.gift-seek { min-width: 0; width: 100%; height: 28px; accent-color: #8a5636; cursor: pointer; }
.gift-time { color: #6e4936; font-size: .78rem; font-variant-numeric: tabular-nums; }
.gift-player .gift-player-error { grid-column: 1 / -1; margin: 0; color: #7e3026; font-size: .83rem; }

.gift-page { margin: 0; min-height: 100svh; background: #211713; color: #f1d6b0; }
.gift-page main { box-sizing: border-box; width: min(100%, 790px); margin-inline: auto; padding: clamp(12px, 4vw, 36px) clamp(11px, 4vw, 33px) 44px; }
.gift-page-title { margin: 0 0 15px; text-align: center; font: 500 clamp(1.4rem, 4vw, 2rem)/1 'Cormorant Garamond', Georgia, serif; }
.gift-page-title span { display: inline-block; margin-inline-start: 4px; font: 800 .62rem/1 Manrope, sans-serif; letter-spacing: .20em; text-transform: uppercase; }

@media (max-width: 560px) {
  .gift-seal { gap: 15px; padding-inline: 16px; }
  .gift-envelope { width: min(83%, 310px); }
  .gift-inside { grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 19px 21px; }
  .gift-record { width: min(83%, 215px); }
  .gift-letter h2 { font-size: clamp(2.1rem, 9vw, 3.4rem); }
}
@media (prefers-reduced-motion: reduce) {
  .gift-scene *, .gift-scene[open] * { animation: none; transition: none; }
  .gift-scene[open] .gift-envelope-flap, .gift-scene[open] .gift-wax { opacity: 0; }
  .gift-scene[open] .gift-envelope-insert { transform: translateY(-31%); }
  .gift-scene[open] .gift-disc { transform: translateX(20%); }
}
