@font-face {
    font-family: "Geist Pixel Square";
    src: url("assets/fonts/GeistPixel-Square.woff2") format("woff2");
    font-display: swap;
}
@font-face {
    font-family: "Geist Pixel Line";
    src: url("assets/fonts/GeistPixel-Line.woff2") format("woff2");
    font-display: swap;
}
@font-face {
    font-family: "Geist Pixel Triangle";
    src: url("assets/fonts/GeistPixel-Triangle.woff2") format("woff2");
    font-display: swap;
}

/* Mirrors src/constants.rs. */
:root {
    color-scheme: dark;
    --bg: rgb(20 20 31);
    --green: rgb(51 242 77);
    --green-mid: rgb(38 166 51);
    --green-dim: rgb(38 140 51);
    --text: rgb(255 247 224);
    --text-mid: rgb(214 207 184);
    --text-dim: rgb(184 184 194);
    --btn-bg: rgb(0 0 0 / 0.69);
    --btn-hover-bg: rgb(0 31 8);
    --token: rgb(255 217 77);

    --font-ui: "Geist Pixel Square", ui-monospace, monospace;
    --font-terminal: "Geist Pixel Line", ui-monospace, monospace;
    --font-display: "Geist Pixel Triangle", ui-monospace, monospace;

    /* The CSS twin of HoloText's eight black outline copies. */
    --outline: -1px 0 #000, 1px 0 #000, 0 -1px #000, 0 1px #000,
        -1px -1px #000, 1px -1px #000, -1px 1px #000, 1px 1px #000;

    --gutter: 16px;
    --col: 880px;
}

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

html,
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-ui);
    font-size: 18px;
    line-height: 1.6;
    -webkit-font-smoothing: none;
    overflow-x: hidden;
}

img.pixel,
.pixel {
    image-rendering: pixelated;
}

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

/* Hero backdrop (-1) under content (1). A z-index on `.hero` itself would trap its backdrop above
   its own content. */
.page {
    position: relative;
    isolation: isolate;
}

.layer {
    position: relative;
    z-index: 1;
}

/* ── Hero ─────────────────────────────────────────────────────────────── */

.hero {
    position: relative;
    min-height: min(100svh, 860px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px var(--gutter) 64px;
    text-align: center;
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        linear-gradient(to bottom, rgb(20 20 31 / 0.35) 0%, rgb(20 20 31 / 0.55) 55%, var(--bg) 100%),
        url("assets/cencon_domes_wide_shot.png") center 30% / cover no-repeat;
    image-rendering: pixelated;
}

.hero-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 28px;
}

.logo {
    width: 218px;
    height: auto;
    filter: drop-shadow(0 4px 0 rgb(0 0 0 / 0.6));
}

@media (min-width: 520px) {
    .logo {
        width: 436px;
    }
}

@media (min-width: 900px) and (min-height: 760px) {
    .logo {
        width: 654px;
    }
}

.tagline {
    margin: 0;
    max-width: 34ch;
    font-family: var(--font-display);
    font-size: 22px;
    line-height: 1.5;
    text-shadow: var(--outline);
}

.cta-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
}

/* paint_live_button: dim border at rest, brighter border and a green wash under the cursor. */
.btn {
    display: inline-block;
    min-width: 180px;
    padding: 14px 28px;
    border: 2px solid var(--green-dim);
    background: var(--btn-bg);
    color: var(--text);
    font-family: var(--font-ui);
    font-size: 20px;
    letter-spacing: 0.12em;
    text-decoration: none;
    text-align: center;
    text-shadow: var(--outline);
}

.btn:hover,
.btn:focus-visible {
    border-color: var(--green);
    background: var(--btn-hover-bg);
    outline: none;
}

/* press_nudge: one pixel down and right while held. */
.btn:active {
    transform: translate(1px, 1px);
}

.btn.primary {
    color: var(--green);
    border-color: var(--green-mid);
}

.btn.primary:hover,
.btn.primary:focus-visible {
    border-color: var(--green);
}

