/*
 * Home page, "Nightfall": a full-screen low-poly scene (stand-in for the presentation video), then numbered chapters
 * lit by royal gold. It is night in the dark theme and daybreak in the light theme: every colour below is
 * light-dark(daybreak, night). At daybreak the moon becomes a rising sun, the last stars fade, the embers turn into
 * golden dust in the light and the monsters' eyes are gone. Motion is progressive: scroll-driven reveals and parallax only
 * where animation timelines are supported, and nothing moves when the visitor prefers reduced motion.
 */
.home {
    --home-bg: light-dark(var(--color-parchment-light), var(--color-night-abyss));
    --home-surface: light-dark(#fffcf5, #121829);
    --home-surface-raised: light-dark(#f7efdc, #1a2238);
    --home-line: light-dark(rgb(43 33 24 / 0.12), rgb(244 236 216 / 0.12));
    --home-line-strong: light-dark(rgb(43 33 24 / 0.28), rgb(244 236 216 / 0.28));
    --home-glass: light-dark(rgb(43 33 24 / 0.04), rgb(244 236 216 / 0.07));
    --home-glass-strong: light-dark(rgb(43 33 24 / 0.08), rgb(244 236 216 / 0.14));
    --home-text: light-dark(var(--color-text), var(--color-on-dark));
    --home-text-muted: light-dark(var(--color-muted), var(--color-on-dark-muted));
    --home-title-from: light-dark(var(--color-text), var(--color-parchment-light));
    /* Gold as text: darkened by day to stay readable on parchment. */
    --home-gold: light-dark(#7d5c0f, var(--color-gold-light));
    --home-gold-deep: light-dark(#5f450a, var(--color-gold));
    --home-glow-gold: rgb(232 199 102 / 0.4);
    --home-ember: #ff8a3d;
    --home-ember-soft: rgb(255 138 61 / 0.35);
    --home-blood: #ff4d4d;
    --home-shade: light-dark(rgb(253 240 226 / 0.85), var(--home-shade-night));
    /* Night shade, for what stays dark whatever the theme (e.g. the eternal trial badge of the game page). */
    --home-shade-night: rgb(5 7 15 / 0.85);
    --home-radius: 1.75rem;
    --home-radius-inner: 1.125rem;
    --home-gutter: clamp(1rem, 4vw, 3rem);
    --home-section-space: clamp(5rem, 12vw, 10rem);
    --home-content-width: 80rem;
    --home-ease: cubic-bezier(0.22, 1, 0.36, 1);

    /* Hero scene palette: at daybreak the moon becomes the sun and its craters melt into it. */
    --scene-sky-top: light-dark(#7d8cc4, #05070f);
    --scene-sky-middle: light-dark(#e8aaa6, #1a2142);
    --scene-sky-horizon: light-dark(#ffd08a, #5e3448);
    --scene-star: light-dark(rgb(255 250 240 / 0.55), var(--color-star));
    --scene-moon: light-dark(#fff1c9, #fff4d6);
    --scene-moon-crater: light-dark(#fff1c9, #eadcb6);
    --scene-moon-glow: light-dark(rgb(255 196 120 / 0.75), rgb(255 244 214 / 0.28));
    --scene-mountain: light-dark(#8e86b0, #1f2747);
    --scene-mountain-lit: light-dark(#c39fb0, #2b3560);
    --scene-hill: light-dark(#5f6f5a, #121831);
    --scene-hill-lit: light-dark(#8f8a62, #19203e);
    --scene-castle: light-dark(#4b3f5c, #0a0e1f);
    --scene-castle-lit: light-dark(#a9788a, #1d2549);
    --scene-castle-glow: light-dark(rgb(255 190 120 / 0.45), var(--home-ember-soft));
    --scene-gate: light-dark(#ffb870, var(--home-ember));
    --scene-window: light-dark(#ffd58f, #ffc56b);
    --scene-window-glow: light-dark(rgb(255 213 143 / 0.6), #ffc56b);
    --scene-ember: light-dark(#fff0c2, var(--home-ember));
    --scene-eyes: light-dark(transparent, var(--home-blood));
    --scene-mist: light-dark(rgb(255 214 180 / 0.45), rgb(200 116 58 / 0.16));
    --scene-ground: light-dark(#3f4a3c, #04060d);
    --scene-tree: light-dark(#363f35, #060914);
    --scene-tree-lit: light-dark(#4f5a45, #0d1328);
    /* The sun rises from behind the mountains, larger and with a wider halo than the moon. */
    --scene-sun-drop: calc(var(--is-day) * 250px);
    --scene-sun-scale: calc(1 + var(--is-day) * 0.25);
    --scene-sun-glow-scale: calc(1 + var(--is-day) * 0.9);

    /*
     * Landscape of the game cards and map tiles: muted like the night version, so only the glow of the game colour
     * stands out, rather than the saturated colours of the daybreak scene.
     */
    --art-landscape-sky-top: light-dark(#f6ead6, var(--scene-sky-top));
    --art-landscape-sky-bottom: light-dark(#f0dcc5, var(--scene-sky-middle));
    --art-landscape-mountain: light-dark(#e9d3bc, var(--scene-mountain));
    --art-landscape-hill: light-dark(#e1c8ae, var(--scene-hill));

    /* Placeholder art palette */
    --art-day-sky: #ffe3a3;
    --art-day-sun: #f6c177;
    --art-day-dusk: #e08a4a;
    --art-day-hill: #c4874a;
    --art-day-hill-dark: #8f5a33;
    --art-night-sky: #0d1330;
    --art-night-haze: #2a3366;
    --art-night-hill: #070a18;

    position: relative;
    overflow-x: clip;
    background-color: var(--home-bg);
    color: var(--home-text);
}

/* The page background shows around the inset footer card. */
body:has(> main.home) {
    background: light-dark(var(--color-parchment-light), var(--color-night-abyss));
}

/*
 * Film grain laid over the whole page, below the header. Hung on the body, which is never transformed: on the main
 * element, it would cover only the main element while the page transition moves it (a transformed element contains
 * its fixed descendants), leaving the strip of the header without grain.
 */
body:has(> main.home)::before {
    content: '';
    position: fixed;
    z-index: 4;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    opacity: 0.06;
    pointer-events: none;
}

.home :focus-visible {
    outline-color: var(--color-focus-ring);
}

/* Hero: full viewport, the scene behind, the title anchored bottom-left. */
.home-hero {
    position: relative;
    isolation: isolate;
    display: grid;
    align-items: end;
    min-height: 100vh;
    min-height: 100dvh;
    overflow: hidden;
}

.home-hero__media {
    position: absolute;
    z-index: -2;
    inset: 0;
}

.home-hero__video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* The scene keeps a 16:9 frame at least as wide as the hero, so it can be re-centred on the castle on tall screens. */
.home-scene {
    position: absolute;
    bottom: 0;
    left: 50%;
    height: 100%;
    min-width: 100%;
    aspect-ratio: 16 / 9;
    transform: translateX(-50%);
}

/* Vignette and fade into the page so the text stays readable over any frame of the future video. */
.home-hero::before {
    content: '';
    position: absolute;
    z-index: -1;
    inset: 0;
    background:
        radial-gradient(ellipse 90% 70% at 50% 35%, transparent 45%, var(--home-shade)),
        linear-gradient(transparent 50%, var(--home-bg));
    pointer-events: none;
}

/* Tall screens: the text covers most of the scene, so only its top stays bright. */
@media (max-aspect-ratio: 1 / 1) {
    .home-scene {
        transform: translateX(-72%);
    }

    .home-hero::before {
        background:
            radial-gradient(ellipse 90% 70% at 50% 35%, transparent 45%, var(--home-shade)),
            linear-gradient(transparent 10%, var(--home-shade) 45%, var(--home-bg));
    }
}

.home-hero__content {
    width: 100%;
    max-width: var(--home-content-width);
    margin-inline: auto;
    padding: calc(var(--header-height) + var(--space-xl)) var(--home-gutter) clamp(5rem, 14vh, 9rem);
}

/* A night-blue glass pill by day too, so the bright gold stays readable over the pale daybreak sky. */
.home-hero__eyebrow {
    display: inline-flex;
    align-items: baseline;
    gap: var(--space-s);
    margin: 0 0 var(--space-l);
    padding: 0.4rem 1rem 0.4rem 0.75rem;
    border: 1px solid light-dark(rgb(27 34 54 / 0.25), var(--home-line-strong));
    border-radius: 999px;
    background-color: light-dark(rgb(27 34 54 / 0.5), var(--home-glass));
    backdrop-filter: blur(10px);
    color: var(--color-gold-light);
    font-family: var(--font-family-ui);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

/*
 * Trim the text box to the capitals so they sit exactly in the middle of the pill, whatever the ascent and descent of
 * the system font; the padding grows by the trimmed amount so the pill keeps its height.
 */

/*
 * The crown drawing fills 17 of the icon's 24 units, its centre 11.5 units above the bottom edge. The icon is sized
 * so the drawing is 15% taller than the capitals, then moved from the baseline so both centres meet, whatever the font.
 */
.home-hero__eyebrow-icon {
    --crown-size: calc(1.15cap * 24 / 17);

    flex-shrink: 0;
    width: var(--crown-size);
    height: var(--crown-size);
    translate: 0 calc(var(--crown-size) * 11.5 / 24 - 0.5cap);
}

/*
 * Where the text box can be trimmed to the capitals, they sit exactly in the middle of the pill whatever the ascent
 * and descent of the system font. The padding grows by the trimmed amount so the pill keeps its height, and negative
 * margins shrink the crown's layout box to the cap height so it does not push the text down. Centring those boxes
 * keeps the crown level with the capitals on one line, and in the middle of the pill when the text wraps.
 */
@supports (text-box: trim-both cap alphabetic) {
    .home-hero__eyebrow {
        align-items: center;
        padding-block: calc(0.4rem + (1lh - 1cap) / 2);
    }

    .home-hero__eyebrow-text {
        text-box: trim-both cap alphabetic;
    }

    .home-hero__eyebrow-icon {
        margin-block: calc(0.5cap - var(--crown-size) * 12.5 / 24) calc(0.5cap - var(--crown-size) * 11.5 / 24);
        translate: none;
    }
}

@media (max-width: 30rem) {
    .home-hero__eyebrow {
        padding-inline-end: 1.25rem;
        letter-spacing: 0.08em;
    }
}

.home-hero__title {
    max-width: 16ch;
    margin: 0;
    background: linear-gradient(175deg, var(--home-title-from) 35%, var(--home-gold) 75%, var(--home-gold-deep));
    background-clip: text;
    color: transparent;
    font-size: clamp(2.25rem, 6vw + 0.5rem, 6.5rem);
    line-height: 0.95;
    letter-spacing: -0.005em;
    text-wrap: balance;
}

.home-hero__lead {
    max-width: 38rem;
    margin: var(--space-l) 0 0;
    color: var(--home-text);
    font-size: clamp(1.0625rem, 1.4vw, 1.25rem);
    line-height: 1.6;
}

.home-hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-m);
    margin: var(--space-l) 0 0;
    padding: 0;
    list-style: none;
}

/* Vertical "discover" link to the about page, with a line flowing downwards. */
.home-hero__scroll {
    position: absolute;
    right: var(--home-gutter);
    bottom: calc(var(--space-xl) + var(--space-l));
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-m);
    color: var(--home-text-muted);
    font-family: var(--font-family-ui);
    font-size: 0.6875rem;
    letter-spacing: 0.3em;
    text-decoration: none;
    text-transform: uppercase;
    writing-mode: vertical-rl;
}

.home-hero__scroll::after {
    content: '';
    width: 1px;
    height: 4.5rem;
    background: linear-gradient(var(--home-gold), transparent);
    transform-origin: top;
}

.home-hero__scroll:hover {
    color: var(--home-gold);
}

@media (max-width: 48rem) {
    .home-hero__scroll {
        display: none;
    }
}

/* Hero scene */
.home-scene__sky {
    fill: url('#home-scene-sky');
}

.home-scene__sky-top {
    stop-color: var(--scene-sky-top);
}

.home-scene__sky-middle {
    stop-color: var(--scene-sky-middle);
}

.home-scene__sky-horizon {
    stop-color: var(--scene-sky-horizon);
}

.home-scene__glow-center {
    stop-color: var(--scene-moon-glow);
}

.home-scene__glow-edge {
    stop-color: transparent;
}

.home-scene__mist-edge {
    stop-color: transparent;
}

.home-scene__mist-center {
    stop-color: var(--scene-mist);
}

.home-scene__stars {
    fill: var(--scene-star);
}

.home-scene__moon,
.home-scene__moon-crater,
.home-scene__moon-glow {
    transform-box: fill-box;
    transform-origin: center;
}

.home-scene__moon {
    fill: var(--scene-moon);
    transform: translateY(var(--scene-sun-drop)) scale(var(--scene-sun-scale));
}

.home-scene__moon-crater {
    fill: var(--scene-moon-crater);
    transform: translateY(var(--scene-sun-drop));
}

.home-scene__moon-glow {
    fill: url('#home-scene-glow');
    transform: translateY(var(--scene-sun-drop)) scale(var(--scene-sun-glow-scale));
}

.home-scene__mountain {
    fill: var(--scene-mountain);
}

.home-scene__mountain-lit {
    fill: var(--scene-mountain-lit);
}

.home-scene__hill {
    fill: var(--scene-hill);
}

.home-scene__hill-lit {
    fill: var(--scene-hill-lit);
}

.home-scene__castle,
.home-scene__roof,
.home-scene__flag-pole {
    fill: var(--scene-castle);
}

.home-scene__roof-lit {
    fill: var(--scene-castle-lit);
}

.home-scene__castle-glow {
    fill: var(--scene-castle-glow);
    filter: blur(60px);
}

.home-scene__gate {
    fill: var(--scene-gate);
}

.home-scene__flag {
    fill: var(--color-primary);
}

.home-scene__windows {
    fill: var(--scene-window);
    filter: drop-shadow(0 0 6px var(--scene-window-glow));
}

.home-scene__embers {
    fill: var(--scene-ember);
}

.home-scene__mist {
    fill: url('#home-scene-mist');
}

.home-scene__ground {
    fill: var(--scene-ground);
}

.home-scene__tree {
    fill: var(--scene-tree);
}

.home-scene__tree-lit {
    fill: var(--scene-tree-lit);
}

.home-scene__eyes {
    fill: var(--scene-eyes);
    filter: drop-shadow(0 0 4px var(--scene-eyes));
}

/* Buttons and links */
.home-button {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.9375rem 1.625rem;
    border: 1px solid transparent;
    border-radius: 999px;
    font-family: var(--font-family-ui);
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    transition:
        transform 0.4s var(--home-ease),
        box-shadow 0.4s var(--home-ease),
        background-color 0.3s ease;
}

.home-button:hover {
    transform: translateY(-2px);
}

.home-button--primary {
    background: linear-gradient(135deg, var(--color-gold-light), var(--color-gold));
    color: var(--color-night-deep);
    box-shadow: 0 0 0 0 var(--home-glow-gold);
}

.home-button--primary:hover {
    color: var(--color-night-deep);
    box-shadow: 0 12px 40px -8px var(--home-glow-gold);
}

.home-button--ghost {
    border-color: var(--home-line-strong);
    background-color: var(--home-glass);
    backdrop-filter: blur(10px);
    color: var(--home-text);
}

.home-button--ghost:hover {
    background-color: var(--home-glass-strong);
    color: var(--home-text);
}

.home-button__icon,
.home-link__icon {
    width: 1.125em;
    height: 1.125em;
    transition: transform 0.4s var(--home-ease);
}

.home-button:hover .home-button__icon {
    transform: translate(2px, -2px);
}

.home-button:hover .home-button__icon--down {
    transform: translateY(3px);
}

.home-link {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    gap: var(--space-s);
    padding-bottom: 0.125rem;
    border-bottom: 1px solid currentColor;
    color: var(--home-gold);
    font-family: var(--font-family-ui);
    font-weight: 600;
    text-decoration: none;
}

.home-link:hover {
    color: var(--home-text);
}

.home-link:hover .home-link__icon {
    transform: translateX(4px);
}

/* Ticker band, slightly tilted, overlapping the bottom of the hero. */
.home-marquee {
    position: relative;
    z-index: 1;
    width: 110%;
    margin: -2.5rem 0 0 -5%;
    padding: 1.125rem 0;
    overflow: hidden;
    background: linear-gradient(90deg, var(--color-gold), var(--color-gold-light), var(--color-gold));
    color: var(--color-night-deep);
    box-shadow: 0 20px 60px -20px var(--home-glow-gold);
    transform: rotate(-2deg);
}

.home-marquee__track {
    display: flex;
    width: max-content;
}

.home-marquee__group {
    display: flex;
    margin: 0;
    padding: 0;
    list-style: none;
}

.home-marquee__group li {
    display: flex;
    align-items: center;
    gap: 2.5rem;
    padding-right: 2.5rem;
    font-family: var(--font-family-display);
    font-size: clamp(1.25rem, 2.6vw, 2.125rem);
    font-weight: 700;
    letter-spacing: var(--letter-spacing-display);
    line-height: 1.1;
    text-transform: uppercase;
    white-space: nowrap;
}

.home-marquee__group li::after {
    content: '✦' / '';
    font-size: 0.6em;
}

.home-marquee__link {
    color: inherit;
    text-decoration: underline;
    text-decoration-color: transparent;
    text-decoration-thickness: max(1px, 0.035em);
    text-underline-offset: 0.15em;
    transition: text-decoration-color 0.3s ease;
}

.home-marquee__link:hover {
    color: inherit;
    text-decoration-color: currentColor;
}

.home .home-marquee :focus-visible {
    outline-color: var(--color-night-deep);
}

/* Sections */
.home-section {
    padding-block: var(--home-section-space);
}

.home-section__inner {
    max-width: var(--home-content-width);
    margin-inline: auto;
    padding-inline: var(--home-gutter);
}

.home-section__header {
    display: grid;
    justify-items: start;
    gap: var(--space-m);
    max-width: 52rem;
    margin-bottom: clamp(2.5rem, 6vw, 4.5rem);
}

.home-section__header--centered {
    justify-items: center;
    margin-inline: auto;
    text-align: center;
}

.home-section__kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0;
    color: var(--home-gold);
    font-family: var(--font-family-ui);
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.home-section__index {
    padding: 0.125rem 0.625rem;
    border: 1px solid currentColor;
    border-radius: 999px;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.05em;
}

.home-section__title {
    margin: 0;
    font-size: clamp(2.25rem, 5.5vw, 5rem);
    line-height: 1;
    letter-spacing: -0.005em;
    text-wrap: balance;
}

.home-section__intro {
    max-width: 36rem;
    margin: 0;
    color: var(--home-text-muted);
    font-size: 1.125rem;
}

/* 01 — The game */
.home-presentation__lead {
    max-width: 50rem;
    margin: 0 0 clamp(3rem, 7vw, 6rem) auto;
    font-size: clamp(1.25rem, 2.2vw, 1.875rem);
    line-height: 1.45;
    text-wrap: pretty;
}

/* Illuminated-manuscript drop cap. */
.home-presentation__lead::first-letter {
    float: left;
    margin: 0.06em 0.12em 0 0;
    color: var(--home-gold);
    font-family: var(--font-family-display);
    font-size: 3.4em;
    font-weight: 700;
    line-height: 0.8;
}

.home-cycle {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
    gap: 1.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.home-cycle__card {
    position: relative;
    isolation: isolate;
    display: flex;
    align-items: flex-end;
    min-height: clamp(26rem, 48vw, 36rem);
    overflow: hidden;
    border: 1px solid var(--home-line);
    border-radius: var(--home-radius);
}

.home-cycle__card .home-placeholder {
    position: absolute;
    z-index: -2;
    inset: 0;
    transition: transform 1.2s var(--home-ease);
}

.home-cycle__card:hover .home-placeholder {
    transform: scale(1.05);
}

.home-cycle__card::after {
    content: '';
    position: absolute;
    z-index: -1;
    inset: 40% 0 0;
    background: linear-gradient(transparent, var(--card-shade));
}

.home-cycle__card--day {
    --card-shade: rgb(251 246 234 / 0.95);

    color: var(--color-text);
}

/* The night card stays at night in both themes: every light-dark() colour inside it resolves to its night value. */
.home-cycle__card--night {
    --card-shade: var(--home-shade);

    color-scheme: dark;
    color: var(--home-text);
}

.home-cycle__body {
    padding: clamp(1.5rem, 3vw, 2.5rem);
}

.home-cycle__icon {
    width: 2.75rem;
    height: 2.75rem;
}

.home-cycle__card--day .home-cycle__icon {
    color: var(--color-dusk);
}

.home-cycle__card--night .home-cycle__icon {
    color: var(--home-gold);
}

.home-cycle__title {
    margin: var(--space-m) 0 var(--space-s);
    font-size: clamp(1.75rem, 3vw, 2.75rem);
}

.home-cycle__text {
    max-width: 26rem;
    margin: 0;
    font-size: 1.125rem;
}

@media (min-width: 52rem) {
    .home-cycle__card--night {
        margin-top: var(--space-xl);
    }
}

/* 02 — Loadout bento */
.home-bento {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.home-bento__tile {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: var(--space-s);
    margin: 0;
    padding: clamp(1.5rem, 2.5vw, 2.25rem);
    overflow: hidden;
    border: 1px solid var(--home-line);
    border-radius: var(--home-radius);
    background:
        radial-gradient(circle at 100% 0, var(--home-glass-strong), transparent 55%),
        var(--home-surface);
    transition: border-color 0.4s ease;
}

.home-bento__tile:hover {
    border-color: var(--home-line-strong);
}

.home-bento__tile--feature {
    grid-column: span 2;
    grid-row: span 2;
    gap: var(--space-l);
}

.home-bento__tile--feature .home-placeholder {
    position: relative;
    flex: 1;
    min-height: 14rem;
    overflow: hidden;
    border-radius: var(--home-radius-inner);
}

/* Taken out of the flow, the picture fills its frame without ever resizing it. */
.home-bento__image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.home-bento__tile--mutators {
    grid-column: 3 / span 2;
    background:
        radial-gradient(circle at 100% 0, var(--home-ember-soft), transparent 60%),
        linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
}

.home-bento__text {
    margin: 0;
    font-size: clamp(1.125rem, 1.6vw, 1.375rem);
    line-height: 1.5;
}

/*
 * Outlined numerals that fill with gold on hover. The fill is a separate plain-text layer fading in while the outline
 * fades out: stroked and plain text are rasterised differently (hinting), so an outline left under the fill shows
 * through it as seams and gaps.
 */
.home-bento__number {
    position: relative;
    color: transparent;
    font-family: var(--font-family-display);
    font-size: clamp(4.5rem, 10vw, 8.5rem);
    font-weight: 700;
    font-variant-numeric: lining-nums;
    line-height: 0.85;
    -webkit-text-stroke: 1.5px var(--home-gold);
    transition: -webkit-text-stroke-color 0.5s ease;
}

.home-bento__number::after {
    content: attr(data-number) / '';
    position: absolute;
    inset: 0;
    color: var(--home-gold);
    -webkit-text-stroke-width: 0;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.home-bento__tile:hover .home-bento__number {
    -webkit-text-stroke-color: transparent;
}

.home-bento__tile:hover .home-bento__number::after {
    opacity: 1;
}

/* The crimson tile shows a solid numeral, with no outline to fill on hover. */
.home-bento__tile--mutators .home-bento__number {
    color: var(--color-parchment-light);
    -webkit-text-stroke-width: 0;
}

.home-bento__tile--mutators .home-bento__number::after {
    content: none;
}

.home-bento__label {
    color: var(--home-gold);
    font-family: var(--font-family-ui);
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.home-bento__tile--mutators .home-bento__label {
    color: var(--color-parchment-light);
}

.home-bento__hint {
    color: var(--color-parchment);
    font-size: 1.125rem;
}

@media (max-width: 60rem) {
    .home-bento {
        grid-template-columns: repeat(2, 1fr);
    }

    .home-bento__tile--feature,
    .home-bento__tile--mutators {
        grid-column: 1 / -1;
        grid-row: auto;
    }
}

/* 03 — Games: tall cards with the game name engraved vertically. */
.home-maps {
    /* Links to #home-games land on the "03" kicker rather than on the section padding. */
    scroll-margin-top: calc(var(--space-l) - var(--home-section-space));
}

.game-banners {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 24rem), 1fr));
    gap: 1.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.game-banner {
    --banner-color: var(--home-gold);

    position: relative;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-start;
    gap: var(--space-m);
    min-height: clamp(28rem, 60vw, 40rem);
    padding: clamp(1.5rem, 3vw, 2.5rem);
    overflow: hidden;
    border: 1px solid var(--home-line);
    border-radius: var(--home-radius);
    color: var(--home-text);
    text-decoration: none;
    transition:
        transform 0.6s var(--home-ease),
        box-shadow 0.6s var(--home-ease),
        border-color 0.6s ease;
}

.game-banner--thronefall {
    --banner-color: var(--color-thronefall);
}

.game-banner--craaghelm {
    --banner-color: var(--color-craaghelm);
}

.game-banner .home-placeholder {
    position: absolute;
    z-index: -2;
    inset: 0;
    transition: transform 1.2s var(--home-ease);
}

.game-banner::before {
    content: '';
    position: absolute;
    z-index: -1;
    inset: 0;
    background: linear-gradient(transparent 35%, var(--home-shade));
}

.game-banner::after {
    content: attr(data-title) / '';
    position: absolute;
    z-index: -1;
    top: -0.12em;
    left: -0.04em;
    color: transparent;
    font-family: var(--font-family-display);
    font-size: clamp(5rem, 11vw, 10rem);
    font-weight: 700;
    line-height: 1;
    text-transform: uppercase;
    white-space: nowrap;
    -webkit-text-stroke: 1px color-mix(in srgb, var(--banner-color) 60%, transparent);
    transition: transform 1.2s var(--home-ease);
}

.game-banner:hover {
    border-color: color-mix(in srgb, var(--banner-color) 60%, transparent);
    color: var(--home-text);
    box-shadow: 0 40px 90px -30px color-mix(in srgb, var(--banner-color) 55%, transparent);
    transform: translateY(-6px);
}

.game-banner:hover .home-placeholder {
    transform: scale(1.06);
}

.game-banner:hover::after {
    transform: translateX(-1.5rem);
}

.game-banner__crown {
    width: 2.75rem;
    height: 2.75rem;
    color: var(--banner-color);
    filter: drop-shadow(0 0 12px var(--banner-color));
}

.game-banner__title {
    font-family: var(--font-family-display);
    font-size: clamp(2.25rem, 4vw, 3.75rem);
    font-weight: 700;
    letter-spacing: var(--letter-spacing-display);
    line-height: 1;
    text-transform: uppercase;
}

.game-banner__action {
    display: inline-flex;
    align-items: center;
    gap: var(--space-s);
    padding: 0.75rem 1.25rem;
    border-radius: 999px;
    background-color: var(--banner-color);
    color: var(--color-night-deep);
    font-family: var(--font-family-ui);
    font-weight: 600;
}

.game-banner__icon {
    width: 1.125em;
    height: 1.125em;
    transition: transform 0.4s var(--home-ease);
}

.game-banner:hover .game-banner__icon {
    transform: translateX(4px);
}

@media (min-width: 52rem) {
    .game-banners li:nth-child(even) {
        margin-top: var(--space-xl);
    }
}

/* 04 — Steps on a parchment slab */
.home-steps {
    margin-inline: var(--home-gutter);
    border-radius: calc(var(--home-radius) * 1.5);
    box-shadow: 0 40px 100px -40px var(--color-shadow);
    background:
        radial-gradient(ellipse at top, var(--color-parchment-light), transparent 70%),
        var(--color-parchment);
    color: var(--color-text);
}

.home-steps :focus-visible {
    outline-color: var(--color-focus);
}

.home-steps .home-section__kicker,
.home-steps .home-link {
    color: var(--color-primary);
}

.home-steps .home-link:hover {
    color: var(--color-primary-dark);
}

/* Parchment whatever the theme: the muted text of the night theme would fade into it. */
.home-steps .home-section__intro {
    color: var(--color-muted);
}

.home-steps__list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
    gap: var(--space-l);
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: step;
}

.home-steps__item {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: var(--space-s);
    padding-top: var(--space-l);
    border-top: 2px solid var(--color-text);
    counter-increment: step;
}

/* Outlined step number, cross-faded on hover with a plain-text fill layer (see .home-bento__number). */
.home-steps__item::before,
.home-steps__item::after {
    content: counter(step, decimal-leading-zero) / '';
    font-family: var(--font-family-display);
    font-size: clamp(4rem, 8vw, 7rem);
    font-weight: 700;
    line-height: 0.85;
}

.home-steps__item::before {
    margin-bottom: var(--space-m);
    color: transparent;
    -webkit-text-stroke: 1.5px var(--color-primary);
    transition: -webkit-text-stroke-color 0.5s ease;
}

.home-steps__item:hover::before {
    -webkit-text-stroke-color: transparent;
}

.home-steps__item::after {
    position: absolute;
    top: var(--space-l);
    left: 0;
    color: var(--color-primary);
    opacity: 0;
    transition: opacity 0.5s ease;
}

.home-steps__item:hover::after {
    opacity: 1;
}

.home-steps__title {
    margin: 0;
    font-size: 1.5rem;
}

.home-steps__item p {
    margin: 0 0 var(--space-s);
    color: var(--color-muted);
}

/* At the foot of its step, so the links of a row line up whatever the length of their texts. */
.home-steps__item .home-link {
    margin-top: auto;
}

/* 05 — Guide and news */
.home-explore__list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 24rem), 1fr));
    gap: 1.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.home-explore__card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: var(--space-s);
    height: 100%;
    padding: var(--space-m) var(--space-m) var(--space-l);
    border: 1px solid var(--home-line);
    border-radius: var(--home-radius);
    background-color: var(--home-surface);
    color: var(--home-text);
    text-decoration: none;
    transition: border-color 0.4s ease, background-color 0.4s ease;
}

.home-explore__card:hover {
    border-color: var(--home-line-strong);
    background-color: var(--home-surface-raised);
    color: var(--home-text);
}

.home-explore__card .home-placeholder {
    aspect-ratio: 16 / 9;
    margin-bottom: var(--space-m);
    border-radius: var(--home-radius-inner);
}

.home-explore__title,
.home-explore__text {
    padding-inline: var(--space-m);
}

.home-explore__title {
    font-family: var(--font-family-display);
    font-size: clamp(1.75rem, 3vw, 2.5rem);
    font-weight: 700;
    letter-spacing: var(--letter-spacing-display);
    line-height: 1.1;
    text-transform: uppercase;
}

.home-explore__text {
    color: var(--home-text-muted);
}

.home-explore__icon {
    position: absolute;
    top: calc(var(--space-m) * 2);
    right: calc(var(--space-m) * 2);
    width: 3.25rem;
    height: 3.25rem;
    padding: 0.875rem;
    border-radius: 50%;
    background-color: var(--color-gold-light);
    color: var(--color-night-deep);
    transition: transform 0.5s var(--home-ease);
}

.home-explore__card:hover .home-explore__icon {
    transform: rotate(45deg) scale(1.08);
}

/* Final call to action, under a giant faint crown. */
.home-final {
    position: relative;
    isolation: isolate;
    display: grid;
    justify-items: center;
    gap: var(--space-l);
    padding: clamp(7rem, 16vw, 12rem) var(--home-gutter);
    overflow: hidden;
    /* Centred behind the button and faded out before the section edges, so it never ends on a hard line. */
    background: radial-gradient(ellipse 65% 36% at 50% 62%, var(--home-ember-soft), transparent);
    text-align: center;
}

.home-final__crown {
    position: absolute;
    z-index: -1;
    top: 50%;
    left: 50%;
    width: min(56rem, 130vw);
    height: auto;
    color: var(--home-gold);
    /* Fainter on the night background than on parchment, where the same opacity would vanish. */
    opacity: calc(0.05 + var(--is-day) * 0.1);
    transform: translate(-50%, -55%);
}

.home-final__title {
    max-width: 14ch;
    margin: 0;
    background: linear-gradient(175deg, var(--home-title-from) 30%, var(--home-gold));
    background-clip: text;
    color: transparent;
    font-size: clamp(2.75rem, 8vw, 7.5rem);
    line-height: 0.95;
    text-wrap: balance;
}

.home-final__text {
    max-width: 36rem;
    margin: 0;
    color: var(--home-text-muted);
    font-size: 1.1875rem;
}

.home-final .home-reveal {
    margin: 0;
}

/* Placeholder art, to be replaced by real images (see the comments in home/index.html.twig). */
.home-placeholder {
    display: block;
    background-color: var(--home-surface-raised);
    background-image:
        repeating-linear-gradient(135deg, var(--home-glass) 0 1px, transparent 1px 14px),
        radial-gradient(circle at 30% 20%, var(--home-glass-strong), transparent 60%);
}

.home-placeholder--day {
    background-image:
        linear-gradient(162deg, transparent 58%, var(--art-day-hill) 58% 70%, transparent 70%),
        linear-gradient(198deg, transparent 64%, var(--art-day-hill-dark) 64%),
        radial-gradient(circle at 72% 30%, var(--color-parchment-light) 0 3.5rem, transparent 3.6rem),
        radial-gradient(circle at 72% 30%, var(--art-day-sun), transparent 45%),
        linear-gradient(var(--art-day-sky), var(--art-day-sun) 55%, var(--art-day-dusk));
}

.home-placeholder--night {
    background-image:
        linear-gradient(160deg, transparent 60%, var(--scene-hill) 60%),
        linear-gradient(200deg, transparent 66%, var(--art-night-hill) 66%),
        radial-gradient(circle at 25% 28%, var(--scene-moon) 0 2.5rem, transparent 2.6rem),
        radial-gradient(circle at 25% 28%, var(--scene-moon-glow), transparent 40%),
        radial-gradient(circle at 60% 15%, var(--scene-star) 0 1px, transparent 2px),
        radial-gradient(circle at 80% 35%, var(--scene-star) 0 1.5px, transparent 2.5px),
        radial-gradient(circle at 45% 40%, var(--scene-star) 0 1px, transparent 2px),
        radial-gradient(circle at 90% 12%, var(--scene-star) 0 1px, transparent 2px),
        linear-gradient(var(--art-night-sky), var(--art-night-haze));
}

.home-placeholder--loadout {
    background-image:
        repeating-linear-gradient(135deg, var(--home-glass) 0 1px, transparent 1px 14px),
        radial-gradient(circle at 70% 30%, var(--home-glow-gold), transparent 55%),
        radial-gradient(circle at 20% 90%, var(--home-ember-soft), transparent 50%);
}

.home-placeholder--thronefall,
.home-placeholder--craaghelm {
    background-image:
        linear-gradient(155deg, transparent 55%, var(--art-landscape-mountain) 55% 68%, transparent 68%),
        linear-gradient(205deg, transparent 62%, var(--art-landscape-hill) 62%),
        radial-gradient(circle at 50% 30%, color-mix(in srgb, var(--banner-color) 55%, transparent), transparent 60%),
        linear-gradient(var(--art-landscape-sky-top), var(--art-landscape-sky-bottom));
}

.home-placeholder--guide {
    background-image:
        repeating-linear-gradient(90deg, var(--home-glass) 0 1px, transparent 1px 2.5rem),
        radial-gradient(circle at 80% 20%, var(--home-glow-gold), transparent 55%);
}

.home-placeholder--news {
    background-image:
        repeating-linear-gradient(0deg, var(--home-glass) 0 1px, transparent 1px 1.5rem),
        radial-gradient(circle at 20% 80%, var(--home-ember-soft), transparent 55%);
}

/* Motion: only for visitors who did not ask for reduced motion. */
@media (prefers-reduced-motion: no-preference) {
    .home-hero__content > * {
        animation: home-rise 1.2s var(--home-ease) both;
    }

    .home-hero__content > :nth-child(2) {
        animation-delay: 0.12s;
    }

    .home-hero__content > :nth-child(3) {
        animation-delay: 0.24s;
    }

    .home-hero__content > :nth-child(4) {
        animation-delay: 0.36s;
    }

    .home-hero__scroll::after {
        animation: home-scroll-cue 2.4s var(--home-ease) infinite;
    }

    .home-scene__stars circle {
        animation: home-twinkle 4s ease-in-out infinite;
    }

    .home-scene__stars circle:nth-child(3n) {
        animation-duration: 5.5s;
        animation-delay: -2s;
    }

    .home-scene__stars circle:nth-child(3n + 1) {
        animation-duration: 3.2s;
        animation-delay: -1s;
    }

    .home-scene__windows rect {
        animation: home-flicker 3s ease-in-out infinite;
    }

    .home-scene__windows rect:nth-child(even) {
        animation-delay: -1.4s;
    }

    .home-scene__eyes {
        transform-box: fill-box;
        transform-origin: center;
        animation: home-blink 7s infinite;
    }

    .home-scene__eyes:nth-child(odd) {
        animation-delay: -3s;
    }

    .home-scene__embers circle {
        transform-box: fill-box;
        animation: home-ember 6s linear infinite;
    }

    .home-scene__embers circle:nth-child(2n) {
        animation-duration: 8s;
        animation-delay: -3s;
    }

    .home-scene__embers circle:nth-child(3n) {
        animation-duration: 5s;
        animation-delay: -1.5s;
    }

    .home-marquee__track {
        animation: home-marquee 40s linear infinite;
    }

    /* Keyboard focus only: a clicked link keeps its focus when the page is restored with the Back button, which would freeze the band. */
    .home-marquee:hover .home-marquee__track,
    .home-marquee:has(:focus-visible) .home-marquee__track {
        animation-play-state: paused;
    }

    @supports (animation-timeline: view()) {
        .home-reveal {
            animation: home-reveal linear both;
            animation-timeline: view();
            animation-range: entry 0% entry 70%;
        }

        .home-scene__layer {
            animation: home-parallax linear both;
            animation-timeline: scroll(root);
            animation-range: 0 100vh;
        }

        .home-scene__layer--moon {
            --parallax-shift: 260px;
        }

        .home-scene__layer--far {
            --parallax-shift: 160px;
        }

        .home-scene__layer--mid {
            --parallax-shift: 80px;
        }

        .home-scene__layer--front {
            --parallax-shift: 0px;
        }

        .home-hero__content {
            animation: home-hero-leave linear both;
            animation-timeline: scroll(root);
            animation-range: 0 80vh;
        }
    }
}

@keyframes home-rise {
    from {
        opacity: 0;
        transform: translateY(2rem);
    }
}

@keyframes home-reveal {
    from {
        opacity: 0;
        transform: translateY(3rem) scale(0.98);
    }
}

@keyframes home-parallax {
    to {
        transform: translateY(var(--parallax-shift));
    }
}

@keyframes home-hero-leave {
    to {
        opacity: 0;
        transform: translateY(-4rem);
    }
}

@keyframes home-scroll-cue {
    0% {
        transform: scaleY(0);
    }

    50% {
        transform: scaleY(1);
    }

    100% {
        transform: scaleY(1);
        opacity: 0;
    }
}

@keyframes home-twinkle {
    50% {
        opacity: 0.25;
    }
}

@keyframes home-flicker {
    40% {
        opacity: 0.75;
    }

    60% {
        opacity: 1;
    }
}

@keyframes home-blink {
    0%,
    90%,
    100% {
        transform: scaleY(1);
    }

    93% {
        transform: scaleY(0.1);
    }
}

@keyframes home-ember {
    from {
        opacity: 0;
        transform: translateY(0);
    }

    20% {
        opacity: 1;
    }

    to {
        opacity: 0;
        transform: translateY(-220px);
    }
}

@keyframes home-marquee {
    to {
        transform: translateX(-50%);
    }
}
