/* Design tokens */
:root, [data-theme="night"] {
    --ground: #0f2132;
    --surface: #152b3d;
    --surface-raised: #1e3a52;
    --ink: #f6e9c9;
    --ink-muted: #97a9bb;
    --line: #2c4a66;
    --line-strong: #5a7690;
    --crust: #d1892d;
    --crust-hover: #e3a24f;
    --on-crust: #152534;
    --crust-text: #e8a94e;
    --navy: #152534;
    --crumb: #f6e9c9;
    --success: #6cc3d6;
    --danger: #f08a6c;
    --focus: #f6e9c9;
    --shadow-pop: 0 4px 0 #071420;
    --shadow-card: 0 6px 0 #0a1a28;
}

[data-theme="day"] {
    --ground: #fbf4e2;
    --surface: #f6e9c9;
    --surface-raised: #fffaf0;
    --ink: #152534;
    --ink-muted: #4c5f71;
    --line: #e2d3ae;
    --line-strong: #8e7f5e;
    --crust: #d1892d;
    --crust-hover: #bd7720;
    --on-crust: #152534;
    --crust-text: #93520c;
    --navy: #152534;
    --crumb: #f6e9c9;
    --success: #1d6a80;
    --danger: #b03a1e;
    --focus: #152534;
    --shadow-pop: 0 4px 0 #152534;
    --shadow-card: 0 6px 0 #e2d3ae;
}

:root {
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 24px;
    --space-6: 32px;
    --space-7: 48px;
    --space-8: 72px;
    --space-9: 96px;
    --radius-s: 6px;
    --radius-m: 12px;
    --radius-l: 20px;
    --radius-pill: 999px;
    --font-display: "Lilita One", "Arial Rounded MT Bold", "Trebuchet MS", system-ui, sans-serif;
    --font-ui: Rubik, system-ui, -apple-system, "Segoe UI", sans-serif;
    --gutter: max(var(--space-4), 5vw);
    --section-y: var(--space-8);
    --header-offset: 0px;
}

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

html { scroll-padding-top: var(--header-offset); }

body {
    margin: 0;
    background: var(--ground);
    color: var(--ink);
    font-family: var(--font-ui);
}

h1, h2, h3, p { margin: 0; }
h1, h2, h3 { text-wrap: balance; }
img { display: block; }

a:focus-visible, button:focus-visible, .table-scroll:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 3px;
}

.container { max-width: 1200px; margin: 0 auto; }

.skip-link {
    position: absolute;
    top: var(--space-2);
    left: var(--space-2);
    z-index: 20;
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-m);
    background: var(--crust);
    color: var(--on-crust);
    font-weight: 700;
    transform: translateY(-200%);
}
.skip-link:focus { transform: none; }

/* Type */
.eyebrow {
    font-size: 13px;
    line-height: 16px;
    font-weight: 700;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: var(--crust-text);
}

h1 {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(44px, 6vw, 72px);
    line-height: 1;
    letter-spacing: 0.01em;
}

.display-l {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 48px;
    line-height: 52px;
    letter-spacing: 0.01em;
}

.heading {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 32px;
    line-height: 36px;
}

.lede {
    max-width: 34em;
    font-size: 17px;
    line-height: 26px;
    color: var(--ink-muted);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    min-height: 44px;
    padding: var(--space-3) 22px;
    border: 2px solid transparent;
    border-radius: var(--radius-pill);
    font: 700 15px/20px var(--font-ui);
    text-decoration: none;
    cursor: pointer;
    transition: transform .12s ease, box-shadow .12s ease, background-color .15s ease, border-color .15s ease, color .15s ease;
}
.btn[hidden] { display: none; }

.btn-primary {
    background: var(--crust);
    color: var(--on-crust);
    border-color: var(--navy);
    box-shadow: var(--shadow-pop);
}
.btn-primary:hover { background: var(--crust-hover); }
.btn-primary:active { transform: translateY(4px); box-shadow: none; }

.btn-ghost {
    background: transparent;
    color: var(--ink);
    border-color: var(--line-strong);
}
.btn-ghost:hover { border-color: var(--ink); }
.btn-ghost:active { transform: translateY(1px); }

