:root {
    color-scheme: dark;
    --canvas: #17181a;
    --surface: #212224;
    --text: #f4efe5;
    --body-text: #dbd5c9;
    --muted: #b9b1a3;
    --gold: #edc577;
    --link-hover: #ffe1a1;
    --link-active: #e3b76e;
    --line: #37383b;
    --gutter: clamp(1rem, 4.5vw, 3rem);
    --sticky-row-height: 3.375rem;
    --feed-width: 52rem;
    --section-text-size: clamp(1rem, 1.15vw, 1.125rem);
    --section-heading-size: calc(var(--section-text-size) + 2px);
    font-family: system-ui, sans-serif;
    background: var(--canvas);
    color: var(--text);
    scroll-padding-block-start: calc(var(--sticky-row-height) + .75rem);
}

*, *::before, *::after {
    box-sizing: border-box;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    background: linear-gradient(90deg, #24262944, transparent 24% 76%, #24262944);
}

a,
a :where(*) {
    text-decoration: none;
}

a {
    color: var(--gold);
}

a:hover {
    color: var(--link-hover);
}

a:active {
    color: var(--link-active);
}

:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 4px;
}

.shell {
    width: min(calc(100% - 2 * var(--gutter)), 74rem);
    margin-inline: auto;
}

.skip-link {
    position: fixed;
    z-index: 3;
    inset-block-start: .5rem;
    inset-inline-start: var(--gutter);
    padding: .65rem 1rem;
    color: #181510;
    background: var(--gold);
    transform: translateY(-150%);
}

.skip-link:focus {
    transform: none;
}

.skip-link:hover,
.skip-link:active {
    color: #181510;
}

