/* ============================================================
   Esoterica — esoterica.ontologi.social
   Editorial chrome for a publication. One stylesheet, no JavaScript.
   Visual language is a sibling of ontologi.dev: system sans, the
   inherited Parthenopean tricolor, dark text on warm white.

   Artifacts bring their own styling (each is a self-contained
   document); this stylesheet governs only the site chrome —
   header, footer, landing, the two stream indexes, and posts.
   ============================================================ */

/* ---- Tokens (shared with ontologi.dev) ---- */
:root {
    --yellow: #FFD100;
    --red: #A22B2B;
    --red-hover: #8a2323;
    --blue: #1B3A6B;
    --blue-hover: #152e55;
    --dark: #1a1a1a;
    --gray: #555;
    --light-gray: #e0e0e0;
    --paper: #fdfcf9;
    --paper-deep: #f4f1ea;

    --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif;
    --mono: 'SFMono-Regular', Menlo, Consolas, 'Liberation Mono', monospace;
    --measure: 38rem;
}

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

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

body {
    margin: 0;
    background: var(--paper);
    color: var(--dark);
    font-family: var(--sans);
    font-size: 1.0625rem;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

.wrap { width: 100%; max-width: 60rem; margin: 0 auto; padding: 0 1.5rem; }

a { color: var(--blue); text-underline-offset: 2px; }
a:hover { color: var(--red); }

:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }

h1, h2, h3 { line-height: 1.2; font-weight: 700; color: var(--dark); }

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

.skip-link {
    position: absolute; left: 1rem; top: -3rem;
    background: var(--blue); color: #fff;
    padding: 0.6rem 1rem; border-radius: 0 0 6px 6px;
    z-index: 50; transition: top 0.15s ease;
}
.skip-link:focus { top: 0; }

/* ---- The inherited tricolor: a thin band at the page head ---- */
.tricolor {
    height: 4px;
    background: linear-gradient(to right,
        var(--blue) 0 33.34%,
        var(--yellow) 33.34% 66.67%,
        var(--red) 66.67% 100%);
}

/* ---- Header / footer ---- */
.site-header { border-bottom: 1px solid var(--light-gray); background: var(--paper); }
.site-header .wrap {
    display: flex; flex-wrap: wrap; align-items: baseline;
    justify-content: space-between; gap: 0.5rem 1.5rem;
    padding-top: 1.1rem; padding-bottom: 1.1rem;
}
.brand {
    font-size: 1.35rem; font-weight: 700; letter-spacing: -0.01em;
    color: var(--dark); text-decoration: none;
}
.site-nav { display: flex; gap: 1.25rem; font-size: 0.82rem; letter-spacing: 0.08em; text-transform: uppercase; }
.site-nav a { text-decoration: none; color: var(--gray); }
.site-nav a:hover { color: var(--dark); }
.site-nav a[aria-current="page"] { color: var(--dark); border-bottom: 2px solid var(--yellow); }

.site-footer {
    border-top: 1px solid var(--light-gray); margin-top: 4rem;
    padding: 2rem 0 3rem; font-size: 0.85rem; color: var(--gray);
}
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.75rem; }

/* ---- Landing ---- */
.lede { max-width: var(--measure); padding: 3rem 0 1rem; }
.lede h1 { font-size: clamp(2.4rem, 6vw, 3.6rem); margin: 0 0 1rem; letter-spacing: -0.02em; }
.intro { font-size: 1.15rem; color: var(--gray); }
.intro > * + * { margin-top: 1rem; }

.streams { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1.5rem; margin: 2.5rem 0; }
.stream-card {
    display: block; text-decoration: none; color: inherit;
    border: 1px solid var(--light-gray); border-radius: 8px; padding: 1.5rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.stream-card:hover { border-color: var(--blue); box-shadow: 0 6px 20px rgba(26,26,26,0.08); }
.stream-card .head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.stream-card h2 { font-size: 1.5rem; margin: 0; }
.stream-card .count { font-size: 0.85rem; color: var(--gray); font-variant-numeric: tabular-nums; }
.stream-card .latest { margin: 0.75rem 0 0; color: var(--gray); font-size: 0.95rem; }
.stream-card .arrow { color: var(--blue); }

/* ---- Stream index (Posts / Artifacts lists) ---- */
.stream-head { max-width: var(--measure); padding: 2.5rem 0 0.5rem; }
.stream-head h1 { font-size: clamp(2rem, 5vw, 2.8rem); margin: 0; }
.entry-list { max-width: 46rem; }
.entry {
    display: block; text-decoration: none; color: inherit;
    padding: 1.5rem 0; border-bottom: 1px solid var(--light-gray);
}
.entry:hover h3 { color: var(--red); }
.entry .meta {
    font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase;
    color: var(--gray); font-variant-numeric: tabular-nums;
}
.entry h3 { margin: 0.25rem 0; font-size: 1.4rem; }
.entry .summary { margin: 0; color: var(--gray); }
.entry .ext { font-size: 0.8rem; color: var(--blue); }
.empty-note { color: var(--gray); font-style: italic; max-width: var(--measure); }

/* ---- Article (a single human-written post) ---- */
.article { max-width: var(--measure); padding-top: 2.5rem; }
.article-header { margin-bottom: 1.75rem; }
.article-header .meta { font-size: 0.8rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--gray); }
.article-header h1 { font-size: clamp(2rem, 5vw, 2.9rem); margin: 0.4rem 0 0; letter-spacing: -0.01em; }
.article-body { font-size: 1.125rem; }
.article-body > * + * { margin-top: 1.2rem; }
.article-body h2 { margin-top: 2.5rem; font-size: 1.6rem; }
.article-body h3 { margin-top: 2rem; font-size: 1.25rem; }
.article-body blockquote {
    margin: 1.5rem 0; padding-left: 1.25rem;
    border-left: 3px solid var(--yellow); color: var(--gray);
}
.article-body code { font-family: var(--mono); font-size: 0.9em; background: var(--paper-deep); padding: 0.1em 0.35em; border-radius: 4px; }
.article-body pre { background: var(--dark); color: var(--paper); padding: 1rem 1.25rem; border-radius: 8px; overflow-x: auto; }
.article-body pre code { background: none; padding: 0; }

.back-link {
    display: inline-block; margin-top: 3rem;
    font-size: 0.82rem; letter-spacing: 0.06em; text-transform: uppercase; text-decoration: none;
}
.back-link::before { content: '\2190\00a0'; }
