/* lu.ca — a hand-tinted engraving that follows the sun.

   Palette: the .night copy of the drawing overrides these variables, and
   script gives every overlay element its own copy according to the light of
   the patch of world behind it. */

:root, .world.day {
    --paper: #F4EFE4;
    --ink: #21408B;
    --snow: #FBFAF5;
    --water: #CBDAE0;
    --sky: #EBF0F2;
    --earth: #EADFC8;
    --rock: #E3D9C4;
    --leaf: #A3B59C;
    --roof: #C98A6B;
    --stone: #E4DCCB;
    --steel: #B8C3CD;
    --gold: #E3B45A;
    --flame: #EE8A3C;
    --flame2: #FAD06E;
    --rain: #7E96B4;
    --bolt: #F1CC63;
    --ink-soft: color-mix(in srgb, var(--ink) 81%, transparent);
    --ink-faint: color-mix(in srgb, var(--ink) 40%, transparent);
    --serif: "IM Fell English", "Iowan Old Style", Georgia, serif;
    --caps: "IM Fell English SC", "Iowan Old Style", Georgia, serif;
    --sans: "Jost", system-ui, -apple-system, sans-serif;
    --gutter: clamp(1.25rem, 4vw, 3.5rem);
}

/* The night palette: the night copy of the drawing, and any sprite or overlay standing in the dark. */
.world.night, [data-dark="1"] {
    --paper: #0E152E;
    --ink: #D6DEF5;
    --snow: #C9D3EC;
    --water: #182847;
    --sky: #070B1C;
    --earth: #151D3A;
    --rock: #111935;
    --leaf: #1C2F3D;
    --roof: #3D2E3D;
    --stone: #1B2442;
    --steel: #2B3758;
    --gold: #F2CB72;
    --rain: #6E86B4;
    --bolt: #FFE08A;
}

* { box-sizing: border-box; }

html {
    background: var(--paper);
    -webkit-text-size-adjust: 100%;
    overscroll-behavior-x: none;
    /* The browser keeps vertical swipes and pinch-zoom; sideways swipes are the page's, to travel. */
    touch-action: pan-y pinch-zoom;
}

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--sans);
    min-height: 100vh;
}

/* Paper grain and a soft plate-mark vignette (a div at the end of the body). Static; never repaints. */
.grain {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 10;
    background:
        radial-gradient(ellipse at 50% 45%, transparent 55%, rgba(120, 100, 60, 0.13) 100%),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .45 0 0 0 0 .38 0 0 0 0 .25 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23n)'/%3E%3C/svg%3E");
    opacity: .28;
}

.stage {
    position: fixed;
    inset: 0;
    overflow: hidden;
    /* A clip box is not a scroll container, so focusing something off to the side cannot slide the stage. */
    overflow: clip;
}

.track {
    position: absolute;
    left: 0;
    bottom: var(--margin, 4rem);
    width: max(100vw, calc(100vh * 5300 / 1300));
    aspect-ratio: 5300 / 1300;
    will-change: transform;
}

/* ---- The drawing: two static copies. The night one sits on top,
   revealed by a mask that follows the sun. ---- */
.world {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    opacity: 0;
    transition: opacity .9s ease;
}

.is-ready .world { opacity: 1; }
.world.night { pointer-events: none; }

.world text {
    fill: var(--ink);
    paint-order: stroke;
    stroke: var(--paper);
    stroke-width: 5px;
    stroke-linejoin: round;
}

.world .lbl { font-family: var(--caps); font-size: 21px; letter-spacing: .14em; opacity: .78; }
.world .lbl-sm, .sp .lbl-sm { font-family: var(--caps); font-size: 14px; letter-spacing: .12em; opacity: .8; }
.world .lbl-it { font-family: var(--serif); font-style: italic; font-size: 16px; opacity: .85; }
.world .credits { font-size: 11px; letter-spacing: .08em; opacity: .6; }
.world .tower, .world .sign { font-family: var(--sans); font-size: 7.5px; letter-spacing: .12em; stroke-width: 0; }
.world .star-name { font-family: var(--serif); font-style: italic; font-size: 11px; opacity: .6; stroke-width: 0; }

