/* Coil site. Tokens from projects/snake/DESIGN.md ("The Playfield Under Glass"): the chrome
   follows the system theme (CoilChromeLight / CoilChromeDark); cobalt panels (chrome-secondary,
   the Daily Table card and control strip) and the printed cream playfield look the same in both
   themes. Anton 400 for display (never synthesised bold), Fira Sans 400/700 for text.
   Yellow on cobalt is for large headings only (4.29:1); body text on cobalt is cream (6.48:1).
   The Lamp Yellow button carries a 2 px ink edge in light (yellow on cream is 1.51:1). */

@font-face {
    font-family: "Anton";
    src: url("/snake/fonts/anton-400.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "Fira Sans";
    src: url("/snake/fonts/firasans-400.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "Fira Sans";
    src: url("/snake/fonts/firasans-700.woff2") format("woff2");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

:root {
    color-scheme: light dark;
    /* Chrome, light (CoilChromeLight) */
    --bg: #F4E7C9;
    --surface: #F8EFD9;
    --sunk: #EAD8AC;
    --ink: #17110F;
    --muted: #3A2E29;
    --accent: #8A141C;
    --outline: #17110F;
    --edge: #17110F;
    --rays: #ECD9A6;
    /* Fixed in both themes (cobalt panels, lamps, the snake) */
    --cobalt: #1D4AAE;
    --on-cobalt: #F4E7C9;
    --yellow: #F5B30C;
    --on-yellow: #17110F;
    --lamp: #FFE27A;
    --red: #BE1E28;
    --red-deep: #8A141C;
    --cream: #F4E7C9;
    --display: "Anton", "Arial Narrow", Impact, sans-serif;
    --body: "Fira Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
    :root {
        /* Chrome, dark (CoilChromeDark) */
        --bg: #17110F;
        --surface: #231A16;
        --sunk: #2E241F;
        --ink: #F4E7C9;
        --muted: #CDBFA0;
        --accent: #F2605F;
        --outline: #BDB09A;
        --edge: #F5B30C;
        --rays: #1E1714;
    }
}

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

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font: 400 1.0625rem/1.6 var(--body);
    overflow-wrap: anywhere;
}

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

a { color: var(--accent); text-underline-offset: 0.15em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

h1, h2 {
    font-family: var(--display);
    font-weight: 400;
    line-height: 1.1;
    letter-spacing: 0.01em;
    text-transform: uppercase;
    margin: 0 0 0.5em;
}
h1 { font-size: clamp(2.4rem, 7.5vw, 4rem); }
h2 { font-size: clamp(1.6rem, 4.5vw, 2.25rem); }
h3 { font-size: 1.125rem; font-weight: 700; line-height: 1.3; margin: 0 0 0.4em; }
p { margin: 0 0 1em; }
strong { font-weight: 700; }

.num { font-weight: 700; font-variant-numeric: tabular-nums; }

.wrap { max-width: 70rem; margin: 0 auto; padding: 0 1rem; }

.skip-link {
    position: absolute; left: 1rem; top: -4rem; z-index: 10;
    background: var(--yellow); color: var(--on-yellow); border: 2px solid var(--ink);
    padding: 0.75rem 1rem; border-radius: 12px; font-weight: 700;
}
.skip-link:focus { top: 1rem; }

/* Header */
.topbar { border-bottom: 2px solid var(--outline); background: var(--bg); }
.topbar .wrap {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
    gap: 0.5rem 1.5rem; padding-block: 0.5rem;
}
.brand {
    display: flex; align-items: center; gap: 0.6rem; min-height: 48px;
    color: var(--ink); text-decoration: none;
}
.brand img { border-radius: 10px; border: 2px solid var(--ink); }
.wordmark { font-family: var(--display); font-size: 1.75rem; line-height: 1; letter-spacing: 0.02em; text-transform: uppercase; }
.site-nav ul { display: flex; flex-wrap: wrap; gap: 0 0.25rem; list-style: none; margin: 0; padding: 0; }
.site-nav a {
    display: inline-flex; align-items: center; min-height: 48px; padding: 0 0.75rem;
    color: var(--ink); font-weight: 700; text-decoration: none; border-radius: 12px;
    text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.9rem;
}
.site-nav a:hover { background: var(--sunk); }
.site-nav a[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 0.35em; }

/* Sections */
main { display: block; }
.section { padding: 2.75rem 0; }
.section + .section { border-top: 2px dashed var(--sunk); }
.lede, .sub { font-size: 1.15rem; color: var(--muted); max-width: 40rem; }
.answer { font-size: 1.125rem; max-width: 42rem; }
.detail, .prose p, .prose ul { max-width: 42rem; }
.detail li { margin-bottom: 0.4rem; }

/* Hero: the printed playfield, sunburst rays on cream (DESIGN.md: quiet print) */
.hero {
    padding: 2rem 0 2.75rem;
    background:
        repeating-conic-gradient(from 0deg at 85% 110%, var(--rays) 0deg 6deg, transparent 6deg 14deg),
        var(--bg);
    border-bottom: 2px solid var(--outline);
}
.hero-grid { display: grid; gap: 2rem; align-items: center; }
@media (min-width: 56rem) { .hero-grid { grid-template-columns: 1fr 21rem; } }
.hero-grid > * { min-width: 0; }
.cta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.25rem; margin-top: 1.5rem; }
.cta-note { margin: 0; color: var(--muted); font-weight: 700; }
.play-badge { display: inline-block; min-height: 48px; border-radius: 8px; }
.play-badge img { width: 188px; height: 56px; }

/* Loop mark: a closed ring (red tube, cream stripe) with a lit inside. Decoration only. */
.loop-mark { display: flex; align-items: center; gap: 0.75rem; margin: 0 0 1.25rem; }
.loop-mark .ring {
    width: 2.75rem; height: 2.75rem; flex: none; border-radius: 6px;
    background: var(--lamp);
    border: 0.45rem solid var(--red);
    box-shadow: inset 0 0 0 2px var(--cream), 0 0 0 2px var(--ink);
}
.loop-mark .tag {
    font-family: var(--display); font-size: 1.1rem; letter-spacing: 0.04em; text-transform: uppercase;
    background: var(--yellow); color: var(--on-yellow); border: 2px solid var(--ink);
    border-radius: 12px; padding: 0.2rem 0.75rem; line-height: 1.25; min-width: 0;
}

/* Phone shots: framed deck exports; 1 px ink edge */
.phone { border: 1px solid var(--ink); border-radius: 12px; background: var(--cream); }
.hero-shot { display: block; max-width: 21rem; margin: 0 auto; }

/* Answer in a printed card */
.entity {
    background: var(--surface); color: var(--ink);
    border: 2px solid var(--outline); border-radius: 16px; padding: 1.25rem; max-width: 48rem;
}
.entity p { margin: 0; }

/* Cards */
.cards { display: grid; gap: 1rem; list-style: none; margin: 1.25rem 0 0; padding: 0; }
@media (min-width: 48rem) { .cards { grid-template-columns: repeat(3, 1fr); } }
.card { background: var(--surface); color: var(--ink); border: 2px solid var(--outline); border-radius: 16px; padding: 1.25rem; }
.card p:last-child { margin: 0; }

/* Multiplier lamps: the multiplier is written as text; the lamp is decoration */
.lamps { display: grid; gap: 0.75rem; list-style: none; margin: 1.25rem 0 0; padding: 0; max-width: 46rem; }
@media (min-width: 40rem) { .lamps { grid-template-columns: repeat(4, 1fr); } }
.lamps li {
    background: var(--surface); color: var(--ink); border: 2px solid var(--outline);
    border-radius: 16px; padding: 0.9rem 1rem;
}
.lamps .figure { display: block; font-family: var(--display); font-size: 2rem; line-height: 1.1; }
.lamps .what { display: block; color: var(--muted); }

/* Cobalt panel: the Daily Table card and the closing band. Same in both themes. */
.cobalt {
    background: var(--cobalt); color: var(--on-cobalt);
    border: 2px solid var(--ink); border-radius: 16px; padding: 1.5rem;
}
.cobalt h2 { color: var(--yellow); }
.cobalt a { color: var(--on-cobalt); }
.cobalt :focus-visible { outline-color: var(--on-cobalt); }
.cobalt p:last-child { margin-bottom: 0; }

.split { display: grid; gap: 1.5rem; align-items: start; }
@media (min-width: 48rem) { .split { grid-template-columns: 1fr 15rem; } }
.split > * { min-width: 0; }
.split img { max-width: min(15rem, 100%); }

/* Gallery */
.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; list-style: none; margin: 0; padding: 0; }
@media (min-width: 48rem) { .gallery { grid-template-columns: repeat(5, 1fr); } }
.gallery > li { min-width: 0; }
.shot { margin: 0; }
.shot figcaption { font-size: 0.95rem; color: var(--muted); margin-top: 0.5rem; }

/* Question links */
.qlinks { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.qlinks a {
    display: flex; align-items: center; min-height: 48px; padding: 0.5rem 1rem;
    background: var(--surface); color: var(--ink); border: 2px solid var(--outline); border-radius: 12px;
    font-weight: 700; text-decoration: none;
}
.qlinks a:hover { background: var(--sunk); text-decoration: underline; }
.toc { margin-bottom: 1rem; }

/* Breadcrumb */
.crumbs ol { display: flex; flex-wrap: wrap; list-style: none; margin: 0 0 1rem; padding: 0; color: var(--muted); font-size: 0.95rem; }
.crumbs li + li::before { content: "›"; padding: 0 0.5rem; }
.crumbs a { display: inline-block; padding: 0.75rem 0; }

/* Tables: stack into cards at 600 px and below */
table { border-collapse: collapse; width: 100%; max-width: 48rem; margin: 1rem 0 1.5rem; }
caption { display: block; text-align: left; font-weight: 700; margin-bottom: 0.5rem; }
th, td { text-align: left; vertical-align: top; padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--outline); }
thead th { border-bottom: 2px solid var(--ink); }
@media (max-width: 37.5rem) {
    thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
    tr { display: block; background: var(--surface); color: var(--ink); border: 2px solid var(--outline); border-radius: 12px; padding: 0.5rem 0.75rem; margin-bottom: 0.75rem; }
    td { display: block; border: 0; padding: 0.25rem 0; }
    td::before { content: attr(data-label) ": "; font-weight: 700; }
}

.faq section { padding: 1.5rem 0; border-top: 2px dashed var(--sunk); }
.faq h2 { font-size: clamp(1.4rem, 4vw, 1.9rem); }

/* Closing band */
.band { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; }
.band h2 { margin: 0; }

/* Footer */
.footer { border-top: 2px solid var(--outline); padding: 2rem 0; margin-top: 1rem; font-size: 0.95rem; }
.footer-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; }
.footer-links { display: flex; flex-wrap: wrap; list-style: none; margin: 1rem 0; padding: 0; gap: 0 1rem; }
.footer-links a { display: inline-flex; align-items: center; min-height: 48px; }
.fine { color: var(--muted); }
.fine p { margin: 0 0 0.5rem; }
