/* GK3Reborn website theme.
   Charcoal stone, blood red and aged ivory, inspired by Gabriel Knight. */

:root {
    --ink: #111216;
    --ink-2: #191a1f;
    --ink-3: #222127;
    --line: #3b3538;
    --gold: #d6c5a0;
    --gold-dim: #b6a17b;
    --blood: #822d3b;
    --text: #ddd8ce;
    --muted: #b0a9a3;
}

:root, [data-bs-theme="dark"] {
    --bs-body-bg: var(--ink);
    --bs-body-color: var(--text);
    --bs-body-color-rgb: 221, 216, 206;
    --bs-secondary-color-rgb: 176, 169, 163;
    --bs-link-color-rgb: 214, 197, 160;
    --bs-link-hover-color-rgb: 242, 230, 201;
    --bs-secondary-color: #b0a9a3;
    --bs-emphasis-color: #f2ece5;
    --bs-link-color: var(--gold);
    --bs-link-hover-color: #f2e6c9;
    --bs-border-color: var(--line);
    --bs-heading-color: #f4efe8;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 90px;
}

body {
    background-color: var(--ink);
    background-image: linear-gradient(rgba(17, 18, 22, 0.94), rgba(17, 18, 22, 0.96)), url("/img/texture-stone.jpg");
    background-attachment: fixed;
    background-size: 520px;
    overflow-x: clip;
    color: var(--text);
    font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
    font-size: 1.02rem;
    line-height: 1.7;
}

h1, h2, h3, h4, .display-1, .display-2, .display-3, .display-4, .footer-brand, .brand-text {
    font-family: Georgia, Cambria, "Times New Roman", serif;
    letter-spacing: 0.01em;
}

h2 {
    font-size: clamp(1.7rem, 3vw, 2.4rem);
    margin-bottom: 0.35em;
}

.skip-link {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    z-index: 2000;
    background: var(--gold);
    color: #14100e;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
}

/* Navigation */

.site-nav {
    background: rgba(17, 18, 22, 0.97);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
    padding-block: 0.55rem;
}

.site-nav .navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 1.3rem;
    color: #f4efe8;
}

.brand-mark {
    border-radius: 9px;
    box-shadow: 0 0 0 1px rgba(214, 178, 110, 0.35);
}

.brand-accent {
    color: var(--gold);
}

.site-nav .nav-link {
    color: #cfc6bd;
    font-size: 0.97rem;
    letter-spacing: 0.02em;
    padding-inline: 0.85rem;
}

.site-nav .nav-link:hover,
.site-nav .nav-link:focus {
    color: var(--gold);
}

.navbar-toggler {
    border-color: var(--line);
}

/* Buttons */

.btn-gold {
    background: #792737;
    border: 1px solid #b65b69;
    color: #fff3df;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.btn-gold:hover,
.btn-gold:focus {
    background: #963649;
    color: #fff3df;
}

.btn-ghost {
    border: 1px solid var(--line);
    color: var(--text);
    background: rgba(255, 255, 255, 0.02);
}

.btn-ghost:hover,
.btn-ghost:focus {
    border-color: var(--gold-dim);
    color: var(--gold);
}

/* Hero */

.hero {
    position: relative;
    min-height: min(84vh, 780px);
    display: flex;
    align-items: flex-end;
    padding: 9rem 0 4rem;
    overflow: hidden;
    border-bottom: 1px solid var(--line);
}

.hero-media {
    position: absolute;
    inset: 0;
    background-image: url("/img/hero.jpg");
    background-size: cover;
    background-position: center 30%;
    transform: scale(1.03);
}

.hero-veil {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(8, 6, 6, 0.92) 0%, rgba(8, 6, 6, 0.62) 45%, rgba(8, 6, 6, 0.35) 100%),
        linear-gradient(0deg, rgba(17, 18, 22, 0.98) 0%, rgba(8, 6, 6, 0.15) 55%);
}

.hero-inner {
    position: relative;
    max-width: 48rem;
}

.hero h1 {
    font-size: clamp(2.6rem, 6.2vw, 4.6rem);
    line-height: 1.02;
    margin-bottom: 0.6rem;
    text-shadow: 0 3px 30px rgba(0, 0, 0, 0.8);
}