/* Sunrise and sunset, warming the horizon wherever the sun is low. (The lit-window sprites are .sp.glow.) */
#glow {
    position: absolute;
    left: 0;
    right: 0;
    top: 30%;
    height: 45%;
    pointer-events: none;
    background: linear-gradient(to bottom, rgba(236, 160, 150, 0) 0%, rgba(236, 160, 150, .18) 40%, rgba(244, 170, 110, .36) 76%, rgba(244, 170, 110, 0) 94%);
}

/* ---- Sprites: everything that moves, each on its own compositor layer ---- */
.sp {
    position: absolute;
    pointer-events: none;
}

.sp.clip { overflow: hidden; }

.sp > svg {
    display: block;
    width: 100%;
    height: 100%;
    overflow: visible;
    will-change: transform;
}

/* Sprites that never move or repaint on their own stay in the track's layer: no GPU memory of their own. */
.sp.glow > svg, .sp.bolt > svg, .sp.delorean > svg, .sp[data-sp^="sun-disc"] > svg, .sp[data-sp^="moon"] > svg,
.sp.wx:not(.on) > svg, .sp.bats:not(.on) > svg { will-change: auto; }

.sp text { fill: var(--ink); paint-order: stroke; stroke: var(--paper); stroke-width: 5px; stroke-linejoin: round; }

.shimmer > svg { animation: shimmer var(--dur, 6s) ease-in-out infinite alternate; }
@keyframes shimmer { to { transform: translateX(var(--dx, 1.4%)); } }

.drift-a > svg { animation: drift var(--dur, 90s) ease-in-out infinite alternate; }
.drift-b > svg { animation: drift var(--dur, 120s) ease-in-out infinite alternate-reverse; }
@keyframes drift { from { transform: translateX(-10%); } to { transform: translateX(10%); } }

.cloud { transition: opacity 3s ease; }
.delorean { z-index: 2; }

.spin > svg { animation: spin var(--dur, 40s) linear infinite; transform-origin: 50% 50%; }
@keyframes spin { to { transform: rotate(360deg); } }

.boat > svg { animation: boat var(--dur, 70s) linear infinite; }
@keyframes boat { 0% { transform: translateX(0); } 45% { transform: translateX(var(--dx)); } 50% { transform: translateX(var(--dx)); } 95% { transform: translateX(0); } }

.train > svg { animation: train var(--dur, 60s) linear infinite; }
@keyframes train { to { transform: translateX(var(--dx)); } }

.lamps > svg { animation: lamp 4s ease-in-out infinite alternate; }
@keyframes lamp { from { opacity: .55; } to { opacity: 1; } }

/* The TBM bores east, revealing the lined tunnel behind it; at the end of its run it fades and the
   rock it cut dissolves back in, and it starts over. */
.tbm-run { --cover-rock: var(--rock); --cover-ink: var(--ink); }   /* until the page mixes them (world.js) */
.tbm-run > svg { animation: tbmrun var(--cycle, 150s) linear infinite; }
@keyframes tbmrun { 0% { transform: translateX(0); opacity: 0; } 4% { opacity: 1; } 92% { transform: translateX(var(--dx)); opacity: 1; } 96%, 100% { transform: translateX(var(--dx)); opacity: 0; } }
.tbm-run .belt { animation: dash 1.4s linear infinite; }
.tbm-run .teeth { animation: dash 1s linear infinite reverse; }
@keyframes dash { to { stroke-dashoffset: 14; } }
.tbm-run .dust { animation: dust 3.6s ease-out infinite; transform-box: fill-box; }
@keyframes dust { from { transform: translate(0, 0); opacity: .9; } to { transform: translate(14px, 6px); opacity: 0; } }