.build-tag {
    margin: 0;
    font-family: var(--font-terminal);
    font-size: 14px;
    letter-spacing: 0.15em;
    color: var(--text-dim);
    text-shadow: var(--outline);
}

/* ── Sections ─────────────────────────────────────────────────────────── */

main {
    display: flex;
    flex-direction: column;
    gap: 56px;
    max-width: calc(var(--col) + var(--gutter) * 2);
    margin: 0 auto;
    padding: 24px var(--gutter) 80px;
}

.holo {
    position: relative;
    isolation: isolate;
    border: 2px solid var(--green-dim);
    padding: 28px 32px;
    text-shadow: var(--outline);
    /* Fallback when WebGL2 is unavailable; holostatic.js clears it once the shader is live. */
    background:
        repeating-linear-gradient(to bottom, rgb(0 70 26 / 0.35) 0 1px, transparent 1px 3px),
        rgb(0 38 22 / 0.75);
}

html.holo-gl .holo {
    background: transparent;
}

/* Inside the panel rather than one fixed canvas over the page, so it scrolls with the panel on the
   compositor instead of chasing it a frame behind. */
.holo-bg {
    position: absolute;
    inset: 0;
    z-index: -1;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

h2 {
    margin: 0 0 16px;
    font-size: 26px;
    font-weight: normal;
    letter-spacing: 0.12em;
    color: var(--green);
}

h3 {
    margin: 0 0 8px;
    font-size: 18px;
    font-weight: normal;
    letter-spacing: 0.1em;
    color: var(--green);
}

p {
    margin: 0 0 14px;
}

p:last-child {
    margin-bottom: 0;
}

.mid {
    color: var(--text-mid);
}

/* The game's spawn_ruled_row (the "AUDIO" subheading): the title breaks a 1px dim green rule, dead
   centre. For headings that sit between panels rather than inside one. */
.ruled {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    font-size: 17px;
    font-weight: normal;
    letter-spacing: 0;
    color: var(--text);
    text-shadow: var(--outline);
    white-space: nowrap;
}

.ruled::before,
.ruled::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--green-dim);
}

/* The same 1px dim green line as .ruled, without a title breaking it. */
hr {
    height: 1px;
    margin: 24px 0;
    border: 0;
    background: var(--green-dim);
}

