/* Self-hosted (SIL Open Font License): Almendra by Ana Sanfelippo, IM Fell English by Igino Marini. Latin subset. */
@font-face { font-family: "Almendra"; font-style: normal; font-weight: 400; font-display: swap; src: url(/fonts/almendra-400.woff2) format("woff2"); }
@font-face { font-family: "Almendra"; font-style: italic; font-weight: 400; font-display: swap; src: url(/fonts/almendra-400-italic.woff2) format("woff2"); }
@font-face { font-family: "Almendra"; font-style: normal; font-weight: 700; font-display: swap; src: url(/fonts/almendra-700.woff2) format("woff2"); }
@font-face { font-family: "IM Fell English"; font-style: normal; font-weight: 400; font-display: swap; src: url(/fonts/imfell-400.woff2) format("woff2"); }
@font-face { font-family: "IM Fell English"; font-style: italic; font-weight: 400; font-display: swap; src: url(/fonts/imfell-400-italic.woff2) format("woff2"); }

:root {
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --t: 600ms;
  --lead: oklch(0.22 0.012 55);
  --parch: oklch(0.93 0.035 85);
  --parch-ink: oklch(0.28 0.04 45);
  --s: 0.78;
  --cm: 0;
  --m0: 0; --m1: 100;
}
/* ---------- lighting modes ---------- */
:root[data-mode="day"] {
  --bg: oklch(0.80 0.08 230);
  --ink: oklch(0.31 0.045 45);
  --st-hi: oklch(0.91 0.035 85); --st: oklch(0.83 0.042 78); --st-sh: oklch(0.66 0.048 62); --st-dk: oklch(0.50 0.045 52);
  --line: oklch(0.58 0.05 58);
  --roof-hi: oklch(0.62 0.13 255); --roof: oklch(0.49 0.14 260); --roof-sh: oklch(0.34 0.11 266);
  --wood: oklch(0.60 0.07 62); --wood-sh: oklch(0.45 0.06 52);
  --grass: oklch(0.73 0.13 132); --grass-sh: oklch(0.60 0.12 140); --grass-dk: oklch(0.48 0.10 148);
  --path: oklch(0.87 0.05 82);
  --water: oklch(0.64 0.09 222); --water-hi: oklch(0.86 0.05 210);
  --hill1: oklch(0.68 0.12 136); --hill2: oklch(0.74 0.09 152); --hill3: oklch(0.79 0.06 175);
  --tree: oklch(0.56 0.12 146); --tree2: oklch(0.64 0.12 138);
  --ivy: oklch(0.58 0.13 138); --ivy2: oklch(0.46 0.12 150);
  --lamp: oklch(0.32 0.03 270); --gatein: oklch(0.24 0.03 280);
  --cloud: oklch(0.98 0.01 90); --cloud-sh: oklch(0.87 0.03 240); --cloud-o: 1;
  --halo: 0.22; --inner: 0.12; --stars: 0; --lamp-glow: 0;
  --cast-day: 0.2; --cast-dusk: 0;
  --o-sunday: 1; --o-sundusk: 0; --o-moon: 0;
  --ui: oklch(0.95 0.025 85); --ui-ink: oklch(0.30 0.04 45); --ui-line: oklch(0.45 0.05 50);
}
:root, :root[data-mode="dusk"] {
  --bg: oklch(0.58 0.13 340);
  --ink: oklch(0.26 0.05 330);
  --st-hi: oklch(0.86 0.07 58); --st: oklch(0.73 0.065 38); --st-sh: oklch(0.51 0.06 335); --st-dk: oklch(0.40 0.06 322);
  --line: oklch(0.50 0.06 342);
  --roof-hi: oklch(0.54 0.14 300); --roof: oklch(0.41 0.13 292); --roof-sh: oklch(0.28 0.09 290);
  --wood: oklch(0.52 0.07 42); --wood-sh: oklch(0.38 0.06 32);
  --grass: oklch(0.53 0.09 138); --grass-sh: oklch(0.43 0.08 158); --grass-dk: oklch(0.34 0.07 190);
  --path: oklch(0.74 0.07 52);
  --water: oklch(0.52 0.11 335); --water-hi: oklch(0.84 0.10 65);
  --hill1: oklch(0.40 0.07 312); --hill2: oklch(0.50 0.085 330); --hill3: oklch(0.63 0.10 345);
  --tree: oklch(0.33 0.06 300); --tree2: oklch(0.38 0.06 310);
  --ivy: oklch(0.47 0.09 145); --ivy2: oklch(0.37 0.08 160);
  --lamp: oklch(0.80 0.14 75); --gatein: oklch(0.56 0.13 58);
  --cloud: oklch(0.83 0.09 35); --cloud-sh: oklch(0.62 0.11 335); --cloud-o: 1;
  --halo: 0.6; --inner: 0.3; --stars: 0.4; --lamp-glow: 0.55;
  --cast-day: 0; --cast-dusk: 0.26;
  --o-sunday: 0; --o-sundusk: 1; --o-moon: 0;
  --ui: oklch(0.93 0.035 70); --ui-ink: oklch(0.28 0.05 330); --ui-line: oklch(0.40 0.06 330);
}
:root[data-mode="night"] {
  --bg: oklch(0.18 0.05 270);
  --ink: oklch(0.17 0.03 272);
  --st-hi: oklch(0.54 0.04 250); --st: oklch(0.44 0.04 258); --st-sh: oklch(0.31 0.04 266); --st-dk: oklch(0.24 0.035 270);
  --line: oklch(0.31 0.035 265);
  --roof-hi: oklch(0.40 0.08 268); --roof: oklch(0.31 0.07 274); --roof-sh: oklch(0.21 0.05 278);
  --wood: oklch(0.38 0.04 60); --wood-sh: oklch(0.28 0.035 50);
  --grass: oklch(0.32 0.05 192); --grass-sh: oklch(0.27 0.045 210); --grass-dk: oklch(0.22 0.04 230);
  --path: oklch(0.46 0.03 250);
  --water: oklch(0.28 0.06 262); --water-hi: oklch(0.78 0.06 240);
  --hill1: oklch(0.23 0.04 262); --hill2: oklch(0.28 0.045 264); --hill3: oklch(0.34 0.05 266);
  --tree: oklch(0.20 0.035 262); --tree2: oklch(0.24 0.04 262);
  --ivy: oklch(0.32 0.05 170); --ivy2: oklch(0.26 0.045 185);
  --lamp: oklch(0.85 0.15 80); --gatein: oklch(0.70 0.14 70);
  --cloud: oklch(0.44 0.045 265); --cloud-sh: oklch(0.31 0.045 268); --cloud-o: 0.7;
  --halo: 1; --inner: 0.5; --stars: 1; --lamp-glow: 1;
  --cast-day: 0; --cast-dusk: 0;
  --o-sunday: 0; --o-sundusk: 0; --o-moon: 1;
  --ui: oklch(0.30 0.04 268); --ui-ink: oklch(0.92 0.03 85); --ui-line: oklch(0.55 0.05 260);
}