/* Weather layers run only while showing. */
.wx { transition: opacity 3s ease; }
.rain.on > svg { animation: fall .5s linear infinite; }
@keyframes fall { to { transform: translateY(4%); } }
.snow.on > svg { animation: flake 7s linear infinite; }
@keyframes flake { to { transform: translateY(5.3333%); } }
.fog.on > svg { animation: fogdrift 50s ease-in-out infinite alternate; }
@keyframes fogdrift { from { transform: translateX(-1.5%); } to { transform: translateX(1.5%); } }

.bats { transition: opacity 4s ease; }
.bats.on > svg { animation: bats 14s linear infinite; }
@keyframes bats { from { transform: translate(10%, 40%); } to { transform: translate(-30%, -40%); } }

/* Starbase: one 300 s timeline shared by four sprites. */
.rocket > svg, .rocket .plume, .rocket .plume-s {
    animation-duration: var(--cycle, 300s);
    animation-timing-function: linear;
    animation-iteration-count: infinite;
    animation-delay: var(--phase, -190s);
}
/* Held on the pad (in the still stretch of the cycle) until a visitor reaches Starbase; world.js then lets it fly. */
.rocket.hold, .rocket.hold > svg, .rocket.hold .plume, .rocket.hold .plume-s { animation-play-state: paused; }
.stack > svg { animation-name: stack; }
/* Lift-off accelerates; the returning booster brakes hard and settles into the arms. */
@keyframes stack { 0%, 42% { transform: translateY(0); } 44% { transform: translateY(-3%); } 46% { transform: translateY(-40%); } 48% { transform: translateY(-260%); } 50%, 100% { transform: translateY(-900%); } }
/* The plume grows as the rocket clears the mount, so it never cuts into the ground. Its box runs
   from the top of the glow (−32) to its foot (152); the nozzle sits 17.4 % down. */
.stack .plume { animation-name: plume; transform-box: fill-box; transform-origin: 50% 17.4%; }
@keyframes plume { 0%, 41.2% { opacity: 0; transform: scaleY(.2); } 42% { opacity: 1; transform: scaleY(.2); } 44% { transform: scaleY(.3); } 46.5%, 50% { opacity: 1; transform: scaleY(1); } 50.5%, 100% { opacity: 0; transform: scaleY(1); } }
.stack { animation: stackvis var(--cycle, 300s) linear infinite; animation-delay: var(--phase, -190s); }
@keyframes stackvis { 0% { opacity: 0; } 1.5%, 100% { opacity: 1; } }
.back > svg { animation-name: back; animation-timing-function: linear; }
@keyframes back { 0%, 78% { transform: translateY(-900%); } 81% { transform: translateY(-260%); } 83.5% { transform: translateY(-40%); } 85.4% { transform: translateY(-4%); } 86.4%, 100% { transform: translateY(0); } }
.back { animation: backvis var(--cycle, 300s) linear infinite; animation-delay: var(--phase, -190s); }
@keyframes backvis { 0%, 1.5% { opacity: 1; } 2%, 77.9% { opacity: 0; } 78%, 100% { opacity: 1; } }
.back .plume-s { animation-name: plumes; }
@keyframes plumes { 0%, 77.9% { opacity: 0; } 78.5%, 85.8% { opacity: 1; } 86.5%, 100% { opacity: 0; } }
.arms > svg { animation-name: arms; }
@keyframes arms { 0%, 40% { transform: translateY(0); } 42%, 84% { transform: translateY(-14%); } 86.4% { transform: translateY(-14%); } 88% { transform: translateY(4%); } 91%, 100% { transform: translateY(0); } }
.rocket.cloud { animation: padcloud var(--cycle, 300s) linear infinite; animation-delay: var(--phase, -190s); }
@keyframes padcloud { 0%, 41% { opacity: 0; } 42% { opacity: 1; } 47%, 100% { opacity: 0; } }
.rocket.cloud > svg { animation-name: padgrow; transform-origin: 50% 100%; }
@keyframes padgrow { 0%, 41% { transform: scale(.4); } 47%, 100% { transform: scale(1.6); } }

