/*
 * Guide page: the hero of the game page, a sticky table of contents, then one numbered chapter per topic (weapons,
 * perks, mutators, maps, buildings, troops, enemies) laid out as card grids. Data the guide does not know yet is shown
 * as a "pending" value.
 */
.guide-page {
    /* Risk colour of the mutators, darkened by day to stay readable on parchment. */
    --guide-risk: light-dark(#a14a12, var(--home-ember));
    --guide-nav-height: 3.75rem;
    /* Gap between the stuck table of contents and the top of the window. */
    --guide-nav-offset: var(--space-m);
}

/* Hero: a longer title than the game page, hence a smaller size. */
.guide-hero__title {
    font-size: clamp(2.5rem, 7vw, 6rem);
    text-wrap: balance;
}

.guide-hero__version {
    display: inline-flex;
    align-items: center;
    gap: var(--space-s);
    margin: var(--space-s) 0 0;
    padding: 0.4rem 1rem 0.4rem 0.75rem;
    border: 1px solid var(--home-line-strong);
    border-radius: 999px;
    background-color: var(--home-glass);
    color: var(--home-gold);
    font-family: var(--font-family-ui);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.guide-hero__version-icon {
    flex-shrink: 0;
    width: 1rem;
    height: 1rem;
}

/* Table of contents: stays in view while scrolling; scrolls sideways on its own when it does not fit. */
.guide-nav {
    position: sticky;
    z-index: 3;
    top: var(--guide-nav-offset);
    max-width: var(--home-content-width);
    /* Leaves room below the name engraved at the bottom of the hero. */
    margin: clamp(2rem, 5vw, 3.5rem) auto 0;
    padding-inline: var(--home-gutter);
}

.guide-nav__list {
    display: flex;
    gap: 0.375rem;
    width: fit-content;
    max-width: 100%;
    margin: 0 auto;
    padding: 0.375rem;
    overflow-x: auto;
    border: 1px solid var(--home-line);
    border-radius: 999px;
    background-color: color-mix(in srgb, var(--home-bg) 80%, transparent);
    backdrop-filter: blur(16px) saturate(140%);
    list-style: none;
    scrollbar-width: none;
}

.guide-nav__link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-s);
    min-height: calc(var(--guide-nav-height) - 2 * 0.375rem - 2px);
    padding: 0 1.25rem;
    border-radius: 999px;
    color: var(--home-text);
    font-family: var(--font-family-ui);
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.3s ease, color 0.3s ease;
}

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

.guide-nav__count {
    padding: 0.0625rem 0.5rem;
    border-radius: 999px;
    background-color: var(--home-glass-strong);
    color: var(--home-gold);
    font-size: 0.75rem;
    font-variant-numeric: tabular-nums;
}

/*
 * Pager of the small screens (see guide_chapters_controller.js): it replaces the links of the table of contents and
 * shows one chapter at a time, with an arrow on each side. Hidden without JavaScript, where every chapter stays shown.
 */
.guide-pager {
    display: none;
    align-items: center;
    gap: var(--space-s);
    padding: 0.375rem;
    border: 1px solid var(--home-line);
    border-radius: 999px;
    background-color: color-mix(in srgb, var(--home-bg) 80%, transparent);
    backdrop-filter: blur(16px) saturate(140%);
}

.guide-chapters--paged .guide-nav__list {
    display: none;
}

.guide-chapters--paged .guide-pager {
    display: flex;
}

.guide-chapters--paged .guide-section {
    padding-top: clamp(2rem, 6vw, 3rem);
}

.guide-pager__arrow {
    display: grid;
    flex-shrink: 0;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background-color: var(--home-glass-strong);
    color: var(--home-gold);
    cursor: pointer;
    transition: background-color 0.3s ease, opacity 0.3s ease;
}

.guide-pager__arrow:hover:not(:disabled) {
    background-color: color-mix(in srgb, var(--home-gold) 22%, transparent);
}

.guide-pager__arrow:disabled {
    cursor: default;
    opacity: 0.35;
}

.guide-pager__icon {
    width: 1.125rem;
    height: 1.125rem;
}

.guide-pager__arrow--previous .guide-pager__icon {
    transform: scaleX(-1);
}