.btn-on-crust {
    flex: 0 0 auto;
    background: transparent;
    color: var(--on-crust);
    border-color: var(--navy);
}
.btn-on-crust:hover { background: var(--navy); color: var(--crumb); }
.btn-on-crust:active { transform: translateY(1px); }

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    padding-top: var(--space-2);
}

/* Badges */
.badges { display: flex; flex-wrap: wrap; gap: var(--space-2); }

.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-s);
    color: var(--ink-muted);
    font: 700 12px/16px var(--font-ui);
    letter-spacing: .06em;
    text-transform: uppercase;
}
.badge-crust {
    background: var(--crust);
    border-color: var(--crust);
    color: var(--on-crust);
}

/* Header */
.site-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3) var(--space-5);
    padding: var(--space-3) max(var(--space-4), 24px);
    background: var(--surface);
    border-bottom: 2px solid var(--line);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
    color: inherit;
    text-decoration: none;
}
.brand-stack { display: grid; gap: 2px; justify-items: start; }
.brand-name {
    font-family: var(--font-display);
    font-size: 24px;
    line-height: 1;
    letter-spacing: .01em;
    white-space: nowrap;
}
.brand-games {
    font: 700 10px/16px var(--font-ui);
    letter-spacing: .3em;
    text-transform: uppercase;
    color: var(--crust-text);
}

.header-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2) var(--space-3);
}

.site-nav { display: flex; align-items: center; gap: var(--space-1); }
.site-nav a {
    position: relative;
    padding: var(--space-3) 14px;
    border-radius: var(--radius-pill);
    color: var(--ink-muted);
    font: 700 15px/20px var(--font-ui);
    text-decoration: none;
}
.site-nav a:hover, .site-nav a[aria-current] { color: var(--ink); }
.site-nav a[aria-current]::after {
    content: "";
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 4px;
    height: 3px;
    border-radius: 3px;
    background: var(--crust);
}

/* Hero */
.hero {
    /* The one gradient the brand permits: a faint crust glow behind the logo. */
    background: radial-gradient(55% 70% at 75% 50%, rgba(209, 137, 45, 0.16), transparent 70%), var(--ground);
    padding: var(--space-9) var(--gutter) 88px;
}
.hero-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 56px;
}
.hero-copy {
    flex: 1 1 460px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
}
.hero-mark {
    flex: 1 1 380px;
    min-width: 0;
    display: flex;
    justify-content: center;
}

.wordmark {
    display: inline-grid;
    justify-items: center;
    gap: var(--space-2);
    text-align: center;
}
.wordmark img { width: min(163px, 44vw); height: auto; }
.wordmark-name {
    font-family: var(--font-display);
    font-size: clamp(40px, 11vw, 65px);
    line-height: 1;
    letter-spacing: .01em;
    white-space: nowrap;
    text-shadow: var(--shadow-pop);
}
[data-theme="day"] .wordmark-name { text-shadow: none; }
.wordmark-games {
    display: flex;
    align-items: center;
    gap: .6em;
    padding-left: .32em;
    font: 700 13px/16px var(--font-ui);
    letter-spacing: .32em;
    text-transform: uppercase;
    color: var(--crust-text);
}
.wordmark-games::before, .wordmark-games::after {
    content: "";
    width: 2.4em;
    height: 2px;
    border-radius: 2px;
    background: var(--crust);
}

/* Sections */
.band {
    background: var(--surface);
    border-top: 2px solid var(--line);
    padding: var(--section-y) var(--gutter);
}
.game { border-bottom: 2px solid var(--line); }

