/* Project: Endless — the game's website. Colours from the game's own UI (wood, parchment, gold). */
:root {
    --bg: #17120d;
    --panel: #2a2017;
    --panel-2: #33281d;
    --edge: #5a4630;
    --gold: #e3b456;
    --gold-dim: #b88a3a;
    --text: #efe3cf;
    --muted: #b9a88f;
    --green: #6fae4c;
    --water: #2f6f8f;
    --radius: 10px;
    --wide: 1120px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 16px/1.6 "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

img {
    max-width: 100%;
    display: block;
}

.pixel {
    image-rendering: pixelated;
}

a {
    color: var(--gold);
}

h1, h2, h3, .brand {
    font-family: "Pixelify Sans", "Inter", sans-serif;
    font-weight: 600;
    line-height: 1.2;
    margin: 0 0 .5em;
}

h2 {
    font-size: clamp(1.6rem, 3vw, 2.2rem);
}

h3 {
    font-size: 1.25rem;
    color: var(--gold);
}

p {
    margin: 0 0 1em;
}

.wrap {
    max-width: var(--wide);
    margin: 0 auto;
    padding: 0 16px;
}

/* ---- Top bar ---- */

.nav {
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(23, 18, 13, .92);
    backdrop-filter: blur(6px);
    border-bottom: 1px solid var(--edge);
}

.nav .wrap {
    display: flex;
    align-items: center;
    gap: 20px;
    height: 60px;
}

.brand {
    color: var(--text);
    text-decoration: none;
    font-size: 1.3rem;
    margin: 0;
    white-space: nowrap;
}

.brand span {
    color: var(--gold);
}

.nav .links {
    display: flex;
    gap: 18px;
    margin-left: auto;
    align-items: center;
}

.nav .links a {
    color: var(--muted);
    text-decoration: none;
    font-weight: 500;
    white-space: nowrap;
}

.nav .links a:hover,
.nav .links a[aria-current="page"] {
    color: var(--text);
}

.nav .links a.btn.primary {
    color: #2a1a08;
}

/* ---- Buttons ---- */

.btn {
    display: inline-block;
    padding: 12px 22px;
    border-radius: 8px;
    font-weight: 700;
    text-decoration: none;
    border: 2px solid var(--gold-dim);
    color: var(--text);
    background: var(--panel-2);
    transition: transform .1s ease, background .2s ease;
}

.btn:hover {
    transform: translateY(-1px);
    background: #3d3022;
}

.btn.primary {
    background: linear-gradient(#f0c565, #c8902f);
    border-color: #f6d88c;
    color: #2a1a08;
}

.btn.primary:hover {
    background: linear-gradient(#f7d27a, #d39b36);
}

.btn.small {
    padding: 7px 14px;
    font-size: .92rem;
}

/* ---- Hero ---- */

.hero {
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid var(--edge);
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: url("img/aeven.png") center / cover no-repeat;
    image-rendering: pixelated;
    filter: saturate(1.1);
}

.hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(23, 18, 13, .35) 0%, rgba(23, 18, 13, .75) 60%, var(--bg) 100%);
}

.hero .wrap {
    position: relative;
    z-index: 1;
    padding-top: 72px;
    padding-bottom: 72px;
    text-align: center;
}

.hero .logo {
    width: min(420px, 80%);
    margin: 0 auto 16px;
    filter: drop-shadow(0 6px 18px rgba(0, 0, 0, .6));
}

.hero .tagline {
    font-size: clamp(1.1rem, 2.2vw, 1.35rem);
    max-width: 640px;
    margin: 0 auto 28px;
    color: var(--text);
    text-shadow: 0 2px 8px rgba(0, 0, 0, .8);
}

.hero .actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.hero .note {
    margin-top: 16px;
    font-size: .9rem;
    color: var(--muted);
    text-shadow: 0 1px 4px rgba(0, 0, 0, .8);
}

/* ---- Sections ---- */

section {
    padding: 64px 0;
}

.section-head {
    max-width: 720px;
    margin-bottom: 32px;
}

.section-head p {
    color: var(--muted);
}

.panel {
    background: var(--panel);
    border: 1px solid var(--edge);
    border-radius: var(--radius);
}

/* Features: picture and words side by side, alternating. */
.feature {
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    gap: 32px;
    align-items: center;
    margin-bottom: 48px;
}

.feature:nth-child(even) .shot {
    order: 2;
}

.feature .shot {
    overflow: hidden;
    border-radius: var(--radius);
    border: 1px solid var(--edge);
    background: #000;
}

.feature .shot img {
    width: 100%;
    image-rendering: pixelated;
}

/* A close-up (a single character): not as big as a scene. */
.feature .shot.close {
    max-width: 340px;
    justify-self: center;
}

.feature ul {
    margin: 0;
    padding-left: 1.1em;
    color: var(--muted);
}

.tag {
    display: inline-block;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: #2a1a08;
    background: var(--gold);
    border-radius: 4px;
    padding: 2px 7px;
    margin-bottom: 10px;
}

/* A grid of smaller things. */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}

.card {
    padding: 20px;
}

.card h3 {
    font-size: 1.08rem;
    margin-bottom: .35em;
}

.card p {
    color: var(--muted);
    margin: 0;
    font-size: .95rem;
}

