/* ==========================================================================
   DiwaGame.com — "Arcade Terminal"
   --------------------------------------------------------------------------
   Dials: DESIGN_VARIANCE 8 · MOTION_INTENSITY 6 · VISUAL_DENSITY 5

   Theme lock: this page is dark-only by design. The brand mark is a gold
   wordmark on black and the product is a nocturnal gaming directory, so there
   is no light variant. No section inverts.

   Accent lock: one accent (--acid) across every section. The logo's gold is
   confined to the logo artwork itself and is never used as a UI colour.

   Shape lock: surfaces and controls are 4px. App icon artwork is 14px,
   because an Android icon reads as a squircle. Nothing else is rounded.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Fonts (self-hosted, latin subset, variable)
   -------------------------------------------------------------------------- */
@font-face {
    font-family: "Geist";
    src: url("/assets/fonts/geist-latin.woff2") format("woff2");
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
                   U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F,
                   U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: "Geist Mono";
    src: url("/assets/fonts/geist-mono-latin.woff2") format("woff2");
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
                   U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F,
                   U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* --------------------------------------------------------------------------
   2. Tokens
   -------------------------------------------------------------------------- */
:root {
    /* Canvas — deliberately near-black, not charcoal */
    --void:      #07080a;
    --panel:     #0c0e12;
    --panel-2:   #12151a;
    --panel-3:   #181c22;

    /* Ink */
    --ink:       #edefe9;
    --ink-dim:   #9ba2aa;
    --ink-faint: #787f88;   /* AA on both --void and --panel */

    /* The single accent */
    --acid:      #c8f24c;
    --acid-deep: #a3cc2e;
    --acid-wash: rgba(200, 242, 76, 0.09);
    --acid-line: rgba(200, 242, 76, 0.28);
    --on-acid:   #0e1400;

    /* Semantic — used only for the responsible-gaming warning */
    --alert:      #ffb26b;
    --alert-wash: rgba(255, 178, 107, 0.07);
    --alert-line: rgba(255, 178, 107, 0.24);

    /* Lines */
    --line:   rgba(255, 255, 255, 0.06);
    --line-2: rgba(255, 255, 255, 0.11);

    /* Type */
    --sans: "Geist", ui-sans-serif, system-ui, -apple-system, sans-serif;
    --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;

    /* Shape */
    --r:      4px;
    --r-icon: 14px;

    /* Layout */
    --page:    1320px;
    --gutter:  28px;
    --rail:    300px;
    --bay:     60px;    /* visible gap between sections */
    --nav-h:   64px;
}

@media (max-width: 900px) {
    :root { --gutter: 18px; --nav-h: 58px; }
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--nav-h) + 24px);
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--void);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 16px;
    line-height: 1.6;
    font-feature-settings: "cv11", "ss01";
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

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

a { color: inherit; text-decoration: none; cursor: pointer; }

button { font: inherit; cursor: pointer; }

h1, h2, h3, h4 {
    margin: 0 0 .5em;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.025em;
    color: var(--ink);
}

::selection { background: var(--acid); color: var(--on-acid); }

:focus-visible {
    outline: 2px solid var(--acid);
    outline-offset: 3px;
    border-radius: var(--r);
}

.ico { width: 1em; height: 1em; flex: none; }

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 200;
    background: var(--acid);
    color: var(--on-acid);
    padding: 12px 20px;
    font-weight: 700;
}
.skip-link:focus { left: 0; }

.vh {
    position: absolute; width: 1px; height: 1px;
    margin: -1px; padding: 0; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* --------------------------------------------------------------------------
   4. Layout primitives
   -------------------------------------------------------------------------- */
.page {
    width: 100%;
    max-width: var(--page);
    margin-inline: auto;
    padding-inline: var(--gutter);
}

.bay { padding-block: calc(var(--bay) / 2); }

/* Section header: headline left, small utility link right. One line. */
.bay-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    padding-bottom: 22px;
    margin-bottom: 34px;
    border-bottom: 1px solid var(--line-2);
}
.bay-head h2 {
    margin: 0;
    font-size: clamp(26px, 3.4vw, 40px);
    letter-spacing: -0.035em;
}
.bay-head p {
    margin: 8px 0 0;
    color: var(--ink-dim);
    font-size: 15px;
    max-width: 56ch;
}
.bay-note {
    flex: none;
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--ink-faint);
    padding-bottom: 4px;
    white-space: nowrap;
}

