/* ==========================================================================
   history.css — the History page (history.html, history.js)
   Load AFTER /css/site.css (uses its fonts and travel plaques).
   One river of time runs down the page: centred on wide screens with the events
   either side of it, along the left edge on phones. Each entry carries its era's
   colour (--era); a world's view retints the river with that world's own eras and
   folds what it never lived into notches.
   ========================================================================== */

.history-page {
    --deep: #06050f;
    --deep2: #0d0b1f;
    --ink: #e4e0f2;
    --ink-soft: #a49dbd;
    --accent: #ffd24a;          /* the view's colour: gold for the universe */
    --accent2: #b48cff;

    /* the eras' colours */
    --tone-ancients: #9fb0ff;   /* the four Creators' energies, still as one */
    --tone-death: #c9b8ff;      /* Ae'lith, pale violet */
    --tone-axon: #ffd24a;       /* the perfect clock */
    --tone-flux: #7cc8ff;
    --tone-abundance: #6fe8b4;  /* the wild energy loose in every world */
    --tone-after: #7a5cc8;      /* drained */
    --tone-eq-before: #5fd65f;  /* Equespir, as on the Planes page */
    --tone-eq-portals: #8fe7ff;
    --tone-eq-chaos: #c86bff;

    --rx: 50%;                  /* where the river runs */
    --gap: 34px;                /* from the river to a card */

    /* site.css locks the gateway to one screen; this page scrolls */
    height: auto;
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
    color: var(--ink);
    background:
        radial-gradient(ellipse 80% 50% at 50% 0%, rgba(180, 140, 255, 0.10), transparent 70%),
        radial-gradient(ellipse 70% 40% at 50% 100%, rgba(122, 92, 200, 0.12), transparent 70%),
        var(--deep);
    background-attachment: fixed;
}
html:has(.history-page) { height: auto; overflow-y: auto; }
.history-page[data-world="equespir"] { --accent: #5fd65f; --accent2: #8fe7ff; }

/* --- Top bar: the way back, whose history, the quality glyph --- */
.page-links {
    position: fixed; top: 0; left: 0; right: 0;
    z-index: 6;
    display: flex; align-items: center; gap: 18px;
    padding: 12px 16px 22px;
    font-size: 0.8rem;
    background: linear-gradient(rgba(6, 5, 15, 0.94), rgba(6, 5, 15, 0));
}
.history-page { --travel-accent: var(--accent); --travel-ink: var(--ink); --travel-bg: var(--deep); --travel-bg2: #1a1533; }
.page-foot a, .world-note a, .body .text a { color: var(--accent); text-decoration: none; }
.page-foot a:hover, .world-note a:hover, .body .text a:hover { text-decoration: underline; }
.history-page a:focus-visible,
.history-page button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 4px;
}

.world-filter {
    margin-left: auto;
    display: flex; gap: 2px;
    padding: 3px;
    border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
    border-radius: 999px;
    background: rgba(13, 11, 31, 0.85);
    box-shadow: 0 0 14px color-mix(in srgb, var(--accent) 12%, transparent);
}
.world-choice {
    all: unset;
    pointer-events: auto;
    cursor: pointer;
    padding: 5px 13px;
    border-radius: 999px;
    font-family: var(--font-fantasy);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-soft);
    transition: color 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
}
.world-choice:hover { color: var(--ink); }
.world-choice[aria-checked="true"] {
    color: var(--deep);
    background: var(--accent);
    box-shadow: 0 0 12px color-mix(in srgb, var(--accent) 55%, transparent);
}
.world-choice.soon { cursor: not-allowed; opacity: 0.38; }
.world-choice.soon:hover { color: var(--ink-soft); }