.hero .lede {
    font-size: clamp(1.05rem, 1.6vw, 1.25rem);
    color: #e6ded4;
    max-width: 38rem;
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.28em;
    font-size: 0.74rem;
    color: var(--gold);
    margin-bottom: 1rem;
}

.hero-note {
    font-size: 0.86rem;
    color: #a99f96;
}

/* Sections */

.section {
    padding: 4rem 0;
    border-bottom: 1px solid rgba(44, 37, 35, 0.7);
}

.section-tight {
    padding: 3.5rem 0;
}

.section-stone {
    background-image: linear-gradient(rgba(24, 24, 29, 0.94), rgba(17, 18, 22, 0.96)), url("/img/texture-stone.jpg");
    background-size: cover;
    background-attachment: fixed;
}

.section-head {
    max-width: 46rem;
    margin-bottom: 2.6rem;
}

.section-head p {
    color: #b3aaa2;
    margin-bottom: 0;
}

.page-head {
    padding: 8.5rem 0 2.5rem;
    border-bottom: 1px solid var(--line);
}

.page-head h1 {
    font-size: clamp(2.1rem, 4.5vw, 3.2rem);
}

.rule {
    width: 80px;
    height: 3px;
    background: var(--blood);
    border: 0;
    opacity: 1;
    margin: 1.2rem 0 1.4rem;
}

/* Cards */

.panel {
    background: var(--ink-2);
    border: 1px solid var(--line);
    border-radius: 0;
    padding: 1.6rem 1.5rem;
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.panel:hover {
    border-color: rgba(214, 178, 110, 0.45);

}

.panel h3 {
    font-size: 1.18rem;
    color: var(--gold);
    margin-bottom: 0.5rem;
}

.panel p:last-child {
    margin-bottom: 0;
}

.panel-icon {
    font-size: 1.5rem;
    line-height: 1;
    margin-bottom: 0.7rem;
    display: block;
}

/* Lists */

.tick-list {
    list-style: none;
    padding-left: 0;
    margin-bottom: 0;
}

.tick-list li {
    position: relative;
    padding-left: 1.6rem;
    margin-bottom: 0.55rem;
}

.tick-list li::before {
    content: "—";
    position: absolute;
    left: 0;
    top: 0;
    color: var(--gold-dim);
    font-size: 0.85rem;
}

.change-list {
    list-style: none;
    padding-left: 0;
}

.change-list li {
    border-left: 1px solid var(--line);
    padding: 0 0 1.3rem 1.4rem;
    position: relative;
}

.change-list li::before {
    content: "";
    position: absolute;
    left: -5px;
    top: 0.55rem;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--gold-dim);
    box-shadow: 0 0 0 3px rgba(12, 10, 9, 1);
}

.change-list li:last-child {
    border-left-color: transparent;
    padding-bottom: 0;
}

.change-list strong {
    display: block;
    color: #f4efe8;
    font-family: Georgia, Cambria, serif;
    font-size: 1.06rem;
}

/* Changelog */

.changelog {
    max-width: 46rem;
}

.changelog-release + .changelog-release {
    margin-top: 2.4rem;
    padding-top: 2.4rem;
    border-top: 1px solid var(--line);
}

.changelog-release h3 {
    font-size: 1.25rem;
    color: var(--gold);
    margin-bottom: 0.15rem;
}

.changelog-older {
    margin-top: 2.4rem;
}

.changelog-older summary {
    width: fit-content;
    color: var(--gold);
    cursor: pointer;
}

.changelog-history {
    margin-top: 1.5rem;
}

.changelog-hide-older,
.changelog-older[open] .changelog-view-older {
    display: none;
}

.changelog-older[open] .changelog-hide-older {
    display: inline;
}

.changelog-date {
    color: var(--muted);
    font-size: 0.88rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 1.1rem;
}

/* A release headed by its own date has no date line under it, so the list takes the gap. */
.changelog-release h3 + .change-list {
    margin-top: 1.1rem;
}

/* Badges */

.tag {
    display: inline-block;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    padding: 0.22rem 0.6rem;
    border-radius: 0;
    border: 1px solid var(--line);
    color: #bdb3aa;
}

.tag-new {
    border-color: rgba(214, 178, 110, 0.5);
    color: var(--gold);
}

.tag-changed {
    border-color: rgba(140, 47, 34, 0.65);
    color: #d98b7c;
}

/* Downloads */