* { box-sizing: border-box; }
html { overflow-x: clip; }
html, body { margin: 0; }
body {
  overflow-x: clip;
  background: var(--bg);
  color: var(--ink);
  font-family: "IM Fell English", Georgia, serif;
  transition: background-color var(--t) var(--ease);
}
.sr { position: absolute; top: 0; left: 0; margin: 0; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- sky + parallax layers (fixed, transform-only) ---------- */
.sky { position: fixed; inset: 0; overflow: hidden; z-index: 0; pointer-events: none; }
.sky-track { position: absolute; left: 0; right: 0; top: 0; height: 400%; will-change: transform; }
.sky-l { position: absolute; inset: 0; opacity: 0; transition: opacity var(--t) var(--ease); }
.sky-day { background: linear-gradient(180deg, oklch(0.50 0.13 256) 0%, oklch(0.60 0.12 248) 30%, oklch(0.74 0.09 236) 65%, oklch(0.86 0.05 215) 90%, oklch(0.92 0.035 190) 100%); }
.sky-dusk { background: linear-gradient(180deg, oklch(0.22 0.07 282) 0%, oklch(0.33 0.11 292) 28%, oklch(0.50 0.14 325) 55%, oklch(0.66 0.15 10) 78%, oklch(0.78 0.14 50) 92%, oklch(0.86 0.12 78) 100%); }
.sky-night { background: linear-gradient(180deg, oklch(0.11 0.035 278) 0%, oklch(0.15 0.045 272) 45%, oklch(0.21 0.06 264) 82%, oklch(0.29 0.07 256) 100%); }
[data-mode="day"] .sky-day, [data-mode="dusk"] .sky-dusk, [data-mode="night"] .sky-night { opacity: 1; }

.par { position: fixed; left: 0; right: 0; bottom: 0; pointer-events: none; will-change: transform; }
.par > * { position: absolute; }
.l-stars { z-index: 1; --f: 0.05; opacity: var(--stars); transition: opacity var(--t) var(--ease); }
.l-sky   { z-index: 1; --f: 0.08; }
.l-hills { z-index: 2; --f: 0.3; height: 58vh; }
.l-far   { z-index: 3; --f: 0.5; }
.l-birds { z-index: 3; --f: 0.72; }
.l-near  { z-index: 7; --f: 1.35; }

@keyframes skyk { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(0, -75%, 0); } }
@keyframes park { from { transform: translate3d(0, calc(var(--cm) * var(--f) * 1px), 0); } to { transform: translate3d(0, 0, 0); } }
@keyframes youk { from { transform: translate3d(0, calc(var(--m0) * 1%), 0); } to { transform: translate3d(0, calc(var(--m1) * 1%), 0); } }
@supports (animation-timeline: scroll()) {
  .sky-track { animation: skyk linear both; animation-timeline: scroll(root); }
  .par { animation: park linear both; animation-timeline: scroll(root); }
  .you { animation: youk linear both; animation-timeline: scroll(root); }
}

