:root {
  color-scheme: dark;
  --ink: #f6e7c7;
  --gold: #d7b675;
  --card-width: min(450px, calc(100vw - 24px), calc((100svh - 96px) * .5625));
  --card-height: calc(var(--card-width) * 1.777777778);
  --top-space: max(16px, calc((100svh - var(--card-height)) / 2 - 12px));
  font-family: Baskerville, "Palatino Linotype", Georgia, serif;
  background: #451711;
  color: var(--ink);
}
* { box-sizing: border-box; }
html { min-height: 100%; scrollbar-gutter: stable; scroll-behavior: auto; }
body { margin: 0; min-height: 100svh; background: radial-gradient(ellipse at 50% 20%, #6c2c21 0, #451711 55%, #32110e 100%); }
body.is-sealed { overflow: hidden; }
button,a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; }
button:focus-visible,a:focus-visible { outline: 2px solid #f8d694; outline-offset: 5px; }
[hidden] { display: none !important; }
.envelope-view { position: fixed; inset: 0; z-index: 10; background: radial-gradient(ellipse at 50% 20%, #6c2c21 0, #451711 55%, #32110e 100%); }
.envelope-stage { position: absolute; left: 50%; top: var(--top-space); transform: translateX(-50%); width: var(--card-width); aspect-ratio: 9/16; box-shadow: 0 15px 60px #16050080, 0 0 0 1px #e9c77e28; overflow: hidden; }
.welcome-underlay,.opening-video,.seal-button,.seal-button img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: contain; }
.seal-button { appearance: none; border: 0; padding: 0; background: transparent; cursor: pointer; }
.seal-button:focus-visible { outline-offset: -6px; outline-width: 3px; }
.opening-video { visibility: hidden; }
.envelope-view.is-opening .opening-video { visibility: visible; }
.envelope-view.is-opening .seal-button { visibility: hidden; }
.open-caption,.skip-opening { position: absolute; left: 50%; top: calc(var(--top-space) + var(--card-height) + 8px); transform: translateX(-50%); padding: 10px 20px; border: 0; background: transparent; font-size: 15px; letter-spacing: .08em; white-space: nowrap; color: #f6e1b4; cursor: pointer; min-height: 44px; }
.little-flower { margin: 0 10px; color: var(--gold); }
.skip-opening { font-size: 13px; text-decoration: underline; text-underline-offset: 4px; }
.invitation { width: var(--card-width); margin: 0 auto; padding-top: var(--top-space); outline: none; }
.card { position: relative; width: 100%; margin: 0 0 18px; background: #f6e6c9; box-shadow: 0 12px 36px #16050052; }
.card>img { display: block; width: 100%; height: auto; aspect-ratio: 9/16; }
.map-link { position: absolute; left: 36.49%; width: 27.02%; top: 86.14%; height: 2.75%; min-height: 32px; transform: translateY(-5px); border-radius: 2px; }
.map-link:focus-visible { outline-color: #8e5f26; }
.music-toggle { position: fixed; z-index: 20; right: max(10px, calc((100vw - var(--card-width)) / 2 - 52px)); top: max(12px, env(safe-area-inset-top)); width: 42px; height: 42px; display: grid; place-items: center; padding: 0; border: 1px solid #c89e5d80; border-radius: 50%; color: #f6e1b4; background: #451711eb; box-shadow: 0 2px 10px #230d0b40; cursor: pointer; }
.music-toggle .sound-waves { display: none; }
.music-toggle.is-playing .sound-waves { display: inline; }
.music-toggle.is-playing .sound-off { display: none; }
.invitation-footer { display: flex; flex-direction: column; align-items: center; padding: 12px 12px max(40px, env(safe-area-inset-bottom)); gap: 8px; text-align: center; color: var(--gold); }
.footer-link { color: #f5e2bb; border: none; background: none; padding: 12px 8px; min-height: 44px; font-size: 15px; cursor: pointer; text-decoration: underline; text-underline-offset: 5px; text-decoration-color: #d8b97588; }
.scroll-hint { position: fixed; bottom: max(12px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); padding: 10px 18px; border: 1px solid #c89e5d60; border-radius: 30px; background: #451711eb; box-shadow: 0 3px 12px #230d0b40; font-size: 13px; letter-spacing: .04em; pointer-events: none; white-space: nowrap; }
.scroll-hint span { margin-left: 8px; color: var(--gold); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.no-script { padding: 40px; text-align: center; }
.no-script a { color: var(--ink); }
@media (max-width: 600px) { html { scrollbar-gutter: auto; } }
@media (orientation: landscape) and (max-height: 600px) {
  :root { --card-width: min(450px, calc(100vw - 40px)); --top-space: 16px; }
  .envelope-stage { width: calc((100svh - 72px) * .5625); }
  .open-caption,.skip-opening { top: auto; bottom: 8px; }
}