.hero {
    --hero-fade: clamp(6.25rem, 12vw, 10rem);
    background-color: var(--canvas);
    background-image:
        linear-gradient(to bottom, transparent calc(100% - var(--hero-fade)), var(--canvas)),
        radial-gradient(ellipse at center, #10111366, #1011131a 75%),
        url("brand/header-background.webp");
    background-repeat: no-repeat;
    background-size: auto, auto, cover;
    background-position: center, center, center 55%;
}

.hero__content {
    --hero-bottom-space: clamp(1.25rem, 2.25vw, 2rem);
    display: grid;
    grid-template: "crest wordmark game" / minmax(0, 1fr) minmax(0, 2.25fr) minmax(0, 1fr);
    place-items: center;
    gap: clamp(1rem, 3.5vw, 3.5rem);
    width: min(calc(100% - 2 * var(--gutter)), 68rem);
    min-height: calc(clamp(19rem, 26vw, 24rem) - var(--hero-bottom-space));
    padding-block: clamp(1.5rem, 3vw, 2.5rem) var(--hero-bottom-space);
}

.hero__art {
    display: block;
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

.hero__crest {
    grid-area: crest;
    width: min(100%, clamp(8rem, 16vw, 13rem));
}

.hero__wordmark {
    grid-area: wordmark;
    display: grid;
    justify-items: center;
    gap: clamp(.35rem, 1.15vw, .875rem);
    width: 100%;
}

.hero__tag {
    width: min(38%, 9.5rem);
}

.hero__name-wrap {
    position: relative;
    width: 100%;
    transform: scaleX(1.07);
}

.hero__name {
    width: 100%;
}

.hero__motto {
    width: min(92%, 25rem);
    transform: scaleX(1.075);
}

.hero__game {
    grid-area: game;
    width: min(100%, clamp(6.5rem, 12vw, 10rem));
}

@media (width > 70rem) {
    .hero__content {
        /* Keep the original wordmark track. Fit larger empty sides around the scaled artwork. */
        --wordmark-width: calc((min(100vw - 2 * var(--gutter), 68rem) - 2 * clamp(1rem, 3.5vw, 3.5rem)) * .52941176);
        width: min(calc(100% - 2 * var(--gutter)), 82rem);
        grid-template-columns: minmax(0, 1fr) var(--wordmark-width) minmax(0, 1fr);
        column-gap: clamp(2rem, calc((100% - var(--wordmark-width)) / 2 - 13rem), 10.5rem);
    }

    .hero__crest {
        justify-self: end;
    }

    .hero__game {
        justify-self: start;
    }
}

@supports (mask-image: url("brand/svoboda.webp")) {
    @media (prefers-reduced-motion: no-preference) {
        .hero__name-wrap--ready::after {
            position: absolute;
            inset: 0;
            background: linear-gradient(108deg, transparent 42%, #ffdc951a 47%, #fff1c9b3 50%, transparent 58%)
                100% 50% / 260% 100% no-repeat;
            mask: url("brand/svoboda.webp") center / 100% 100% no-repeat;
            pointer-events: none;
            animation: wordmark-glint 2.25s ease-in-out 1s both;
            content: "";
        }
    }
}

@keyframes wordmark-glint {
    from { background-position: 100% 50%; opacity: 0; }
    18%, 75% { opacity: .72; }
    to { background-position: 0% 50%; opacity: 0; }
}

.sticky-bar {
    position: sticky;
    z-index: 2;
    inset-block-start: 0;
    background: var(--canvas);
}

@supports (backdrop-filter: blur(12px)) {
    .sticky-bar {
        background: #17181af0;
        backdrop-filter: blur(12px);
    }
}

.navigation__inner {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: var(--sticky-row-height);
}

.navigation__title {
    margin: 0;
    font-size: 1.125rem;
    line-height: 1.25;
}

@media (width > 70rem) {
    .navigation__title {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip-path: inset(50%);
        white-space: nowrap;
    }
}

.section-links {
    display: flex;
    gap: clamp(.4rem, 1.2vw, 1rem);
    margin: 0;
    padding: 0;
    list-style: none;
}

.section-links li > * {
    display: flex;
    min-height: var(--sticky-row-height);
    align-items: center;
    padding-inline: .45rem;
    color: var(--muted);
    font-size: .925rem;
    font-weight: 600;
}

.desktop-nav .section-links li > * {
    font-size: 1.225rem;
}

.desktop-nav .section-links {
    gap: calc(clamp(.4rem, 1.2vw, 1rem) + clamp(1.25rem, 2vw, 1.5rem));
}

.section-links a[aria-current="page"] {
    box-shadow: inset 0 -2px var(--gold);
    color: var(--gold);
}

.section-links a:hover,
.mobile-nav summary:hover {
    background: #28292c;
    color: var(--link-hover);
}

.section-links a:active {
    color: var(--link-active);
}

.mobile-nav {
    display: none;
}

.page-content {
    position: relative;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.side-wallpapers {
    display: none;
}

@supports (width: 1cqi) and (mask-composite: intersect) and (height: 100dvh) and (overflow: clip) {
    @media (min-width: 80rem) {
        .page-content {
            container-type: inline-size;
        }

        .side-wallpapers {
            --wallpaper-opacity: .70;
            --wallpaper-glint-opacity: .10;
            --wallpaper-width: calc((100cqi - var(--feed-width)) / 2 * .90);
            --wallpaper-height: calc(var(--wallpaper-width) * 1536 / 560);
            position: absolute;
            inset: 0;
            display: flex;
            justify-content: space-between;
            overflow: clip;
            pointer-events: none;
        }

        .side-wallpaper {
            position: sticky;
            inset-block-start: var(--sticky-row-height);
            align-self: flex-start;
            width: var(--wallpaper-width);
            /* The zero-height anchor stays pinned while the artwork is clipped at the document edge. */
            height: 0;
            --wallpaper-edge-mask:
                linear-gradient(to bottom, transparent, #000 2.5rem),
                linear-gradient(var(--wallpaper-fade), #000 72%, transparent);
        }

        .side-wallpaper::before,
        .side-wallpaper::after {
            position: absolute;
            inset: 0 0 auto;
            height: min(var(--wallpaper-height), max(0px, calc(100dvh - var(--sticky-row-height))));
        }

        .side-wallpaper::before {
            opacity: var(--wallpaper-opacity);
            background-image: var(--wallpaper-image);
            background-position: top;
            background-size: 100% auto;
            background-repeat: no-repeat;
            mask-image: var(--wallpaper-edge-mask);
            mask-composite: intersect;
            content: "";
        }

        .side-wallpaper--left {
            --wallpaper-fade: to right;
            --wallpaper-image: url("brand/side-left.webp");
        }

        .side-wallpaper--right {
            --wallpaper-fade: to left;
            --wallpaper-image: url("brand/side-right.webp");
            --wallpaper-glint-delay: 1.5s;
        }
    }

    @media (min-width: 80rem) and (prefers-reduced-motion: no-preference) {
        .side-wallpapers--glint .side-wallpaper::after {
            opacity: var(--wallpaper-glint-opacity);
            background: linear-gradient(160deg, transparent 35%, #afc4d640 44%, #d3e3f1 50%,
                #afc4d640 56%, transparent 65%) center / 100% 280% no-repeat;
            mask-image: var(--wallpaper-image), var(--wallpaper-edge-mask);
            mask-size: 100% auto, 100% 100%, 100% 100%;
            mask-position: top;
            mask-repeat: no-repeat;
            mask-composite: intersect;
            animation: wallpaper-glint 5.5s ease-in-out var(--wallpaper-glint-delay, 0s) both;
            content: "";
        }

        .side-wallpapers--glint-fading .side-wallpaper::after {
            animation-name: wallpaper-glint, wallpaper-glint-fade;
            animation-duration: 5.5s, .18s;
            animation-delay: var(--wallpaper-glint-delay, 0s), 0s;
            animation-timing-function: ease-in-out, ease-out;
            animation-play-state: paused, running;
        }
    }
}

@keyframes wallpaper-glint {
    from { background-position: center bottom; }
    to { background-position: center top; }
}

@keyframes wallpaper-glint-fade {
    to { opacity: 0; }
}

.feed {
    width: min(calc(100% - 2 * var(--gutter)), var(--feed-width));
    margin-inline: auto;
    padding-block: clamp(1rem, 2vw, 1.5rem) clamp(2rem, 5vw, 4rem);
    overflow-wrap: anywhere;
}

@media (width > 70rem) {
    .feed {
        padding-block-start: calc(clamp(1rem, 2vw, 1.5rem) + 2.75rem);
    }
}

.site-footer {
    width: min(calc(100% - 2 * var(--gutter)), var(--feed-width));
    margin-inline: auto;
    margin-block-start: auto;
    padding-block: .9rem 1.5rem;
    border-block-start: 1px solid var(--line);
    color: var(--muted);
    font-size: .875rem;
    line-height: 1.5;
}

.feed__intro {
    margin: 0;
    padding-block-end: clamp(1.2rem, 3vw, 2rem);
    color: var(--body-text);
    line-height: 1.65;
}

.feed__empty {
    margin: 0;
    color: var(--muted);
}

.story,
.content-section {
    padding-block: clamp(1.4rem, 4vw, 2.75rem);
    border-block-start: 1px solid var(--line);
}

.feed > [data-news-feed]:first-child .story:first-child,
.feed > .content-section:first-child {
    padding-block-start: 0;
    border-block-start: 0;
}

.story:last-child {
    border-block-end: 1px solid var(--line);
}

.story h2 {
    margin: 0;
    font-size: clamp(1.45rem, 3.1vw, 2.25rem);
    line-height: 1.17;
    letter-spacing: -.025em;
}

.story__meta {
    display: block;
    margin-block: .6rem 1rem;
    color: var(--muted);
    font-size: .875rem;
}

.story__poster {
    display: block;
    margin-block: 1rem;
}

.story__poster-link {
    --corner-length: clamp(.5rem, 2vw, .875rem);
    --corner-horizontal: linear-gradient(90deg, #a9adb5, #eef0f2 50%, #a9adb5);
    --corner-vertical: linear-gradient(#a9adb5, #eef0f2 50%, #a9adb5);
    position: relative;
    display: block;
    width: fit-content;
    max-width: 100%;
    margin: 1rem auto;
    padding: 2px;
    border: 1px solid #848891;
    cursor: zoom-in;
}

.story__poster-link .story__poster {
    margin: 0;
}

.story__poster-link::after {
    position: absolute;
    inset: -1px;
    background:
        var(--corner-horizontal) left top / var(--corner-length) 3px,
        var(--corner-horizontal) right top / var(--corner-length) 3px,
        var(--corner-horizontal) left bottom / var(--corner-length) 3px,
        var(--corner-horizontal) right bottom / var(--corner-length) 3px,
        var(--corner-vertical) left top / 3px var(--corner-length),
        var(--corner-vertical) right top / 3px var(--corner-length),
        var(--corner-vertical) left bottom / 3px var(--corner-length),
        var(--corner-vertical) right bottom / 3px var(--corner-length);
    background-repeat: no-repeat;
    pointer-events: none;
    content: "";
}

.story__poster img {
    display: block;
    max-width: 100%;
    height: auto;
    margin-inline: auto;
    object-fit: contain;
}

.story__body {
    color: var(--body-text);
    font-size: clamp(1rem, 1.15vw, 1.125rem);
    line-height: 1.7;
}

.story__links {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: .5rem 1rem;
    margin-block: 1rem 0;
}

.story__links button {
    padding: .25em 0;
    border: 0;
    background: none;
    color: var(--gold);
    font: inherit;
    cursor: pointer;
}

.story__links button:hover {
    color: var(--link-hover);
}

.news-more {
    margin-block: 1.25rem 0;
    text-align: center;
}

.news-more a {
    display: inline-block;
    padding: .45rem 1rem;
    border: 1px solid var(--gold);
    background: var(--surface);
}

.news-more a:hover {
    border-color: var(--link-hover);
}

.news-more a[aria-disabled="true"] {
    cursor: progress;
}

.story__links [role="status"],
.news-feed__status {
    color: var(--muted);
}

.news-feed__status:empty {
    margin: 0;
}

.content-section h2,
.guide > summary,
.resource-group h2,
.media-entry h2 {
    margin: 0;
    font-size: var(--section-heading-size);
    line-height: 1.3;
}

.content-section__body,
.guide__body,
.resource-group,
.media-entry {
    color: var(--body-text);
    font-size: var(--section-text-size);
    line-height: 1.7;
}

:is(.story__body, .content-section__body) > :first-child {
    margin-block-start: 0;
}

:is(.story__body, .content-section__body) > :last-child {
    margin-block-end: 0;
}

:is(.story__body, .content-section__body) :is(ul, ol) {
    padding-inline-start: 1.5rem;
}

.content-section__heading {
    display: flex;
    align-items: center;
    gap: .65rem;
    margin-block-end: .65rem;
}

.content-section__icon {
    flex: none;
    width: 2rem;
    height: 2rem;
    object-fit: contain;
}

.content-section__body img {
    display: block;
    max-width: 100%;
    height: auto;
}

.ts3-connection {
    margin-block: 0.75rem 0;
}

.guide,
.media-entry,
.resource-group {
    min-width: 0;
    overflow-wrap: anywhere;
    border-block-start: 1px solid var(--line);
}

.guide > summary {
    padding-block: 0.85rem;
    color: var(--gold);
    font-weight: 650;
    cursor: pointer;
}

.guide__body {
    padding-block-end: 1rem;
}

.guide-image {
    display: block;
    width: fit-content;
    max-width: 100%;
    margin-block: 0.65rem;
    cursor: zoom-in;
}

.guide-image img {
    display: block;
    max-width: 100%;
    height: auto;
}

:is(.guide__body, .story__body) .guide-image,
:is(.guide__body, .story__body) img.richtext-image:not(.guide-image img) {
    border: 1px solid #8d9198;
}

:is(.guide__body, .story__body) img.richtext-image:not(.guide-image img) {
    max-width: 100%;
    height: auto;
}

.svd-image-open {
    overflow: hidden;
}

.svd-image-open--gutter {
    scrollbar-gutter: stable;
}

.svd-image-dialog {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    padding: 0;
    border: 0;
    background: transparent;
}

.svd-image-dialog::backdrop {
    background: transparent;
}

.svd-image-dialog .pswp__original {
    align-self: center;
    margin-inline: .5rem;
    padding: .4rem .6rem;
    color: var(--text);
    background: var(--surface);
}

.guide__links {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    margin-block-end: 0;
}

.guide__links button {
    padding: 0.25em 0;
    border: 0;
    background: none;
    color: var(--gold);
    font: inherit;
    text-decoration: none;
    cursor: pointer;
}

.guide > summary:hover,
.guide__links button:hover {
    color: var(--link-hover);
}

.guide > summary:active,
.guide__links button:active {
    color: var(--link-active);
}

.guide__links [role="status"] {
    color: var(--muted);
    font-size: 0.875rem;
}

.resource-groups {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem 2rem;
}

.resource-group,
.media-entry {
    padding-block: 0.85rem;
}

.resource-group h2,
.media-entry h2 {
    color: var(--text);
}

.resource-group ul {
    margin-block: 0.5rem 0;
    padding-inline-start: 1.25rem;
}

.resource-group li + li {
    margin-block-start: 0.35rem;
}

.media-entry p {
    margin-block: 0.35rem;
}

.about-year {
    margin-block: 1rem 0;
    color: var(--muted);
}

@media (max-width: 70rem) {
    .hero__content {
        column-gap: clamp(1rem, 3vw, 2rem);
    }

    .desktop-nav {
        display: none;
    }

    .navigation__inner {
        position: static;
        justify-content: space-between;
        gap: .5rem;
    }

    .navigation__title {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .mobile-nav {
        display: block;
        flex: none;
    }

    .mobile-nav summary {
        display: flex;
        min-height: 2.75rem;
        align-items: center;
        gap: .55rem;
        padding-inline: .65rem;
        list-style: none;
        color: var(--text);
        font-weight: 650;
        cursor: pointer;
    }

    .mobile-nav summary::-webkit-details-marker {
        display: none;
    }

    .menu-icon {
        position: relative;
        display: block;
        width: 1rem;
        height: .75rem;
        border-block: 2px solid var(--gold);
    }

    .menu-icon::after {
        position: absolute;
        inset: 50% 0 auto;
        height: 2px;
        background: var(--gold);
        transform: translateY(-50%);
        content: "";
    }

    .mobile-nav[open] summary {
        color: var(--gold);
    }

    .mobile-nav__panel {
        position: absolute;
        inset: 100% var(--gutter) auto auto;
        z-index: 1;
        width: min(calc(100% - 2 * var(--gutter)), 21rem);
        max-height: min(23rem, calc(100dvh - var(--sticky-row-height) - 1rem));
        overflow: auto;
        overscroll-behavior: contain;
        border: 1px solid var(--line);
        background: var(--surface);
        box-shadow: 0 .75rem 2rem #0007;
    }

    .mobile-nav .section-links {
        flex-direction: column;
        gap: 0;
        padding: .3rem;
    }

    .mobile-nav .section-links li > * {
        min-height: 2.75rem;
        justify-content: space-between;
        padding-inline: .75rem;
        font-size: 1.05rem;
    }

    .mobile-nav .section-links a:focus-visible {
        outline-offset: -2px;
    }

    .mobile-nav .section-links a[aria-current="page"] {
        box-shadow: inset 2px 0 var(--gold);
        background: #2b2c2e;
    }
}

@media (max-width: 42rem) {
    .resource-groups {
        grid-template-columns: minmax(0, 1fr);
    }

    .hero__content {
        column-gap: clamp(.45rem, 3vw, 1.25rem);
        min-height: 0;
        padding-block: clamp(.75rem, 3.5vw, 1.35rem) clamp(.55rem, 2.5vw, .875rem);
    }

    .hero__wordmark {
        gap: clamp(.18rem, .85vw, .35rem);
    }

    .hero__crest {
        width: 90%;
    }

    .hero__game {
        width: 70%;
    }
}

@media (prefers-reduced-motion: reduce) {
    :root {
        scroll-behavior: auto;
    }
}