.star { position: absolute; width: 2px; height: 2px; border-radius: 50%; background: oklch(0.96 0.03 90); }
.star.b { width: 3px; height: 3px; box-shadow: 0 0 6px oklch(0.95 0.05 90 / 0.8); }
.star.tw { animation: tw 4s ease-in-out infinite; }
@keyframes tw { 50% { opacity: 0.25; } }

.sun-day { right: 9%; width: 120px; height: 120px; opacity: var(--o-sunday); transition: opacity var(--t) var(--ease); }
.moon { left: 8%; width: 110px; height: 110px; opacity: var(--o-moon); transition: opacity var(--t) var(--ease); }
.l-hills svg { width: 100%; height: 100%; display: block; overflow: visible; }
.sun-dusk { opacity: var(--o-sundusk); transition: opacity var(--t) var(--ease); }

.cloud { opacity: var(--cloud-o); transition: opacity var(--t) var(--ease); }
.cloud svg { display: block; width: 100%; height: auto; overflow: visible; animation: drift 46s cubic-bezier(0.45, 0, 0.55, 1) infinite alternate; }
@keyframes drift { from { transform: translate3d(-34px, 0, 0); } to { transform: translate3d(34px, 0, 0); } }
.l-near .cloud { opacity: calc(var(--cloud-o) * 0.72); }
.bird-flock { animation: flock 60s linear infinite; }
@keyframes flock { from { transform: translate3d(-18vw, 0, 0); } to { transform: translate3d(118vw, -40px, 0); } }
.bird { transform-box: fill-box; transform-origin: center; animation: flap 0.9s ease-in-out infinite alternate; }
@keyframes flap { from { transform: scaleY(1); } to { transform: scaleY(0.25) translateY(6px); } }