.guide-pager__current {
    flex: 1;
    min-width: 0;
    margin: 0;
    text-align: center;
}

.guide-pager__label {
    display: inline-flex;
    align-items: center;
    gap: var(--space-s);
    color: var(--home-text);
    font-family: var(--font-family-ui);
    font-size: 0.9375rem;
    font-weight: 600;
    white-space: nowrap;
}

.guide-pager__label[hidden] {
    display: none;
}

.guide-pager__index {
    color: var(--home-text-muted);
    font-size: 0.75rem;
    font-variant-numeric: tabular-nums;
}

/* Chapters */
.guide-body {
    max-width: var(--home-content-width);
    margin-inline: auto;
    padding: 0 var(--home-gutter) var(--home-section-space);
}

.guide-section {
    position: relative;
    isolation: isolate;
    padding-top: clamp(4rem, 9vw, 7rem);
    /* Keeps the heading clear of the sticky table of contents when reached through it. */
    scroll-margin-top: calc(var(--guide-nav-offset) + var(--guide-nav-height));
}

/*
 * Decor of the Thronefall chapters: a large silhouette from the game beside the heading, lit by the game colour and
 * fading out before the cards, over a faint halo. Kept in the empty space right of the heading on wide screens.
 */
.game-page--thronefall .guide-section {
    --guide-emblem-color: light-dark(
        color-mix(in srgb, var(--game-color) 40%, transparent),
        color-mix(in srgb, var(--game-color) 20%, transparent)
    );
}

.game-page--thronefall .guide-section::before,
.game-page--thronefall .guide-section::after {
    content: '';
    position: absolute;
    pointer-events: none;
}

.game-page--thronefall .guide-section::before {
    z-index: -1;
    top: clamp(3rem, 7vw, 5.5rem);
    right: 0;
    width: clamp(8rem, 22vw, 16rem);
    aspect-ratio: 1;
    background: linear-gradient(var(--guide-emblem-color) 20%, transparent 85%);
    mask: var(--guide-emblem) right top / contain no-repeat;
}

.game-page--thronefall .guide-section::after {
    z-index: -2;
    top: 0;
    right: -10rem;
    width: 40rem;
    height: 28rem;
    background: radial-gradient(closest-side, color-mix(in srgb, var(--game-color) 8%, transparent), transparent);
}

.guide-section--weapons {
    --guide-emblem: url("../images/guide/emblems/weapons-uvP-s_6.webp");
}

.guide-section--perks {
    --guide-emblem: url("../images/guide/emblems/perks-22TWo_O.webp");
}

.guide-section--mutators {
    --guide-emblem: url("../images/guide/emblems/mutators-hmudwUT.webp");
}

.guide-section--maps {
    --guide-emblem: url("../images/guide/emblems/maps-8i7zHpV.webp");
}

.guide-section--buildings {
    --guide-emblem: url("../images/guide/emblems/buildings-PVKwOus.webp");
}

.guide-section--troops {
    --guide-emblem: url("../images/guide/emblems/troops-1RtWzk8.webp");
}

.guide-section--enemies {
    --guide-emblem: url("../images/guide/emblems/enemies-C1I9it-.webp");
}

.guide-section__header {
    display: grid;
    justify-items: start;
    gap: var(--space-m);
    max-width: 48rem;
    margin-bottom: clamp(1.5rem, 4vw, 2.5rem);
}

.guide-section__title {
    margin: 0;
    font-size: clamp(2rem, 4.5vw, 3.5rem);
    line-height: 1;
}

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

.guide-section__report {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: var(--space-s) var(--space-m);
    margin: clamp(1.5rem, 4vw, 2.5rem) 0 0;
    color: var(--home-text-muted);
    font-size: 1rem;
}

.guide-section__report .home-link {
    font-size: 1.03125rem;
}

/* Leaves room below the name engraved at the bottom of the hero. */
.guide-empty {
    margin: 5rem 0 0;
    padding: var(--space-l);
    border: 1px dashed var(--home-line-strong);
    border-radius: var(--home-radius-inner);
    color: var(--home-text-muted);
    text-align: center;
}

/* Card grids */
.guide-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr));
    gap: clamp(0.75rem, 1.6vw, 1.25rem);
    margin: 0;
    padding: 0;
    list-style: none;
}