.eyebrow {
    display: block;
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--acid);
    margin-bottom: 18px;
}

/* --------------------------------------------------------------------------
   5. Buttons
   -------------------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 46px;
    padding: 13px 24px;
    border: 1px solid transparent;
    border-radius: var(--r);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.01em;
    white-space: nowrap;
    transition: background .18s ease, border-color .18s ease,
                color .18s ease, transform .12s ease;
}
.btn .ico { font-size: 19px; }

.btn-acid { background: var(--acid); color: var(--on-acid); }
.btn-acid:hover { background: #d6fa6a; }
.btn-acid:active { transform: translateY(1px); }

.btn-line { border-color: var(--line-2); color: var(--ink); }
.btn-line:hover { border-color: var(--acid); color: var(--acid); }
.btn-line:active { transform: translateY(1px); }

.btn-wide { width: 100%; }
.btn-lg { min-height: 54px; padding: 16px 30px; font-size: 16px; }

/* --------------------------------------------------------------------------
   6. Masthead
   -------------------------------------------------------------------------- */
.masthead {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 100;
    background: rgba(7, 8, 10, 0.86);
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    border-bottom: 1px solid var(--line);
}
.masthead-in {
    display: flex;
    align-items: center;
    gap: 28px;
    min-height: var(--nav-h);
}

.wordmark { display: inline-flex; align-items: center; gap: 10px; flex: none; }
.wordmark img { width: 30px; height: 30px; border-radius: 7px; }
.wordmark b {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav a {
    position: relative;
    padding: 8px 12px;
    font-size: 14px;
    color: var(--ink-dim);
    border-radius: var(--r);
    transition: color .16s ease, background .16s ease;
}
.nav a:hover { color: var(--ink); background: rgba(255,255,255,.04); }
.nav a.on { color: var(--acid); }
.nav a.on::after {
    content: "";
    position: absolute;
    left: 12px; right: 12px; bottom: 2px;
    height: 1px;
    background: var(--acid);
}

.nav-cta {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 38px;
    padding: 0 16px;
    margin-left: 8px;
    background: var(--acid);
    color: var(--on-acid);
    border-radius: var(--r);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: -0.01em;
    transition: background .18s ease;
}
.nav-cta:hover { background: #d6fa6a; }
.nav-cta .ico { font-size: 15px; }

.burger {
    display: none;
    margin-left: auto;
    width: 42px; height: 42px;
    align-items: center; justify-content: center;
    background: transparent;
    border: 1px solid var(--line-2);
    border-radius: var(--r);
    color: var(--ink);
    font-size: 21px;
}
.burger .shut { display: none; }
.burger[aria-expanded="true"] .open { display: none; }
.burger[aria-expanded="true"] .shut { display: block; }

@media (max-width: 1080px) {
    .burger { display: inline-flex; }
    .nav {
        position: fixed;
        inset: var(--nav-h) 0 auto 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        margin: 0;
        padding: 10px var(--gutter) 22px;
        background: var(--void);
        border-bottom: 1px solid var(--line-2);
        max-height: calc(100dvh - var(--nav-h));
        overflow-y: auto;
        opacity: 0;
        visibility: hidden;
        transform: translateY(-8px);
        transition: opacity .2s ease, transform .2s ease, visibility .2s ease;
    }
    .nav.show { opacity: 1; visibility: visible; transform: none; }
    .nav a { padding: 15px 4px; font-size: 16px; border-bottom: 1px solid var(--line); border-radius: 0; }
    .nav a.on::after { left: 4px; right: auto; width: 22px; bottom: 8px; }
    .nav-cta { margin: 18px 0 0; height: 48px; justify-content: center; }
}

/* --------------------------------------------------------------------------
   7. Hero — asymmetric split, never centered
   -------------------------------------------------------------------------- */
.hero {
    position: relative;
    padding-top: calc(var(--nav-h) + 84px);
    padding-bottom: var(--bay);
    overflow: hidden;
}
.hero::before {
    /* single low-opacity accent wash, no neon glow */
    content: "";
    position: absolute;
    top: -30%; right: -10%;
    width: 780px; height: 780px;
    background: radial-gradient(circle, var(--acid-wash), transparent 62%);
    pointer-events: none;
}

/* Generated casino plate. Shown at full strength; legibility comes from a
   directional scrim that is opaque behind the text column and clears toward
   the right so the photograph reads. */
.plate {
    position: absolute;
    inset: 0;
    z-index: 0;
    background-size: cover;
    background-position: center right;
    pointer-events: none;
}
.plate::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg,
            var(--void) 0%,
            rgba(7, 8, 10, .93) 30%,
            rgba(7, 8, 10, .68) 55%,
            rgba(7, 8, 10, .34) 80%,
            rgba(7, 8, 10, .22) 100%),
        linear-gradient(180deg,
            rgba(7, 8, 10, .62) 0%,
            rgba(7, 8, 10, .16) 38%,
            rgba(7, 8, 10, .55) 82%,
            var(--void) 100%);
}