/* Flights, created by script. Real aircraft cover about 8 px a minute at this scale, so each one also
   rides a slow swell of its own (compositor only; its phase comes from the aircraft's hex id). */
.fl {
    position: absolute;
    width: 2.2%;
    pointer-events: auto;
    cursor: default;
    opacity: 0;
    transition: opacity 1.2s ease;
    animation: fly var(--bob, 9s) ease-in-out var(--bob-at, 0s) infinite alternate;
}
@keyframes fly { from { transform: translateY(-.16vh); } to { transform: translateY(.16vh); } }

/* A target big enough to hover or tap, though the drawing is fine. */
.fl::before { content: ""; position: absolute; inset: -10px -4px -14px; }
.fl:focus { outline: none; }
.fl:focus-visible { outline: 1px solid var(--ink); outline-offset: 6px; }

.fl.on { opacity: 1; }
/* Passing under the fixed name plate, an aircraft fades as if it flew behind it. */
.fl.on.under { opacity: .1; }
.fl svg { display: block; width: 100%; overflow: visible; }
.fl.east svg { transform: scaleX(-1); }

.fl .fn {
    position: absolute;
    left: 78.4%;
    top: 100%;
    transform: translateX(-50%);
    margin-top: .15em;
    font-family: var(--caps);
    font-size: .65rem;
    line-height: 1.2;
    letter-spacing: .1em;
    white-space: nowrap;
    color: var(--ink-soft);
    /* A soft halo of paper round the number, as round the drawing's own labels, so it reads over cloud. */
    text-shadow: 0 0 3px var(--halo, var(--paper)), 0 0 6px var(--halo, var(--paper)), 0 0 9px var(--halo, var(--paper));
    opacity: .85;
    transition: opacity .3s ease;
}

.fl.east .fn { left: 21.6%; }

.fl:hover .fn, .fl.is-open .fn, .fl:focus-visible .fn { opacity: 1; color: var(--ink); }

.tip {
    position: fixed;
    z-index: 7;
    max-width: 19rem;
    padding: .6rem .8rem .65rem;
    border: 1px solid var(--ink-faint);
    background: color-mix(in srgb, var(--halo, var(--paper)) 94%, transparent);
    color: var(--ink);
    font-family: var(--serif);
    font-size: .9rem;
    line-height: 1.35;
    pointer-events: none;
    opacity: 0;
    transition: opacity .25s ease;
}

.tip.on { opacity: 1; }
.tip b { display: block; font-family: var(--caps); font-weight: 400; letter-spacing: .12em; font-size: .85rem; margin-bottom: .15rem; }
.tip small { display: block; color: var(--ink-soft); font-size: .8rem; }
.tip .note { margin-top: .3rem; font-style: italic; }

/* The Achensee: a small simulated surface, drawn by script. */
.lake {
    position: absolute;
    pointer-events: none;
    will-change: transform;
}

/* ---- Overlays take the light of the patch of world behind them ---- */
.chapter, .plate, .langs, .hint, .route, .route li, .sp, .fl, .tip {
    --ink-soft: color-mix(in srgb, var(--ink) 81%, transparent);
    --ink-faint: color-mix(in srgb, var(--ink) 40%, transparent);
    color: var(--ink);
}

.chapter {
    position: absolute;
    top: 31.5%;
    width: min(30vh, 300px);
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 1.4s ease, transform 1.4s cubic-bezier(.22, 1, .36, 1);
}

.is-ready .chapter { opacity: 1; transform: none; }

/* Overlay text takes the ink of the nearer pole (day or night) and a halo of that pole's paper, so it
   stays legible through twilight while the paper behind it passes through grey. */