.guide-grid--wide {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 24rem), 1fr));
}

.guide-card {
    display: flex;
    flex-direction: column;
    gap: var(--space-m);
    height: 100%;
    padding: 1.25rem;
    border: 1px solid var(--home-line);
    border-radius: var(--home-radius-inner);
    background-color: var(--home-surface);
    transition: border-color 0.4s ease;
}

.guide-card:hover {
    border-color: color-mix(in srgb, var(--game-color) 50%, transparent);
}

.guide-card__head {
    display: flex;
    align-items: center;
    gap: var(--space-m);
}

.guide-card__name {
    margin: 0;
    font-size: 1.125rem;
    line-height: 1.15;
    text-transform: uppercase;
}

.guide-card__text {
    margin: 0;
    line-height: 1.55;
}

.guide-card__badge {
    align-self: flex-start;
    margin: 0;
    padding: 0.2rem 0.75rem;
    border: 1px solid currentColor;
    border-radius: 999px;
    color: var(--guide-risk);
    font-family: var(--font-family-ui);
    font-size: 0.75rem;
    font-weight: 600;
}

/* Pushed to the bottom of the card so the stats line up across a row. */
.guide-card__stats {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-s) 1.5rem;
    margin: auto 0 0;
    padding-top: var(--space-m);
    border-top: 1px dashed var(--home-line);
}

.guide-stat {
    display: flex;
    align-items: baseline;
    gap: var(--space-s);
    font-family: var(--font-family-ui);
    font-size: 0.8125rem;
}

.guide-stat__label {
    color: var(--home-text-muted);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.guide-stat__value {
    margin: 0;
    font-weight: 600;
}

.guide-stat__value--pending {
    color: var(--home-text-muted);
    font-style: italic;
    font-weight: 400;
}

/* Icons of weapons, perks, mutators, building options, troops and enemies: a framed square lit by the game colour. */
.guide-icon {
    display: grid;
    /* Tracks the size of the frame, or a portrait image would stretch its row and overflow at the bottom. */
    grid-template: minmax(0, 1fr) / minmax(0, 1fr);
    flex-shrink: 0;
    place-items: center;
    width: 3.5rem;
    height: 3.5rem;
    overflow: hidden;
    border: 1px solid var(--home-line);
    border-radius: 0.75rem;
    background:
        radial-gradient(circle at 50% 30%, color-mix(in srgb, var(--game-color) 22%, transparent), transparent 70%),
        var(--home-surface-raised);
}

.guide-card--compact .guide-icon {
    width: 3rem;
    height: 3rem;
}

/* Relative padding keeps the same margin around the image whatever the size of the frame. */
.guide-icon img {
    width: 100%;
    height: 100%;
    padding: 15%;
    object-fit: contain;
    /* The game icons are white silhouettes: darkened by day to stay visible on parchment. */
    filter: brightness(calc(1 - 0.8 * var(--is-day)));
}

.guide-icon__placeholder {
    width: 1.375rem;
    height: 1.375rem;
    color: var(--home-gold);
}

.guide-card--mutator .guide-icon__placeholder,
.guide-card--boss .guide-icon__placeholder {
    color: var(--guide-risk);
}

/* Weapon abilities: passive in gold, active in the risk colour. */
.guide-abilities {
    display: grid;
    gap: var(--space-s);
    margin: 0;
}

.guide-ability {
    --ability-color: var(--home-gold);

    padding: 0.75rem var(--space-m);
    border-left: 2px solid var(--ability-color);
    border-radius: 0 0.75rem 0.75rem 0;
    background-color: var(--home-glass);
}

.guide-ability--active {
    --ability-color: var(--guide-risk);
}

.guide-ability__label {
    color: var(--ability-color);
    font-family: var(--font-family-ui);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.guide-ability__text {
    margin: 0.25rem 0 0;
    line-height: 1.5;
}

/* Map cards: the leaderboard link covers the whole card, like the tiles of the game page. */
.guide-map__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: var(--space-m);
    padding: var(--space-s) 1.25rem 1.25rem;
}

/* The gap of the body alone spaces the name from the stats, as much as the stats from their dashed line. */
.guide-map .map-tile__name {
    margin: 0;
}

/*
 * Stats right below the name, link at the bottom: when the stats of a tile of the row take two lines, the other tiles
 * get the extra space before their link rather than above their stats.
 */
.guide-map .guide-card__stats {
    margin-top: 0;
}

.guide-map__body > .home-link {
    margin-top: auto;
}

.guide-map .home-link::after {
    content: '';
    position: absolute;
    inset: 0;
}

/* Opens the details of a campaign map: a button looking like the link of the other tiles, stretched over the tile. */
.guide-map__details-button {
    padding: 0 0 0.125rem;
    border: 0;
    border-bottom: 1px solid currentColor;
    background: none;
    font-size: inherit;
    line-height: inherit;
    cursor: pointer;
}

.guide-map__details-button[hidden] {
    display: none;
}

/* Leaderboard of a campaign map, in the top right corner of its art; raised above the button stretched over the tile. */
.guide-map__leaderboard {
    position: absolute;
    z-index: 2;
    top: var(--space-m);
    right: var(--space-m);
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.75rem;
    border: 1px solid var(--game-color);
    border-radius: 999px;
    background-color: var(--home-shade-night);
    color: var(--game-color);
    font-family: var(--font-family-ui);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-decoration: none;
    text-transform: uppercase;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.guide-map__leaderboard:hover {
    background-color: var(--game-color);
    color: var(--color-night-deep);
}

.guide-map__leaderboard-icon {
    width: 0.875rem;
    height: 0.875rem;
}

/* Details of a map: a fixed header, then the quests and the waves, which scroll on their own. */
.guide-dialog {
    width: min(44rem, 100vw - 2rem);
    max-height: min(85dvh, 56rem);
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--home-line-strong);
    border-radius: var(--home-radius-inner);
    background-color: var(--home-surface);
    box-shadow: 0 30px 80px var(--color-shadow);
    color: var(--home-text);
}

.guide-dialog::backdrop {
    background-color: rgb(5 7 15 / 0.6);
    backdrop-filter: blur(4px);
}

/* The page behind stays still while a dialog is open. */
:root:has(.guide-dialog[open]) {
    overflow: hidden;
}

/* Only while open: a closed dialog keeps the display: none of the browser. */
.guide-dialog[open] {
    display: flex;
    flex-direction: column;
}

.guide-dialog__header {
    display: flex;
    flex-shrink: 0;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--space-m);
    padding: 1.5rem 1.5rem var(--space-m);
    border-bottom: 1px solid var(--home-line);
}

