/* ============================================================
   The 61-Byte File — post styles
   Vanilla CSS. Light/dark via prefers-color-scheme + manual
   data-theme override. Tokens mirror the blog's shared palette.
   ============================================================ */

/* ---------- Tokens ---------- */

:root {
    --accent: #667eea;
    --accent-2: #764ba2;
    --accent-ink: #4f5fd6;
    --bg: #f7f8fc;
    --bg-card: #ffffff;
    --bg-inset: #eef0f8;
    --text: #1f2430;
    --text-soft: #5a6172;
    --text-faint: #70788c;
    --line: #dfe3ef;
    --line-strong: #c9cede;
    --good: #157e4f;
    --warn: #9a6a12;
    --bad: #c23a47;
    --code-bg: #eceef7;
    --shadow: 0 10px 30px rgba(31, 36, 48, 0.08);
    --ring-color: rgba(102, 126, 234, 0.85);
    --radius: 16px;
    --radius-sm: 10px;
    --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --accent-ink: #9aa8ff;
        --bg: #12141c;
        --bg-card: #1a1d29;
        --bg-inset: #1e2231;
        --text: #e8eaf2;
        --text-soft: #aab0c2;
        --text-faint: #8a92a8;
        --line: #2b3042;
        --line-strong: #3a4057;
        --good: #46c98a;
        --warn: #e0a93e;
        --bad: #e87c87;
        --code-bg: #232738;
        --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
        color-scheme: dark;
    }
}

:root[data-theme="dark"] {
    --accent-ink: #9aa8ff;
    --bg: #12141c;
    --bg-card: #1a1d29;
    --bg-inset: #1e2231;
    --text: #e8eaf2;
    --text-soft: #aab0c2;
    --text-faint: #8a92a8;
    --line: #2b3042;
    --line-strong: #3a4057;
    --good: #46c98a;
    --warn: #e0a93e;
    --bad: #e87c87;
    --code-bg: #232738;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    color-scheme: dark;
}

/* ---------- Base ---------- */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    * {
        animation-duration: 0.001ms !important;
        transition-duration: 0.001ms !important;
    }
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 1.0625rem;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a {
    color: var(--accent-ink);
}

:focus-visible {
    outline: 3px solid var(--ring-color);
    outline-offset: 2px;
    border-radius: 4px;
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--bg-card);
    color: var(--text);
    padding: 0.75rem 1.25rem;
    z-index: 100;
    border-radius: 0 0 var(--radius-sm) 0;
}

.skip-link:focus {
    left: 0;
}

/* ---------- Hero ---------- */

.hero {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
    color: #fff;
    padding: 0 1.25rem 3.5rem;
}

.site-nav {
    max-width: 46rem;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.1rem 0 2.5rem;
}

.crumbs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.crumbs a {
    color: rgba(255, 255, 255, 0.92);
    text-decoration: none;
}

.crumbs a:hover {
    text-decoration: underline;
}

.crumbs .sep {
    color: rgba(255, 255, 255, 0.5);
}

.theme-toggle {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    width: 2.35rem;
    height: 2.35rem;
    border-radius: 50%;
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: background 0.18s ease;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.28);
}

.theme-toggle svg {
    width: 1.05rem;
    height: 1.05rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
}

.icon-sun {
    display: none;
}

:root[data-theme="dark"] .icon-moon {
    display: none;
}

:root[data-theme="dark"] .icon-sun {
    display: block;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .icon-moon {
        display: none;
    }

    :root:not([data-theme="light"]) .icon-sun {
        display: block;
    }
}

.hero-inner {
    max-width: 46rem;
    margin: 0 auto;
}

.hero h1 {
    font-size: clamp(1.9rem, 5.2vw, 3rem);
    line-height: 1.14;
    letter-spacing: -0.02em;
    font-weight: 750;
    text-wrap: balance;
}

.dek {
    margin-top: 1.15rem;
    font-size: clamp(1.02rem, 2.3vw, 1.2rem);
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.93);
    max-width: 40rem;
}

.meta {
    margin-top: 1.75rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.1rem;
    font-size: 0.84rem;
    color: rgba(255, 255, 255, 0.82);
}

.meta span:not(:last-child)::after {
    content: "·";
    margin-left: 1.1rem;
    color: rgba(255, 255, 255, 0.45);
}

/* ---------- Body ---------- */