.chapter > *, .plate .text > *, .langs button, .langs a, .hint, .route button {
    text-shadow: 0 0 3px var(--halo, var(--paper)), 0 0 10px var(--halo, var(--paper)), 0 0 22px var(--halo, var(--paper));
}

.chapter::before { content: ""; display: block; width: 2.25rem; height: 1px; margin-bottom: .8rem; background: var(--ink-faint); }
.chapter .no { margin: 0; font-family: var(--caps); font-size: .8125rem; letter-spacing: .2em; color: var(--ink-soft); }
.chapter h2 { margin: .3rem 0 .55rem; font-family: var(--serif); font-weight: 400; font-size: clamp(1.5rem, 3.4vh, 2.1rem); line-height: 1.05; }
.chapter .quote, .chapter blockquote { margin: 0; }
.chapter .quote p {
    margin: 0;
    font-family: var(--serif);
    font-style: italic;
    font-size: clamp(1rem, 2vh, 1.15rem);
    line-height: 1.42;
    quotes: "“" "”";
}
/* The opening mark hangs in the margin, so the quote's left edge stays aligned with the title. */
.chapter .quote p::before { content: open-quote; margin-left: -.42em; }
.chapter .quote p::after { content: close-quote; }
:lang(de) .chapter .quote p { quotes: "„" "“"; }
:lang(fr) .chapter .quote p { quotes: "«\00A0" "\00A0»"; }
:lang(fr) .chapter .quote p::before { margin-left: -.9em; }
.chapter .quote figcaption {
    margin-top: .45rem;
    font-family: var(--caps);
    font-size: .75rem;
    letter-spacing: .06em;
    color: var(--ink-soft);
}
.chapter .quote figcaption::before { content: "— "; }
.chapter .facts {
    margin: .75rem 0 0;
    font-size: .625rem;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--ink-soft);
}
.chapter .live {
    /* Under the kicker, so the weather can never run down into the drawing's own labels. */
    margin: .2rem 0 0;
    font-family: var(--caps);
    font-size: .75rem;
    letter-spacing: .08em;
    white-space: nowrap;
    color: var(--ink-soft);
    min-height: 1.2em;
}

/* ---- Fixed header: cameo, name and socials ---- */
.plate {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: clamp(.9rem, 2vw, 1.4rem);
    padding: calc(var(--gutter) + env(safe-area-inset-top)) var(--gutter) 0 calc(var(--gutter) + env(safe-area-inset-left));
}

.cameo {
    position: relative;
    flex: none;
    width: clamp(3.6rem, 9vw, 5.4rem);
    height: clamp(3.6rem, 9vw, 5.4rem);
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0 0 0 1px var(--ink-faint), 0 0 0 5px var(--paper), 0 0 0 6px var(--ink-faint);
    background: var(--paper);
}

.cameo img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity .6s ease;
}

.cameo .night-img { opacity: var(--night, 0); }
.cameo .photo { opacity: 0; }
.cameo:hover .photo, .cameo:focus-visible .photo { opacity: 1; }

h1 { margin: 0; font-family: var(--serif); font-weight: 400; font-size: clamp(1.8rem, 5vw, 3rem); line-height: 1; letter-spacing: .005em; }
.line { margin: .5rem 0 0; font-family: var(--serif); font-style: italic; font-size: clamp(.95rem, 2vw, 1.15rem); color: var(--ink-soft); }
.links { margin-top: .95rem; display: flex; gap: clamp(1.1rem, 3vw, 2rem);     flex-wrap: wrap;
    row-gap: .15rem;
}

a { color: inherit; }

.links a {
    display: inline-block;
    font-size: .6875rem;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--ink);
    text-decoration: none;
    padding: .35rem 0 3px;
    border-bottom: 1px solid var(--ink-faint);
    transition: border-color .3s ease;
    white-space: nowrap;
}