/* The shortlist floats over the photograph, so it carries its own ground and
   its heading sits inside the panel rather than on the image. */
.picks {
    position: relative;
    z-index: 1;
    background: rgba(8, 10, 13, .89);
    backdrop-filter: blur(16px) saturate(130%);
    -webkit-backdrop-filter: blur(14px) saturate(130%);
    border: 1px solid var(--line-2);
    border-radius: var(--r);
    padding: 16px 18px 6px;
}
.picks-h {
    margin: 0 0 10px;
    font-family: var(--mono);
    font-size: 10.5px;
    letter-spacing: .18em;
    text-transform: uppercase;
    /* brighter than a label on solid ground: this panel floats over photography */
    color: var(--ink-dim);
}
.picks-list { border-top: 1px solid var(--line); }

.ident { position: relative; }
.ident .plate { background-position: right center; }
.ident .plate::after {
    background:
        linear-gradient(90deg,
            var(--void) 0%,
            rgba(7, 8, 10, .9) 32%,
            rgba(7, 8, 10, .58) 54%,
            rgba(7, 8, 10, .22) 82%,
            rgba(7, 8, 10, .12) 100%),
        linear-gradient(180deg,
            rgba(7, 8, 10, .42) 0%,
            rgba(7, 8, 10, .1) 32%,
            rgba(7, 8, 10, .6) 80%,
            var(--void) 100%);
}
.ident-top, .readout { position: relative; z-index: 1; }

/* Stacked layouts put text over the whole width, so the horizontal scrim can
   no longer protect it. Switch to a vertical one below the split breakpoint. */
@media (max-width: 1080px) {
    .plate::after,
    .ident .plate::after {
        background: linear-gradient(180deg,
            rgba(7, 8, 10, .88) 0%,
            rgba(7, 8, 10, .8) 45%,
            rgba(7, 8, 10, .86) 72%,
            var(--void) 100%);
    }
    .plate { background-position: center; }
}
.hero-grid {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.32fr) minmax(0, .68fr);
    gap: 56px;
    align-items: center;
}
.hero-title {
    font-size: clamp(30px, 3.9vw, 48px);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.08;
    margin: 0 0 22px;
    text-wrap: balance;
}
.hero-title em {
    font-style: normal;
    color: var(--acid);
}
.hero-sub {
    margin: 0 0 34px;
    color: var(--ink-dim);
    font-size: clamp(16px, 1.6vw, 18px);
    line-height: 1.65;
    max-width: 46ch;
}
.hero-acts { display: flex; flex-wrap: wrap; gap: 12px; }