/* --- Gauge: the eras of the current view --- */
.depth-gauge {
    position: fixed; left: 22px; top: 50%;
    transform: translateY(-50%);
    z-index: 4;
    display: flex; flex-direction: column; align-items: flex-start;
    gap: 8px;
    max-width: 170px;
    font-size: 0.7rem;
    color: var(--ink-soft);
}
.gauge-end { font-family: var(--font-fantasy); color: var(--accent); opacity: 0.8; }
.gauge-stops {
    list-style: none;
    margin: 0; padding: 0 0 0 6px;
    border-left: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
    display: flex; flex-direction: column; gap: 12px;
}
.gauge-stops a {
    position: relative;
    display: block;
    padding-left: 14px;
    color: var(--ink-soft);
    text-decoration: none;
    transition: color 0.3s ease;
}
.gauge-stops a::before {
    content: '';
    position: absolute; left: -10px; top: 50%;
    width: 7px; height: 7px;
    border-radius: 50%;
    transform: translateY(-50%);
    background: var(--deep2);
    border: 1px solid color-mix(in srgb, var(--accent) 50%, transparent);
    transition: background 0.3s ease, box-shadow 0.3s ease;
}
.gauge-stops a.here { color: var(--ink); }
.gauge-stops a.here::before { background: var(--accent); box-shadow: 0 0 10px var(--accent); }

