:root { color-scheme: dark; --background: #111615; --gold: #f6d596; --muted: #c6c7b8; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--background); color: #fff3df; font-family: system-ui, sans-serif; }
.journey { height: 440vh; height: 440svh; }
.stage {
  position: sticky; top: 0; height: 100vh; height: 100svh;
  display: grid; grid-template-columns: minmax(12rem, .68fr) minmax(0, 1.55fr);
  grid-template-rows: minmax(0, 1fr) auto; align-items: center; gap: 1.2rem 3.5vw;
  max-width: 92rem; margin: 0 auto; padding: clamp(1.2rem, 5vw, 5rem);
}
.letter { align-self: center; }
.ornament { display: block; color: var(--gold); font-size: 1.7rem; margin-bottom: 1.4rem; }
h1 { font: 400 clamp(2.9rem, 6vw, 6.4rem)/.93 Georgia, serif; letter-spacing: -.065em; margin: 0; }
h1 em { color: var(--gold); font-weight: inherit; }
p { font-size: 1rem; line-height: 1.6; max-width: 19rem; color: var(--muted); margin: 1.45rem 0 0; }
.film {
  position: relative; margin: 0; place-self: center; width: 100%;
  max-width: min(100%, calc((100svh - 9rem) * 1.4)); aspect-ratio: 1.4;
  border: 1px solid #8b7754; border-radius: 1.05rem; overflow: hidden;
  background: #171a1e; box-shadow: 0 1.5rem 5rem #0007;
}
canvas { display: block; width: 100%; height: 100%; object-fit: contain; }
figcaption { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
label { color: var(--muted); font-size: .875rem; white-space: nowrap; }
input { width: 100%; accent-color: var(--gold); cursor: pointer; min-height: 2rem; }
input:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }
@media (max-width: 680px) {
  .stage { display: flex; flex-direction: column; justify-content: center; padding: 1rem; gap: 1rem; }
  .letter { width: min(100%, 36rem); text-align: center; }
  .ornament { display: none; }
  h1 { font-size: clamp(2rem, 10vw, 3.6rem); }
  h1 br { display: none; }
  h1 em { margin-left: .09em; }
  p { margin: .55rem auto 0; line-height: 1.35; }
  .film { flex: 0 1 auto; max-width: min(100%, calc((100svh - 13rem) * 1.4)); }
}
@media (prefers-reduced-motion: reduce) {
  .journey { height: auto; }
  .stage { position: relative; min-height: 100svh; }
}

.film { aspect-ratio: 1.36; background:#161c23; }
canvas { touch-action:none; cursor:grab; }
canvas:active { cursor:grabbing; }
button { min-width: 2.5rem; min-height: 2.5rem; border:1px solid #71654e; background:#202520; color:#f6d596; border-radius:.4rem; padding: .35rem .72rem; cursor:pointer; }
button:hover { background:#33362a; }
button:focus-visible { outline:2px solid #f6d596; outline-offset:3px; }
.status { position:absolute; inset:45% 1rem auto; margin:0 auto; text-align:center; }
@media(max-width:680px) {
  .film { width:100%; aspect-ratio:1.15; max-width: min(100%, calc((100svh - 16rem) * 1.15)); }
}

.stage { display:block; padding:0; max-width:none; overflow:hidden; isolation:isolate; }
.film { position:absolute; inset:0; width:100%; height:100%; max-width:none; aspect-ratio:auto; border:0; border-radius:0; box-shadow:none; z-index:-1; }
.letter { position:absolute; top:clamp(2rem,8vh,6rem); left:clamp(1.3rem,6vw,6rem); margin:0; text-shadow:0 2px 20px #000d; pointer-events:none; }
h1 { font-size:clamp(2.6rem,5.8vw,5.7rem); }
@media(max-width:680px) {
  .letter { top:1.8rem; left:1rem; right:1rem; width:auto; text-align:left; }
  h1 { font-size: clamp(1.95rem,9vw,3.5rem); }
  p { margin:.4rem 0 0; max-width:16rem; }
}

[hidden] {display:none!important}
.journey {height:520vh;height:520svh}
#fireworks {position:absolute;inset:0;pointer-events:none;z-index:1}
.letter {z-index:2}
.finale {
  position:absolute; z-index:3; left:50%; bottom:clamp(3.7rem,10vh,7.4rem);
  width:min(35rem,calc(100% - 2rem)); text-align:center;
  transform:translate(-50%, calc(100% + 10rem)); opacity:0; visibility:hidden;
  transition:transform .74s cubic-bezier(.16,1,.3,1), opacity .32s ease, visibility 0s linear .74s;
}
.finale.is-visible {
  transform:translate(-50%,0); opacity:1; visibility:visible;
  transition:transform .74s cubic-bezier(.16,1,.3,1), opacity .35s ease;
}
.candy {
  padding:.4rem; background:repeating-linear-gradient(135deg,#ad2834 0 10px,#fff1da 10px 20px);
  border-radius:1rem; border:1px solid #fff0ca; box-shadow:0 .8rem 3rem #0009;
}
.paper {
  position:relative; max-height:52svh; overflow:auto;
  padding:clamp(1.05rem,3.4vw,1.9rem) clamp(1.85rem,5.5vw,3.5rem);
  border-radius:.61rem; background:#fff3dc; color:#35271e;
}
.paper h2 {font:400 clamp(1.65rem,5.5vw,2.85rem)/1.05 Georgia,serif;color:#812733;margin:0 0 .65rem;overflow-wrap:anywhere}
.paper p {font-size:clamp(.9rem,2.6vw,1rem);margin:0 0 .65rem;line-height:1.4;max-width:initial;color:#492f28}
.paper p:last-child {margin-bottom:0}
.gingerbread {position:absolute;width:2.1rem;height:2.4rem;pointer-events:none;filter:drop-shadow(0 2px 1px #79371b45)}
.top-left {top:.45rem;left:.4rem;transform:rotate(-18deg)}
.top-right {top:.45rem;right:.4rem;transform:rotate(18deg)}
.bottom-left {bottom:.3rem;left:.5rem;transform:rotate(-17deg) scale(.76)}
.bottom-right {bottom:.3rem;right:.5rem;transform:rotate(17deg) scale(.76)}
.cookie-head {position:absolute;top:1px;left:.58rem;width:.94rem;height:.94rem;background:#ac6032;border:1px solid #87411f;border-radius:50%}
.cookie-head::before {content:"";position:absolute;top:.22rem;left:.18rem;width:.12rem;height:.12rem;background:#fff2d1;border-radius:50%;box-shadow:.34rem 0 #fff2d1}
.cookie-head::after {content:"";position:absolute;left:.25rem;top:.4rem;width:.35rem;height:.15rem;border-bottom:2px solid #fff2d1;border-radius:50%}
.cookie-body {position:absolute;left:.67rem;top:.75rem;width:.77rem;height:1rem;border-radius:36%;background:#ac6032}
.cookie-body::before {content:"";position:absolute;left:-.51rem;top:.24rem;width:1.8rem;height:.34rem;border-radius:1rem;background:#ac6032;transform:rotate(-8deg)}
.cookie-body::after {content:"";position:absolute;left:.31rem;top:.36rem;width:.15rem;height:.15rem;border-radius:50%;background:#a22536;box-shadow:0 .24rem #588263,-.28rem .43rem 0 .09rem #ac6032,-.31rem .6rem 0 .09rem #ac6032,.29rem .43rem 0 .09rem #ac6032,.32rem .6rem 0 .09rem #ac6032}
@media(prefers-reduced-motion:reduce) {.finale,.finale.is-visible {transition:none}}
.admin {width:min(42rem,92vw);margin:8vh auto}
.admin h1 {font-size:clamp(2.8rem,7vw,4.3rem);margin:1.2rem 0}
.admin form {display:flex;align-items:end;gap:.7rem;margin:2rem 0 1rem;flex-wrap:wrap}
.admin form label {display:grid;gap:.4rem;flex:1;min-width:13rem}
.admin form input {background:#26302b;border:1px solid #99917e;border-radius:.4rem;padding:.65rem;color:#fff3df;font:inherit}
.admin ul {list-style:none;padding:0}
.admin li {display:grid;grid-template-columns:minmax(0,1fr) auto auto;align-items:center;gap:.55rem;border-top:1px solid #605849;padding:.65rem 0}
.admin li strong {overflow-wrap:anywhere}
.admin li [href] {color:var(--gold);padding:.5rem}
.admin button[disabled] {opacity:.5}
a {color:var(--gold)}
@media(max-width:520px) {.finale {bottom:4rem}.gingerbread {scale:.83}}
@media(prefers-reduced-motion:reduce) {.journey {height:auto}}


.login form {display:grid;justify-items:start;gap:.9rem;max-width:25rem}
.login form label {width:100%;min-width:0}
.login form button {margin-top:.2rem}
.admin .logout {margin:.8rem 0}
.camera-glass {
  position:absolute; z-index:4;
  right:max(clamp(1rem,4vw,3rem),env(safe-area-inset-right));
  top:max(clamp(.75rem,2.2vw,1.6rem),env(safe-area-inset-top));
  display:flex; gap:.25rem; padding:.33rem;
  border:1px solid #fff8; border-radius:999px;
  background:linear-gradient(155deg,#f9fbff4f,#cadaeb1a 52%,#d6b68629);
  backdrop-filter:blur(22px) saturate(1.6);
  -webkit-backdrop-filter:blur(22px) saturate(1.6);
  box-shadow:inset 0 1px 1px #fff9,inset 0 -1px 2px #f5c57b47,0 12px 32px #01040a66;
}
.camera-glass button {
  display:grid; place-items:center; width:2.85rem; height:2.85rem;
  padding:0; border:1px solid transparent; border-radius:50%;
  background:transparent; color:#fff9ec; text-shadow:0 1px 3px #000a;
  font:400 1.65rem/1 system-ui,sans-serif;
  transition:background .2s,border-color .2s,transform .2s;
}
.camera-glass button:hover {background:#fff4;border-color:#fff5}
.camera-glass button:active {transform:scale(.92)}
.camera-glass button:disabled {opacity:.48;cursor:default}
.signature {margin-top:.8rem;color:#77303a;font:italic 1.05rem/1.24 Georgia,serif}
.signature strong {font-weight:600}
@media(prefers-reduced-motion:reduce) {.camera-glass button {transition:none}}


canvas {user-select:none;-webkit-user-select:none}
@media(max-width:680px) {.letter {top:4.7rem}.camera-glass {right:max(.75rem,env(safe-area-inset-right));gap:.15rem;padding:.25rem}}