.key-art {
    margin: var(--space-3) 0;
    aspect-ratio: 2 / 1;
    overflow: hidden;
    background: var(--navy);
    border: 2px solid var(--line);
    border-radius: var(--radius-l);
    box-shadow: var(--shadow-card);
}
.key-art img { width: 100%; height: 100%; object-fit: cover; }
.game-copy {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

/* Screenshot gallery: a scroll-snap track, so swiping works without any JS. */
.gallery { margin: var(--space-7) auto 0; }

.gallery-stage {
    position: relative;
    aspect-ratio: 16 / 9;
    max-height: min(675px, 75vh);
    overflow: hidden;
    background: var(--navy);
    border: 2px solid var(--line);
    border-radius: var(--radius-l);
    box-shadow: var(--shadow-card);
}

.gallery-track {
    display: flex;
    height: 100%;
    margin: 0;
    padding: 0;
    list-style: none;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}
.gallery-track::-webkit-scrollbar { display: none; }
.gallery-track:focus-visible { outline: 2px solid var(--focus); outline-offset: -4px; }

.gallery-slide {
    flex: 0 0 100%;
    min-width: 0;
    scroll-snap-align: center;
    scroll-snap-stop: always;
}
.gallery-slide img { width: 100%; height: 100%; object-fit: contain; }

.gallery-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    margin-top: var(--space-5);
}
.gallery-controls[hidden] { display: none; }

.gallery-arrow {
    flex: 0 0 44px;
    width: 44px;
    padding: 0;
}

.gallery-thumbs {
    flex: 0 1 324px; /* Four 72px thumbnails and their gaps; shrinks on narrow screens. */
    display: flex;
    justify-content: center;
    gap: var(--space-3);
    min-width: 0;
}

.gallery-thumb {
    flex: 0 1 72px;
    min-width: 0;
    height: 54px;
    padding: 0;
    overflow: hidden;
    background: var(--navy);
    border: 2px solid var(--line-strong);
    border-radius: var(--radius-m);
    cursor: pointer;
    transition: border-color .15s ease;
}
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumb:hover { border-color: var(--ink); }
.gallery-thumb[aria-current] { border-color: var(--crust); box-shadow: 0 0 0 1px var(--crust); }

.gallery-status {
    flex: 0 0 auto;
    min-width: 3.5em;
    color: var(--ink-muted);
    font-size: 14px;
    line-height: 20px;
    text-align: center;
}

/* Ideas: the same carousel as the screenshots, holding concept cards. */
.ideas { border-top: 0; border-bottom: 2px solid var(--line); } /* .game already draws the line above. */
.ideas-intro {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}
.ideas .gallery-stage {
    aspect-ratio: auto;
    max-height: none;
    background: var(--surface-raised);
}
.ideas .gallery-slide { display: flex; }

.idea {
    flex: 1 1 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: var(--space-6);
    padding: max(var(--space-5), 3vw);
}

.idea-art {
    flex: 1 1 320px;
    min-height: 240px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    padding: var(--space-5);
    background: var(--ground);
    border: 2px dashed var(--line-strong);
    border-radius: var(--radius-m);
    color: var(--crust-text);
    text-align: center;
}
.idea-art span {
    color: var(--ink-muted);
    font: 700 13px/16px var(--font-ui);
    letter-spacing: .2em;
    text-transform: uppercase;
}

.idea-copy {
    flex: 1 1 360px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: var(--space-4);
}
.idea-pitch {
    max-width: 34em;
    font-size: 17px;
    line-height: 26px;
}
.idea-points {
    margin: 0;
    padding-left: var(--space-5);
    color: var(--ink-muted);
    font-size: 16px;
    line-height: 24px;
}
.idea-points li + li { margin-top: var(--space-2); }
.idea-points li::marker { color: var(--crust); }

.idea-picks { flex: 0 1 auto; gap: var(--space-2); }
.idea-pick {
    min-height: 44px;
    padding: var(--space-2) var(--space-4);
    background: transparent;
    color: var(--ink-muted);
    border: 2px solid var(--line-strong);
    border-radius: var(--radius-pill);
    font: 700 14px/20px var(--font-ui);
    white-space: nowrap;
    cursor: pointer;
    transition: border-color .15s ease, color .15s ease;
}
.idea-pick:hover { border-color: var(--ink); color: var(--ink); }
.idea-pick[aria-current] { border-color: var(--crust); color: var(--ink); box-shadow: 0 0 0 1px var(--crust); }

/* The two name buttons need more room than thumbnails; arrows and swiping remain. */
@media (max-width: 599px) {
    .idea-picks { display: none; }
    .ideas .gallery-controls { gap: var(--space-5); }
}