/* Studio band. */
.studio {
    background: linear-gradient(180deg, var(--bg), #1d1711 30%, #1d1711 70%, var(--bg));
}

.studio .pair {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 16px;
    margin-top: 24px;
}

.studio .pair img {
    border-radius: var(--radius);
    border: 1px solid var(--edge);
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Call to action. */
.cta {
    text-align: center;
    padding: 48px 24px;
}

.cta p {
    color: var(--muted);
    max-width: 560px;
    margin: 0 auto 24px;
}

/* ---- About page ---- */

.page-head {
    padding: 56px 0 24px;
    border-bottom: 1px solid var(--edge);
}

.page-head p {
    color: var(--muted);
    max-width: 680px;
    font-size: 1.1rem;
}

.prose {
    max-width: 760px;
}

.prose h2 {
    margin-top: 1.6em;
}

.prose h2:first-child {
    margin-top: 0;
}

.timeline {
    list-style: none;
    padding: 0;
    margin: 0 0 1em;
    border-left: 2px solid var(--edge);
}

.timeline li {
    position: relative;
    padding: 0 0 18px 22px;
}

.timeline li::before {
    content: "";
    position: absolute;
    left: -7px;
    top: 7px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--gold);
    border: 2px solid var(--bg);
}

.timeline .when {
    display: block;
    font-weight: 700;
    color: var(--gold);
}

.timeline .what {
    color: var(--muted);
}

/* Text still to be written by the team (shown so it's not forgotten before publishing). */
.draft {
    border: 2px dashed var(--gold-dim);
    border-radius: var(--radius);
    padding: 16px 18px;
    background: rgba(227, 180, 86, .07);
    color: var(--text);
}

.draft strong {
    color: var(--gold);
}

.steps {
    counter-reset: step;
    list-style: none;
    padding: 0;
}

.steps li {
    counter-increment: step;
    position: relative;
    padding: 14px 16px 14px 56px;
    margin-bottom: 10px;
}

.steps li::before {
    content: counter(step);
    position: absolute;
    left: 16px;
    top: 14px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--gold);
    color: #2a1a08;
    font-weight: 800;
    display: grid;
    place-items: center;
}

/* ---- Footer ---- */

footer {
    border-top: 1px solid var(--edge);
    padding: 32px 0;
    color: var(--muted);
    font-size: .92rem;
}

footer .wrap {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
}

footer a {
    color: var(--muted);
}

/* ---- Small screens ---- */

@media (max-width: 760px) {
    .nav .links .hide-small {
        display: none;
    }

    .nav .wrap {
        gap: 12px;
    }

    .nav .links {
        gap: 12px;
    }

    .brand {
        font-size: 1.1rem;
    }

    .feature,
    .studio .pair {
        grid-template-columns: 1fr;
    }

    .feature:nth-child(even) .shot {
        order: 0;
    }

    section {
        padding: 44px 0;
    }
}

/* ---- The database ---- */

.muted {
    color: var(--muted);
}

.db {
    padding-top: 24px;
    padding-bottom: 48px;
}

.db-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 14px;
}

.db-tab {
    padding: 8px 14px;
    border-radius: 8px;
    border: 1px solid var(--edge);
    background: var(--panel);
    color: var(--muted);
    text-decoration: none;
    font-weight: 600;
}

.db-tab[aria-selected="true"] {
    background: var(--gold);
    border-color: var(--gold);
    color: #2a1a08;
}

.db-tools {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.db-tools input,
.db-tools select {
    background: var(--panel);
    color: var(--text);
    border: 1px solid var(--edge);
    border-radius: 8px;
    padding: 9px 12px;
    font: inherit;
}

.db-tools input {
    flex: 1 1 260px;
    min-width: 0;
}

.db-count {
    color: var(--muted);
    font-size: .9rem;
}

.db-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.db-results {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.db-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    border-radius: 8px;
    background: var(--panel);
    border: 1px solid transparent;
    color: var(--text);
    text-decoration: none;
    min-height: 46px;
}

.db-row:hover,
.db-row.active {
    border-color: var(--gold-dim);
    background: var(--panel-2);
}

.db-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.db-name small {
    display: block;
    color: var(--muted);
    font-size: .8rem;
}

.db-id {
    color: var(--muted);
    font-variant-numeric: tabular-nums;
    font-size: .85rem;
}

.db-icon {
    width: 34px;
    height: 34px;
    object-fit: contain;
    image-rendering: pixelated;
    flex: none;
}

.db-icon.npc {
    width: 40px;
    height: 40px;
}

.db-detail {
    position: sticky;
    top: 76px;
    padding: 18px 20px;
    max-height: calc(100vh - 96px);
    overflow: auto;
}

.db-detail h4 {
    margin: 18px 0 6px;
    color: var(--gold);
    font-size: .95rem;
}

.db-head {
    display: flex;
    gap: 14px;
    align-items: center;
    margin-bottom: 10px;
}

.db-head .db-icon {
    width: 64px;
    height: 64px;
}

.db-head h3 {
    margin: 0;
}

.db-head p {
    margin: 0;
}

.db-close {
    float: right;
    font-size: 1.6rem;
    line-height: 1;
    text-decoration: none;
    color: var(--muted);
}

.db-cmd {
    display: inline-block;
    font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
    background: #120e0a;
    border: 1px solid var(--edge);
    border-radius: 6px;
    padding: 3px 9px;
    color: var(--gold);
}

.db-stats {
    border-collapse: collapse;
    width: 100%;
}

.db-stats th {
    text-align: left;
    font-weight: 500;
    color: var(--muted);
    padding: 3px 12px 3px 0;
    width: 40%;
}

.db-stats td {
    padding: 3px 0;
}

.db-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.db-list li {
    padding: 2px 0;
}

.db-ref {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.db-ref .db-icon {
    width: 26px;
    height: 26px;
}

/* The commands on the home page. */
.commands {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
    margin-top: 18px;
}

.commands code {
    font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
    color: var(--gold);
}

@media (max-width: 900px) {
    .db-body {
        grid-template-columns: 1fr;
    }

    .db-detail {
        position: static;
        max-height: none;
        order: -1;
    }
}