.body {
    max-width: 46rem;
    margin: 0 auto;
    padding: 3rem 1.25rem 4rem;
}

.body h2 {
    font-size: clamp(1.35rem, 3.4vw, 1.7rem);
    line-height: 1.25;
    letter-spacing: -0.015em;
    margin: 2.9rem 0 1rem;
    text-wrap: balance;
}

.body h2:first-child {
    margin-top: 0;
}

.body p {
    margin-bottom: 1.15rem;
    color: var(--text-soft);
}

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

.body code {
    font-family: var(--mono);
    font-size: 0.875em;
    background: var(--code-bg);
    padding: 0.14em 0.4em;
    border-radius: 5px;
    color: var(--text);
    word-break: break-word;
}

/* ---------- Triage box ---------- */

.triage {
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-left: 4px solid var(--accent);
    border-radius: var(--radius);
    padding: 1.5rem 1.6rem 1.35rem;
    margin-bottom: 3rem;
    box-shadow: var(--shadow);
}

.triage h2 {
    margin: 0 0 0.85rem;
    font-size: 1.15rem;
}

.triage p {
    margin-bottom: 0.9rem;
}

.check {
    list-style: none;
    margin: 0 0 1rem;
    display: grid;
    gap: 0.55rem;
}

.check li {
    position: relative;
    padding-left: 1.75rem;
    color: var(--text-soft);
    font-size: 0.97rem;
    line-height: 1.55;
}

.check li::before {
    content: "";
    position: absolute;
    left: 0.35rem;
    top: 0.52em;
    width: 0.42rem;
    height: 0.75rem;
    border: solid var(--good);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.triage-verdict {
    margin: 0;
    padding-top: 0.9rem;
    border-top: 1px solid var(--line);
    color: var(--text);
    font-weight: 550;
}

/* ---------- Code blocks ---------- */

.term {
    background: var(--bg-inset);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 1rem 1.15rem;
    margin: 0 0 1.5rem;
    overflow-x: auto;
    font-family: var(--mono);
    font-size: 0.855rem;
    line-height: 1.62;
    color: var(--text);
    -webkit-overflow-scrolling: touch;
}

.term code {
    background: none;
    padding: 0;
    border-radius: 0;
    font-size: inherit;
    white-space: pre;
    word-break: normal;
}

.term.bad {
    border-left: 4px solid var(--bad);
}

.term.good {
    border-left: 4px solid var(--good);
}

/* ---------- Pull quote ---------- */

.pull {
    margin: 1.9rem 0 1.9rem;
    padding: 1.15rem 1.4rem;
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-left: 4px solid var(--warn);
    border-radius: var(--radius-sm);
    font-size: 1.06rem;
    color: var(--text) !important;
    line-height: 1.55;
}

/* ---------- Numbered chain ---------- */

.chain {
    margin: 0 0 1.6rem 0;
    padding-left: 1.4rem;
    display: grid;
    gap: 0.5rem;
}

.chain li {
    color: var(--text-soft);
    padding-left: 0.3rem;
    line-height: 1.6;
}

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

/* ---------- Colophon ---------- */

.colophon {
    margin-top: 3.5rem;
    padding-top: 1.75rem;
    border-top: 1px solid var(--line);
}

.colophon p {
    font-size: 0.94rem;
    color: var(--text-faint);
}

.post-footer-nav {
    margin-top: 1.6rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    font-size: 0.94rem;
}

.post-footer-nav a {
    text-decoration: none;
}

.post-footer-nav a:hover {
    text-decoration: underline;
}

/* ---------- Back to top ---------- */

.back-top {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 50%;
    border: 1px solid var(--line-strong);
    background: var(--bg-card);
    color: var(--text-soft);
    display: grid;
    place-items: center;
    cursor: pointer;
    box-shadow: var(--shadow);
    opacity: 0;
    pointer-events: none;
    transform: translateY(6px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.back-top.show {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

/* ---------- Narrow screens ---------- */

@media (max-width: 32rem) {
    body {
        font-size: 1rem;
    }

    .hero {
        padding-bottom: 2.75rem;
    }

    .body {
        padding-top: 2.25rem;
    }

    .triage {
        padding: 1.25rem 1.2rem 1.1rem;
    }

    .term {
        font-size: 0.8rem;
        padding: 0.9rem 1rem;
    }
}