/* Right column: ranked top picks. Directory-native, not a card grid. */
.pick {
    display: grid;
    grid-template-columns: 30px 52px minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
    padding: 15px 8px;
    border-bottom: 1px solid var(--line);
    transition: background .16s ease, padding-left .16s ease;
}
.pick:hover { background: rgba(255,255,255,.03); padding-left: 14px; }
.pick-rk {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--ink-faint);
}
.pick:hover .pick-rk { color: var(--acid); }
.pick img { width: 52px; height: 52px; border-radius: 11px; }
.pick-nm { display: block; font-size: 15px; font-weight: 600; letter-spacing: -0.015em; }
.pick-mt {
    display: block;
    font-family: var(--mono);
    font-size: 11px;
    color: var(--ink-dim);
    letter-spacing: .06em;
    margin-top: 3px;
}
.pick-bn {
    font-family: var(--mono);
    font-size: 13px;
    font-weight: 600;
    color: var(--acid);
    white-space: nowrap;
}

@media (max-width: 1080px) {
    .hero { padding-top: calc(var(--nav-h) + 52px); padding-bottom: 56px; }
    .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 44px; }
}
@media (max-width: 560px) {
    .hero-acts { flex-direction: column; align-items: stretch; }
    .hero-acts .btn { width: 100%; }
}

/* --------------------------------------------------------------------------
   8. Signal band — thin utility strip under the hero
   -------------------------------------------------------------------------- */
.band {
    border-block: 1px solid var(--line);
    background: var(--panel);
}
.band-in {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background: var(--line);
}
.band-cell {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 20px 22px;
    background: var(--panel);
    font-family: var(--mono);
    font-size: 11.5px;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--ink-dim);
}
.band-cell .ico { font-size: 17px; color: var(--acid); }

@media (max-width: 780px) {
    .band-in { grid-template-columns: repeat(2, 1fr); }
    .band-cell { padding: 15px 14px; font-size: 10.5px; letter-spacing: .08em; }
}

/* --------------------------------------------------------------------------
   9. Rail — horizontal scroll-snap strip
   -------------------------------------------------------------------------- */
.rail {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 246px;
    gap: 16px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 18px;
    margin-inline: calc(var(--gutter) * -1);
    padding-inline: var(--gutter);
    scrollbar-width: thin;
    scrollbar-color: var(--line-2) transparent;
}
.rail::-webkit-scrollbar { height: 3px; }
.rail::-webkit-scrollbar-track { background: var(--line); }
.rail::-webkit-scrollbar-thumb { background: var(--line-2); }
.rail:hover::-webkit-scrollbar-thumb { background: var(--acid-line); }

.slab {
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    padding: 20px;
    background: var(--panel-2);
    border: 1px solid var(--line);
    border-radius: var(--r);
    transition: border-color .18s ease, background .18s ease, transform .18s ease;
}
.slab:hover {
    border-color: var(--acid-line);
    background: var(--panel-3);
    transform: translateY(-3px);
}
.slab-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.slab img { width: 62px; height: 62px; border-radius: var(--r-icon); }
.slab h3 {
    margin: 18px 0 6px;
    font-size: 16px;
    font-weight: 650;
    letter-spacing: -0.02em;
}
.slab-mt {
    display: flex;
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: .07em;
    color: var(--ink-faint);
    display: flex;
    align-items: center;
    gap: 7px;
}
.slab-mt .ico { font-size: 12px; color: var(--acid); }
.slab-foot {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.slab-bn { display: block; font-family: var(--mono); font-size: 13px; font-weight: 600; color: var(--acid); }
.slab-go {
    font-size: 17px;
    color: var(--ink-faint);
    transition: color .18s ease, transform .18s ease;
}
.slab:hover .slab-go { color: var(--acid); transform: translate(3px, -3px); }

.flag {
    font-family: var(--mono);
    font-size: 9.5px;
    font-weight: 600;
    letter-spacing: .14em;
    text-transform: uppercase;
    padding: 4px 8px;
    border-radius: var(--r);
    border: 1px solid;
}
.flag-new { color: var(--acid); border-color: var(--acid-line); background: var(--acid-wash); }
.flag-hot { color: var(--alert); border-color: var(--alert-line); background: var(--alert-wash); }
.flag-ver { color: var(--ink-faint); border-color: var(--line-2); }

/* Single large monospace figure, used in the detail sidebar. */
.figure {
    margin: 0;
    font-family: var(--mono);
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--acid);
}

