/* Navigation proportions and copper rules from the approved first reference. */
.site-header {
    background: linear-gradient(180deg, #071014ed, #0a1318d9);
    border-bottom: 1px solid #b7783f;
    box-shadow: 0 2px 18px #0003;
    backdrop-filter: blur(12px);
}
.site-header::after {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    bottom: -5px;
    left: calc(50% - 4px);
    border-right: 1px solid #ce8b4b;
    border-bottom: 1px solid #ce8b4b;
    background: #0b1519;
    transform: rotate(45deg);
    pointer-events: none;
}
.site-header .header-inner {
    width: min(1456px, calc(100% - 80px));
    min-height: 60px;
    gap: 26px;
}
.site-header .brand {
    gap: 15px;
}
.site-header .brand > .emblem {
    width: 73px;
    height: 42px;
    color: #e78c4f;
    filter: drop-shadow(0 0 8px #dc702421);
}
.site-header .brand > span {
    border-color: #cb9768;
    padding-left: 18px;
}
.site-header .brand strong {
    font: 400 27px/1.2 var(--body-serif);
    letter-spacing: 0;
    color: #f2e5cd;
}
.site-header .site-nav {
    gap: 27px;
}
.site-header .site-nav a {
    gap: 10px;
    padding-block: 17px;
    font: 600 16px/1.5 var(--sans);
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #f0e7d5;
}
.site-header .site-nav a:hover,
.site-header .site-nav a[aria-current] {
    color: #f4ae6f;
}
.site-header .site-nav .icon {
    display: block;
    width: 27px;
    height: 27px;
    stroke-width: 1.15;
}
.site-header .site-nav a::after {
    bottom: 7px;
    background: #e7904b;
    box-shadow: 0 0 10px #c8663166;
}
/* A brass regulator with a visible run/pause state. */
.site-header .motion-toggle {
    position: relative;
    width: 40px;
    height: 40px;
    padding: 3px;
    border: 1px solid #a77c4e;
    border-radius: 50%;
    color: #f3c692;
    background: radial-gradient(circle at 35% 25%, #66513a, #241f1a 62%, #0a1418);
    box-shadow:
        inset 0 0 0 2px #10191b,
        inset 0 0 0 3px #a77c4e55,
        0 2px 8px #0008;
}
.site-header .motion-toggle:hover {
    border-color: #efb57f;
    color: #ffe0b0;
}
.motion-mechanism {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
}
.motion-cog {
    grid-area: 1 / 1;
    width: 100%;
    height: 100%;
    color: #c78d52;
}
.motion-control-icon {
    grid-area: 1 / 1;
    display: grid;
    place-items: center;
    width: 20px;
    height: 20px;
    border: 1px solid #c78d5255;
    border-radius: 50%;
    background: #101719;
    box-shadow: inset 0 1px 3px #000a;
}
.motion-control-icon .icon {
    width: 12px;
    height: 12px;
    stroke-width: 2;
}
.motion-control-play {
    display: none;
}
.motion-indicator {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 6px;
    height: 6px;
    border: 1px solid #493723;
    border-radius: 50%;
    background: #ffc576;
    box-shadow: 0 0 5px #ea9a49;
}
.site-header .motion-toggle[aria-pressed='true'] {
    color: #dcc9ad;
    border-color: #847053;
    background: radial-gradient(circle at 35% 25%, #40392e, #1b1c19 65%, #0a1418);
}
.motion-toggle[aria-pressed='true'] .motion-control-pause {
    display: none;
}
.motion-toggle[aria-pressed='true'] .motion-control-play {
    display: grid;
}
.motion-toggle[aria-pressed='true'] .motion-indicator {
    background: #6c6454;
    box-shadow: none;
}
.explorer-choice {
    grid-template-columns: 82px minmax(0, 1fr);
}
.choice-emblem .icon {
    width: 29px;
    height: 29px;
}
/* Every home card uses the same square window and preserves the artwork. */
.home-page .chronicle-story {
    display: flex;
    flex-direction: column;
}
.home-page .chronicle-story-art,
.home-page .home-chapter-catalog .chapter-art {
    display: block;
    width: 100%;
    height: auto;
    min-height: 0;
    aspect-ratio: 1;
    flex-shrink: 0;
    background: radial-gradient(ellipse, #49352155, #0b1518 75%);
    border-bottom: 1px solid #a7734566;
}
.home-page .chronicle-story-art img,
.home-page .home-chapter-catalog .chapter-art img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    padding: 12px;
    filter: saturate(0.9);
    transform: none;
}
.home-page .chronicle-story:hover .chronicle-story-art img,
.home-page .home-chapter-catalog .chapter-art:hover img {
    transform: none;
}
.home-page .home-chapter-catalog .chapter-art::after {
    background: none;
}
@media (max-width: 1050px) {
    .home-page .chronicle-stories,
    .home-page .home-chapter-catalog {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 520px) {
    .home-page .chronicle-stories,
    .home-page .home-chapter-catalog {
        grid-template-columns: minmax(0, 1fr);
    }
}
.home-page .hero {
    border: 1px solid #a77345;
}
/* The foreground ironwork belongs to the page environment, not a small cutout. */
.world-explorer,
.illustrated-page,
.lore-article-page {
    position: relative;
    isolation: isolate;
    background: #0b1214;
}
.world-explorer::before,
.illustrated-page::before,
.lore-article-page::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        linear-gradient(
            90deg,
            transparent,
            #07101266 100px,
            #071012cc 140px,
            #07101280 320px,
            #07101273 65%
        ),
        url('../assets/ironwork-page-background.webp') -50px top / cover no-repeat;
}
.world-explorer .container,
.lore-article-page > .container {
    width: min(1320px, calc(100% - 220px));
}
@media (max-width: 1250px) {
    .site-header .header-inner {
        gap: 18px;
    }
    .site-header .brand {
        gap: 10px;
    }
    .site-header .brand > span {
        padding-left: 13px;
    }
    .site-header .brand strong {
        font-size: 22px;
    }
    .site-header .brand > .emblem {
        width: 55px;
    }
    .site-header .site-nav {
        gap: 15px;
    }
    .site-header .site-nav a {
        font-size: 14px;
        letter-spacing: 0.5px;
        gap: 7px;
    }
    .site-header .site-nav .icon {
        width: 22px;
        height: 22px;
    }
}
@media (max-width: 1100px) {
    .world-explorer .container,
    .lore-article-page > .container {
        width: calc(100% - 80px);
    }
    .explorer-choice {
        grid-template-columns: 62px minmax(0, 1fr);
    }
    .world-explorer::before,
    .illustrated-page::before,
    .lore-article-page::before {
        background: radial-gradient(ellipse at 0 25%, #45574c33, transparent 70%), #0c1518;
    }
}
@media (min-width: 901px) and (max-width: 1100px) {
    .site-header .header-inner {
        width: calc(100% - 48px);
        gap: 12px;
    }
    .site-header .brand > .emblem {
        width: 48px;
    }
    .site-header .brand strong {
        font-size: 21px;
    }
    .site-header .site-nav {
        gap: 12px;
    }
    .site-header .site-nav a {
        gap: 6px;
        letter-spacing: 0.2px;
    }
    .site-header .site-nav .icon {
        width: 20px;
        height: 20px;
    }
}
@media (max-width: 900px) {
    .site-header .header-inner {
        min-height: 66px;
        width: calc(100% - 36px);
        gap: 12px;
    }
    .site-header .brand > .emblem {
        width: 50px;
        height: 38px;
    }
    .site-header .brand strong {
        font-size: 23px;
    }
    .site-header .site-nav {
        top: 66px;
        gap: 0;
        background: #0b1519f7;
        border-bottom-color: #b7783f;
    }
    .site-header .site-nav a {
        font-size: 16px;
        padding-block: 14px;
        gap: 15px;
    }
    .site-header .site-nav .icon {
        width: 25px;
        height: 25px;
    }
}
@media (max-width: 760px) {
    .world-explorer .container,
    .lore-article-page > .container {
        width: calc(100% - 36px);
    }
    .explorer-choice {
        grid-template-columns: 70px minmax(0, 1fr);
    }
}
@media (max-width: 400px) {
    .site-header .header-inner {
        width: calc(100% - 28px);
        gap: 7px;
    }
    .site-header .brand {
        gap: 8px;
    }
    .site-header .brand > span {
        padding-left: 9px;
    }
    .site-header .brand > .emblem {
        width: 39px;
    }
    .site-header .brand strong {
        font-size: 19px;
    }
    .site-header .menu-toggle {
        width: 36px;
        height: 36px;
    }
    .site-header .motion-toggle {
        width: 36px;
        height: 36px;
    }
}

/* Encyclopedia articles continue the world page's environment and reading grid. */
.lore-article-page .page-heading {
    padding-block: 42px 28px;
    margin-bottom: 32px;
    border-bottom: 1px solid #946a4166;
}
.lore-article-page .page-heading .eyebrow {
    color: #efb57f;
    margin: 0 0 12px;
}
.lore-article-page .page-heading h1 {
    font: 400 52px/1.15 var(--body-serif);
    margin: 0 0 18px;
    color: #f2e5ce;
}
.lore-article-page .page-intro {
    font: 18px/1.7 var(--body-serif);
    color: #dbd2c0;
    max-width: 850px;
    margin: 0;
}
.lore-article-page .lore-layout {
    grid-template-columns: 235px minmax(0, 1fr);
    gap: 28px;
}
.lore-article-page .lore-sidebar {
    top: 92px;
    max-height: calc(100vh - 115px);
    padding: 22px;
    border: 1px solid #936a456e;
    border-radius: 2px;
    background: #091215de;
}
.lore-article-page .lore-sidebar nav {
    margin-block: 20px 28px;
}
.lore-article-page .lore-sidebar nav > a,
.lore-article-page .article-toc a {
    color: #d3c8b4;
    font-size: 14px;
    line-height: 1.6;
    border-color: #936a4544;
}
.lore-article-page .lore-sidebar a:hover,
.lore-article-page .lore-sidebar a[aria-current] {
    color: #f4ae6f;
}
.lore-article-page .article-toc {
    border-color: #946a4166;
}
.lore-article-page .lore-surface {
    padding: clamp(24px, 3vw, 44px);
    background: #091215e8;
    border: 1px solid #936a456e;
    border-radius: 2px;
    box-shadow: 0 15px 40px #0003;
}
.lore-article-page .prose {
    font: 18px/1.85 var(--body-serif);
    color: #ded6c7;
}
.lore-article-page .prose h3,
.lore-article-page .prose h4 {
    font-family: var(--body-serif);
    font-weight: 400;
    color: #f0dfc0;
    letter-spacing: 0;
}
.lore-article-page .prose .illustration {
    padding-bottom: 24px;
    border-color: #936a4566;
}
.lore-article-page .prose .illustration > img {
    border-color: #a7734577;
}
.lore-article-page .prose .image-caption {
    color: #c6b69a;
}
.lore-article-page .prose .steam-quote {
    border-left: 1px solid #b77e4a;
    background: linear-gradient(90deg, #8c582522, transparent);
}
.lore-article-page .prose .region,
.lore-article-page .prose .feature-item {
    border-color: #936a456e;
    background: #08111499;
}
@media (max-width: 1100px) {
    .lore-article-page .lore-layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 24px;
    }
    .lore-article-page .lore-sidebar {
        position: static;
        max-height: none;
    }
    .lore-article-page .lore-sidebar nav {
        margin-block: 14px 0;
    }
}
@media (max-width: 760px) {
    .lore-article-page .page-heading h1 {
        font-size: 38px;
    }
    .lore-article-page .page-heading {
        padding-block: 30px 24px;
        margin-bottom: 24px;
    }
    .lore-article-page .lore-sidebar {
        padding: 20px;
    }
    .lore-article-page .prose {
        font-size: 17px;
    }
}

/* Mobile has a quiet background and no motion, independently of desktop preferences. */
@media (max-width: 900px), (hover: none) and (pointer: coarse) {
    .home-page main::before {
        background: radial-gradient(ellipse at 50% 0, #26343877, transparent 65%), #0c1518;
    }
    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
    .site-header .motion-toggle,
    .sky-lane,
    .ember-field,
    .steam-layer {
        display: none !important;
    }
}