.download-section {
    background-image: linear-gradient(rgba(24, 24, 29, 0.94), rgba(17, 18, 22, 0.96)), url("/img/texture-stone.jpg");
    background-size: cover;
}

.download-flow {
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.download-stage {
    display: grid;
    grid-template-columns: minmax(13rem, 0.68fr) minmax(0, 2fr);
    gap: 2rem;
    padding: 2rem 0;
}

.download-stage + .download-stage {
    border-top: 1px solid var(--line);
}

.download-stage-head {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.download-stage-head .eyebrow {
    margin-bottom: 0.25rem;
}

.download-stage-head h2 {
    font-size: 1.55rem;
    margin-bottom: 0.25rem;
}

.download-stage-head p:last-child {
    color: #b3aaa2;
    font-size: 0.94rem;
    line-height: 1.55;
    margin-bottom: 0;
}

.download-stage-number {
    flex: 0 0 2.4rem;
    width: 2.4rem;
    height: 2.4rem;
    display: grid;
    place-items: center;
    border: 1px solid var(--gold-dim);
    border-radius: 50%;
    color: var(--gold);
    font-family: Georgia, Cambria, serif;
    font-size: 1.08rem;
}

.download-grid {
    display: grid;
    gap: 1rem;
    min-width: 0;
}

.download-grid-engine {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.download-grid-content {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.download-grid-language {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* The flag reads as part of the heading, so it sits on the text baseline rather than above it. */
.flag {
    width: 1.5rem;
    height: auto;
    margin-right: 0.5rem;
    border-radius: 2px;
    border: 1px solid var(--line);
    vertical-align: -0.16em;
}

.download-tile {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 1.2rem;
    border: 1px solid var(--line);
    border-radius: 0;
    background: var(--ink-2);
}

.download-tile-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
}

.download-tile h3 {
    font-size: 1.18rem;
    margin-bottom: 0.15rem;
}

.download-tile-action {
    margin-top: auto;
    padding-top: 1.1rem;
}

.download-tile-action .btn {
    white-space: normal;
}

.download-stage-notice {
    grid-column: 2;
}

.download-card {
    background: linear-gradient(180deg, rgba(32, 27, 25, 0.9), rgba(18, 15, 14, 0.9));
    border: 1px solid var(--line);
    border-radius: 0;
    padding: 1.8rem;
    height: 100%;
}

.download-card h3 {
    font-size: 1.35rem;
    margin-bottom: 0.2rem;
}

.download-meta {
    font-size: 0.85rem;
    color: #a49a92;
}

.download-card code {
    color: var(--gold-dim);
    word-break: break-all;
}

/* Screenshots */

.shot {
    display: block;
    position: relative;
    border: 1px solid var(--line);
    border-radius: 0;
    overflow: hidden;
    background: var(--ink-2);
}

.shot img {
    width: 100%;
    height: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    transition: transform 0.35s ease, opacity 0.35s ease;
}

.shot:hover img {
    transform: scale(1.04);
    opacity: 0.92;
}

.shot figcaption {
    padding: 0.6rem 0.8rem;
    font-size: 0.86rem;
    color: #b3aaa2;
    border-top: 1px solid var(--line);
}

.shot-empty {
    border: 1px dashed var(--line);
    border-radius: 0;
    padding: 3rem 1.5rem;
    text-align: center;
    color: #a49a92;
}

.lightbox .modal-content {
    background: rgba(17, 18, 22, 0.98);
    border: 1px solid var(--line);
}

.lightbox img {
    width: 100%;
    height: auto;
}

/* Code and steps */

.code-block {
    background: #0a0807;
    border: 1px solid var(--line);
    border-radius: 0;
    padding: 1rem 1.1rem;
    font-family: Consolas, "Cascadia Mono", "SFMono-Regular", monospace;
    font-size: 0.88rem;
    color: #cbbfa6;
    overflow-x: auto;
    white-space: pre;
    line-height: 1.6;
}

.steps {
    counter-reset: step;
    list-style: none;
    padding-left: 0;
}

.steps > li {
    counter-increment: step;
    position: relative;
    padding-left: 3.2rem;
    margin-bottom: 1.6rem;
}

.steps > li::before {
    content: counter(step);
    position: absolute;
    left: 0;
    top: 0;
    width: 2.2rem;
    height: 2.2rem;
    display: grid;
    place-items: center;
    border-radius: 50%;
    border: 1px solid var(--gold-dim);
    color: var(--gold);
    font-family: Georgia, serif;
}

.steps h3 {
    font-size: 1.1rem;
    margin-bottom: 0.3rem;
}

/* Notices */

.notice {
    border: 1px solid rgba(214, 178, 110, 0.35);
    border-left-width: 3px;
    background: rgba(214, 178, 110, 0.06);
    border-radius: 0;
    padding: 1.1rem 1.25rem;
}

.notice-red {
    border-color: rgba(140, 47, 34, 0.5);
    background: rgba(140, 47, 34, 0.08);
}

.notice p:last-child {
    margin-bottom: 0;
}

/* Footer */

.site-footer {
    padding: 3.5rem 0 2.5rem;
    border-top: 1px solid var(--line);
    background: rgba(8, 6, 6, 0.6);
}

.footer-brand {
    font-size: 1.35rem;
    color: #f4efe8;
    margin-bottom: 0.4rem;
}

.footer-heading {
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 0.74rem;
    color: var(--gold);
    margin-bottom: 0.7rem;
}

.footer-links {
    list-style: none;
    padding-left: 0;
    margin-bottom: 0;
}

.footer-links li {
    margin-bottom: 0.35rem;
}

.footer-links a {
    color: #b8afa7;
    text-decoration: none;
    font-size: 0.92rem;
}

.footer-links a:hover {
    color: var(--gold);
}

.footer-rule {
    border-color: var(--line);
    margin: 2.2rem 0 1.4rem;
    opacity: 1;
}

/* Small screens */

@media (max-width: 991.98px) {
    .hero {
        min-height: 0;
        padding: 7.5rem 0 3rem;
    }

    .site-nav .navbar-collapse {
        padding-top: 0.6rem;
    }

    .section-stone,
    body {
        background-attachment: scroll;
    }

    .download-stage {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .download-stage-notice {
        grid-column: 1;
    }
}

@media (max-width: 767.98px) {
    .download-grid-engine,
    .download-grid-content {
        grid-template-columns: 1fr;
    }

    /* A language tile is only a flag and a name, so two still fit where a build does not. */
    .download-grid-language {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .panel:hover,
    .shot:hover img {
        transform: none;
    }
}

.site-nav-scrolled {
    background: rgba(17, 18, 22, 0.98);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}

code {
    color: var(--gold-dim);
    background: rgba(214, 178, 110, 0.08);
    padding: 0.08em 0.35em;
    border-radius: 4px;
    font-size: 0.9em;
}

.code-block code {
    background: none;
    padding: 0;
}

/* Title treatment and restrained, engraved-looking controls. */
.btn { border-radius: 2px; padding-block: .65rem; }
.btn-gold:active, .btn-gold:focus-visible { background: #963649; color: #fff3df; border-color: #d39098; }
a { text-underline-offset: .2em; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }
.hero-title-accent { display: block; color: #d6c5a0; font-size: 1.35em; font-style: italic; line-height: 1.12; }
.hero .eyebrow { color: #d6c5a0; letter-spacing: .18em; }
.hero h1 { font-size: clamp(2.6rem, 5.7vw, 4.7rem); }
.hero .lede { margin-top: 1.5rem; }
.hero-note { color: #c4bcb4; }
.page-head { background: linear-gradient(100deg, #321a23, #17181d 75%); }
.page-links { display: flex; flex-wrap: wrap; gap: .75rem 1.75rem; margin-top: 1.75rem; font-size: .93rem; }
.section-head { max-width: none; }
.download-grid-engine .download-tile { border-top: 3px solid var(--blood); padding: 1.4rem; }
.download-meta { overflow-wrap: anywhere; color: var(--muted); }
.download-stage-number, .steps > li::before { border-radius: 2px; border-color: #80505a; }
.tag { color: var(--muted); }
.shot { border: 0; background: transparent; }
.shot a { display: block; border: 1px solid #585051; padding: 4px; background: #111216; }
.shot figcaption { border: 0; padding: .7rem 0; color: var(--muted); }
.site-footer { background: #0e0f12; }
@media (max-width: 575.98px) {
    .hero { padding-top: 8rem; }
    .hero .eyebrow { font-size: .65rem; letter-spacing: .12em; }
    .hero-media { background-position: 62% center; }
    .section { padding-block: 2.75rem; }
    .download-grid-language { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; }
}
