:root{color-scheme:dark;--night:#101b26;--paper:#f8ead9;--muted:#d2c6b9;--gold:#efcfaa;--line:#53616c;--serif:Georgia,"Times New Roman",serif;font-family:system-ui,sans-serif}
*{box-sizing:border-box}
body{margin:0;background:#050a15;color:var(--paper)}
button,input,textarea{font:inherit}
button{cursor:pointer;color:inherit}
button:focus-visible,input:focus-visible,textarea:focus-visible,a:focus-visible{outline:2px solid #fff0b7;outline-offset:3px}
#app{position:relative;isolation:isolate;max-width:520px;margin:auto;background:var(--night);min-height:100svh;overflow:hidden}
.screen{min-height:100svh;display:flex;flex-direction:column;position:relative}
.art{position:absolute;inset:0;z-index:-2;background-size:cover;background-position:center 39%}
.hero::after,.delivery::after{content:"";position:absolute;inset:0;z-index:-1;background:linear-gradient(180deg,transparent 47%,#101b2644 64%,#101b26ee 87%,#101b26 100%);pointer-events:none}
.hero,.delivery{justify-content:flex-end;text-align:center}
.bottom{padding:26px 24px max(28px,env(safe-area-inset-bottom));width:100%}
h1,h2,p{margin:0}
h1,h2{font-family:var(--serif);font-weight:400;line-height:1.05;text-wrap:balance}
h1{font-size:clamp(44px,12vw,66px);letter-spacing:-.045em}
h2{font-size:clamp(30px,9vw,45px);letter-spacing:-.035em}
.lead{margin:12px auto 25px;color:#f0e0cf;line-height:1.5;max-width:28ch}
.button{display:flex;align-items:center;justify-content:center;min-height:49px;border:1px solid transparent;border-radius:4px;width:100%;padding:10px 15px;font-weight:600;background:var(--gold);color:#24170f;text-decoration:none}
.button:active{background:#ffe0a9}
.secondary{background:#ffffff0b;color:var(--paper);border-color:var(--line)}
.text{background:none;border:0;color:#f5d7a1;min-height:44px;padding:8px 10px;text-decoration:underline;text-underline-offset:4px}
.stack{display:grid;gap:10px}
.header{display:flex;align-items:center;justify-content:space-between;padding:max(12px,env(safe-area-inset-top)) 16px 10px;min-height:62px}
.header .text{text-decoration:none}
.wordmark{font-family:var(--serif);font-size:20px;color:#ffe0aa}
.composer{padding:24px}
form h1{font-size:39px;margin-bottom:20px}
label{display:grid;gap:6px;font-size:14px;font-weight:650}
input,textarea{width:100%;min-height:46px;padding:11px;border-radius:10px;border:1px solid var(--line);color:var(--paper);background:#172634;font-size:16px}
textarea{resize:vertical;min-height:90px}
.fields{display:grid;gap:14px;margin-bottom:15px}
details{border-top:1px solid var(--line);padding:0;margin:0}
details:last-of-type{border-bottom:1px solid var(--line);margin-bottom:19px}
summary{cursor:pointer;min-height:49px;padding:14px 0;color:#f4d4a2}
.details-body{display:grid;gap:9px;padding:0 0 14px}
.hint,.status{font-size:13px;color:var(--muted);line-height:1.5}
.status:empty{display:none}
.field-actions{display:flex;gap:6px;flex-wrap:wrap}
.field-actions .text{padding-left:0}
.signature{display:block;width:100%;height:auto;background:#ebc38e;border:1px solid #e6b37b;border-radius:9px;touch-action:none}
.suggestions{display:grid;gap:4px}
.suggestions:empty{display:none}
.suggestions button{padding:9px;background:#19253c;border:0;border-radius:5px;text-align:left;min-height:44px}
.metric{display:flex;gap:8px;align-items:center;justify-content:center;margin:7px 0;font-variant-numeric:tabular-nums}
.metric .text{font-size:13px}
.letter{background:#f2e2cc;color:#392921;text-align:left;border-radius:2px;padding:20px;margin:0 0 18px;overflow-wrap:anywhere}
.letter h2{font-size:28px;margin-bottom:12px}
.letter p{white-space:pre-wrap;line-height:1.6;max-height:40svh;overflow:auto}
.share-field{margin:10px 0;font-size:16px}
[hidden]{display:none!important}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{scroll-behavior:auto!important;transition:none!important}}
.art{position:absolute;inset:0;z-index:-2;background:linear-gradient(#101d33,#132530 60%,#101b26)}
.art canvas,.form-art canvas{display:block;width:100%;height:100%}
.form-art{overflow:hidden;background:#152330}

.eyebrow{font-size:11px;font-weight:750;letter-spacing:.19em;color:#ffd7a1;margin-bottom:10px}
.scene-sound{position:absolute;top:max(10px,env(safe-area-inset-top));right:14px;z-index:4;text-decoration:none;background:#0c122a9c;border-radius:24px;padding-inline:16px}
.hero .bottom{background:linear-gradient(transparent,#111b2ae0 30%,#111b2a);padding-top:48px}
.hero h1{max-width:9ch;margin:auto}
.hero .lead{margin-bottom:19px}
.hearth-screen{background:#241c25}
.hearth-screen .header{z-index:2;justify-content:flex-start;gap:12px;background:linear-gradient(#121520b3,transparent)}
.hearth-screen .scene-sound{top:13px}
.hearth-screen .form-art{position:absolute;top:0;left:0;right:0;height:65svh;background:radial-gradient(ellipse at 37% 60%,#834832,#242236 70%)}
.hearth-actions{z-index:1;margin-top:calc(62svh - 62px);display:flex;justify-content:space-between;gap:12px;padding:6px 20px 18px;background:linear-gradient(transparent,#241c25)}
.hearth-actions .button{width:auto;background:#402c30;border-color:#b69066}
.composer{z-index:1;color:#453028;background:#f0dcc0;margin:0 16px 25px;padding:21px;border-radius:3px;box-shadow:0 16px 35px #0c0a0f8c}
.composer input,.composer textarea{background:#fcf0dd;color:#3c2521;border-color:#ae8c74;color-scheme:light}
.composer summary,.composer .text,.composer .hint,.composer .status{color:#6a4138}
.composer details{border-color:#bb9e84}
.composer .button{background:#803f41;color:#fff1df}
.approach{position:absolute;z-index:5;inset:0 0 auto;height:100svh;pointer-events:none;animation:arrive 1.55s ease-in-out forwards}
.approach canvas,.globe-art canvas{width:100%;height:100%;display:block}
@keyframes arrive{0%,45%{opacity:1}100%{opacity:0}}
.delivery,.roof-screen{isolation:isolate;background:#261e27}
.delivery .delivery-scene{inset:0 0 auto;height:63svh;background:radial-gradient(ellipse at center,#6e4333,#231e2a 70%)}
.delivery::after{background:linear-gradient(transparent 47svh,#261e2700 49svh,#261e27 64svh)}
.delivery .bottom{margin-top:clamp(325px,59svh,570px);padding-top:0}
.delivery h1,.roof-screen h1{font-size:clamp(40px,10vw,56px)}
.delivery .lead{margin-bottom:13px}
.delivery .text{min-height:44px}
.parcel-hit{z-index:2;position:absolute;width:130px;height:120px;left:50%;top:41svh;transform:translate(-50%,-50%);border:0;border-radius:12px;background:transparent}
.delivery-scene[data-unavailable="true"] + .parcel-hit::before,.delivery-scene:not(:has(canvas:not([hidden]))) + .parcel-hit::before{content:'🎁';font-size:68px}
.letter{padding:22px 24px;background:#f0ddbf;animation:unfold .62s cubic-bezier(.2,.8,.3,1) both;transform-origin:50% 0;box-shadow:0 12px 36px #0c0912a0}
.letter .eyebrow{color:#7c4c43;line-height:1.3}
.letter #note-body{min-height:2em;max-height:none}
.signed-tag{display:block;max-width:145px;margin:9px 0 0 auto;transform:rotate(-5deg);background:#e9c9a1}
.ink-reveal{animation:write-ink .86s ease-out forwards}
@keyframes write-ink{to{stroke-dashoffset:0}}
@keyframes unfold{from{opacity:0;transform:perspective(700px) rotateX(-63deg) scale(.88)}to{opacity:1;transform:none}}
.visually-hidden{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.roof-screen{justify-content:flex-end;text-align:center}
.roof-screen .bottom{background:linear-gradient(transparent,#241d28 34%);padding-top:42px}
.globe-screen{min-height:100svh;background:radial-gradient(ellipse at 50% 38%,#182742,#080e21 72%);text-align:center}
.globe-screen::before{content:'';position:absolute;inset:0;pointer-events:none;background-image:radial-gradient(circle,#f8dca39c 0 1px,transparent 1.5px),radial-gradient(circle,#b9cfff9e 0 1px,transparent 1.3px);background-size:83px 107px,137px 67px;background-position:11px -28px,35px 14px;opacity:.42}
.globe-screen>*{position:relative}
.route-copy{padding:1px 18px 0}
.route-copy h1{font-size:clamp(38px,11vw,57px)}
.route-copy p:last-child{margin:7px 0;color:#cdd7e5;font-size:14px}
.globe-art{height:clamp(220px,39svh,430px);pointer-events:none}
.flight-console{margin:auto 14px 0;padding:7px 10px max(16px,env(safe-area-inset-bottom));border-top:1px solid #d6b7924f}
.flight-console .hint{margin:6px 0 8px}
.distance-console{display:flex;gap:11px;justify-content:space-between;align-items:center;text-align:left;margin-bottom:4px}
.distance-console strong,.distance-console small{display:block}
.distance-console strong{font-variant-numeric:tabular-nums;color:#f8d2a4;font-size:16px}
.distance-console small{color:#c8c7cb;font-size:11px}
.distance-console .text{font-size:12px;white-space:nowrap}
.steering{display:grid;grid-template-columns:44px 1fr 44px;align-items:center;gap:8px}
.turn,.wheel{min-height:46px;background:#192646a6;border:1px solid #9daac674;border-radius:10px;color:#ffe2ba}
.turn{font-size:29px}.wheel{touch-action:none;user-select:none}
#needle{display:inline-block;margin-right:8px;font-size:20px;color:#fdd196}
@media(prefers-reduced-motion:reduce){.approach,.letter,.ink-reveal{animation:none}}
.hearth-screen:not(.writing) .form-art{height:100svh}
.hearth-screen:not(.writing) .hearth-actions{margin-top:auto;padding:52px 20px max(24px,env(safe-area-inset-bottom));background:linear-gradient(transparent,#211923e8 69%)}
.globe-art[data-unavailable="true"]{height:130px;background:radial-gradient(circle at center,#42686c 3%,#223b61 25%,transparent 26%)}
.flight-console .stack{gap:3px}
@media(max-height:670px){.globe-screen .header{min-height:50px;padding-block:3px}.route-copy h1{font-size:36px}.route-copy p:last-child{margin:4px 0}.globe-art{height:35svh}.flight-console{padding-bottom:7px}}
.delivery:not(.mailbox) .bottom{margin-top:clamp(274px,53svh,505px)}
.share-actions{display:flex;justify-content:space-between;gap:3px}
.share-actions .text{font-size:13px;padding-inline:6px}

/* Compose in the room; stationery never changes the camera viewport. */
.hearth-screen,.hearth-screen.writing{height:100svh;min-height:0;isolation:isolate;background:#19131a}
.hearth-screen .form-art,.hearth-screen:not(.writing) .form-art{height:100%;z-index:-2}
.hearth-screen::after{content:'';position:absolute;inset:0;z-index:-1;pointer-events:none;background:linear-gradient(#120c17a6,transparent 18%,transparent 74%,#140d16bb)}
.hearth-screen .hearth-actions{display:contents}
#log,#write{position:absolute;z-index:2;width:94px;height:65px;transform:translate(-50%,-50%);background:none;border:0;padding:0;min-height:0;border-radius:25px}
#log{left:34%;top:58%;color:#fff0d3}
#write{left:38%;top:82%;width:135px;color:#fff0d3;text-decoration:none;font-size:13px}
#log span,#write::after,.parcel-hit span{display:inline-block;position:absolute;bottom:-8px;left:50%;transform:translateX(-50%);white-space:nowrap;background:#241719eb;border:1px solid #e0b68180;border-radius:20px;padding:4px 9px;color:#ffe8c6;font-size:11px}
#write[data-placed]{font-size:0}
#write[data-placed]::after{content:'Pick up the card'}
.approach{animation:none;background:#0e182c;pointer-events:auto}
.approach.playing{animation:arrive-new 5s linear both}
@keyframes arrive-new{0%,65%{opacity:1}100%{opacity:0}}
.approach .text{z-index:6}
.stationery{width:min(90%,430px);max-height:min(84dvh,700px);border:1px solid #ead1aa;border-radius:4px;background:#f5e7d1;color:#392521;padding:0;overflow:auto;overscroll-behavior:contain;box-shadow:0 10px 85px #10070dbb}
.stationery[open]{animation:lift-card .36s cubic-bezier(.18,.72,.29,1) both}
.stationery::backdrop{background:#1b11156b;backdrop-filter:blur(4px)}
@keyframes lift-card{from{transform:translateY(38px) rotate(-3deg) scale(.95);opacity:0}to{transform:none;opacity:1}}
.stationery .composer{position:relative;background:none;margin:0;padding:25px 22px 23px;box-shadow:none}
.stationery form h1{font-size:42px;margin:0 0 15px}
.stationery input,.stationery textarea{border-radius:4px}
.stationery #close-card{position:absolute;right:10px;top:8px;min-width:44px;font-size:25px;text-decoration:none}
.stationery .suggestions button{color:#372421;background:#f9ecda;border:1px solid #b89875}
.stationery .suggestions button:is(:active,:hover,:focus-visible){color:#311e1a;background:#e6caab;outline-color:#763e37}
.stationery :is(input,textarea,button):focus-visible{outline-color:#763e37}
.stationery .composer small{color:#735849}
.stationery .signature{border-radius:4px}
.stationery .composer .button{border-radius:3px}
@media(prefers-reduced-motion:reduce){.stationery[open]{animation:none}}

/* Sleigh-height camera with controls over the flight, clear of the horizon. */
.globe-screen{isolation:isolate;min-height:100svh;overflow:hidden;background:#070c1e}
.globe-screen::before{display:none}
.globe-screen .header{z-index:2;background:linear-gradient(#080c20c9,transparent)}
.globe-screen .route-copy{z-index:1;pointer-events:none;text-shadow:0 2px 10px #080c1c}
.globe-screen .route-copy h1{font-size:clamp(42px,10vw,60px);overflow-wrap:anywhere}
.globe-screen .route-copy p:last-child{min-height:1.2em;margin-top:9px;color:#ffe2ae}
.globe-screen .globe-art{position:absolute;z-index:-1;inset:0;height:100%;margin:0}
.globe-screen .flight-console{width:100%;margin:auto 0 0;padding:48px 22px max(18px,env(safe-area-inset-bottom));border:0;background:linear-gradient(transparent,#070c20da 32%,#080d20 82%)}
.globe-screen .distance-console strong{font-size:14px}
.globe-screen .distance-console small{font-size:10px}
.globe-screen .flight-console .stack{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.globe-screen .flight-console .stack button{flex:1;min-width:max-content}
.globe-screen .flight-console .stack #skip{flex-basis:100%}
.globe-screen .steering{gap:5px}
.globe-screen .turn,.globe-screen .wheel{background:#121d37c4;border-color:#d0ba8f73;border-radius:5px}
.globe-screen .wheel{letter-spacing:.035em}
.city-layer{position:absolute;inset:0;pointer-events:none}
.city-layer span{position:absolute;top:0;left:0;font-size:11px;white-space:nowrap;color:#f3e9d6;background:#111829e0;border:1px solid #cab48672;border-radius:3px;padding:3px 6px}
.city-layer span::after{content:'';position:absolute;left:50%;top:100%;width:3px;height:6px;background:#eecf99}
.city-layer .destination-pin{color:#ffe0a4;border-color:#eecf99}
.globe-screen:has(#watch),.mailbox{background-color:#1d151e}
.mailbox .parcel-hit span{bottom:4px}
.mailbox:has(.letter) .bottom{margin-top:clamp(295px,51svh,500px)}
.mailbox .letter{position:relative;padding-top:26px;background:repeating-linear-gradient(0deg,#e8d1af22 0 1px,transparent 1px 3px),#f4e4ca;border:1px solid #edcfa6}
.mailbox .letter::before{content:'';position:absolute;inset:7px;border:1px solid #b98858;pointer-events:none}
.mailbox .letter h2{font-size:32px;color:#743d3d}
.mailbox .letter .eyebrow{letter-spacing:.12em}
.stationery .details-body{position:relative}
.stationery .suggestions:not(:empty){margin-top:-3px;box-shadow:0 5px 18px #67403721}
.globe-screen .flight-console{background:linear-gradient(transparent,#070c20a9 27%,#080d20f0 81%)}
.globe-screen .turn,.globe-screen .wheel{background:#111d32e8}
@media(max-height:670px){.globe-screen .flight-console{padding-top:28px;padding-bottom:9px}}
.globe-screen .globe-art{background:
  radial-gradient(circle,#cadbffb0 0 1px,transparent 1.4px) 12px 7px/113px 97px,
  radial-gradient(circle,#ecb98480 0 .7px,transparent 1.2px) 35px 41px/83px 117px,
  radial-gradient(ellipse at 47% 42%,#111c38,#060b1c 77%)}
.hearth-screen:has(.approach) > .header,.hearth-screen:has(.approach) > .scene-sound,
.hearth-screen:has(.approach) > #log,.hearth-screen:has(.approach) #write{visibility:hidden}
.manual-flight{touch-action:none}
.village-pass .bottom{background:linear-gradient(transparent,#17131ee8 53%,#19131f);padding-top:45px}
.village-pass .eyebrow{letter-spacing:.16em}
.mailbox .letter #note-body,.stationery textarea{
  font-family:"Segoe Print","Bradley Hand","Chalkboard SE","Comic Sans MS",cursive;
  font-weight:400;
}
.mailbox .letter #note-body{font-size:clamp(19px,5vw,24px);line-height:1.55;color:#52332d}
.globe-art::after{content:'';position:absolute;inset:20% -15% 42%;pointer-events:none;opacity:0;transition:opacity 1s;
 background:repeating-linear-gradient(105deg,transparent 0 14px,#84ffae34 21px,transparent 39px),linear-gradient(168deg,transparent 24%,#73ffae38 44%,#a884f960 57%,transparent 77%);
 mask-image:radial-gradient(ellipse at center,#000 22%,transparent 69%);transform:skewY(-11deg);mix-blend-mode:screen}
.under-aurora .globe-art::after{opacity:1}
.link-label{margin-top:8px;text-align:left;font-size:12px;color:#ffe1b0}
.link-label .share-field{margin:0;background:#31252c;border-color:#a18369;color:#fff1dc}