/* ---------- the tower world (normal document flow, native scroll) ---------- */
main { position: relative; z-index: 5; }
.world { position: relative; height: calc(4065px * var(--s)); overflow: hidden; }
.wsvg { position: absolute; top: 0; left: 0; width: 100%; height: 100%; display: block; }
.wsvg path, .wsvg rect, .wsvg circle, .wsvg ellipse, .hsvg path, .hsvg circle, .cloud path, .cloud circle {
  transition: fill var(--t) var(--ease), stroke var(--t) var(--ease), opacity var(--t) var(--ease);
}
.wsvg stop, .hsvg stop { transition: stop-color var(--t) var(--ease); }
.ink { stroke: var(--ink); stroke-width: 3.2; stroke-linejoin: round; stroke-linecap: round; }
.ink2 { stroke: var(--ink); stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.nofill { fill: none; }
.fst { fill: var(--st); } .fsh { fill: var(--st-sh); } .fdk { fill: var(--st-dk); } .fhi { fill: var(--st-hi); }
.fcyl { fill: url(#gCyl); } .fwall { fill: url(#gWall); } .froof { fill: url(#gRoof); }
.ln { fill: none; stroke: var(--line); stroke-width: 2.2; stroke-linecap: round; }
.hl { fill: none; stroke: var(--st-hi); stroke-width: 2.4; stroke-linecap: round; opacity: 0.8; }
.void { fill: oklch(0.17 0.025 290); }
.lampwin { fill: var(--lamp); }
.gatein { fill: var(--gatein); }
.fwood { fill: var(--wood); } .fwoodsh { fill: var(--wood-sh); }
.fgrass { fill: var(--grass); } .fgrass-sh { fill: var(--grass-sh); } .fgrass-dk { fill: var(--grass-dk); }
.fpath { fill: var(--path); } .fwater { fill: var(--water); }
.wave { fill: none; stroke: var(--water-hi); stroke-width: 2.4; stroke-linecap: round; opacity: 0.8; }
.fivy { fill: var(--ivy); } .fivy2 { fill: var(--ivy2); } .vine { fill: none; stroke: var(--ivy2); stroke-width: 3; stroke-linecap: round; }
.ftree { fill: var(--tree); } .ftree2 { fill: var(--tree2); }
.roofline { fill: none; stroke: var(--roof-sh); stroke-width: 2.2; stroke-linecap: round; }
.gold { fill: oklch(0.80 0.13 82); } .ruby { fill: oklch(0.56 0.19 24); } .cobalt { fill: oklch(0.50 0.14 262); }
.lglow { opacity: var(--lamp-glow); }
.cast-day { fill: oklch(0.25 0.05 280); opacity: var(--cast-day); }
.cast-dusk { fill: oklch(0.22 0.06 300); opacity: var(--cast-dusk); }

/* banner over the gate */
.banner {
  position: absolute; left: 50%; top: calc(3453px * var(--s)); transform: translateX(-50%);
  width: calc(330px * var(--s)); min-width: 200px; text-align: center; z-index: 2;
}
.banner h1 {
  position: relative; margin: 0; padding: 0.18em 0.5em 0.22em;
  font-family: "Almendra", serif; font-weight: 700; font-size: clamp(23px, calc(38px * var(--s)), 40px);
  letter-spacing: 0.04em; line-height: 1.05; color: oklch(0.94 0.06 88);
  background: linear-gradient(180deg, oklch(0.52 0.19 24), oklch(0.43 0.17 20));
  box-shadow: inset 0 2px 0 oklch(0.62 0.17 30), inset 0 -3px 0 oklch(0.34 0.13 18), 0 4px 0 oklch(0.22 0.05 20 / 0.35);
  border: 2.5px solid var(--lead); border-radius: 3px;
  text-shadow: 0 2px 0 oklch(0.30 0.12 20);
}
.banner h1::before, .banner h1::after {
  content: ""; position: absolute; top: 22%; width: 26px; height: 100%; z-index: -1;
  background: oklch(0.36 0.14 20); border: 2.5px solid var(--lead);
}
.banner h1::before { left: -20px; clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 42% 50%); }
.banner h1::after { right: -20px; clip-path: polygon(0 0, 100% 0, 58% 50%, 100% 100%, 0 100%); }
.banner p {
  display: inline-block; margin: 10px 0 0; padding: 3px 12px 4px;
  font-style: italic; font-size: 15px; line-height: 1.25; color: var(--parch-ink);
  background: var(--parch); border: 1.5px solid var(--lead); border-radius: 2px;
  box-shadow: 0 3px 0 oklch(0.20 0.03 40 / 0.25);
}

/* ---------- windows ---------- */
.win { position: absolute; z-index: 3; display: block; color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }
.win .pane { filter: var(--gf, none); display: block; width: 100%; height: 100%; overflow: visible; border-radius: 50% 50% 4px 4px / 29% 29% 4px 4px; transition: filter 700ms var(--ease); }
.app { cursor: pointer; outline: none; }
.app::before {
  content: ""; position: absolute; z-index: -1; left: -70%; right: -70%; top: -30%; bottom: -34%; pointer-events: none;
  background: radial-gradient(closest-side, var(--hc1), var(--hc2) 52%, transparent);
  opacity: var(--halo); transition: opacity var(--t) var(--ease), transform 900ms var(--ease);
}
.app.k-health { --hc1: oklch(0.88 0.13 100 / 0.85); --hc2: oklch(0.72 0.14 160 / 0.32); }
.app.k-play { --hc1: oklch(0.86 0.13 70 / 0.85); --hc2: oklch(0.62 0.19 25 / 0.34); }
.app.on::before { opacity: calc(var(--halo) * 0.6 + 0.45); transform: scale(1.14); }
body[data-active] .app:not(.on) .pane { filter: brightness(0.55) saturate(0.6); }
.app.on .pane { filter: brightness(1.16) saturate(1.12) drop-shadow(0 0 10px oklch(0.92 0.12 88 / 0.7)); }
.bd .pane { filter: none; }
:root[data-mode="dusk"] { --gf: brightness(1.04) drop-shadow(0 0 4px oklch(0.9 0.12 85 / 0.35)); }
:root[data-mode="night"] { --gf: brightness(1.1) saturate(1.12) drop-shadow(0 0 8px oklch(0.9 0.12 85 / 0.6)); }
.app:focus-visible .pane { outline: 3px solid oklch(0.93 0.13 92); outline-offset: 7px; }

.ribbon {
  position: absolute; left: 50%; top: calc(100% + 24px * var(--s)); transform: translateX(-50%);
  min-width: 128px; width: calc(196px * var(--s)); padding: 4px 10px 5px; text-align: center; white-space: nowrap;
  font-family: "Almendra", serif; font-weight: 700; font-size: clamp(15px, calc(21px * var(--s)), 21px); letter-spacing: 0.03em;
  color: oklch(0.95 0.05 88); border: 2px solid var(--lead); border-radius: 2px;
  text-shadow: 0 1.5px 0 oklch(0.22 0.05 40 / 0.6);
  box-shadow: inset 0 2px 0 oklch(1 0 0 / 0.14), 0 3px 0 oklch(0.2 0.03 40 / 0.3);
}
.k-health .ribbon { background: linear-gradient(180deg, oklch(0.52 0.12 165), oklch(0.43 0.11 168)); }
.k-play .ribbon { background: linear-gradient(180deg, oklch(0.53 0.18 26), oklch(0.44 0.17 22)); }
.ribbon::before, .ribbon::after {
  content: ""; position: absolute; top: 30%; width: 18px; height: 100%; z-index: -1; border: 2px solid var(--lead); filter: brightness(0.72);
  background: inherit;
}
.ribbon::before { left: -14px; clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 45% 50%); }
.ribbon::after { right: -14px; clip-path: polygon(0 0, 100% 0, 55% 50%, 100% 100%, 0 100%); }
.note {
  position: absolute; left: 50%; top: calc(100% + 24px * var(--s) + 46px); width: 214px; margin-left: -107px;
  padding: 7px 12px 8px; text-align: center; font-size: 15px; line-height: 1.3; color: var(--parch-ink);
  background: var(--parch); border: 1.5px solid var(--lead); border-radius: 2px;
  box-shadow: 0 4px 0 oklch(0.2 0.03 40 / 0.25);
  opacity: 0; transform: translate3d(0, -6px, 0); pointer-events: none;
  transition: opacity 450ms var(--ease), transform 450ms var(--ease);
}
.note::before { content: ""; position: absolute; left: 50%; top: -7px; width: 12px; height: 12px; margin-left: -6px; background: var(--parch); border-left: 1.5px solid var(--lead); border-top: 1.5px solid var(--lead); transform: rotate(45deg); }
.note b { font-family: "Almendra", serif; font-weight: 700; display: block; font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: oklch(0.42 0.08 40); margin-bottom: 1px; }
.app:hover .note, .app:focus-visible .note, .bd.show .note { opacity: 1; transform: translate3d(0, 0, 0); }
.bd { cursor: help; }
.bd .note { top: calc(100% + 30px * var(--s)); width: 220px; margin-left: -110px; }
@media (hover: none) { .app .note { opacity: 1; transform: none; } }

.flag { position: absolute; z-index: 2; left: 50%; top: calc(98px * var(--s)); width: calc(150px * var(--s)); height: calc(80px * var(--s)); }
.flag svg { display: block; width: 100%; height: 100%; overflow: visible; transform-origin: 0 50%; animation: wave 3.2s cubic-bezier(0.45, 0, 0.55, 1) infinite alternate; }
@keyframes wave { from { transform: skewY(-4deg) scaleX(0.94); } to { transform: skewY(5deg) scaleX(1.02); } }

/* ---------- UI chrome ---------- */
.chrome { position: fixed; z-index: 30; top: 14px; display: flex; align-items: center; gap: 10px; }
.chrome.l { left: 16px; flex-direction: column; align-items: flex-start; gap: 6px; }
.chrome.r { right: 16px; }
.back {
  display: inline-flex; align-items: center; min-height: 36px; padding: 4px 13px 5px;
  font-family: "Almendra", serif; font-weight: 700; font-size: 15px; color: var(--ui-ink); text-decoration: none;
  background: var(--ui); border: 1.5px solid var(--ui-line); border-radius: 3px;
  box-shadow: 0 2px 0 oklch(0.2 0.03 40 / 0.25);
  transition: background-color var(--t) var(--ease), color var(--t) var(--ease), border-color var(--t) var(--ease);
}
.back:hover { filter: brightness(1.06); }
.tag { margin: 0; font-style: italic; font-size: 14px; color: var(--ui-ink); background: var(--ui); padding: 1px 8px 2px; border-radius: 2px; opacity: 0.88; transition: background-color var(--t) var(--ease), color var(--t) var(--ease); }
.modes {
  display: flex; padding: 3px; gap: 2px; background: var(--ui); border: 1.5px solid var(--ui-line); border-radius: 4px;
  box-shadow: 0 2px 0 oklch(0.2 0.03 40 / 0.25);
  transition: background-color var(--t) var(--ease), border-color var(--t) var(--ease);
}
.modes button {
  min-height: 34px; min-width: 52px; padding: 2px 10px 3px; border: 0; border-radius: 2px; cursor: pointer;
  font: 700 14.5px/1 "Almendra", serif; color: var(--ui-ink); background: transparent;
  transition: background-color 400ms var(--ease), color 400ms var(--ease);
}
.modes button:hover { background: oklch(0.6 0.05 60 / 0.16); }
.modes button[aria-pressed="true"] { background: oklch(0.45 0.16 24); color: oklch(0.96 0.04 88); }
.modes button.auto { min-width: 0; font-weight: 400; font-style: italic; font-size: 13.5px; }
.modes button.auto[aria-pressed="true"] { background: oklch(0.6 0.05 60 / 0.2); color: var(--ui-ink); box-shadow: inset 0 0 0 1.5px var(--ui-line); }
.modes button.cur { box-shadow: inset 0 0 0 1.5px oklch(0.45 0.16 24); }
.modes .sep { width: 1px; margin: 5px 3px; background: var(--ui-line); opacity: 0.6; }
.back:focus-visible, .modes button:focus-visible, .rail button:focus-visible { outline: 2.5px solid oklch(0.80 0.15 85); outline-offset: 2px; }

.hint {
  position: fixed; z-index: 30; left: 50%; bottom: 16px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 8px; padding: 6px 14px 7px; white-space: nowrap;
  font-style: italic; font-size: 16px; color: var(--parch-ink); background: var(--parch);
  border: 1.5px solid var(--lead); border-radius: 30px; box-shadow: 0 3px 0 oklch(0.2 0.03 40 / 0.25);
  transition: opacity 500ms var(--ease), transform 500ms var(--ease);
}
.hint svg { width: 14px; height: 16px; animation: bob 1.8s cubic-bezier(0.16, 1, 0.3, 1) infinite; }
@keyframes bob { 0% { transform: translateY(4px); } 60%, 100% { transform: translateY(-3px); } }
body.climbed .hint { opacity: 0; transform: translate(-50%, 12px); pointer-events: none; }

/* altitude rail */
.rail { position: fixed; z-index: 30; right: 18px; top: 50%; height: 58vh; width: 44px; transform: translateY(-46%); }
.rope { position: absolute; left: 21px; top: 0; bottom: 0; width: 2px; background: var(--ui-line); opacity: 0.9; border-radius: 2px; }
.rope::before, .rope::after { content: ""; position: absolute; left: -4px; width: 10px; height: 2px; background: var(--ui-line); }
.rope::before { top: 0; } .rope::after { bottom: 0; }
.mk {
  position: absolute; left: 0; width: 44px; height: 44px; margin-top: -22px; padding: 0; border: 0; background: transparent; cursor: pointer;
  display: grid; place-items: center;
}
.mk i { display: block; width: 14px; height: 14px; transform: rotate(45deg); border: 2px solid var(--lead); transition: transform 400ms var(--ease); }
.mk:hover i { transform: rotate(45deg) scale(1.25); }
.mk.health i { background: oklch(0.62 0.13 165); box-shadow: 0 0 10px oklch(0.75 0.14 150 / calc(var(--halo) * 0.9)); }
.mk.play i { background: oklch(0.58 0.19 26); box-shadow: 0 0 10px oklch(0.72 0.16 50 / calc(var(--halo) * 0.9)); }
.mk.end i { width: 10px; height: 10px; background: var(--ui); }
.mk.bdm { cursor: default; }
.mk.bdm i { width: 10px; height: 7px; transform: none; border-width: 1.5px; background: var(--wood); border-radius: 1px; }
.mk span {
  position: absolute; right: 40px; top: 50%; transform: translateY(-50%); white-space: nowrap;
  font-family: "Almendra", serif; font-weight: 700; font-size: 13px; color: var(--ui-ink);
  background: var(--ui); padding: 1px 7px 2px; border-radius: 2px; opacity: 0.9;
  transition: background-color var(--t) var(--ease), color var(--t) var(--ease);
}
.mk.bdm span, .mk.end span { opacity: 0; transition: opacity 300ms var(--ease); }
.mk.end:hover span, .mk.end:focus-visible span { opacity: 0.9; }
.you { position: absolute; left: 0; top: 0; width: 44px; height: 100%; pointer-events: none; will-change: transform; }
.you::before {
  content: ""; position: absolute; left: 12px; top: -10px; width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid oklch(0.85 0.14 85); background: oklch(0.85 0.14 85 / 0.18);
}

@media (max-width: 640px) {
  .chrome.l { left: 10px; top: 10px; }
  .chrome.r { right: 10px; top: 10px; }
  .back { font-size: 14px; padding: 3px 10px 4px; min-height: 34px; }
  .tag { font-size: 12.5px; }
  .modes button { min-width: 0; padding: 2px 7px 3px; font-size: 13.5px; min-height: 36px; }
  .modes button.auto { font-size: 12.5px; padding: 2px 6px 3px; }
  .back { padding: 3px 8px 4px; }
  .rail { right: 2px; height: 50vh; transform: translateY(-40%); }
  .mk span { display: none; }
  .note { width: 186px; margin-left: -93px; font-size: 14px; }
  .banner p { font-size: 14px; }
  .hint { font-size: 15px; bottom: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .par { --f: 1 !important; }
  .cloud svg, .bird-flock, .bird, .flag svg, .hint svg, .star.tw, .sweep { animation: none !important; }
  .note, .app::before, .pane { transition-duration: 1ms !important; }
}
@keyframes sweep { from { transform: translateX(-60px); } to { transform: translateX(300px); } }

/* boarded windows are keyboard-reachable buttons */
button.bd { background: none; border: 0; padding: 0; margin: 0; font: inherit; color: inherit; appearance: none; }
button.bd:focus { outline: none; }
.bd:focus-visible .note { opacity: 1; transform: translate3d(0, 0, 0); }
.bd:focus-visible .pane { outline: 3px dashed oklch(0.93 0.13 92); outline-offset: 7px; }

/* no-JS fallback: the castle is drawn by script, so offer plain links */
.nojs { position: relative; z-index: 40; max-width: 30rem; margin: 20vh auto; padding: 24px; background: var(--ui); color: var(--ui-ink); font-size: 18px; line-height: 1.6; }
.nojs a { color: inherit; }