.links a:hover { border-bottom-color: var(--ink); }
a:focus-visible, button:focus-visible { outline: 1px solid var(--ink); outline-offset: 5px; }

.langs {
    position: fixed;
    top: calc(var(--gutter) + env(safe-area-inset-top));
    right: calc(var(--gutter) + env(safe-area-inset-right));
    z-index: 6;
    display: flex;
    gap: .25rem;
    align-items: center;
}

.langs button {
    padding: .3rem .45rem;
    border: 0;
    background: none;
    font-family: var(--sans);
    font-size: .6875rem;
    letter-spacing: .16em;
    color: var(--ink-soft);
    cursor: pointer;
    border-bottom: 1px solid transparent;
}

.langs button[aria-pressed="true"] { color: var(--ink); border-bottom-color: var(--ink); }
.lang-set { display: flex; gap: .25rem; }
/* The way back to the rest of the site, as quiet as the language switch beside it. */
.langs .site { display: flex; align-items: center; gap: .25rem; }
.langs .site::after { content: ""; width: 1px; height: .8rem; margin: 0 .4rem 0 .3rem; background: var(--ink-faint); }
.langs .site a {
    padding: .3rem .45rem;
    font-family: var(--sans);
    font-size: .6875rem;
    letter-spacing: .16em;
    color: var(--ink-soft);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color .3s ease, color .3s ease;
}
.langs .site a:hover { color: var(--ink); border-bottom-color: var(--ink-faint); }

/* ---- Route: where you are on the journey ---- */
.route {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 5;
    padding: .9rem var(--gutter) calc(1rem + env(safe-area-inset-bottom));
    pointer-events: none;
    background: var(--paper);
}

.route ol {
    position: relative;
    display: flex;
    justify-content: space-between;
    margin: 0 auto;
    padding: .9rem 0 0;
    max-width: 30rem;
    list-style: none;
    pointer-events: auto;
    background: linear-gradient(var(--ink-faint), var(--ink-faint)) 0 .45rem / 100% 1px no-repeat;
}

.route button {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .1rem;
    padding: .25rem 0;
    border: 0;
    background: none;
    font-family: var(--caps);
    font-size: .8125rem;
    letter-spacing: .14em;
    color: var(--ink-soft);
    cursor: pointer;
}

.route button small { font-family: var(--sans); font-size: .625rem; letter-spacing: .08em; color: var(--ink-soft); }
.route li:first-child button { align-items: flex-start; }
.route li:last-of-type button { align-items: flex-end; }

.route button::before {
    content: "";
    position: absolute;
    top: -.65rem;
    left: 50%;
    width: 5px;
    height: 5px;
    margin-left: -2.5px;
    border-radius: 50%;
    background: var(--paper);
    box-shadow: 0 0 0 1px var(--ink-soft);
}

.route li:first-child button::before { left: 0; margin-left: 0; }
.route li:last-of-type button::before { left: auto; right: 0; margin-left: 0; }
.route button.is-here { color: var(--ink); }

.route .you {
    position: absolute;
    top: calc(.45rem - 4.5px);
    left: 0;
    width: 9px;
    height: 9px;
    margin-left: -4.5px;
    border-radius: 50%;
    background: var(--ink);
    pointer-events: none;
    will-change: transform;
}

.hint {
    position: fixed;
    right: var(--gutter);
    bottom: calc(1.1rem + env(safe-area-inset-bottom));
    z-index: 5;
    margin: 0;
    font-family: var(--serif);
    font-style: italic;
    font-size: 1rem;
    color: var(--ink-soft);
    transition: opacity .8s ease;
}

.hint.is-gone { opacity: 0; }
.hint span { display: inline-block; animation: nudge 2.4s ease-in-out infinite; }
@keyframes nudge { 50% { transform: translateX(5px); } }