.guide-dialog__body {
    display: grid;
    flex: 1;
    gap: var(--space-l);
    min-height: 0;
    padding: 1.5rem;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.guide-dialog__heading {
    display: grid;
    gap: var(--space-s);
}

.guide-dialog__title {
    margin: 0;
    font-size: clamp(1.5rem, 4vw, 2rem);
    line-height: 1.1;
}

.guide-dialog__close {
    display: grid;
    flex-shrink: 0;
    place-items: center;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: none;
    color: var(--home-text-muted);
    cursor: pointer;
}

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

.guide-dialog__close-icon {
    width: 1.125rem;
    height: 1.125rem;
}

.guide-dialog__subtitle {
    margin: 0 0 var(--space-m);
    font-size: 1.125rem;
}

.guide-quests {
    display: grid;
    gap: var(--space-s);
    margin: 0;
    padding-left: 1.5rem;
    line-height: 1.5;
}

.guide-quest::marker {
    color: var(--home-gold);
    font-family: var(--font-family-ui);
    font-weight: 700;
}

.guide-waves {
    display: grid;
    gap: var(--space-s);
    margin: 0;
    padding: 0;
    list-style: none;
}

/* A wave: its number and gold on the left, its enemies on the right; stacked on small screens. */
.guide-wave {
    display: grid;
    grid-template-columns: 6.5rem 1fr;
    align-items: start;
    gap: var(--space-m);
    padding: 0.75rem;
    border: 1px solid var(--home-line);
    border-radius: 0.625rem;
    background-color: var(--home-glass);
}

.guide-wave__head {
    display: grid;
    gap: 0.25rem;
    padding-top: 0.25rem;
    font-family: var(--font-family-ui);
}

.guide-wave__number {
    font-weight: 700;
}

.guide-wave__gold {
    color: var(--home-gold);
    font-size: 0.875rem;
    font-variant-numeric: tabular-nums;
}

.guide-wave__enemies {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-s);
    margin: 0;
    padding: 0;
    list-style: none;
}