/* -------------------------------------------------------------------------
   10. Ledger — ranked leaderboard rows
   ------------------------------------------------------------------------- */
.ledger { border-top: 1px solid var(--line-2); }
.row {
    display: grid;
    grid-template-columns: 56px 60px minmax(0, 1fr) 130px 120px 34px;
    align-items: center;
    gap: 18px;
    padding: 17px 10px;
    border-bottom: 1px solid var(--line);
    transition: background .16s ease, padding-left .16s ease;
}
.row:hover { background: rgba(255,255,255,.028); padding-left: 18px; }
.row-rk {
    font-family: var(--mono);
    font-size: 18px;
    font-weight: 500;
    color: var(--ink-faint);
    transition: color .16s ease;
}
.row:hover .row-rk { color: var(--acid); }
.row img { width: 60px; height: 60px; border-radius: 13px; }
.row-nm { display: block; font-size: 17px; font-weight: 650; letter-spacing: -0.022em; }
.row-ds {
    display: block;
    margin-top: 4px;
    color: var(--ink-faint);
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.row-dt {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--ink-dim);
    letter-spacing: .05em;
    display: flex;
    align-items: center;
    gap: 7px;
}
.row-dt .ico { font-size: 13px; color: var(--acid); }
.row-bn {
    font-family: var(--mono);
    font-size: 15px;
    font-weight: 600;
    color: var(--acid);
    text-align: right;
}
.row-go { font-size: 17px; color: var(--ink-faint); text-align: right; transition: color .16s ease, transform .16s ease; }
.row:hover .row-go { color: var(--acid); transform: translateX(3px); }

@media (max-width: 900px) {
    .row {
        grid-template-columns: 34px 52px minmax(0, 1fr) auto;
        gap: 13px;
        padding: 14px 4px;
    }
    .row:hover { padding-left: 8px; }
    .row img { width: 52px; height: 52px; }
    .row-rk { font-size: 13px; }
    .row-nm { font-size: 15px; }
    .row-ds, .row-dt, .row-go { display: none; }
    .row-bn { font-size: 13px; }
}

/* -------------------------------------------------------------------------
   11. Index — dense directory grid
   ------------------------------------------------------------------------- */
.index {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 1px;
    background: var(--line);
    border: 1px solid var(--line);
    border-radius: var(--r);
    overflow: hidden;
}
.cell {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 17px 16px;
    background: var(--panel);
    transition: background .16s ease;
}
.cell:hover { background: var(--panel-3); }
.cell img { width: 42px; height: 42px; border-radius: 10px; flex: none; }
.cell-b { min-width: 0; }
.cell-nm {
    display: block;
    font-size: 13.5px;
    font-weight: 600;
    letter-spacing: -0.015em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color .16s ease;
}
.cell:hover .cell-nm { color: var(--acid); }
.cell-bn {
    display: block;
    font-family: var(--mono);
    font-size: 11px;
    color: var(--ink-faint);
    margin-top: 3px;
    letter-spacing: .05em;
}

