/* ==========================================================================
   ihnatov.nl — article surface (transcriber/*)
   The Lit Field world in Read mode: same field, same faces, same accent, but
   composed for sustained reading rather than for scanning.

   These pages carry ~21KB of their own inline CSS written against the previous
   newsprint token names. Rather than rewrite all of it, the legacy names are
   re-pointed at Lit Field values below, so the page-specific components inherit
   the new world without being touched. See DESIGN.md.
   ========================================================================== */

:root {
    /* --- Lit Field ------------------------------------------------------ */
    --field-cool: #b9c8d2;
    --field-warm: #ffd9b8;
    --field-ember: #ffcfa8;
    --field-haze: #cfd8d6;
    --base: #eceeed;
    --base-deep: #e2e6e6;

    --ink: #0b0c0e;
    --ink-2: #23262b;
    --ink-3: #454a52;
    --ink-4: #5c626b;

    /* One orange per ground. See DESIGN.md — two is the floor, not a choice.
       These pages' own CSS reaches for var(--accent) on both grounds, so the
       token is made ground-aware instead: it defaults to the light value, and
       the night blocks below flip it. Every existing use then resolves
       correctly without being touched. */
    --accent-bright: #ff4726;
    --accent-on-light: #c03210;
    --accent: var(--accent-on-light);

    --night: #0b0c0e;
    --night-2: #16181c;
    --night-3: #24272d;
    --on-night: #f4f5f5;
    --on-night-2: #a9b0b8;

    --veil: rgba(255, 255, 255, 0.54);
    --veil-strong: rgba(255, 255, 255, 0.74);
    --hair: rgba(11, 12, 14, 0.12);
    --hair-strong: rgba(11, 12, 14, 0.22);

    --edge: inset 0 1px 0 rgba(255, 255, 255, 0.9);
    --lift-1: var(--edge), 0 1px 1px rgba(16, 20, 28, 0.05), 0 6px 12px -8px rgba(16, 20, 28, 0.30);
    --lift-2: var(--edge), 0 1px 2px rgba(16, 20, 28, 0.06), 0 14px 26px -14px rgba(16, 20, 28, 0.38);
    --lift-3: var(--edge), 0 2px 3px rgba(16, 20, 28, 0.07), 0 26px 44px -22px rgba(16, 20, 28, 0.45);

    --display: 'Archivo', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    --text: 'Schibsted Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    --code: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;

    --ease: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-soft: cubic-bezier(0.33, 1, 0.68, 1);

    --gutter: clamp(20px, 4.5vw, 56px);
    --radius: 22px;

    /* --- Legacy aliases -------------------------------------------------
       The inline article CSS references these thirteen names. Re-pointing them
       is what carries those components into the new world. */
    --paper: var(--veil-strong);
    --white: #ffffff;
    --ink-soft: var(--ink-2);
    --muted: var(--ink-3);
    --line: var(--hair-strong);
    --line-soft: var(--hair);
    /* --accent-dark carried text on light in the old world. */
    --accent-dark: var(--accent-on-light);
    --condensed: var(--display);
    --serif: var(--display);
    --ui: var(--text);
    --mono: var(--display);
}

/* The night blocks: inside them the accent flips to the bright value, which is
   the only place it is legible (5.76:1 on #0b0c0e) and the only place it belongs. */
.kicker,
.tr-close,
.proof-cell-hot,
.btn-download,
.skip-link {
    --accent: var(--accent-bright);
}

/* ==========================================================================
   Base
   ========================================================================== */

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    scrollbar-color: var(--ink-4) var(--base-deep);
    overflow-x: clip;
}

body {
    margin: 0;
    background: var(--base);
    color: var(--ink-2);
    font-family: var(--text);
    font-size: 18px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* The same fixed field as the landing page, so the two surfaces read as one
   site rather than two projects. */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -2;
    background:
        radial-gradient(115% 85% at 6% 10%, var(--field-cool) 0%, rgba(185, 200, 210, 0) 58%),
        radial-gradient(85% 75% at 90% 14%, var(--field-warm) 0%, rgba(255, 217, 184, 0) 62%),
        radial-gradient(75% 65% at 76% 92%, var(--field-ember) 0%, rgba(255, 207, 168, 0) 64%),
        radial-gradient(95% 95% at 26% 84%, var(--field-haze) 0%, rgba(207, 216, 214, 0) 62%),
        linear-gradient(140deg, #dbe3e7 0%, #e9e6df 46%, #f7e6d4 100%);
}
body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    opacity: 0.5;
    mix-blend-mode: soft-light;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='0.42'/%3E%3C/svg%3E");
}