/* A ruled heading and what it titles, held closer than the gap between sections. */
.group {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* At main's full section gap a heading this short floats free of the panels it titles. */
main > .group {
    margin-top: -5px;
}

.features {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

@media (min-width: 600px) {
    .features {
        grid-template-columns: 1fr 1fr;
    }
}

.features .holo {
    padding: 22px 24px;
    font-size: 16px;
}

.shot {
    display: block;
    border: 2px solid var(--green-dim);
    background: #000;
    cursor: zoom-in;
}

.shot:hover,
.shot:focus-visible {
    border-color: var(--green);
    outline: none;
}

.shot img {
    display: block;
    width: 100%;
    height: auto;
}

.features .shot {
    margin: -8px -10px 18px;
}

.gallery {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

@media (min-width: 600px) {
    .gallery {
        grid-template-columns: 1fr 1fr;
    }
}

.lightbox {
    max-width: min(96vw, 1496px);
    max-height: 96vh;
    padding: 0;
    border: 2px solid var(--green);
    background: #000;
    cursor: zoom-out;
}

.lightbox::backdrop {
    background: rgb(0 0 0 / 0.85);
}

.lightbox img {
    display: block;
    max-width: 100%;
    max-height: calc(96vh - 4px);
}

.log {
    margin: 20px 0 0;
    padding: 16px 20px;
    border: 2px solid rgb(38 140 51 / 0.45);
    background: rgb(0 0 0 / 0.45);
    font-family: var(--font-terminal);
    font-size: 15px;
    color: var(--text-mid);
}

.log h3 {
    font-family: var(--font-terminal);
    font-size: 15px;
}

.log ul {
    margin: 0 0 12px;
    padding-left: 1.2em;
}

.log ul:last-child {
    margin-bottom: 0;
}

.log li::marker {
    color: var(--green-dim);
}

/* Applied by script, so the full log stays readable without JS. */
.log-body.collapsed {
    max-height: 220px;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(to bottom, #000 60%, transparent);
    mask-image: linear-gradient(to bottom, #000 60%, transparent);
}

.log-toggle {
    display: block;
    min-width: 0;
    margin-top: 16px;
    padding: 8px 16px;
    font-size: 15px;
    cursor: pointer;
}

.log-toggle[hidden] {
    display: none;
}

/* ── Roadmap ──────────────────────────────────────────────────────────── */

.roadmap {
    list-style: none;
    margin: 20px 0 0;
    padding: 0;
}

.roadmap li {
    position: relative;
    padding: 0 0 28px 40px;
}

.roadmap li:last-child {
    padding-bottom: 0;
}

/* The track running down to the next milestone: solid behind what is done, dashed ahead of it. */
.roadmap li::before {
    content: "";
    position: absolute;
    left: 7px;
    top: 20px;
    bottom: -4px;
    width: 2px;
    background: repeating-linear-gradient(to bottom, var(--green-dim) 0 4px, transparent 4px 8px);
}

.roadmap li.done::before {
    background: var(--green-mid);
}

.roadmap li:last-child::before {
    display: none;
}

/* The node: square, like every other control in the game. */
.roadmap li::after {
    content: "";
    position: absolute;
    left: 0;
    top: 4px;
    width: 16px;
    height: 16px;
    border: 2px solid var(--green-dim);
    background: #000;
}

.roadmap li.done::after {
    border-color: var(--green-mid);
    background: var(--green-mid);
}

.roadmap li.now::after {
    border-color: var(--green);
    background: var(--green);
    box-shadow: 0 0 0 3px rgb(51 242 77 / 0.25);
    animation: node-blink 1.2s steps(1) infinite;
}

@keyframes node-blink {
    50% {
        background: #000;
    }
}

.roadmap .when {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 12px;
    font-family: var(--font-terminal);
    font-size: 14px;
    letter-spacing: 0.15em;
    color: var(--text-dim);
}

.roadmap .done .when::after {
    content: "[ DONE ]";
    color: var(--green-mid);
}

.roadmap .now .when::after {
    content: "[ IN PROGRESS ]";
    color: var(--green);
}

.roadmap .next .when::after {
    content: "[ PLANNED ]";
}

.roadmap h4 {
    margin: 2px 0 6px;
    font-size: 18px;
    font-weight: normal;
    letter-spacing: 0.1em;
    color: var(--text);
}

.roadmap .now h4 {
    color: var(--green);
}

.roadmap .next h4,
.roadmap .next p {
    color: var(--text-dim);
}

@media (prefers-reduced-motion: reduce) {
    .roadmap li.now::after {
        animation: none;
    }
}

.closing {
    text-align: center;
}

.closing .cta-row {
    margin-top: 20px;
}

/* ── Footer ───────────────────────────────────────────────────────────── */

footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 24px var(--gutter) 48px;
    color: var(--text-dim);
    font-family: var(--font-terminal);
    font-size: 14px;
}

/* The boot logo strip: 17 cells of 157x159, played once at the game's 10 fps. */
.studio-logo {
    width: 157px;
    height: 159px;
    background: url("assets/thunderbloods-logo-pixelated_animated.png") 0 0 / 2669px 159px no-repeat;
    image-rendering: pixelated;
}

.studio-logo.play {
    animation: strike 1.7s steps(16) forwards;
}

@keyframes strike {
    to {
        background-position: -2512px 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .studio-logo,
    .studio-logo.play {
        animation: none;
        background-position: -2512px 0;
    }
}

@media (max-width: 520px) {
    html,
    body {
        font-size: 16px;
    }
    .holo {
        padding: 20px;
    }
    .tagline {
        font-size: 18px;
    }
    .btn {
        min-width: 0;
        width: 100%;
    }
    .cta-row {
        flex-direction: column;
        align-self: stretch;
    }
}