@media (max-width: 1200px) { .index { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 900px)  { .index { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 620px)  { .index { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px)  { .cell { padding: 13px 11px; gap: 10px; } .cell img { width: 36px; height: 36px; } }

/* -------------------------------------------------------------------------
   12. Statement band — responsible gaming
   ------------------------------------------------------------------------- */
.statement {
    border-top: 1px solid var(--alert-line);
    background: var(--alert-wash);
}
.statement-in {
    display: grid;
    grid-template-columns: minmax(0, 320px) minmax(0, 1fr);
    gap: 56px;
    padding-block: var(--bay);
}
.statement h2 {
    display: flex;
    align-items: center;
    gap: 13px;
    margin: 0;
    font-size: clamp(24px, 3vw, 34px);
    letter-spacing: -0.035em;
    color: var(--alert);
}
.statement h2 .ico { font-size: 30px; flex: none; }
.statement p {
    margin: 0 0 16px;
    color: var(--ink-dim);
    font-size: 15.5px;
    line-height: 1.75;
    max-width: 74ch;
}
.statement p:last-of-type { margin-bottom: 0; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 26px; }
.tag {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: .11em;
    text-transform: uppercase;
    color: var(--alert);
    border: 1px solid var(--alert-line);
    border-radius: var(--r);
    padding: 7px 12px;
}
@media (max-width: 900px) {
    .statement-in { grid-template-columns: minmax(0, 1fr); gap: 26px; }
}

/* -------------------------------------------------------------------------
   13. APK identity band
   ------------------------------------------------------------------------- */
.crumbs {
    display: flex;
    align-items: center;
    gap: 9px;
    padding-top: calc(var(--nav-h) + 26px);
    padding-bottom: 22px;
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--ink-faint);
    flex-wrap: wrap;
}
.crumbs a { color: var(--ink-faint); transition: color .16s ease; }
.crumbs a:hover { color: var(--acid); }
.crumbs .ico { font-size: 11px; opacity: .5; }
.crumbs [aria-current] { color: var(--ink-dim); }

.ident { padding-bottom: calc(var(--bay) / 2); }
.ident-top {
    display: grid;
    grid-template-columns: 132px minmax(0, 1fr) auto;
    gap: 30px;
    align-items: center;
}
.ident-art {
    width: 132px; height: 132px;
    border-radius: 26px;
    border: 1px solid var(--line-2);
}
.ident-flags { display: flex; gap: 8px; margin-bottom: 14px; position: static; }
.ident h1 {
    margin: 0 0 12px;
    font-size: clamp(30px, 5vw, 54px);
    font-weight: 800;
    letter-spacing: -0.045em;
    line-height: 1.02;
}
.ident-ds {
    margin: 0;
    color: var(--ink-dim);
    font-size: 16px;
    line-height: 1.6;
    max-width: 58ch;
}

/* Monospace data strip. Replaces the old pill chips. */
.readout {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    margin-top: 40px;
    background: var(--line);
    border: 1px solid var(--line);
    border-radius: var(--r);
    overflow: hidden;
}
.readout div { background: var(--panel); padding: 18px 20px; }
.readout dt {
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--ink-faint);
    margin: 0 0 8px;
}
.readout dd {
    margin: 0;
    font-family: var(--mono);
    font-size: clamp(17px, 2vw, 22px);
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--ink);
    display: flex;
    align-items: center;
    gap: 7px;
}
.readout .acid { color: var(--acid); }
.readout .ico { font-size: 16px; color: var(--acid); }

@media (max-width: 900px) {
    .ident-top { grid-template-columns: 84px minmax(0, 1fr); gap: 18px; }
    .ident-art { width: 84px; height: 84px; border-radius: 18px; }
    .ident-cta { grid-column: 1 / -1; }
    .ident-cta .btn { width: 100%; }
    .readout { grid-template-columns: repeat(2, 1fr); margin-top: 26px; }
    .readout div { padding: 14px 15px; }
}

/* -------------------------------------------------------------------------
   14. Document layout — article plus sticky rail
   ------------------------------------------------------------------------- */
.doc {
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--rail);
    gap: 64px;
    align-items: start;
    padding-block: calc(var(--bay) / 2);
    border-top: 1px solid var(--line);
}
.doc-flip { grid-template-columns: var(--rail) minmax(0, 1fr); }
@media (max-width: 1080px) {
    .doc, .doc-flip { grid-template-columns: minmax(0, 1fr); gap: 40px; }
    .doc-flip .side { order: -1; }
}