/* --- Page body --- */
main,
.page-foot {
    position: relative;
    z-index: 2;
    width: min(1040px, calc(100% - 48px));
    margin: 0 auto;
}
.hero {
    min-height: 100vh;
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    text-align: center;
}
.plane-kind { margin: 0; font-style: italic; color: var(--ink-soft); font-size: 1.05rem; }
.hero h1 {
    margin: 0.1em 0 0.25em;
    font-family: var(--font-fantasy);
    font-weight: 700;
    font-size: clamp(3.2rem, 11vw, 7.5rem);
    line-height: 0.95;
    letter-spacing: 0.02em;
    color: transparent;
    background: linear-gradient(100deg, #fff4d6 0%, var(--accent) 30%, var(--accent2) 60%, #fff4d6 85%) 0 0 / 250% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    animation: history-flow 14s ease-in-out infinite alternate;
    filter: drop-shadow(0 0 18px color-mix(in srgb, var(--accent) 35%, transparent));
}
@keyframes history-flow { to { background-position: 100% 0; } }
.hero-line {
    max-width: 34ch;
    margin: 0 0 1rem;
    font-size: clamp(1.15rem, 2.4vw, 1.45rem);
    line-height: 1.5;
}
.world-note {
    max-width: 44ch;
    min-height: 1.6em;
    margin: 0 0 2rem;
    color: var(--ink-soft);
    font-style: italic;
}
.set-out {
    font-family: var(--font-fantasy);
    font-size: 0.95rem;
    color: var(--ink);
    text-decoration: none;
    padding-bottom: 4px;
    border-bottom: 1px solid color-mix(in srgb, var(--accent) 50%, transparent);
}
.set-out:hover { border-bottom-color: var(--accent); }
.no-script { text-align: center; color: var(--ink-soft); }

/* ==========================================================================
   The river
   ========================================================================== */
.river {
    list-style: none;
    margin: 0; padding: 6vh 0 10vh;
    position: relative;
}
.entry {
    --era: var(--era-u, var(--tone-ancients));
    position: relative;
    padding: 22px 0;
    scroll-margin-top: 80px;
}
.history-page[data-world="equespir"] .entry { --era: var(--era-w, var(--tone-eq-before)); }

/* each entry draws its stretch of the river, in its era's colour */
.entry::before {
    content: '';
    position: absolute; top: 0; bottom: 0; left: var(--rx);
    width: 3px;
    transform: translateX(-50%);
    background: var(--era);
    box-shadow: 0 0 10px var(--era), 0 0 26px color-mix(in srgb, var(--era) 35%, transparent);
    opacity: 0.75;
    transition: background 0.6s ease, box-shadow 0.6s ease;
}
.river > .entry:first-child::before { top: -6vh; background: linear-gradient(transparent, var(--era) 6vh); }
.river > .entry:last-child::before { bottom: 50%; }

.body {
    position: relative;
    margin: 0;
}
.when { margin: 0 0 0.35rem; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.year {
    font-family: var(--font-fantasy);
    font-size: 0.85rem;
    letter-spacing: 0.12em;
    color: var(--era);
}
.aside { font-size: 0.82rem; color: var(--ink-soft); }
.title { margin: 0 0 0.5rem; font-family: var(--font-fantasy); font-weight: 400; }
.text { margin: 0; font-size: 1.06rem; line-height: 1.7; }

/* --- Eras: a band across the river --- */
.entry.era .body,
.entry.mark .body {
    text-align: center;
    max-width: 640px;
    margin: 0 auto;
    padding: 1.4rem 1.6rem 1.3rem;
    background: radial-gradient(ellipse at center, rgba(6, 5, 15, 0.94) 40%, rgba(6, 5, 15, 0.6) 100%);
    border-top: 1px solid color-mix(in srgb, var(--era) 55%, transparent);
    border-bottom: 1px solid color-mix(in srgb, var(--era) 55%, transparent);
}
.entry.era .when, .entry.mark .when { justify-content: center; }
.entry.era .title,
.entry.mark .title {
    font-size: clamp(1.7rem, 4.2vw, 2.4rem);
    color: var(--ink);
    text-shadow: 0 0 18px color-mix(in srgb, var(--era) 50%, transparent);
}
.entry.era .text, .entry.mark .text { color: var(--ink-soft); font-style: italic; }
/* each era gets room to be seen: the sky behind it needs a screen of its own */
.entry.era { padding: 9vh 0 5vh; }
.entry.era + .entry.era,
.entry.era:has(+ .entry.era) { padding: 28vh 0 26vh; }
.entry.mark { padding: 6vh 0 4vh; }

/* --- Each era its own voice: the band's frame and the way its name is written ---
   (the sky behind, history-fx.js, paints the same eras; these hold without it too) */
.entry.era .title, .entry.mark:not(.minor) .title { position: relative; }
/* Ancients: the four energies, still one name */
.entry.era.tone-ancients .title {
    color: transparent;
    background: linear-gradient(90deg, #5a8dff, #ff5b4a 34%, #5fe08a 66%, #c9ccd6) 0 0 / 100% 100%;
    -webkit-background-clip: text; background-clip: text;
    text-shadow: none;
    filter: drop-shadow(0 0 14px rgba(160, 170, 255, 0.35));
}
.entry.era.tone-ancients .body {
    border-image: linear-gradient(90deg, transparent, #5a8dff 15%, #ff5b4a 38%, #5fe08a 62%, #c9ccd6 85%, transparent) 1;
}
/* Death: pale, wide, quiet */
.entry.era.tone-death .title {
    font-size: clamp(1.5rem, 3.6vw, 2.1rem);
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: #ece6ff;
    text-shadow: 0 0 22px rgba(220, 205, 255, 0.55);
}
.entry.era.tone-death .body { border-image: linear-gradient(90deg, transparent, rgba(220, 205, 255, 0.6), transparent) 1; }
/* Axon Core: the clock's ticks along its frame, gold and exact */
.entry.era.tone-axon .title {
    color: #ffe08a;
    letter-spacing: 0.12em;
    font-variant: small-caps;
    text-shadow: 0 0 16px rgba(255, 200, 80, 0.55);
}
.entry.era.tone-axon .body {
    border-width: 4px 0;
    border-style: solid;
    border-image: repeating-linear-gradient(90deg, #ffd24a 0 2px, transparent 2px 11px) 4;
}
.entry.era.tone-axon .year { color: #ffe08a; }
/* Flux: colours that will not settle */
.entry.era.tone-flux .title {
    color: transparent;
    background: linear-gradient(90deg, #7cc8ff, #c58bff, #7dffcf, #ffd27a, #7cc8ff) 0 0 / 300% 100%;
    -webkit-background-clip: text; background-clip: text;
    animation: era-flux 9s linear infinite;
    text-shadow: none;
    filter: drop-shadow(0 0 12px rgba(124, 200, 255, 0.4));
}
@keyframes era-flux { to { background-position: 300% 0; } }
.entry.era.tone-flux .body { border-image: linear-gradient(90deg, transparent, #7cc8ff, #c58bff, #7dffcf, transparent) 1; }
/* Abundance: wild energy, lush and bright */
.entry.era.tone-abundance .title {
    color: transparent;
    background: linear-gradient(100deg, #6fe8b4, #fff1b0 45%, #ffcf5a 70%, #6fe8b4);
    -webkit-background-clip: text; background-clip: text;
    text-shadow: none;
    filter: drop-shadow(0 0 18px rgba(111, 232, 180, 0.55));
    font-size: clamp(1.9rem, 4.8vw, 2.8rem);
}
.entry.era.tone-abundance .body { border-image: linear-gradient(90deg, transparent, #6fe8b4, #ffcf5a, #6fe8b4, transparent) 1; }
/* Equespir before the portals: green, like its bubble on the Planes page */
.entry.mark.tone-eq-before:not(.minor) .title { color: #c8ffb8; text-shadow: 0 0 16px rgba(95, 214, 95, 0.6); font-style: italic; }
/* the Portal Era: a portal ring before its name */
.entry.mark.tone-eq-portals:not(.minor) .title { color: #d4f7ff; text-shadow: 0 0 16px rgba(143, 231, 255, 0.65); }
.entry.mark.tone-eq-portals:not(.minor) .title::before {
    content: '';
    display: inline-block;
    width: 0.55em; height: 0.85em;
    margin-right: 0.35em;
    vertical-align: -0.05em;
    border: 2px solid #8fe7ff;
    border-radius: 50%;
    box-shadow: 0 0 10px #8fe7ff, inset 0 0 8px rgba(143, 231, 255, 0.6);
}
/* the Era of Chaos: violet, split, never quite still */
.entry.era.tone-eq-chaos .title {
    color: #eadcff;
    text-shadow: 2px -1px 0 rgba(255, 60, 200, 0.45), -2px 1px 0 rgba(80, 200, 255, 0.35), 0 0 18px rgba(200, 107, 255, 0.6);
    animation: era-chaos 5s steps(1) infinite;
}
@keyframes era-chaos {
    0%, 86%, 100% { transform: none; }
    88% { transform: translateX(3px) skewX(-6deg); }
    92% { transform: translateX(-2px); }
}
.entry.era.tone-eq-chaos .body {
    border-top-style: dashed; border-bottom-style: dashed;
    border-color: rgba(200, 107, 255, 0.6);
}

/* With the sky painting the eras, the bands and cards let more of it through */
.sky-live .entry.era .body,
.sky-live .entry.mark:not(.minor) .body {
    background: radial-gradient(ellipse at center, rgba(6, 5, 15, 0.72) 30%, rgba(6, 5, 15, 0.15) 100%);
}

/* a world's own era, seen from the Universal view: a small label beside the river */
.entry.mark.minor { padding: 10px 0; }
.entry.mark.minor .body {
    max-width: none;
    margin: 0 0 0 calc(var(--rx) + 16px);
    padding: 0;
    text-align: left;
    background: none;
    border: 0;
}
.entry.mark.minor .when { justify-content: flex-start; }
.entry.mark.minor .title { font-size: 0.95rem; letter-spacing: 0.08em; color: var(--era); text-shadow: none; margin: 0; }
.entry.mark.minor .text { display: none; }
.entry.mark.minor::after {
    content: '';
    position: absolute; left: var(--rx); top: 50%;
    width: 12px; height: 1px;
    background: var(--era);
}

/* --- Events: a card on one side, a bead on the river --- */
.entry.event .body,
.entry.today .body {
    padding: 1.1rem 1.3rem 1.2rem;
    border: 1px solid color-mix(in srgb, var(--era) 30%, transparent);
    border-radius: 8px;
    background: linear-gradient(160deg, rgba(20, 16, 44, 0.86), rgba(8, 7, 20, 0.8));
    backdrop-filter: blur(5px);
    box-shadow: 0 0 22px rgba(0, 0, 0, 0.5);
}
.entry.event .title, .entry.today .title { font-size: 1.3rem; color: var(--ink); }
.entry.event.major .title { font-size: 1.5rem; color: color-mix(in srgb, var(--era) 35%, #fff); }
.entry.event::after,
.entry.today::after {
    content: '';
    position: absolute; left: var(--rx); top: 44px;
    width: 11px; height: 11px;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    background: var(--deep);
    border: 2px solid var(--era);
    box-shadow: 0 0 10px var(--era);
}
.entry.event.major::after { width: 15px; height: 15px; background: var(--era); }
/* the link from the bead to the card */
.entry.left .body::before,
.entry.right .body::before {
    content: '';
    position: absolute; top: 21px;
    width: var(--gap); height: 1px;
    background: linear-gradient(90deg, var(--era), transparent);
}
.entry.left .body::before { right: calc(-1 * var(--gap)); transform: scaleX(-1); }
.entry.right .body::before { left: calc(-1 * var(--gap)); }

/* a span (the Cultural Wars): a long shaded stretch beside the river */
.entry.span .body { border-style: dashed; }
.entry.span::after { height: 46px; border-radius: 6px; width: 9px; }

/* the end of the river for now */
.entry.today .body { border-color: color-mix(in srgb, var(--era) 60%, transparent); }
.entry.today::after { width: 17px; height: 17px; background: var(--era); animation: today-beat 3s ease-in-out infinite; }
@keyframes today-beat { 50% { box-shadow: 0 0 22px var(--era), 0 0 44px color-mix(in srgb, var(--era) 40%, transparent); } }

/* --- Event 0: the river breaks --- */
.entry.anchor { padding: 12vh 0 10vh; }
.entry.anchor::before {
    background:
        linear-gradient(transparent 0 30%, rgba(6, 5, 15, 0) 30%),
        repeating-linear-gradient(transparent 0 7px, var(--era) 7px 10px);
    box-shadow: none;
    opacity: 0.5;
}
.entry.anchor::after {
    content: '';
    position: absolute; left: var(--rx); top: 9vh;
    width: 46px; height: 46px;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    border: 2px solid #f4f1ff;
    box-shadow: 0 0 0 5px rgba(6, 5, 15, 0.9), 0 0 0 6px color-mix(in srgb, var(--accent2) 70%, transparent), 0 0 30px var(--accent2);
    background: radial-gradient(circle, #000 0 40%, color-mix(in srgb, var(--accent2) 40%, #000) 70%);
}
.entry.anchor .body {
    max-width: 640px;
    margin: 0 auto;
    text-align: center;
    padding: 1.6rem 1.8rem;
    border: 1px solid color-mix(in srgb, var(--accent2) 55%, transparent);
    border-radius: 10px;
    background: radial-gradient(ellipse at 50% 0%, rgba(40, 24, 80, 0.9), rgba(6, 5, 15, 0.94) 75%);
    backdrop-filter: blur(5px);
    box-shadow: 0 0 40px color-mix(in srgb, var(--accent2) 25%, transparent);
}
.entry.anchor .when { justify-content: center; }
.entry.anchor .year { color: #f4f1ff; }
.entry.anchor .title { font-size: clamp(1.6rem, 4vw, 2.2rem); color: #f4f1ff; text-shadow: 0 0 20px var(--accent2); }
.seen-as { margin-top: 1.1rem; text-align: left; }
.seen-world {
    padding: 0.7rem 0 0.1rem 1rem;
    border-left: 2px solid var(--tone-eq-before);
}
.seen-label { margin: 0 0 0.2rem; font-family: var(--font-fantasy); font-size: 0.8rem; letter-spacing: 0.1em; color: var(--tone-eq-before); }
.seen-text { margin: 0; color: var(--ink-soft); line-height: 1.65; }
.veil {
    margin: 1.1rem 0 0;
    padding-top: 0.9rem;
    border-top: 1px dashed color-mix(in srgb, var(--accent2) 40%, transparent);
    font-style: italic;
    color: var(--ink-soft);
}
.veil-lift {
    all: unset;
    cursor: pointer;
    margin-left: 4px;
    color: var(--accent2);
    border-bottom: 1px solid color-mix(in srgb, var(--accent2) 50%, transparent);
}
.veil-lift:hover { color: #f4f1ff; }

/* --- Living scenes (history-scenes.js, painted by history-fx.js on the sky's canvas) ---
   The window is an empty, see-through box: the scene is drawn behind it. Wide screens:
   on the free side of the river, beside the card. Event 0: under its card. Phones: under
   the card. Without the sky or its scenes (no WebGL), there is no window at all. */
.scene-window { display: none; pointer-events: none; }
.scenes-live .entry.has-scene:not(.folded) .scene-window { display: block; }
.scene-window.scene-broken { display: none !important; }   /* its shader failed on this device */
.scene-window { height: clamp(190px, 30vh, 300px); }
.entry.anchor .scene-window {
    position: relative;
    width: min(640px, 100%);
    height: clamp(220px, 34vh, 330px);
    margin: 28px auto 0;
}

/* --- Folded: what this world never lived, left as a notch on the river --- */
.notch { display: none; }
.entry.folded { padding: 3px 0; }
.entry.folded::after { display: none; }
.entry.folded::before { opacity: 0.3; box-shadow: none; }
.entry.folded .body { display: none; }
.entry.folded .notch {
    all: unset;
    display: flex; align-items: center; gap: 10px;
    position: relative;
    margin-left: var(--rx);
    transform: translateX(-6px);
    cursor: pointer;
    min-height: 22px;
    font-size: 0.78rem;
    color: var(--ink-soft);
}
.notch-dot {
    flex: none;
    width: 9px; height: 9px;
    transform: rotate(45deg);
    background: var(--deep);
    border: 1px solid color-mix(in srgb, var(--era-u, var(--ink-soft)) 70%, transparent);
}
.notch-name { opacity: 0.45; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: min(46vw, 420px); transition: opacity 0.3s ease; }
.entry.folded .notch:hover .notch-name,
.entry.folded .notch:focus-visible .notch-name,
.entry.folded.peek .notch-name { opacity: 0.95; }
.entry.folded.peek .notch-dot { background: var(--era-u, var(--ink-soft)); }
/* peeking: the card opens beside the notch, quieter than the world's own */
.entry.folded.peek { padding: 6px 0 14px; }
.entry.folded.peek .body {
    display: block;
    max-width: 520px;
    margin: 8px 0 0 calc(var(--rx) + 22px);
    padding: 0.9rem 1.1rem;
    text-align: left;
    border: 1px dashed color-mix(in srgb, var(--era-u, var(--ink-soft)) 40%, transparent);
    border-radius: 8px;
    background: rgba(8, 7, 20, 0.9);
    opacity: 0.85;
}
.entry.folded.peek .body .title { font-size: 1.1rem; }
.entry.folded.peek .body::before { display: none; }
.entry.folded.peek .year { color: var(--era-u, var(--ink-soft)); }

/* --- The way back --- */
.page-foot {
    padding: 4vh 0 22vh;
    text-align: center;
    color: var(--ink-soft);
    font-size: 0.95rem;
}
.page-foot p { margin: 0 0 0.5rem; }

/* ==========================================================================
   Layouts
   ========================================================================== */
/* wide: cards either side of the river; room for the gauge */
@media (min-width: 900px) {
    .entry.left .body { margin-right: calc(50% + var(--gap)); }
    .entry.right .body { margin-left: calc(50% + var(--gap)); }
    .entry.has-scene:not(.anchor) .scene-window { position: absolute; top: 22px; }
    .entry.left.has-scene .scene-window { left: calc(50% + var(--gap)); right: 0; }
    .entry.right.has-scene .scene-window { right: calc(50% + var(--gap)); left: 0; }
    .scenes-live .entry.has-scene:not(.anchor):not(.folded) { min-height: calc(clamp(190px, 30vh, 300px) + 44px); }
    .entry.folded.peek .body { margin-left: calc(var(--rx) + 22px); }
}
@media (min-width: 1101px) {
    main, .page-foot { width: min(1040px, calc(100% - 420px)); }
}
@media (max-width: 1100px) {
    .depth-gauge { display: none; }
}
/* narrow: the river along the left edge, everything to its right */
@media (max-width: 899px) {
    .history-page { --rx: 12px; --gap: 22px; }
    main, .page-foot { width: calc(100% - 28px); }
    .entry.event .body,
    .entry.today .body,
    .entry.anchor .body,
    .entry.era .body,
    .entry.mark:not(.minor) .body { margin-left: calc(var(--rx) + var(--gap)); }
    .entry.era .body, .entry.mark:not(.minor) .body, .entry.anchor .body { text-align: left; }
    .entry.era .when, .entry.mark .when, .entry.anchor .when { justify-content: flex-start; }
    .entry.left .body::before { right: auto; left: calc(-1 * var(--gap)); transform: none; }
    .entry.anchor::after { width: 30px; height: 30px; }
    .entry.folded.peek .body { margin-left: calc(var(--rx) + 18px); }
    .notch-name { max-width: 70vw; }
    .entry.has-scene .scene-window { position: relative; margin: 12px 0 0 calc(var(--rx) + var(--gap)); height: 190px; }
    .entry.anchor .scene-window { width: auto; height: 210px; }
    .entry.event .body, .entry.today .body { padding: 0.95rem 1rem 1rem; }
    .text { font-size: 1rem; }
}
/* phones: whose history moves to a pill at the bottom, within thumb's reach */
@media (max-width: 600px) {
    .world-filter {
        position: fixed; left: 50%; bottom: 14px;
        transform: translateX(-50%);
        margin: 0;
        z-index: 7;
        box-shadow: 0 6px 24px rgba(0, 0, 0, 0.7), 0 0 14px color-mix(in srgb, var(--accent) 14%, transparent);
    }
    .world-choice { padding: 7px 11px; font-size: 0.66rem; }
    .page-foot { padding-bottom: 30vh; }
}
@media (max-height: 500px) and (orientation: landscape) {
    .hero { min-height: 100vh; padding: 70px 0 30px; box-sizing: border-box; }
    .hero h1 { font-size: clamp(2.6rem, 9vh, 4rem); }
}

@media (prefers-reduced-motion: reduce) {
    .hero h1 { animation: none; }
    .entry.era .title { animation: none !important; }
    .entry.today::after { animation: none; }
    .entry::before, .world-choice, .gauge-stops a { transition: none; }
}

/* ==========================================================================
   Visual quality tiers (html[data-quality], fx-quality.js)
   Light: the cards don't blur what is behind them (a little more opaque instead).
   Still: the same as the reduced-motion rules.
   ========================================================================== */
html[data-quality="light"] .entry.event .body,
html[data-quality="light"] .entry.today .body,
html[data-quality="light"] .entry.anchor .body {
    backdrop-filter: none; -webkit-backdrop-filter: none;
    background: linear-gradient(160deg, rgba(20, 16, 44, 0.95), rgba(8, 7, 20, 0.92));
}
html[data-quality="light"] .history-page { background-attachment: scroll; }
html[data-quality="still"] .hero h1 { animation: none; }
html[data-quality="still"] .entry.era .title { animation: none !important; }
html[data-quality="still"] .entry.today::after { animation: none; }
html[data-quality="still"] .entry::before,
html[data-quality="still"] .world-choice,
html[data-quality="still"] .gauge-stops a { transition: none; }