.about { padding: var(--section-y) var(--gutter); }
.about-card {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 40px;
    padding: var(--space-7) max(var(--space-5), 4vw);
    background: var(--crust);
    color: var(--on-crust);
    border: 2px solid var(--navy);
    border-radius: var(--radius-l);
    box-shadow: var(--shadow-pop);
    --focus: var(--navy);
}
.about-card img {
    flex: 0 0 auto;
    width: 120px;
    height: 140px;
    object-fit: contain;
}
.about-copy {
    flex: 1 1 380px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}
.about-copy p {
    max-width: 40em;
    font-size: 17px;
    line-height: 26px;
}

/* Policy pages */
.policy {
    max-width: 44em;
    margin: 0 auto;
    padding: var(--section-y) var(--gutter);
    box-sizing: content-box;
    font-size: 17px;
    line-height: 26px;
}
.policy > * + * { margin-top: var(--space-4); }
.policy > h2 { margin-top: var(--space-7); }
.policy a { color: var(--crust-text); }
.policy a:hover { color: var(--ink); }
.policy ul { margin-bottom: 0; padding-left: var(--space-5); }
.policy li + li { margin-top: var(--space-2); }
.policy-date { color: var(--ink-muted); }

.table-scroll {
    overflow-x: auto;
    border: 2px solid var(--line);
    border-radius: var(--radius-m);
}
.table-scroll table {
    width: 100%;
    min-width: 560px;
    border-collapse: collapse;
    font-size: 15px;
    line-height: 22px;
}
.table-scroll th, .table-scroll td {
    padding: var(--space-3);
    text-align: left;
    vertical-align: top;
}
.table-scroll th { background: var(--surface); }
.table-scroll tbody tr { border-top: 1px solid var(--line); }

/* Footer */
.site-footer {
    padding: var(--space-7) var(--gutter) 40px;
    background: var(--navy);
    color: var(--crumb);
    /* The footer stays navy in both themes, so its focus ring must stay light. */
    --focus: var(--crumb);
}
.site-footer a { color: var(--crumb); }
.footer-inner {
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
}
.footer-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-5);
}
.footer-brand {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-family: var(--font-display);
    font-size: 24px;
    line-height: 1;
    text-decoration: none;
}
.footer-nav {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2) var(--space-5);
}
.footer-nav a {
    padding: var(--space-3) 0;
    font-size: 15px;
    line-height: 20px;
}
.footer-bottom {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: var(--space-3);
    padding-top: var(--space-5);
    border-top: 1px solid rgba(246, 233, 201, 0.2);
    color: #b9c4cf;
    font-size: 14px;
    line-height: 20px;
}

/* The header only sticks where it fits on one row. */
@media (min-width: 720px) {
    :root { --header-offset: 74px; }
    .site-header { position: sticky; top: 0; z-index: 10; }
}

@media (max-width: 719px) {
    :root { --section-y: var(--space-7); }
    .hero { padding-top: var(--space-8); padding-bottom: var(--space-8); }
    .about-card { gap: var(--space-5); }
    .gallery-stage { aspect-ratio: 4 / 5; }
}

/* Each policy table row stacks, so no column hides off-screen on phones. */
@media (max-width: 639px) {
    .table-scroll { overflow-x: visible; }
    .table-scroll table { min-width: 0; }
    .table-scroll thead { display: none; }
    .table-scroll tbody, .table-scroll tr, .table-scroll td { display: block; }
    .table-scroll tbody tr:first-child { border-top: 0; }
    .table-scroll td { padding: var(--space-1) var(--space-3); }
    .table-scroll td:first-child { padding-top: var(--space-3); }
    .table-scroll td:last-child { padding-bottom: var(--space-3); }
    .table-scroll td::before {
        content: attr(data-label) ": ";
        font-weight: 700;
    }
}

/* Too narrow for useful thumbnails: arrows, the counter and swiping remain. */
@media (max-width: 479px) {
    .gallery-thumbs { display: none; }
    .gallery-controls { gap: var(--space-5); }
}

@media (prefers-reduced-motion: no-preference) {
    html { scroll-behavior: smooth; }
}

@media (prefers-reduced-motion: reduce) {
    .btn, .gallery-thumb, .idea-pick { transition: none; }
}
