@font-face {
  font-family: 'Cormorant Garamond';
  src: url('assets/fonts/cormorant.woff2') format('woff2');
  font-weight: 300 700;
  font-display: swap;
}
@font-face {
  font-family: 'Cormorant Garamond';
  src: url('assets/fonts/cormorant-italic.woff2') format('woff2');
  font-weight: 300 700;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'Golos Text';
  src: url('assets/fonts/golos.woff2') format('woff2');
  font-weight: 400 900;
  font-display: swap;
}
@font-face {
  font-family: 'Marck Script';
  src: url('assets/fonts/marck.woff2') format('woff2');
  font-display: swap;
}

:root {
  color-scheme: dark;
  --night: #101914;
  --cream: #f9eed5;
  --paper: #ecdbc0;
  --ink: #301b1d;
  --muted-ink: #62483c;
  --gold: #ead09a;
  --line: #dbb97952;
  --serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --sans: 'Golos Text', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--night); color: var(--cream); font: 1rem/1.6 var(--sans); }
a { color: inherit; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
:focus-visible { outline: 2px solid #edbd63; outline-offset: 5px; }
h1, h2, p { margin: 0; }
h1, h2 { font-family: var(--serif); font-weight: 700; }
.handwritten { font-family: 'Marck Script', var(--serif); }
#wand-trail { position: fixed; z-index: 6; inset: 0; width: 100%; height: 100%; pointer-events: none; }
@media (pointer: fine) and (prefers-reduced-motion: no-preference) {
  body { --wand-cursor: url('assets/wand-cursor.png?v=2') 56 19; cursor: var(--wand-cursor), default; }
  a, button:not(:disabled), label.option { cursor: var(--wand-cursor), pointer; }
  @supports (cursor: image-set(url('assets/wand-cursor.png') 1x) 0 0, default) {
    body {
      --wand-cursor: image-set(url('assets/wand-cursor.png?v=2') 1x, url('assets/wand-cursor@2x.png') 2x) 56 19,
        url('assets/wand-cursor.png?v=2') 56 19;
    }
  }
}

.site-header {
  position: relative;
  z-index: 2;
  background: radial-gradient(ellipse at 14% -160%, #53442b 0%, #213329 54%, #111e18 85%);
  border-bottom: 1px solid #cda56656;
}
.site-header-inner {
  width: min(100% - 3rem, 76rem);
  min-height: 4.8rem;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}
.brand { display: inline-flex; align-items: center; gap: .78rem; font: 700 1.65rem/1 var(--serif); letter-spacing: .025em; }
.brand-mark { display: block; width: 3.25rem; height: 3.25rem; object-fit: contain; filter: drop-shadow(0 0 .65rem #b37a2938); }
.site-header a { text-decoration: none; }
.site-header nav { display: flex; align-items: center; gap: clamp(1rem, 3vw, 2.6rem); font-size: .9rem; color: #ded0b6; }
.site-header a:hover { color: var(--gold); }
.site-header nav a {
  padding: .6rem 0;
  background: linear-gradient(90deg, #b3864d, #edcd94) left bottom / 0 1px no-repeat;
  transition: color .2s, background-size .25s;
}
.site-header nav a:is(:hover, :focus-visible) { background-size: 100% 1px; }

.test-scene {
  position: relative;
  overflow: clip;
  background:
    linear-gradient(180deg, #1116106b, #17191430 46%, var(--night)),
    url('assets/great-hall.webp') center 41% / cover no-repeat;
}
.hero {
  --opening-height: calc(100svh - 4.8rem);
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  overflow: hidden;
  padding: clamp(1.55rem, 4.4vw, 4.3rem) 1.5rem;
  background: radial-gradient(ellipse at 77% 36%, #46321f, #181a14 64%, var(--night));
}
.hero:has(.envelope-opening:not([hidden])) {
  min-height: var(--opening-height);
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: var(--opening-height);
  z-index: -1;
  background:
    radial-gradient(ellipse at center, #34261b2b 12%, #101914ca 75%),
    url('assets/great-hall.webp') center / cover no-repeat;
  transition: opacity .65s ease;
}
.hero:has(.invitation-card:not([hidden]))::before { opacity: 0; }
.envelope-opening {
  position: absolute;
  z-index: 2;
  inset: 0 0 auto;
  height: var(--opening-height);
  padding: inherit;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
}
.envelope-opening.unsealed { pointer-events: none; }
.envelope-prop { position: relative; isolation: isolate; width: min(100%, 46rem); margin: 2rem auto; }
.unseal { display: grid; width: 100%; padding: 0; border: 0; background: none; color: var(--gold); }
.envelope-face { position: relative; display: block; transition: transform .35s ease; filter: drop-shadow(0 1.45rem 1.75rem #090604bd); }
.unseal:not(:disabled):is(:hover, :focus-visible) .envelope-face { transform: translateY(-.45rem) rotate(-1deg); }
.envelope-face img { display: block; width: 100%; height: auto; clip-path: inset(.35% 1.2% 4% 2.6% round .48rem); }
.envelope-address {
  position: absolute;
  top: 14%;
  left: 17%;
  width: 66%;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  color: #482323;
  font: clamp(1.38rem, 5.3vw, 3.75rem)/.98 'Marck Script', var(--serif);
  text-shadow: 0 1px #fff1cb90;
  overflow-wrap: anywhere;
}
.unseal-caption { margin: 1.05rem auto 0; padding: .62rem 1.52rem; border-block: 1px solid #c79d667d; font-weight: 650; }
.unseal:hover .unseal-caption, .unseal:focus-visible .unseal-caption { color: #fff2c8; }
.seal-glow {
  position: absolute;
  top: 50.5%;
  left: 50.3%;
  width: 21%;
  aspect-ratio: 1;
  translate: -50% -50%;
  border-radius: 50%;
  box-shadow: 0 0 2.3rem #ffbf5f1f;
  transition: box-shadow .25s;
}
.unseal:not(:disabled):is(:hover, :focus-visible) .seal-glow { box-shadow: 0 0 2.2rem .25rem #ffbf5f83; }
.unsealed .seal-glow { animation: crack-flare .8s ease-out both; }
.unsealed .seal-glow::before {
  content: '';
  position: absolute;
  inset: 8% 24%;
  background: #fff0bb;
  clip-path: polygon(49% 0, 57% 0, 40% 35%, 72% 48%, 48% 69%, 60% 100%, 53% 100%, 38% 69%, 61% 49%, 31% 35%);
}
.unsealed .seal-glow::after {
  content: '';
  position: absolute;
  inset: -110%;
  background: radial-gradient(circle at 23% 30%, #ffe6a8 0 2px, transparent 4px), radial-gradient(circle at 82% 23%, #ffc878 0 2px, transparent 5px), radial-gradient(circle at 91% 59%, #ffcf70 0 2px, transparent 4px), radial-gradient(circle at 75% 75%, #fff3ce 0 1.5px, transparent 4px), radial-gradient(circle at 13% 63%, #ffbc60 0 2px, transparent 4px), radial-gradient(circle at 34% 85%, #ffe6a4 0 2px, transparent 4px), radial-gradient(circle at 54% 6%, #ffdb9b 0 1.8px, transparent 4px);
  animation: stamp-sparks .85s ease-out both;
}
.opening-paper {
  position: absolute;
  z-index: -1;
  inset: 6% 11% 31%;
  border: 1px solid #f1d8a4;
  background: radial-gradient(ellipse, #fff4d4, #dbc192);
  box-shadow: inset 0 0 0 .55rem #ceb88d91, 0 .5rem 2.5rem #0a0b08b8;
  transform-origin: center bottom;
  opacity: 0;
}
.unsealed .opening-paper { animation: open-paper 1.25s .07s ease both; }
.unsealed .envelope-face, .unsealed .unseal-caption { animation: yield-envelope 1.05s ease-in-out both; }
@keyframes crack-flare { 0% { opacity: .3; } 32% { opacity: 1; box-shadow: 0 0 3rem .5rem #ffc36678; } 100% { opacity: 0; } }
@keyframes stamp-sparks { 0% { opacity: .9; scale: .15; } 100% { opacity: 0; scale: 1.35; rotate: 14deg; } }
@keyframes open-paper {
  0% { opacity: 0; transform: translateY(0) scaleY(.24); }
  35% { opacity: 1; }
  55% { opacity: .9; }
  100% { opacity: 0; transform: translateY(-35%) scaleY(1.26); }
}
@keyframes yield-envelope { 0%, 38% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(14%) rotate(3deg); } }
.atmosphere { position: absolute; z-index: 1; inset: 0; overflow: hidden; pointer-events: none; }
.atmosphere::before, .atmosphere::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 51% 11%, #fff0bfbb 0 .95px, transparent 2.8px),
    radial-gradient(circle at 47% 26%, #e2ac60b0 0 1.1px, transparent 3px),
    radial-gradient(circle at 54% 40%, #ffcf8caa 0 1.3px, transparent 3.25px),
    radial-gradient(circle at 21% 7%, #e3ae7099 0 .9px, transparent 2.6px),
    radial-gradient(circle at 14% 86%, #e5ba7680 0 .9px, transparent 2.4px),
    radial-gradient(circle at 88% 34%, #f6d69bbf 0 1.2px, transparent 3px),
    radial-gradient(circle at 92% 67%, #e1ac6d9e 0 1.2px, transparent 3.2px),
    radial-gradient(circle at 82% 73%, #ebaa59aa 0 1px, transparent 3px),
    radial-gradient(circle at 72% 85%, #edc68bb0 0 1px, transparent 2.55px);
  animation: lift-motes 4.5s ease-out both;
}
.atmosphere::after { inset: 12% -11% -12% 11%; opacity: .62; scale: 1.08; animation-duration: 4.75s; }
.floating-candle {
  position: absolute;
  left: var(--left, 49%);
  top: var(--top, 7%);
  width: var(--width, 1.85rem);
  aspect-ratio: 1 / 3.8;
  background: url('assets/floating-candle.webp') center top / auto 90% no-repeat;
  filter: drop-shadow(0 0 .65rem #e1904073);
  opacity: var(--opacity, .85);
  animation: float-candle 4.4s var(--delay, 0s) ease-out both;
}
.floating-candle::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 5%;
  width: 380%;
  aspect-ratio: 1;
  translate: -50% -50%;
  background: radial-gradient(circle, #fbb7653f, #a7471513 43%, transparent 68%);
  animation: flame-light 1.45s ease-in-out 3;
}
.floating-candle:nth-child(2) { --left: 94%; --top: 24%; --width: 1.5rem; --opacity: .67; --delay: .13s; }
.floating-candle:nth-child(3) { --left: 65%; --top: 1%; --width: 1.15rem; --opacity: .48; --delay: .27s; }
.test-scene .floating-candle { --left: 9%; --top: 12%; }
.test-scene .floating-candle:nth-child(2) { --left: 87%; --top: 22%; }
.test-scene .floating-candle:nth-child(3) { --left: 15%; --top: 60%; }
.test-scene:has(.ritual:not(.in-quiz):not([hidden])) .atmosphere { display: none; }
@keyframes float-candle {
  0% { opacity: 0; transform: translateY(1.2rem) rotate(-4deg); }
  35% { opacity: var(--opacity, .85); }
  75% { transform: translateY(-.14rem) rotate(1.8deg); }
  100% { transform: translateY(0) rotate(0); }
}
@keyframes flame-light { 0%, 100% { opacity: .5; scale: .82; } 48% { opacity: 1; scale: 1.14; } }
@keyframes lift-motes { from { opacity: .24; transform: translateY(.9rem); } to { opacity: .72; transform: translateY(0); } }
.invitation-card {
  position: relative;
  isolation: isolate;
  width: 100%;
  max-width: 79rem;
  min-height: clamp(34rem, calc(100svh - 9.2rem), 50rem);
  margin: auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  align-items: center;
  animation: scene-arrival .65s ease-out both;
}
.letter, .scroll {
  color-scheme: light;
  color: var(--ink);
  background:
    repeating-linear-gradient(16deg, #765d4307 0 1px, transparent 1px 5px),
    radial-gradient(ellipse at 36% 31%, #fcf2db 0%, #f1dfbc 64%, #d5b17d 100%);
}
.letter {
  isolation: isolate;
  position: relative;
  z-index: 1;
  display: grid;
  align-items: center;
  border: 1px solid #e6c886;
  box-shadow: .4rem 1.45rem 5rem #0c0907a8, inset 0 0 2rem #b4824140;
  padding: clamp(2.4rem, 3.4vw, 3rem) clamp(2.4rem, 5vw, 4.5rem);
  animation: scene-arrival .7s cubic-bezier(.2,.7,.3,1) both;
}
.letter::before, .scroll::before {
  content: '';
  position: absolute;
  inset: .9rem;
  border: 1px solid #96704482;
  outline: 1px solid #a9865d42;
  outline-offset: 4px;
  pointer-events: none;
}
.letter::after, .scroll::after, .ritual.in-quiz::before {
  --corner: #936946;
  --rule: linear-gradient(var(--corner) 0 0);
  content: '';
  position: absolute;
  inset: .88rem;
  pointer-events: none;
  background:
    var(--rule) top left / 1.35rem 2px no-repeat,
    var(--rule) top left / 2px 1.35rem no-repeat,
    var(--rule) top right / 1.35rem 2px no-repeat,
    var(--rule) top right / 2px 1.35rem no-repeat,
    var(--rule) bottom left / 1.35rem 2px no-repeat,
    var(--rule) bottom left / 2px 1.35rem no-repeat,
    var(--rule) bottom right / 1.35rem 2px no-repeat,
    var(--rule) bottom right / 2px 1.35rem no-repeat;
}
.letter :focus-visible, .scroll :focus-visible { outline-color: #6a333a; }
.letter-content { z-index: 1; }
.eyebrow { color: #754838; font-size: .875rem; font-weight: 700; letter-spacing: .105em; line-height: 1.35; text-transform: uppercase; }
.letter h1 { margin: .85rem 0; font-size: clamp(3rem, 6.1vw, 6.26rem); line-height: .88; letter-spacing: -.045em; }
.letter-rule { display: flex; align-items: center; gap: .45rem; margin: 1rem 0 .8rem; width: 7.5rem; color: #956e38; font: 1.15rem var(--serif); }
.letter-rule img, .button-star { display: block; flex: none; object-fit: contain; }
.letter-rule::before, .letter-rule::after { content: ''; height: 1px; flex: 1; background: #aa8558; }
.letter-rule::before { flex: .3; }
.letter-intro { max-width: 30rem; color: #372b20; }
.letter-greeting { margin-bottom: .22rem; font-size: clamp(1.6rem, 3vw, 2.35rem); line-height: 1.08; overflow-wrap: anywhere; }
.letter-content > :is(.letter-greeting, .letter-intro, .event-details, .event-dress, .signature) { animation: ink-arrives .53s ease-out both; }
.letter-content > .letter-greeting { animation-delay: .16s; }
.letter-content > .letter-intro { animation-delay: .27s; }
.letter-content > .event-details { animation-delay: .38s; }
.letter-content > .event-dress { animation-delay: .49s; }
.letter-content > .signature { animation-delay: .58s; }
@keyframes ink-arrives { from { opacity: .18; clip-path: inset(0 0 100% 0); } to { opacity: 1; clip-path: inset(0); } }
.event-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .6rem;
  margin: 1.15rem 0 .95rem;
  padding: .75rem 0;
  border-block: 1px solid #a17d5266;
}
.event-details dt { color: var(--muted-ink); font-size: .875rem; }
.event-details dd { margin: .13rem 0 0; font-size: .9rem; font-weight: 650; overflow-wrap: anywhere; }
.event-details > :last-child { grid-column: 1 / -1; }
.event-dress { margin-bottom: .4rem; color: var(--muted-ink); font-size: .91rem; }
.event-dress strong { margin-right: .28rem; color: var(--ink); }
.event-actions { display: flex; flex-wrap: wrap; gap: .2rem .85rem; margin-bottom: .95rem; color: #632c38; font-size: .875rem; font-weight: 650; }
.event-actions a { text-underline-offset: .23em; text-decoration-color: #ac755e; }
.event-actions a:hover { text-decoration-color: currentColor; }
.signature { margin-top: .55rem; color: #714331; font-size: 1.42rem; line-height: 1.1; }
.event-demo { color: #77584b; margin-top: .6rem; font-size: .81rem; }
.letter-note { max-width: 29rem; margin-top: .95rem; font: italic 600 1.23rem/1.25 var(--serif); color: var(--muted-ink); }
.envelope-stage {
  position: absolute;
  overflow: hidden;
  inset: -4.5rem -1.5rem -4.5rem 35%;
  background: #221a14 url('assets/sealed-letter.webp') center / cover no-repeat;
}
.envelope-stage video { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 61% 54%; }
.envelope-stage::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, #181a14, #181a1452 28%, transparent 49%),
    linear-gradient(0deg, var(--night), transparent 21%), linear-gradient(270deg, #181a14, transparent 15%);
}

.button {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: .6rem;
  min-height: 3.15rem;
  padding: .73rem 1.35rem;
  border: 1px solid transparent;
  border-radius: .52rem .14rem;
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
  text-decoration: none;
  transition: background-color .2s, border-color .2s, box-shadow .24s, transform .2s;
}
.button-gold {
  --face: linear-gradient(155deg, #f3dba6, #c89c57);
  background: var(--face);
  color: #2a1c15;
  border-color: #c69557;
  box-shadow: inset 0 0 0 2px #54361970, inset 0 0 0 3px #fff1c476, 0 .2rem .55rem #09090756;
}
.letter .button-gold {
  --face: linear-gradient(155deg, #713541, #411b29);
  color: #fff1d7;
  border-color: #85504f;
  box-shadow: inset 0 0 0 2px #3b14268a, inset 0 0 0 3px #d49d6480, 0 .24rem .55rem #603b3950;
}
.button-gold::after {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(108deg, transparent 35%, #ffedb856 49%, transparent 64%) 130% / 260% 100% no-repeat;
  opacity: 0;
}
.button-gold:not(:disabled):is(:hover, :focus-visible) { border-color: #edce99; transform: translateY(-2px); }
.button-gold:not(:disabled):is(:hover, :focus-visible)::after { animation: engrave-glint .65s ease-out; }
.button-gold:not(:disabled):active { transform: translateY(1px); }
@keyframes engrave-glint {
  0% { opacity: 0; background-position: 130% 50%; }
  35% { opacity: .76; }
  100% { opacity: 0; background-position: -40% 50%; }
}
.button-star { transition: transform .35s, filter .35s; }
.letter .button-gold:hover .button-star, .letter .button-gold:focus-visible .button-star {
  transform: rotate(22deg) scale(1.12);
  filter: drop-shadow(0 0 .38rem #f9c564);
}
.button-gold:disabled { opacity: .49; }
.button-quiet { background: none; color: #e9d8b4; border-color: #b48c4e46; }
.button-quiet:hover { background: #e7c89115; border-color: #b48c4eaa; }
.button-outline { background: #20352b; color: var(--cream); border-color: #a58150; }
.button-outline:hover { background: #324639; border-color: #dfbe81; }

.program { width: min(100% - 3rem, 72.5rem); margin: 0 auto; padding: clamp(2.15rem, 5.8vw, 5rem) 0 clamp(3rem, 7vw, 6rem); }
.program h2 { font-size: clamp(2.1rem, 4vw, 3.5rem); line-height: 1.1; margin-bottom: 1.8rem; }
.program h2::after { content: ''; display: block; width: 6.8rem; height: 1px; margin-top: .75rem; background: linear-gradient(90deg, #d6ac66, transparent); }
.program-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(.55rem, 1.3vw, 1.1rem);
}
.program-list li {
  position: relative;
  padding: 1.4rem clamp(.95rem, 2vw, 1.5rem) 1.6rem;
  border: 1px solid var(--line);
  border-top-color: #bd986b90;
  border-radius: .7rem .17rem;
  background: radial-gradient(ellipse at 18% 0, var(--card-light, #51312d), transparent 64%),
    linear-gradient(145deg, #24352b, #17221c 76%);
  box-shadow: inset 0 0 0 3px #11181070, 0 .45rem 1.2rem #080d0966;
  transition: border-color .28s, box-shadow .28s;
}
.program-list li:nth-child(2) { --card-light: #5d452e; }
.program-list li:nth-child(3) { --card-light: #50492f; }
.program-list li:nth-child(4) { --card-light: #494037; }
.program-list li:hover { border-color: #d5b17fbd; box-shadow: inset 0 0 0 3px #11181070, 0 0 1.2rem #d2944e22; }
.program-icon {
  display: block;
  width: 5.25rem;
  height: 5.25rem;
  margin: 0 0 .7rem -.45rem;
  object-fit: contain;
  filter: drop-shadow(0 .5rem .55rem #100b07a0);
  transition: transform .3s, filter .3s;
}
.program-list li:hover .program-icon { transform: translateY(-.2rem); filter: drop-shadow(0 0 .55rem #d3814255); }
.program-list strong { font: 700 1.74rem/.95 var(--serif); }
.program-list p { font-size: .94rem; color: #e1d8c5; margin-top: .55rem; }

.test-scene { min-height: calc(100svh - 4.8rem); padding: clamp(1.75rem, 5vw, 4.5rem) 1.5rem 3rem; }
.test-scene:has(.ritual:not(.in-quiz):not([hidden])) { padding: 0; background: #100e0b; }
.ritual {
  position: relative;
  z-index: 1;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr);
  min-height: max(34rem, calc(100svh - 4.8rem));
  align-items: center;
  overflow: clip;
}
.ceremony-film, .ceremony-film::after, .ceremony-film video { position: absolute; inset: 0; }
.ceremony-film { z-index: -1; overflow: hidden; background: #17120f; }
.ceremony-film video { width: 100%; height: 100%; object-fit: cover; object-position: 40% center; }
.ceremony-film::after {
  content: '';
  background: linear-gradient(90deg, transparent 36%, #160f0a55 51%, #110e0bef 83%),
    linear-gradient(0deg, #100e0be0, transparent 30%);
}
.hat-caption {
  position: absolute;
  z-index: 1;
  inset-inline: clamp(1rem, 4vw, 4rem) 47%;
  bottom: clamp(1.25rem, 6vh, 3.6rem);
  color: #ffebbf;
  text-align: center;
  text-shadow: 0 .1rem .45rem #110b06, 0 0 1rem #110b06;
  font: italic 700 clamp(1.55rem, 3.3vw, 2.75rem)/1.08 var(--serif);
  text-wrap: balance;
  animation: scene-arrival .45s .35s ease-out both;
}
.ritual-content { grid-column: 2; min-width: 0; padding: clamp(1.7rem, 4vw, 4rem); padding-left: clamp(1rem, 2.5vw, 3rem); }
.ritual-content .eyebrow { color: var(--gold); }
.ritual-content h1 {
  margin: .7rem 0 1.15rem;
  font-size: clamp(2.2rem, 4.8vw, 5.15rem);
  line-height: .94;
  letter-spacing: -.035em;
  text-wrap: balance;
}
#test-intro { animation: scene-arrival .7s ease-out both; }
.ceremony-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .6rem; }
.test-length { color: #d1c0a3; margin-top: .65rem; font-size: .875rem; }
.ritual.in-quiz {
  display: block;
  max-width: 53rem;
  min-height: 0;
  margin: auto;
  background: radial-gradient(ellipse at 46% -33%, #4a4130, transparent 72%), linear-gradient(142deg, #1d3127, #111d18);
  border: 1px solid #a47f48;
  outline: 1px solid #a47f4849;
  outline-offset: 6px;
  box-shadow: 0 2rem 6rem #0a0b08a6;
}
.ritual.in-quiz::before { --corner: #c6a36bc0; inset: .58rem; }
.in-quiz .ceremony-film { display: none; }
.in-quiz .ritual-content { padding: clamp(1.5rem, 4vw, 3rem); }

.question-progress { display: grid; gap: .65rem; }
progress { appearance: none; overflow: hidden; display: block; width: 100%; height: .36rem; border: 0; border-radius: 1rem; background: #a48a5a40; color: #e4be76; accent-color: #e4be76; }
progress::-webkit-progress-bar { background: #a48a5a40; }
progress::-webkit-progress-value { background: linear-gradient(90deg, #a77641, #f4d497); border-radius: 1rem; transition: width .3s ease; }
progress::-moz-progress-bar { background: linear-gradient(90deg, #a77641, #f4d497); border-radius: 1rem; }
#question-title { margin: 1.35rem 0 1.55rem; font-size: clamp(2.15rem, 4.7vw, 3.65rem); line-height: .96; letter-spacing: -.028em; text-wrap: initial; }
#options { padding: 0; border: 0; margin: 0; min-width: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; }
.option {
  position: relative;
  display: flex;
  align-items: center;
  gap: .8rem;
  min-height: 4.65rem;
  padding: .85rem .95rem;
  border: 1px solid #b7986e80;
  border-radius: .5rem .12rem;
  background: linear-gradient(155deg, #f0d3a212, #e8c18703);
  cursor: pointer;
  line-height: 1.38;
  transition: background-color .25s, border-color .25s, box-shadow .25s;
  animation: scene-arrival .26s ease-out both;
}
.option input { appearance: none; flex: 0 0 1.08rem; width: 1.08rem; height: 1.08rem; margin: 0; border: 1px solid #d3b783; border-radius: 50%; }
.option input:checked { background: radial-gradient(circle, #f5dda0 0 36%, transparent 39%); box-shadow: 0 0 .4rem #ebc47766; }
.option:hover { border-color: #d9b986; background-color: #dcbc8111; }
.option:nth-child(2) { animation-delay: .025s; }
.option:nth-child(3) { animation-delay: .05s; }
.option:nth-child(4) { animation-delay: .075s; }
.option:has(input:checked) { border-color: #e7c68a; background-color: #dcbc8126; box-shadow: inset .18rem 0 #f2d492, 0 0 .8rem #c69d5438; }
.option:has(input:checked)::after { content: ''; position: absolute; inset: 0; border: 1px solid #f2d492; border-radius: inherit; pointer-events: none; animation: selection-halo .45s ease-out both; }
@keyframes selection-halo { from { opacity: .8; } to { opacity: 0; transform: scale(1.025); } }
@media (forced-colors: active) { .option input { appearance: auto; } }
.option:focus-within { outline: 1px solid var(--gold); outline-offset: 2px; }
.question-actions { display: flex; justify-content: space-between; gap: .65rem; margin-top: 1.35rem; }

.test-scene:has(.house-ceremony:not([hidden])) { padding: 0; background: #111914; }
.house-ceremony { position: relative; min-height: calc(100svh - 4.8rem); display: grid; place-items: end center; isolation: isolate; }
.house-ceremony video { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; object-position: 22% center; }
.house-ceremony::before { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(0deg, #0d160fe8, transparent 57%); }
.suspense-line { max-width: calc(100% - 2rem); margin-bottom: 12vh; text-align: center; color: #ffebbf; font: italic 700 clamp(1.8rem, 5vw, 3.1rem)/1.05 var(--serif); }
.suspense-line::first-letter { color: #ffdc9d; }
.suspense-line { animation: spell-text 2.3s .25s steps(27) both; }
@keyframes spell-text { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0); } }
.house-flash {
  position: fixed;
  z-index: 5;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1rem;
  pointer-events: none;
  isolation: isolate;
  background: radial-gradient(ellipse, color-mix(in srgb, var(--house) 65%, #d6a654), color-mix(in srgb, var(--house) 53%, #101b16) 61%, #0d1714 96%);
  color: #fff1c5;
  text-shadow: 0 .4rem 2rem #111b13c0;
  font: 700 clamp(3.25rem, 12vw, 9rem)/1 var(--serif);
  animation: proclaim .98s ease-out both;
}
.house-flash::before, .house-flash::after {
  content: '';
  position: absolute;
  z-index: -1;
  inset: 13%;
  background: radial-gradient(circle at 21% 25%, #ffedb6 0 2px, transparent 4px), radial-gradient(circle at 28% 74%, #ffdb95 0 3px, transparent 6px), radial-gradient(circle at 63% 17%, #fff0c3 0 2px, transparent 4px), radial-gradient(circle at 81% 72%, #fff1ba 0 2px, transparent 5px), radial-gradient(circle at 91% 38%, #ffdd82 0 3px, transparent 5px), radial-gradient(circle at 43% 85%, #fff1ba 0 2px, transparent 5px);
  animation: stamp-sparks .95s ease-out both;
}
.house-flash::after { rotate: 96deg; }
@keyframes proclaim { 0% { opacity: 0; scale: .93; } 27%, 77% { opacity: 1; scale: 1; } 100% { opacity: .86; } }

.reveal { --house: #843a36; isolation: isolate; position: relative; z-index: 1; max-width: 39rem; margin: auto; text-align: center; }
.reveal::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: -3rem -4rem 0;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 41%, color-mix(in srgb, var(--house) 72%, #e8b05e), transparent 66%);
  filter: blur(1.8rem);
  animation: house-light 1.45s ease-out both;
}
.result-film {
  position: relative;
  margin: -1rem auto .65rem;
  max-width: 38rem;
  outline: 1px solid #9c794a80;
  box-shadow: 0 .75rem 3rem color-mix(in srgb, var(--house) 35%, transparent);
  background: #1f1912;
}
.result-film video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; }
.scroll {
  position: relative;
  padding: 1.7rem 2.25rem 2.15rem;
  border: 2px solid var(--house);
  box-shadow: 0 1.5rem 4rem #0b0b098c, inset 0 0 2.3rem #8c572933;
  transform-origin: center top;
  animation: reveal-scroll .98s cubic-bezier(.2,.78,.24,1) both;
}
.crest { width: 6rem; height: 6rem; margin: 0 auto .3rem; background: url('assets/house-crests.webp') var(--tile) / 200% 200% no-repeat; animation: crest-arrival .65s .23s ease-out both; }
.scroll h1 { margin: .2rem 0; color: var(--house); font-size: clamp(2.95rem, 7vw, 4.8rem); line-height: .94; letter-spacing: -.03em; }
.result-recipient { margin: .55rem auto .15rem; max-width: 26rem; color: #6f483b; font-size: 1.57rem; overflow-wrap: anywhere; }
.result-traits { color: var(--muted-ink); font: italic 600 1.44rem/1.25 var(--serif); }
.result-description { max-width: 27rem; margin: .9rem auto 0; }
.result-actions { margin-top: 1.3rem; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: .6rem; }
.result-status { color: #eed3a7; font-size: .875rem; }
.result-status:not(:empty) { margin-top: .65rem; }
.card-preview { width: min(100%, 25rem); margin: 1.35rem auto 0; scroll-margin-top: 1rem; }
.card-preview figcaption { margin-bottom: .55rem; color: #eed3a7; font-size: .875rem; }
.card-preview img { display: block; width: 100%; height: auto; margin: auto; border: 1px solid #ac845b; }

.spell {
  position: fixed;
  z-index: 5;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #050505;
  animation: enter-spell .2s ease-out both;
}
.spell video { display: block; width: min(100vw, 100svh); height: auto; }
@keyframes enter-spell { from { opacity: 0; } to { opacity: 1; } }
@keyframes scene-arrival { from { opacity: 0; transform: translateY(.45rem); } to { opacity: 1; transform: translateY(0); } }
@keyframes crest-arrival { from { opacity: .35; transform: scale(.82); } to { opacity: 1; transform: scale(1); } }
@keyframes house-light { 0% { opacity: 0; transform: scale(.75); } 43% { opacity: .74; } 100% { opacity: .38; transform: scale(1); } }

@keyframes reveal-scroll { from { opacity: 0; transform: translateY(-1rem) scaleY(.78); } to { opacity: 1; transform: translateY(0) scaleY(1); } }

@media (max-width: 52rem) {
  .invitation-card { grid-template-columns: minmax(0, 1.13fr) minmax(0, .87fr); min-height: 0; }
  .letter { padding: 2.65rem 2.2rem; }
  .letter h1 { font-size: clamp(3rem, 6.8vw, 5rem); }
  .program-list { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 46rem) {
  .ritual { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .ceremony-film { position: relative; aspect-ratio: 1.2; }
  .ceremony-film video { object-position: 4% 56%; }
  .ceremony-film::after { background: linear-gradient(0deg, #100e0b, transparent 33%); }
  .hat-caption { inset-inline: 1rem; bottom: 1rem; }
  .ritual-content { grid-column: 1; max-width: 36rem; padding: .35rem 1.3rem 2.25rem; }
  .ritual-content h1 { text-wrap: initial; font-size: clamp(2.05rem, 7.75vw, 3.65rem); }
}

@media (max-width: 39rem) {
  .hero .floating-candle { --left: 6%; --top: 2%; --width: 1.15rem; --opacity: .63; }
  .hero .floating-candle:nth-child(n + 2), .test-scene .floating-candle { display: none; }
  .site-header-inner { width: calc(100% - 1.5rem); min-height: 4.1rem; gap: .45rem; }
  .site-header nav { gap: .65rem; font-size: .84rem; }
  .site-header nav a:first-child { display: none; }
  .brand { gap: .35rem; font-size: 1.38rem; }
  .brand-mark { width: 2.55rem; height: 2.55rem; }
  .hero, .test-scene { padding-inline: 1rem; }
  .hero { --opening-height: calc(100svh - 4.1rem); padding-top: 1rem; }
  .house-ceremony { min-height: calc(100svh - 4.1rem); }
  .house-ceremony video { object-position: 13% center; }
  .invitation-card { display: flex; flex-direction: column-reverse; align-items: stretch; }
  .envelope-stage { position: relative; inset: auto; margin: -1rem -1rem 0; aspect-ratio: 1.55; }
  .envelope-stage video { object-position: center 60%; }
  .envelope-stage::after { background: linear-gradient(0deg, var(--night), transparent 37%); }
  .letter { margin-top: -.9rem; padding: 2.1rem 1.65rem 2.4rem; }
  .letter::before, .scroll::before { inset: .65rem; outline-offset: 3px; }
  .letter::after, .scroll::after { inset: .65rem; }
  .letter h1 { font-size: clamp(2.8rem, 10.75vw, 4.25rem); }
  .event-details { gap: .45rem; }
  .event-details dd { font-size: .875rem; }
  .letter .button { width: 100%; }
  .program { width: calc(100% - 2rem); }
  .program-list li { padding: 1rem; }
  .test-scene { min-height: calc(100svh - 4.1rem); }
  #options { grid-template-columns: 1fr; }
  .option { min-height: 3.2rem; padding: .68rem .75rem; }
  .scroll { padding-inline: 1.6rem; }
  .reveal::before { inset-inline: -.8rem; }
  .result-film { margin-top: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-delay: 0s !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