h1, h2, h3, h4 {
    margin: 0;
    font-family: var(--display);
    font-weight: 700;
    letter-spacing: -0.025em;
    color: var(--ink);
    text-wrap: balance;
}

p { margin: 0; }
ul, ol { margin: 0; padding: 0; }

a { color: inherit; }

::selection { background: var(--accent-on-light); color: #fff; }

:focus-visible {
    outline: 2px solid var(--accent-on-light);
    outline-offset: 3px;
    border-radius: 4px;
}

::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: var(--base-deep); }
::-webkit-scrollbar-thumb {
    background: #b3b9bd;
    border: 3px solid var(--base-deep);
    border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover { background: var(--ink-4); }

small { font-size: 11px; }

code, kbd, samp, pre {
    font-family: var(--code);
    font-size: 0.9em;
}
code {
    padding: 0.12em 0.36em;
    border-radius: 5px;
    background: rgba(11, 12, 14, 0.07);
    color: var(--ink);
}
pre {
    overflow-x: auto;
    padding: 18px 20px;
    border-radius: 14px;
    background: var(--night);
    color: var(--on-night);
    line-height: 1.55;
}
pre code { background: none; padding: 0; color: inherit; }

.skip-link {
    position: absolute;
    left: 16px;
    top: -100px;
    z-index: 90;
    padding: 12px 20px;
    background: var(--night);
    color: var(--on-night);
    font-family: var(--display);
    font-size: 14px;
    font-weight: 600;
    border-radius: 999px;
    text-decoration: none;
    transition: top .18s var(--ease);
}
.skip-link:focus-visible { top: 16px; }

/* ==========================================================================
   Shell
   ========================================================================== */

.site-frame {
    width: min(100%, 1180px);
    margin: 0 auto;
    padding: 0 clamp(8px, 1.4vw, 18px) clamp(24px, 4vw, 56px);
}

.sheet {
    border-radius: var(--radius);
    background: var(--veil);
    -webkit-backdrop-filter: blur(14px) saturate(1.1);
    backdrop-filter: blur(14px) saturate(1.1);
    box-shadow: var(--lift-2);
    overflow: hidden;
}

/* Nav — the landing page's sticky bar, in article proportions. */
.nav {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 14px var(--gutter);
    background: rgba(238, 238, 236, 0.58);
    -webkit-backdrop-filter: blur(16px) saturate(1.1);
    backdrop-filter: blur(16px) saturate(1.1);
    box-shadow: 0 1px 0 rgba(11, 12, 14, 0.07);
}

.nav-logo {
    font-family: var(--display);
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--ink);
    text-decoration: none;
    white-space: nowrap;
    padding: 10px 2px;
    margin: -10px -2px;
}
.nav-logo span { color: var(--accent-on-light); }

.nav-center {
    font-family: var(--display);
    font-size: 13.5px;
    font-weight: 500;
    color: var(--ink-3);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dot { color: var(--accent-on-light); }

.nav-links { display: flex; align-items: center; gap: 2px; }
.nav-links a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 11px 12px;
    border-radius: 999px;
    font-family: var(--display);
    font-size: 14.5px;
    font-weight: 500;
    color: var(--ink-2);
    text-decoration: none;
    white-space: nowrap;
    transition: color .16s var(--ease), background-color .16s var(--ease);
}
.nav-links a:hover { color: var(--ink); background: rgba(255, 255, 255, 0.55); }

/* ==========================================================================
   Article layout
   ========================================================================== */

.section-grid {
    display: grid;
    grid-template-columns: 190px minmax(0, 1fr);
    gap: clamp(20px, 3.4vw, 52px);
    padding: clamp(36px, 5vw, 68px) var(--gutter);
    border-top: 1px solid var(--hair);
}
.section-grid:first-of-type { border-top: 0; }