.guide-wave__enemy {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.75rem 0.25rem 0.25rem;
    border-radius: 999px;
    background-color: var(--home-surface-raised);
    font-size: 0.875rem;
}

.guide-wave__enemy .guide-icon {
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
}

.guide-wave__enemy .guide-icon__placeholder {
    width: 0.875rem;
    height: 0.875rem;
}

.guide-wave__units {
    color: var(--home-gold);
    font-family: var(--font-family-ui);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

@media (max-width: 36rem) {
    .guide-wave {
        grid-template-columns: 1fr;
        gap: var(--space-s);
    }

    .guide-wave__head {
        display: flex;
        justify-content: space-between;
        padding-top: 0;
    }
}

/* Troops: one group per training building, headed by its name in gold. */
.guide-groups {
    display: grid;
    gap: clamp(1.5rem, 3vw, 2.25rem);
}

.guide-group {
    display: grid;
    gap: var(--space-m);
}

.guide-group__title {
    margin: 0;
    padding-bottom: var(--space-s);
    border-bottom: 1px dashed var(--home-line);
    color: var(--home-gold);
    font-family: var(--font-family-display);
    font-size: 1.25rem;
    letter-spacing: var(--letter-spacing-display);
    text-transform: uppercase;
}

/*
 * Building cards: one per row, as they hold the whole upgrade path. Wide screens put the summary on the left and the
 * levels on the right.
 */
.guide-list {
    display: grid;
    gap: clamp(0.75rem, 1.6vw, 1.25rem);
    margin: 0;
    padding: 0;
    list-style: none;
}

.guide-building {
    display: grid;
    gap: var(--space-l);
}

.guide-building__summary {
    display: flex;
    flex-direction: column;
    gap: var(--space-m);
}

@media (min-width: 60rem) {
    .guide-building {
        grid-template-columns: minmax(16rem, 1fr) 2.5fr;
        padding: 1.5rem;
    }
}

.guide-upgrades {
    display: grid;
    gap: 0.75rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.guide-upgrade {
    --upgrade-color: var(--home-gold);

    display: grid;
    gap: 0.75rem;
    padding: 0.875rem var(--space-m);
    border-left: 2px solid var(--upgrade-color);
    border-radius: 0 0.75rem 0.75rem 0;
    background-color: var(--home-glass);
}

.guide-upgrade__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-s) 0.75rem;
}

.guide-upgrade__level {
    color: var(--upgrade-color);
    font-family: var(--font-family-display);
    font-size: 0.9375rem;
    font-weight: 700;
    letter-spacing: var(--letter-spacing-display);
    text-transform: uppercase;
}

.guide-upgrade__stats {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-s) 1.25rem;
    margin: 0 0 0 auto;
}

.guide-upgrade__text {
    margin: 0;
    line-height: 1.5;
}

.guide-upgrade__choices {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 11rem), 1fr));
    gap: var(--space-s);
    margin: 0;
    padding: 0;
    list-style: none;
}

.guide-choice {
    display: flex;
    flex-direction: column;
    gap: var(--space-s);
    padding: 0.75rem;
    border: 1px dashed var(--home-line);
    border-radius: 0.625rem;
    background-color: var(--home-surface);
}

.guide-choice__head {
    display: flex;
    align-items: center;
    gap: var(--space-s);
}

.guide-choice .guide-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.5rem;
}

.guide-choice__name {
    margin: 0;
    font-size: 0.9375rem;
    line-height: 1.2;
}

.guide-choice__text {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.5;
}

/* Pushed to the bottom of the option so the stats line up across a level. */
.guide-choice__stats {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-s) 1rem;
    margin: auto 0 0;
}

@media (prefers-reduced-motion: reduce) {
    .guide-card,
    .guide-nav__link,
    .guide-pager__arrow,
    .guide-map__leaderboard {
        transition: none;
    }
}

/*
 * Guide index, "the codex": a large title with a motto, a ribbon of chapter names, then one book cover per game with
 * its table of contents. A game without a guide yet gets a wax seal on its cover.
 */
