:root {
  color-scheme: light;
  --wine: #641724;
  --ink: #450c0c;
  --gold: #ad8b51;
  --paper: #f7f5e9;
  --sans: Arial, Helvetica, sans-serif;
  font-family: Georgia, 'Times New Roman', serif;
  color: var(--ink);
  background: #2d181b;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; }
body { margin: 0; isolation: isolate; }
.envelope-intro {
  position: relative;
  z-index: 2;
  height: 100svh;
  min-height: 320px;
  display: grid;
  place-items: center;
  background: #eeecdf;
}
.envelope-intro[hidden] { display: none; }
.envelope-frame {
  position: relative;
  width: min(100%, calc(100svh * 9 / 16));
  aspect-ratio: 9 / 16;
}
.envelope-frame video { display: block; width: 100%; height: 100%; object-fit: contain; }
.envelope-open { position: absolute; inset: 0; -webkit-tap-highlight-color: transparent; }
.envelope-open:focus-visible { outline-offset: -6px; }
.envelope-intro.is-opening .envelope-open { cursor: progress; }
a { color: inherit; -webkit-tap-highlight-color: transparent; }
a:focus-visible { outline: 3px solid #e4c582; outline-offset: 5px; }
.scenery {
  position: fixed;
  inset: 0;
  z-index: -2;
  background: #918b83 url('assets/winter-background.jpeg') center / cover no-repeat;
  pointer-events: none;
}
.scenery::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(#3411161a, #201d2426);
}
.skip-link { position: fixed; left: 16px; top: -100px; background: var(--paper); padding: 16px; z-index: 10; }
.skip-link:focus { top: 16px; }
main { width: min(100% - 44px, 520px); margin: 0 auto; padding: calc(24px + env(safe-area-inset-top)) 0 calc(48px + env(safe-area-inset-bottom)); }
.reference-panel { position: relative; width: 100%; box-shadow: 0 12px 38px #1c080c35; }
#invitation { margin-bottom: 36px; }
/* This section receives focus after the envelope; Safari otherwise draws a blue outline. */
#invitation:focus { outline: none; }
.reference-panel > img { display: block; width: 100%; height: auto; }
.accessible-copy {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.invitation-tools {
  position: relative;
  container-type: inline-size;
  aspect-ratio: 4 / 3;
  margin: 24px 0 36px;
  text-align: center;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 12px 38px #1c080c35;
}
.countdown-art { display: block; width: 100%; height: 100%; object-fit: cover; }
.countdown-content {
  position: absolute;
  inset: 12% 9%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.countdown-date { font-size: clamp(10px, 3.3cqw, 16px); letter-spacing: .07em; color: #806332; text-transform: uppercase; margin: 0; }
.countdown-content h2 { font-size: clamp(22px, 6.6cqw, 34px); line-height: 1.2; font-weight: 400; text-transform: none; letter-spacing: 0; margin: 0; }
.countdown { width: 100%; }
.countdown-units { display: flex; align-items: center; justify-content: center; gap: 5cqw; }
.countdown-units div { display: flex; flex-direction: column; gap: 5px; min-width: 38px; }
.countdown-units strong { font-weight: 400; font-size: clamp(30px, 9.5cqw, 48px); font-variant-numeric: tabular-nums; line-height: 1; color: var(--wine); }
.countdown-units span { font-size: clamp(9px, 2.6cqw, 13px); letter-spacing: .08em; text-transform: uppercase; color: #806332; }
.countdown-units i { font-size: clamp(18px, 5cqw, 26px); color: var(--gold); font-style: normal; align-self: flex-start; }
.scroll-cue {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 90%;
  min-height: 44px;
  padding: 8px 10px;
  font-size: clamp(11px, 3.2cqw, 16px);
  line-height: 1.3;
  text-decoration: none;
  background: var(--wine);
  color: #f1d5a1;
  border: 1px solid #8e252b;
  border-radius: 3px;
  box-shadow: 0 2px 5px #451b2222;
  transition: background .2s;
}
.scroll-cue:hover { background: #7c2635; }
.scroll-cue span { font-size: 18px; }
.eyebrow { font: 10px/1.7 var(--sans); letter-spacing: .12em; text-transform: uppercase; margin: 0 0 18px; }
.event-section { text-align: center; margin-bottom: 36px; }
.location-hotspot {
  position: absolute;
  left: 27%; top: 87.3%; width: 46%; height: 6%;
  min-height: 44px;
  border-radius: 5px;
  transition: background .2s;
}
.location-hotspot:hover { background: #f2d7921a; }
.location-hotspot:active { background: #f2d79233; }
.location-hotspot:focus-visible { outline: 3px solid #e4c582; outline-offset: 3px; box-shadow: 0 0 0 6px #64172499; }
.paper { position: relative; padding: 44px 30px; margin: 0 0 36px; text-align: center; background: radial-gradient(ellipse at top left, #fffdf2bb, transparent 60%), var(--paper); border: 1px solid #a38a51; box-shadow: 0 12px 38px #1c080c35; }
.paper::before { content: ''; position: absolute; inset: 10px; border: 1px solid #a38a5177; pointer-events: none; }
.paper::after { content: '❦'; position: absolute; bottom: 14px; left: 18px; font-size: 28px; color: var(--gold); pointer-events: none; }
/* Generated parchment frame; retain the existing card dimensions and spacing. */
.promise {
  background: var(--paper) url('assets/wedding-coming-parchment.png') center / 100% 100% no-repeat;
  border-color: transparent;
}
.promise::before, .promise::after { content: none; }
.hands-portrait { margin: 0 0 30px; }
.hands-portrait img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border: 1px solid var(--gold); padding: 4px; }
h2 { font-weight: 400; font-size: 36px; text-transform: uppercase; line-height: 1.1; letter-spacing: -1px; margin: 0 0 24px; }
.promise p { font-size: 16px; line-height: 1.65; margin: 0 0 18px; }
.divider { display: flex; align-items: center; gap: 12px; width: 140px; margin: 24px auto; color: var(--gold); font-size: 12px; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--gold)); }
.divider::after { transform: rotate(180deg); }
.invitation-footer { margin-bottom: 0; }
.egg-card {
  position: relative;
  container-type: inline-size;
  padding: 38px 28px 32px;
  margin-bottom: 36px;
  text-align: center;
  background: var(--paper) url('assets/dragon-date-parchment.png') center / 100% 100% no-repeat;
  box-shadow: 0 12px 38px #1c080c35;
}
.egg-eyebrow { margin: 0 0 14px; color: #806332; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; }
.egg-card h2 { font-size: clamp(25px, 8cqw, 37px); text-transform: none; letter-spacing: -.5px; margin-bottom: 12px; }
.egg-stage { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; align-items: center; min-height: 210px; }
.scratch-egg {
  position: relative; width: 100%; aspect-ratio: 2 / 3; border: 0; padding: 0;
  background: transparent; color: var(--wine); cursor: grab; touch-action: none;
  user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent;
}
.scratch-egg:active { cursor: grabbing; }
.scratch-egg:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; border-radius: 8px; }
.egg-shell {
  position: absolute; inset: 0; pointer-events: none;
  background: url('assets/dragon-eggs.png') no-repeat; background-size: 300% 100%;
  filter: drop-shadow(0 10px 8px #55231820); transition: opacity .65s, transform .65s;
}
.egg-shell-day { background-position: left center; }
.egg-shell-month { background-position: center; }
.egg-shell-year { background-position: right center; }
.egg-part { position: absolute; inset: 0; display: grid; place-items: center; font: clamp(28px, 12cqw, 58px)/1 Georgia, serif; pointer-events: none; }
.egg-part[hidden] { display: none; }
.egg-date-caption { display: block; margin-top: 24px; }
.egg-date-names { display: block; font-size: 16px; font-style: italic; }
.egg-fallback { margin: 12px auto 0; max-width: 280px; font-size: 13px; line-height: 1.6; color: #806332; min-height: 42px; }
.scratch-egg.is-hatched { cursor: default; touch-action: pan-y; }
.scratch-egg.is-hatched .egg-shell { opacity: 0; transform: scale(.8); }
.scratch-egg.is-hatched .egg-part { animation: date-appear .75s ease both; }
@media (prefers-reduced-motion: reduce) {
  .egg-shell { transition: none; }
  .scratch-egg.is-hatched .egg-part { animation: none; }
}
@keyframes date-appear { from { opacity: 0; transform: translateY(12px) scale(.95); } to { opacity: 1; transform: none; } }
.back-hotspot {
  position: absolute;
  left: 16%; top: 80.5%; width: 68%; height: 8%;
  min-height: 44px;
  border-radius: 5px;
  transition: background .2s;
}
.back-hotspot:hover { background: #f2d7921a; }
.back-hotspot:active { background: #f2d79233; }
.back-hotspot:focus-visible { outline: 3px solid #e4c582; outline-offset: 3px; box-shadow: 0 0 0 6px #64172499; }
.reveal { transition: opacity .7s ease, transform .7s cubic-bezier(.2,.7,.3,1); }
.reveal.is-pending { opacity: 0; transform: translateY(24px); }
@media (min-width: 700px) {
  main { padding-top: 40px; }
  .event-section { margin-bottom: 50px; }
  .paper { padding: 56px 54px; }
  .promise p { font-size: 20px; }
  h2 { font-size: 45px; }
}
@media (max-width: 360px) {
  main { width: calc(100% - 28px); }
  .paper { padding-inline: 25px; }
  .eyebrow { font-size: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .reveal.is-pending { opacity: 1; transform: none; }
}

/* Viewport snowfall passes over the scenery and cards without intercepting taps. */
.snowfall {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 8;
  pointer-events: none;
}
.snowfall[hidden], .snow-toggle[hidden], .music-toggle[hidden] { display: none; }
.snow-toggle, .music-toggle {
  position: fixed;
  right: max(14px, env(safe-area-inset-right));
  bottom: max(14px, env(safe-area-inset-bottom));
  z-index: 9;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid #b4996288;
  border-radius: 50%;
  color: #f3ddab;
  background: #451b22e6;
  box-shadow: 0 3px 14px #1c080c33;
  font: 23px Georgia, serif;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.music-toggle { bottom: calc(max(14px, env(safe-area-inset-bottom)) + 54px); }
.snow-toggle:hover, .music-toggle:hover { background: #641724; }
.snow-toggle:focus-visible, .music-toggle:focus-visible { outline: 3px solid #e4c582; outline-offset: 4px; }
.snow-toggle[data-paused="true"], .music-toggle[data-paused="true"] { opacity: .65; }
@media (prefers-reduced-motion: reduce) {
  .snowfall, .snow-toggle { display: none !important; }
}