.section-index {
    position: sticky;
    top: 84px;
    align-self: start;
}
.section-index-num {
    display: block;
    margin-bottom: 10px;
    font-family: var(--display);
    font-size: 13px;
    font-weight: 600;
    color: var(--accent-on-light);
}
.section-index-summary {
    font-size: 14.5px;
    line-height: 1.5;
    color: var(--ink-3);
}
.section-index-toc { display: grid; gap: 2px; margin-top: 16px; }
.section-index-toc a {
    display: block;
    padding: 7px 0;
    font-family: var(--display);
    font-size: 14px;
    font-weight: 500;
    color: var(--ink-3);
    text-decoration: none;
    transition: color .16s var(--ease);
}
.section-index-toc a:hover,
.section-index-toc a.active { color: var(--accent-on-light); }

.section-main { min-width: 0; }

.section-title {
    font-size: clamp(1.7rem, 3.2vw, 2.6rem);
    line-height: 1.05;
    font-weight: 700;
    letter-spacing: -0.035em;
    margin-bottom: 20px;
}
.section-title em { font-style: normal; color: var(--ink-4); }

/* The reading column: a real measure, which the old newsprint grid never set. */
.prose { max-width: 72ch; }
.prose > * + * { margin-top: 1.05em; }
.prose h2 {
    margin-top: 1.9em;
    font-size: 1.5rem;
    letter-spacing: -0.03em;
}
.prose h3 {
    margin-top: 1.7em;
    font-size: 1.15rem;
    letter-spacing: -0.025em;
}
.prose p { color: var(--ink-2); }
.prose ul, .prose ol { padding-left: 1.15em; }
.prose li { margin-bottom: 0.45em; }
.prose li::marker { color: var(--accent-on-light); }
.prose a {
    color: var(--ink);
    text-decoration: underline;
    text-decoration-color: var(--accent-on-light);
    text-decoration-thickness: 1.5px;
    text-underline-offset: 0.2em;
}
.prose a:hover { color: var(--accent-on-light); }
.prose strong { color: var(--ink); font-weight: 600; }
.prose img, .prose svg { border-radius: 12px; }

.hero-main { min-width: 0; }

/* Kept rather than deleted, because on an article a kicker can carry the part
   number — but demoted to a quiet label, not a tracked-caps chip. */
.hero-eyebrow {
    font-family: var(--display);
    font-size: 14px;
    font-weight: 600;
    color: var(--accent-on-light);
    margin-bottom: 12px;
    letter-spacing: 0;
    text-transform: none;
}

/* ==========================================================================
   Proof strip (android article)
   ========================================================================== */

.proof-strip { padding: clamp(28px, 4vw, 44px) var(--gutter); border-top: 1px solid var(--hair); }
.proof-cell {
    padding: 22px 20px;
    border-radius: 16px;
    background: var(--veil);
    box-shadow: var(--lift-1);
}
.proof-cell-hot {
    background: var(--night);
    color: var(--on-night);
}
.proof-cell-hot strong { color: var(--accent); }

/* ==========================================================================
   Footer
   ========================================================================== */

.footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 26px var(--gutter);
    border-top: 1px solid var(--hair);
    font-family: var(--display);
    font-size: 14.5px;
    color: var(--ink-3);
}
.footer a { color: var(--ink-2); }

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 940px) {
    .nav-center { display: none; }
    .section-grid { grid-template-columns: minmax(0, 1fr); }
    .section-index { position: static; }
    .section-index-toc { display: none; }
}

@media (max-width: 560px) {
    body { font-size: 17px; }
    .nav { padding: 10px 16px; }
    .nav-logo { font-size: 18px; }
    .nav-links a { padding: 11px 8px; font-size: 14px; }
    .prose { max-width: none; }
}

/* ==========================================================================
   Reduced motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
}

/* ==========================================================================
   Print
   ========================================================================== */

@media print {
    body { background: #fff; color: #000; font-size: 11pt; }
    body::before, body::after { display: none !important; }
    .nav, .skip-link, .section-index-toc { display: none !important; }
    .sheet {
        background: #fff !important;
        box-shadow: none !important;
        -webkit-backdrop-filter: none !important;
        backdrop-filter: none !important;
    }
    .section-grid { grid-template-columns: minmax(0, 1fr); padding: 12pt 0; }
    .prose { max-width: none; }
    pre { background: #f4f4f4; color: #000; border: 1px solid #bbb; }
}