.side { position: sticky; top: calc(var(--nav-h) + 28px); display: grid; gap: 22px; }
@media (max-width: 1080px) { .side { position: static; } }

.side-h {
    font-family: var(--mono);
    font-size: 10.5px;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--ink-faint);
    margin: 0 0 14px;
}

/* Auto table of contents */
.toc { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line-2); }
.toc li { margin: 0; }
.toc a {
    display: block;
    padding: 8px 0 8px 16px;
    margin-left: -1px;
    border-left: 1px solid transparent;
    color: var(--ink-dim);
    font-size: 13.5px;
    line-height: 1.45;
    transition: color .16s ease, border-color .16s ease;
}
.toc a:hover { color: var(--ink); border-left-color: var(--line-2); }
.toc a.on { color: var(--acid); border-left-color: var(--acid); }
.toc .sub a { padding-left: 28px; font-size: 12.5px; color: var(--ink-faint); }
.toc .sub a:hover { color: var(--ink-dim); }

.note {
    display: flex;
    gap: 11px;
    padding: 15px 16px;
    border: 1px solid var(--alert-line);
    background: var(--alert-wash);
    border-radius: var(--r);
    font-size: 13px;
    line-height: 1.6;
    color: var(--ink-dim);
}
.note .ico { font-size: 17px; color: var(--alert); flex: none; margin-top: 2px; }
.note b {
    display: block;
    color: var(--alert);
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: .14em;
    text-transform: uppercase;
    margin-bottom: 5px;
}

/* -------------------------------------------------------------------------
   15. Prose — unboxed, generous measure
   ------------------------------------------------------------------------- */
.prose {
    max-width: 74ch;
    font-size: 17px;
    line-height: 1.78;
    color: var(--ink-dim);
}
.prose > *:first-child { margin-top: 0; }
.prose > *:last-child { margin-bottom: 0; }
.prose p { margin: 0 0 1.3em; }

.prose .lede {
    font-size: clamp(21px, 2.6vw, 27px);
    font-weight: 650;
    letter-spacing: -0.03em;
    line-height: 1.28;
    color: var(--ink);
    margin: 0 0 1.1em;
    padding-bottom: .85em;
    border-bottom: 1px solid var(--line-2);
}
.prose .lede::before { display: none; }

.prose h2 {
    margin: 2.1em 0 .7em;
    font-size: clamp(21px, 2.4vw, 27px);
    font-weight: 700;
    letter-spacing: -0.032em;
    color: var(--ink);
    scroll-margin-top: calc(var(--nav-h) + 26px);
}
.prose h2::before {
    content: "";
    display: block;
    width: 26px;
    height: 2px;
    background: var(--acid);
    margin-bottom: 18px;
}
.prose h3 {
    margin: 1.7em 0 .55em;
    scroll-margin-top: calc(var(--nav-h) + 26px);
    font-size: 18px;
    font-weight: 650;
    letter-spacing: -0.022em;
    color: var(--ink);
}
.prose h4 { margin: 1.4em 0 .5em; font-size: 16px; color: var(--ink); }

.prose ul { margin: 0 0 1.4em; padding: 0; list-style: none; }
.prose li { position: relative; padding-left: 22px; margin-bottom: .55em; }
.prose li::before {
    content: "";
    position: absolute;
    left: 2px; top: .72em;
    width: 6px; height: 1px;
    background: var(--acid);
}
.prose a { color: var(--acid); text-decoration: underline; text-underline-offset: 3px; }
.prose strong { color: var(--ink); font-weight: 650; }

.tablewrap { overflow-x: auto; margin: 0 0 1.4em; }
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; }
.prose td { border-bottom: 1px solid var(--line); padding: 11px 14px 11px 0; }

@media (max-width: 900px) { .prose { font-size: 16px; } }

