:root {
    --bg: #fbfbfd;
    --surface: #ffffff;
    --border: #e3e3ea;
    --text: #1a1a1f;
    --muted: #5f5f6d;
    --accent: #ff007a;
    --accent-2: #12aaff;
    --code-bg: #f2f2f6;
    --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 8px 24px rgba(0, 0, 0, .04);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0e0e12;
        --surface: #16161c;
        --border: #2a2a33;
        --text: #ececf1;
        --muted: #9b9baa;
        --accent: #ff4d9d;
        --accent-2: #4cc2ff;
        --code-bg: #1e1e26;
        --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .35);
    }
}

* {
    box-sizing: border-box;
}

html {
    background: var(--bg);
    color: var(--text);
    font: 16px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0 auto;
    max-width: 52rem;
    padding: 0 1.25rem 5rem;
}

a {
    color: var(--accent-2);
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

header {
    padding: 4rem 0 2.5rem;
    border-bottom: 1px solid var(--border);
}

h1 {
    margin: 0 0 .5rem;
    font-size: clamp(2rem, 6vw, 2.9rem);
    letter-spacing: -.02em;
    line-height: 1.1;
}

.tagline {
    margin: 0;
    font-size: 1.15rem;
    color: var(--muted);
    max-width: 40rem;
}

.badges {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-top: 1.5rem;
}

.badge {
    font-size: .8rem;
    font-weight: 600;
    padding: .25rem .65rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--muted);
}

.badge strong {
    color: var(--text);
}

h2 {
    margin: 3rem 0 .75rem;
    font-size: 1.45rem;
    letter-spacing: -.01em;
}

h3 {
    margin: 2rem 0 .5rem;
    font-size: 1.05rem;
}

p {
    color: var(--text);
}

.lead {
    color: var(--muted);
}

code {
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
    font-size: .875em;
    background: var(--code-bg);
    padding: .12em .38em;
    border-radius: 4px;
}

pre {
    background: var(--code-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1rem;
    overflow-x: auto;
}

pre code {
    background: none;
    padding: 0;
    font-size: .85rem;
    line-height: 1.6;
}

.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

table {
    border-collapse: collapse;
    width: 100%;
    min-width: 30rem;
}

th,
td {
    text-align: left;
    padding: .7rem .9rem;
    border-bottom: 1px solid var(--border);
    font-size: .93rem;
    vertical-align: top;
}

th {
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--muted);
    font-weight: 600;
}

tbody tr:last-child td {
    border-bottom: none;
}

.pair {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
    margin: 1.25rem 0;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.1rem 1.2rem;
    box-shadow: var(--shadow);
}

.card h3 {
    margin: 0 0 .35rem;
    font-size: .95rem;
}

.card p {
    margin: 0;
    font-size: .9rem;
    color: var(--muted);
}

.kicker {
    display: inline-block;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: .4rem;
}

ul.checks {
    list-style: none;
    padding: 0;
}

ul.checks li {
    padding-left: 1.6rem;
    position: relative;
    margin: .45rem 0;
}

ul.checks li::before {
    content: "→";
    position: absolute;
    left: 0;
    color: var(--accent);
    font-weight: 700;
}

ul.checks li.done::before {
    content: "✓";
    color: #12a150;
}

footer {
    margin-top: 4rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: .875rem;
}

nav.site {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    margin-top: 1.5rem;
    font-size: .9rem;
}

nav.site a {
    color: var(--muted);
    text-decoration: none;
    font-weight: 600;
    padding-bottom: .2rem;
    border-bottom: 2px solid transparent;
}

nav.site a:hover {
    color: var(--text);
}

nav.site a[aria-current="page"] {
    color: var(--text);
    border-bottom-color: var(--accent);
}

.note {
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: 0 10px 10px 0;
    padding: .9rem 1.1rem;
    margin: 1.25rem 0;
    box-shadow: var(--shadow);
}

.note p {
    margin: 0;
    font-size: .92rem;
}

.note p + p {
    margin-top: .6rem;
}

.note strong {
    color: var(--accent);
}

.step {
    counter-increment: step;
}

.step h3::before {
    content: counter(step) ". ";
    color: var(--accent);
    font-weight: 700;
}

main {
    counter-reset: step;
}

td.num,
th.num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

td.win {
    color: #12a150;
    font-weight: 600;
}

td.loss {
    color: var(--accent);
}

.pill {
    display: inline-block;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    padding: .15rem .5rem;
    border-radius: 999px;
    background: var(--code-bg);
    color: var(--muted);
}

/* --- charts -------------------------------------------------------------- */

.viz {
    --series-rust: #2a78d6;
    --series-sol: #eb6834;
    --viz-grid: #e1e0d9;
    --viz-axis: #c3c2b7;
    --viz-ink: #1a1a1f;
    --viz-muted: #6d6b66;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: var(--shadow);
    padding: 1.1rem 1.2rem 1rem;
    margin: 1.5rem 0;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .viz {
        --series-rust: #3987e5;
        --series-sol: #d95926;
        --viz-grid: #2c2c2a;
        --viz-axis: #383835;
        --viz-ink: #ececf1;
        --viz-muted: #9b9baa;
    }
}

:root[data-theme="dark"] .viz {
    --series-rust: #3987e5;
    --series-sol: #d95926;
    --viz-grid: #2c2c2a;
    --viz-axis: #383835;
    --viz-ink: #ececf1;
    --viz-muted: #9b9baa;
}

.viz figcaption {
    font-size: .95rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: .15rem;
}

.viz .viz-sub {
    font-size: .82rem;
    color: var(--muted);
    margin: 0 0 .9rem;
}

.viz svg {
    display: block;
    width: 100%;
    height: auto;
    overflow: visible;
}

.viz-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: .8rem;
    font-size: .8rem;
    color: var(--muted);
}

.viz-legend span {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
}

.viz-legend i {
    width: 14px;
    height: 3px;
    border-radius: 2px;
    display: inline-block;
}

.viz text {
    font-family: inherit;
}

.viz .ax {
    fill: var(--viz-muted);
    font-size: 11px;
}

.viz .lbl {
    fill: var(--viz-ink);
    font-size: 11.5px;
    font-weight: 600;
}

.viz .note {
    fill: var(--viz-muted);
    font-size: 11px;
}