.guide-index__title {
    font-size: clamp(4rem, 14vw, 11rem);
}

.guide-index__motto {
    max-width: 28ch;
    margin: 0;
    color: var(--home-gold);
    font-size: clamp(1.5rem, 3vw, 2.25rem);
    font-style: italic;
    line-height: 1.25;
    text-wrap: balance;
}

.guide-index__figures {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-s) calc(var(--space-m) + var(--space-xs));
    margin: var(--space-s) 0 0;
    padding: 0;
    color: var(--home-text-muted);
    font-family: var(--font-family-ui);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    list-style: none;
    text-transform: uppercase;
}

.guide-index__figures li {
    display: flex;
    align-items: baseline;
    gap: var(--space-s);
}

/* The star of the ribbon between two figures, as far from each. */
.guide-index__figures li + li::before {
    content: '✦' / '';
    align-self: center;
    margin-right: calc(var(--space-m) + var(--space-xs) - var(--space-s));
    font-size: 1rem;
}

.guide-index__figure {
    color: var(--home-text);
    font-family: var(--font-family-display);
    font-size: 2.25rem;
    letter-spacing: 0;
    line-height: 1;
}

/*
 * Ribbon: the home page ticker tilted the other way, every other word engraved. Night-blue by night; by day a faint
 * band barely darker than the page, as it is only decorative. Opaque, as it overlaps the name engraved in the hero.
 */
.guide-ribbon {
    --ribbon-text: light-dark(rgb(125 92 15 / 0.6), var(--color-gold-light));

    border-block: 1px solid light-dark(var(--home-line), transparent);
    background: light-dark(color-mix(in srgb, var(--color-text) 4%, var(--home-bg)), var(--color-night-deep));
    color: var(--ribbon-text);
    box-shadow: 0 20px 60px -25px light-dark(transparent, var(--color-shadow));
    transform: rotate(1.5deg);
}

.guide-ribbon li:nth-child(even) {
    color: transparent;
    -webkit-text-stroke: 1px var(--ribbon-text);
}

.guide-ribbon li::after {
    color: var(--ribbon-text);
}

/* Volumes */
.guide-volumes {
    max-width: var(--home-content-width);
    margin-inline: auto;
    padding: var(--home-section-space) var(--home-gutter) 0;
}

.guide-volumes__list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 26rem), 1fr));
    gap: clamp(2rem, 4vw, 3rem);
    margin: 0;
    padding: 0;
    list-style: none;
}

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

/* A book cover: a coloured spine on the left, a thin inner frame and the game name engraved along the right edge. */
.guide-volume {
    --volume-color: var(--home-gold);
    --volume-padding: clamp(1.5rem, 3vw, 2.5rem);

    position: relative;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-m);
    height: 100%;
    padding: calc(var(--volume-padding) + 0.5rem) var(--volume-padding) var(--volume-padding) calc(var(--volume-padding) + 0.75rem);
    border: 1px solid var(--home-line);
    border-left: 0.875rem solid color-mix(in srgb, var(--volume-color) 70%, var(--color-night-deep));
    border-radius: 0.375rem var(--home-radius-inner) var(--home-radius-inner) 0.375rem;
    background:
        radial-gradient(ellipse at 100% 0, color-mix(in srgb, var(--volume-color) 16%, transparent), transparent 60%),
        var(--home-surface);
    box-shadow:
        0 30px 70px -40px color-mix(in srgb, var(--volume-color) 60%, transparent),
        inset 6px 0 12px -8px var(--color-shadow);
    transition: border-color 0.6s ease;
}

.guide-volume--thronefall {
    --volume-color: var(--color-thronefall);
}

.guide-volume--craaghelm {
    --volume-color: var(--color-craaghelm);
}

.guide-volume:hover {
    border-color: color-mix(in srgb, var(--volume-color) 55%, transparent);
    border-left-color: color-mix(in srgb, var(--volume-color) 70%, var(--color-night-deep));
}

.guide-volume::before {
    content: '';
    position: absolute;
    z-index: -1;
    inset: 0.75rem;
    border: 1px solid color-mix(in srgb, var(--volume-color) 30%, transparent);
    border-radius: 0.375rem;
    pointer-events: none;
}