/* -------------------------------------------------------------------------
   16. Static page masthead
   ------------------------------------------------------------------------- */
.title-block {
    padding-top: calc(var(--nav-h) + 60px);
    padding-bottom: calc(var(--bay) / 2);
}
.title-block h1 {
    margin: 0;
    font-size: clamp(32px, 5.6vw, 62px);
    font-weight: 800;
    letter-spacing: -0.045em;
    line-height: 1.03;
    max-width: 20ch;
    text-wrap: balance;
}
.title-block p {
    margin: 22px 0 0;
    color: var(--ink-dim);
    font-size: 17px;
    line-height: 1.6;
    max-width: 62ch;
}

.ask {
    margin-top: var(--bay);
    padding: 30px 32px;
    border: 1px solid var(--line-2);
    border-radius: var(--r);
    background: var(--panel);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 26px;
    flex-wrap: wrap;
}
.ask h2 { margin: 0 0 6px; font-size: 20px; letter-spacing: -0.03em; }
.ask p { margin: 0; color: var(--ink-dim); font-size: 14.5px; }

/* -------------------------------------------------------------------------
   17. Colophon
   ------------------------------------------------------------------------- */
.colophon {
    border-top: 1px solid var(--line-2);
    background: var(--panel);
    padding-block: 60px 30px;
}
.colophon-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) repeat(3, minmax(0, 1fr));
    gap: 44px;
}
.colophon-blurb {
    margin: 16px 0 0;
    color: var(--ink-faint);
    font-size: 14px;
    line-height: 1.7;
    max-width: 38ch;
}
.colophon h3 {
    margin: 0 0 15px;
    font-family: var(--mono);
    font-size: 10.5px;
    font-weight: 500;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--ink-faint);
}
.colophon ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.colophon ul a { color: var(--ink-dim); font-size: 14px; transition: color .16s ease; }
.colophon ul a:hover { color: var(--acid); }
.colophon-base {
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    color: var(--ink-faint);
    font-size: 13px;
    line-height: 1.7;
}
.colophon-base b { color: var(--ink-dim); }
@media (max-width: 900px) {
    .colophon-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; }
}
@media (max-width: 560px) {
    .colophon-grid { grid-template-columns: minmax(0, 1fr); }
}

/* -------------------------------------------------------------------------
   18. Back to top
   ------------------------------------------------------------------------- */
/* Sentinel sits 480px down the page. When it leaves the viewport the back to
   top button appears, which avoids a scroll listener entirely. */
#top-sentinel {
    position: absolute;
    top: 480px;
    left: 0;
    width: 1px;
    height: 1px;
    pointer-events: none;
}

.totop {
    position: fixed;
    right: 20px; bottom: 20px;
    z-index: 90;
    width: 44px; height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--acid);
    color: var(--on-acid);
    border: none;
    border-radius: var(--r);
    font-size: 19px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity .2s ease, transform .2s ease, visibility .2s ease;
}
.totop.show { opacity: 1; visibility: visible; transform: none; }

/* -------------------------------------------------------------------------
   19. Motion — scroll-driven where supported, IO fallback
   ------------------------------------------------------------------------- */
.js .rise { opacity: 0; transform: translateY(16px); }
.js .rise.seen {
    opacity: 1;
    transform: none;
    transition: opacity .5s cubic-bezier(.16,1,.3,1), transform .5s cubic-bezier(.16,1,.3,1);
}

@supports (animation-timeline: view()) {
    @media (prefers-reduced-motion: no-preference) {
        .js .rise {
            opacity: 1;
            transform: none;
            animation: rise-in linear both;
            animation-timeline: view();
            animation-range: entry 0% entry 42%;
        }
        .js .rise.seen { transition: none; }
    }
}
@keyframes rise-in {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
    .js .rise { opacity: 1; transform: none; animation: none; }
    .slab:hover, .btn-acid:active { transform: none; }
    .row:hover, .pick:hover { padding-left: 10px; }
    .rail { scroll-snap-type: none; }
}