@media (max-width: 560px) {
    .plate { right: 0; }
    /* The three links fit on one line in every language. */
    .links { column-gap: .8rem; }
    .links a { letter-spacing: .07em; }
    .hint { bottom: calc(var(--margin, 4rem) + .9rem); }
    .langs { top: auto; bottom: calc(var(--margin, 4rem) + .75rem); right: auto; left: var(--gutter); }
    /* the way home sits above the language switch, clear of the scroll hint on the right */
    .langs { flex-direction: column; align-items: flex-start; gap: 0; }
    .langs .site::after { display: none; }
    .route button { font-size: .6875rem; letter-spacing: .06em; }
    /* Higher and a little tighter, so the text clears the ridges and the drawing's own labels. */
    .chapter { top: 24%; width: min(34vh, 260px); }
    .chapter::before { margin-bottom: .6rem; }
    .chapter h2 { margin-bottom: .45rem; }
    .chapter .quote p { font-size: .95rem; line-height: 1.38; }
    .chapter .live { margin-top: .2rem; font-size: .72rem; }
    /* On a phone the text runs over ridges and linework; a soft wash of the paper behind it keeps it readable. */
    .chapter { isolation: isolate; }
    .chapter::after {
        content: ""; position: absolute; inset: -1.6rem -1.8rem -1.8rem -2rem; z-index: -1; pointer-events: none;
        background: var(--halo, var(--paper)); opacity: .9;
        --fade: linear-gradient(to right, transparent, #000 1.6rem, #000 calc(100% - 1.6rem), transparent);
        -webkit-mask: var(--fade), linear-gradient(to bottom, transparent, #000 1.6rem, #000 calc(100% - 1.6rem), transparent);
        -webkit-mask-composite: source-in;
        mask: var(--fade), linear-gradient(to bottom, transparent, #000 1.6rem, #000 calc(100% - 1.6rem), transparent);
        mask-composite: intersect;
    }
}

/* Fingers, not cursors: every control at least about 44 px tall, without changing how it looks. */
@media (pointer: coarse) {
    .links a { padding: .75rem 0 .45rem; margin-top: -.4rem; }
    .langs button { min-width: 2.75rem; min-height: 2.75rem; }
    .langs .site a { min-height: 2.75rem; display: inline-flex; align-items: center; }
    .route button { padding: .55rem .2rem; }
}

/* Phones on their side: a short screen, so the name plate and captions get compact. */
@media (max-height: 520px) and (orientation: landscape) {
    .plate { gap: .8rem; padding-top: calc(.8rem + env(safe-area-inset-top)); }
    .cameo { width: 2.8rem; height: 2.8rem; }
    h1 { font-size: 1.45rem; }
    .line { margin-top: .25rem; font-size: .85rem; }
    .links { margin-top: .35rem; }
    .langs { top: calc(.8rem + env(safe-area-inset-top)); }
    .chapter { top: 22%; width: min(52vh, 300px); }
    .chapter h2 { font-size: 1.2rem; margin: .15rem 0 .3rem; }
    .chapter .quote p { font-size: .82rem; line-height: 1.32; }
    .chapter .facts { margin-top: .4rem; }
    .chapter::before { margin-bottom: .4rem; }
    .route { padding-top: .4rem; padding-bottom: calc(.45rem + env(safe-area-inset-bottom)); }
    .route button small { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .sp > svg, .sp *, .hint span, .cloud, .wx, .bats, .rocket, .fl { animation: none !important; transition: none !important; }
}

/* An overlay's twin, shown only while the day/night seam passes under the overlay: each copy is
   clipped to its own side and lit by it (see themeViewport in world.js). */
.seam-twin { visibility: hidden; pointer-events: none; }
.seam-twin.on { visibility: visible; }
/* A route label's twin lies exactly over it (world.js sets its box); the stop's dot is the original's. */
.route li.seam-twin { position: absolute; margin: 0; }
.route li.seam-twin button::before { display: none; }