/* Clipped by its own box, as the cover lets the wax seal overflow. */
.guide-volume::after {
    content: attr(data-title) / '';
    position: absolute;
    z-index: -1;
    top: 0.75rem;
    right: 1rem;
    bottom: 0.75rem;
    overflow: hidden;
    color: transparent;
    font-family: var(--font-family-display);
    font-size: clamp(4rem, 7vw, 6rem);
    font-weight: 700;
    line-height: 1;
    text-transform: uppercase;
    white-space: nowrap;
    writing-mode: vertical-rl;
    -webkit-text-stroke: 1px color-mix(in srgb, var(--volume-color) 30%, transparent);
    pointer-events: none;
}

.guide-volume__number {
    margin: 0;
    color: var(--home-gold);
    font-family: var(--font-family-ui);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.24em;
    text-transform: uppercase;
}

.guide-volume__title {
    margin: 0;
    background: linear-gradient(
        175deg,
        var(--home-title-from) 35%,
        light-dark(color-mix(in srgb, var(--volume-color) 55%, var(--color-text)), var(--volume-color)) 80%
    );
    background-clip: text;
    color: transparent;
    font-size: clamp(2.25rem, 4.5vw, 3.5rem);
    line-height: 1;
}

/* Wax seal stamped over the top right corner of the cover. */
.guide-volume__seal {
    position: absolute;
    top: -1.5rem;
    right: clamp(-1.5rem, -2vw, -0.5rem);
    display: grid;
    place-items: center;
    align-content: center;
    gap: 0.375rem;
    width: 6.5rem;
    aspect-ratio: 1;
    margin: 0;
    padding: var(--space-s);
    border-radius: 48% 52% 50% 50% / 50% 46% 54% 50%;
    background: radial-gradient(
        circle at 35% 30%,
        color-mix(in srgb, var(--volume-color) 70%, white),
        var(--volume-color) 45%,
        color-mix(in srgb, var(--volume-color) 55%, black)
    );
    box-shadow:
        0 12px 25px -10px color-mix(in srgb, var(--volume-color) 80%, transparent),
        inset 0 0 0 5px rgb(0 0 0 / 0.12);
    color: var(--color-night-deep);
    font-family: var(--font-family-ui);
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    line-height: 1.1;
    text-align: center;
    text-transform: uppercase;
    transform: rotate(-12deg);
}

.guide-volume__seal-icon {
    width: 1.5rem;
    height: 1.5rem;
}

/* Table of contents with dotted leaders, faded while the volume is sealed. */
.guide-volume__chapters {
    display: grid;
    gap: 0.625rem;
    width: 100%;
    margin: var(--space-s) 0 var(--space-m);
    padding: 0;
    list-style: none;
}

.guide-volume--sealed .guide-volume__chapters {
    opacity: 0.55;
}

.guide-volume__chapter {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    font-size: 1.0625rem;
}

.guide-volume__chapter-leader {
    flex: 1;
    min-width: 1rem;
    border-bottom: 1px dotted var(--home-line-strong);
}

.guide-volume__chapter-number {
    color: var(--home-gold);
    font-family: var(--font-family-ui);
    font-size: 0.75rem;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.1em;
}

.guide-volume__action {
    margin-top: auto;
}

/* Colophon: a short closing note under three stars, with an illuminated drop cap. */
.guide-colophon {
    display: grid;
    justify-items: center;
    gap: var(--space-m);
    max-width: 46rem;
    margin-inline: auto;
    padding: var(--home-section-space) var(--home-gutter);
    text-align: center;
}

.guide-colophon::before {
    content: '✦ ✦ ✦' / '';
    color: var(--home-gold);
    letter-spacing: 0.5em;
}

.guide-colophon__title {
    margin: 0;
    font-size: clamp(1.75rem, 4vw, 2.75rem);
}

.guide-colophon__text {
    margin: var(--space-s) 0 0;
    font-size: clamp(1.125rem, 1.8vw, 1.375rem);
    line-height: 1.6;
    text-align: left;
    text-wrap: pretty;
}

.guide-colophon__text::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;
}

@media (prefers-reduced-motion: reduce) {
    .guide-volume {
        transition: none;
    }
}
