/* ============================================================
   coder000 design system
   Fonts:  Space Grotesk (headings) · Inter (body) · JetBrains Mono (code)
   Themes: light (default) and dark via [data-theme] on <html>
   ============================================================ */

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

:root {
    --font-body: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
    --font-display: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
    --font-mono: "JetBrains Mono", "Cascadia Code", Consolas, monospace;

    --dot-red: #ff5f57;
    --dot-amber: #febc2e;
    --dot-green: #28c840;

    --radius: 14px;
    --radius-sm: 8px;
    --container: 1100px;
    --header-h: 66px;

    color-scheme: light;
    --bg: #faf9f7;
    --bg-soft: #f2f3ee;
    --card: #ffffff;
    --text: #1b2420;
    --muted: #5c6b63;
    --accent: #0b8a5c;
    --accent-strong: #096b48;
    --accent-soft: rgba(11, 138, 92, 0.09);
    --link: #096b48;
    --border: #e4e7e0;
    --shadow: 0 1px 2px rgba(23, 32, 27, 0.05), 0 8px 24px -12px rgba(23, 32, 27, 0.12);
    --shadow-lg: 0 2px 4px rgba(23, 32, 27, 0.05), 0 20px 48px -16px rgba(23, 32, 27, 0.18);
    --header-bg: rgba(250, 249, 247, 0.85);
    --terminal-bg: #0d1412;
    --terminal-text: #d7e4dc;
}

[data-theme="dark"] {
    color-scheme: dark;
    --bg: #0d1412;
    --bg-soft: #121b17;
    --card: #151f1a;
    --text: #e9efe9;
    --muted: #9db0a5;
    --accent: #3ddc97;
    --accent-strong: #6ce7b2;
    --accent-soft: rgba(61, 220, 151, 0.12);
    --link: #4ee0a3;
    --border: #243129;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px -12px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.4), 0 20px 48px -16px rgba(0, 0, 0, 0.6);
    --header-bg: rgba(13, 20, 18, 0.85);
    --terminal-bg: #0a100e;
    --terminal-text: #d7e4dc;
}

/* ---------- Reset & base ---------- */

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

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: var(--font-body);
    font-size: 1.0625rem;
    line-height: 1.75;
    color: var(--text);
    background: var(--bg);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: background-color 0.25s ease, color 0.25s ease;
}

main { flex: 1; }

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

h1, h2, h3, h4 {
    font-family: var(--font-display);
    line-height: 1.2;
    letter-spacing: -0.015em;
    margin: 0 0 0.6em;
    text-wrap: balance;
}

h1 { font-size: clamp(1.9rem, 4.5vw, 2.9rem); font-weight: 700; }
h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); font-weight: 700; }
h3 { font-size: clamp(1.15rem, 2.2vw, 1.35rem); font-weight: 600; }

p { margin: 0 0 1.1em; }

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

code, pre, kbd {
    font-family: var(--font-mono);
    font-size: 0.9em;
}

code {
    background: var(--accent-soft);
    color: var(--accent-strong);
    padding: 0.12em 0.4em;
    border-radius: 6px;
}

pre {
    background: var(--terminal-bg);
    color: var(--terminal-text);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    padding: 1.1rem 1.3rem;
    margin: 1.5rem 0;
    overflow-x: auto;
    line-height: 1.65;
    font-size: 0.88rem;
}

pre code {
    background: none;
    color: inherit;
    padding: 0;
    border-radius: 0;
    font-size: inherit;
}

::selection { background: var(--accent); color: #fff; }
[data-theme="dark"] ::selection { color: #0d1412; }

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

h1:focus { outline: none; }

.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 clamp(1rem, 4vw, 2rem);
}

.skip-link {
    position: absolute;
    left: -999px;
    top: 0;
    z-index: 100;
    background: var(--accent);
    color: #fff;
    padding: 0.6rem 1rem;
    border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus { left: 0; }

/* ---------- Header ---------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--header-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    height: var(--header-h);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none !important;
}

.brand-mark { flex-shrink: 0; border-radius: 9px; }

.brand-word {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.35rem;
    letter-spacing: -0.02em;
    color: var(--text);
}

.brand-zeros {
    font-family: var(--font-mono);
    font-weight: 700;
    color: var(--accent);
}

.site-nav {
    display: flex;
    gap: 0.35rem;
    margin-left: auto;
}

.site-nav a {
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    color: var(--muted);
    font-weight: 500;
    font-size: 0.98rem;
    text-decoration: none !important;
    transition: color 0.15s ease, background-color 0.15s ease;
}

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

.site-nav a.active {
    color: var(--accent-strong);
    background: var(--accent-soft);
    font-weight: 600;
}

.header-actions { display: flex; align-items: center; gap: 0.4rem; }

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.icon-btn:hover { background: var(--bg-soft); border-color: var(--muted); }

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

.nav-toggle { display: none; }
.nav-toggle .cross { display: none; }
body.nav-open .nav-toggle .bars { display: none; }
body.nav-open .nav-toggle .cross { display: block; }

/* ---------- Buttons ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1.4rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 1rem;
    font-family: var(--font-body);
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none !important;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    box-shadow: var(--shadow);
}
[data-theme="dark"] .btn-primary { color: #0d1412; }

.btn-primary:hover { transform: translateY(-1px); box-shadow: var(--shadow-lg); }

.btn-ghost {
    border-color: var(--border);
    color: var(--text);
    background: var(--card);
}

.btn-ghost:hover { border-color: var(--accent); color: var(--accent-strong); }

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

.hero {
    padding: clamp(3rem, 8vw, 5.5rem) 0 clamp(2.5rem, 6vw, 4rem);
    overflow: hidden;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: clamp(2rem, 5vw, 4rem);
    align-items: center;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent-strong);
    background: var(--accent-soft);
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
    margin-bottom: 1.2rem;
}

.hero h1 { margin-bottom: 0.5em; }

.hero-accent {
    background: linear-gradient(100deg, var(--accent), #14b8a6);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero-sub {
    font-size: 1.15rem;
    color: var(--muted);
    max-width: 34rem;
    margin-bottom: 1.8rem;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 0.8rem; }

/* Terminal card (decorative) */

.terminal {
    background: var(--terminal-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    font-family: var(--font-mono);
    font-size: 0.88rem;
    line-height: 1.9;
}

.terminal-bar {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 0.7rem 1rem;
    background: rgba(255, 255, 255, 0.04);
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.terminal-bar span {
    width: 11px;
    height: 11px;
    border-radius: 50%;
}

.terminal-bar span:nth-child(1) { background: var(--dot-red); }
.terminal-bar span:nth-child(2) { background: var(--dot-amber); }
.terminal-bar span:nth-child(3) { background: var(--dot-green); }

.terminal-bar em {
    margin-left: auto;
    font-style: normal;
    color: rgba(255, 255, 255, 0.35);
    font-size: 0.75rem;
}

.terminal-body { padding: 1.1rem 1.2rem 1.3rem; color: var(--terminal-text); }
.terminal-body .t-line { display: block; white-space: pre-wrap; word-break: break-word; }
.terminal-body .t-prompt { color: #3ddc97; font-weight: 600; }
.terminal-body .t-dim { color: rgba(215, 228, 220, 0.55); }
.terminal-body .t-accent { color: #3ddc97; }

.cursor {
    display: inline-block;
    width: 0.55em;
    height: 1.1em;
    vertical-align: text-bottom;
    background: #3ddc97;
    animation: blink 1.1s steps(1) infinite;
}

@keyframes blink { 50% { opacity: 0; } }

/* ---------- Sections ---------- */

.section { padding: clamp(2.5rem, 6vw, 4.5rem) 0; }
.section-alt { background: var(--bg-soft); }

.section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.8rem;
    flex-wrap: wrap;
}

.section-head p { color: var(--muted); margin: 0; max-width: 40rem; }

.section-link {
    font-weight: 600;
    white-space: nowrap;
}

/* Series feature card */

.series-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(1.5rem, 4vw, 3rem);
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: clamp(1.5rem, 4vw, 2.5rem);
    margin-bottom: 2rem;
}

.series-card-info .series-badge { margin-bottom: 0.9rem; }

.series-badge {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--accent-strong);
    background: var(--accent-soft);
    padding: 0.25rem 0.7rem;
    border-radius: 999px;
}

.series-card-info p { color: var(--muted); }

.series-toc {
    list-style: none;
    margin: 0;
    padding: 0;
    counter-reset: part;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.series-toc li { counter-increment: part; }

.series-toc a {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.55rem 0.8rem;
    border-radius: var(--radius-sm);
    color: var(--text);
    font-weight: 500;
    font-size: 0.98rem;
    text-decoration: none !important;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.series-toc a::before {
    content: counter(part, decimal-leading-zero);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent);
    flex-shrink: 0;
}

.series-toc a:hover { background: var(--accent-soft); color: var(--accent-strong); }

/* ---------- Post cards ---------- */

.post-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.post-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.post-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent);
}

.post-card-link {
    display: flex;
    align-items: center;
    gap: clamp(1rem, 3vw, 1.8rem);
    padding: clamp(1.1rem, 3vw, 1.5rem) clamp(1.1rem, 3vw, 1.8rem);
    color: inherit;
    text-decoration: none !important;
}

.post-card-part {
    font-family: var(--font-mono);
    font-size: clamp(1.6rem, 4vw, 2.2rem);
    font-weight: 700;
    color: var(--accent);
    opacity: 0.5;
    flex-shrink: 0;
}

.post-card-body { display: flex; flex-direction: column; gap: 0.25rem; min-width: 0; }

.post-card-series {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--accent-strong);
}

.post-card-title { margin: 0; font-size: 1.2rem; }

.post-card-desc {
    color: var(--muted);
    font-size: 0.95rem;
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-card-meta {
    display: flex;
    gap: 0.5rem;
    color: var(--muted);
    font-size: 0.85rem;
    margin-top: 0.15rem;
}

.post-card-arrow {
    margin-left: auto;
    font-size: 1.3rem;
    color: var(--accent);
    opacity: 0;
    transform: translateX(-6px);
    transition: opacity 0.18s ease, transform 0.18s ease;
    flex-shrink: 0;
}

.post-card:hover .post-card-arrow { opacity: 1; transform: translateX(0); }

/* Topic chips */

.topics { display: flex; flex-wrap: wrap; gap: 0.6rem; }

.chip {
    font-family: var(--font-mono);
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text);
    background: var(--card);
    border: 1px solid var(--border);
    padding: 0.4rem 0.95rem;
    border-radius: 999px;
}

.chip-soon { color: var(--muted); border-style: dashed; }

a.chip { text-decoration: none !important; transition: border-color 0.15s ease, color 0.15s ease, transform 0.15s ease; }
a.chip:hover { border-color: var(--accent); color: var(--accent-strong); transform: translateY(-1px); }

/* ---------- Article ---------- */

.article { padding: clamp(2rem, 5vw, 3.5rem) 0; }

.article-container { max-width: 780px; }

.breadcrumbs {
    display: flex;
    gap: 0.55rem;
    font-size: 0.88rem;
    color: var(--muted);
    margin-bottom: 1.6rem;
    flex-wrap: wrap;
}

.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--accent-strong); }

.article-header { margin-bottom: 2.2rem; }

.article-series {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.series-part {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--muted);
}

.article-byline {
    color: var(--muted);
    font-size: 0.95rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.1rem;
}

.series-progress { display: flex; gap: 7px; }

.progress-dot {
    width: 26px;
    height: 7px;
    border-radius: 999px;
    background: var(--border);
    transition: background-color 0.15s ease, transform 0.15s ease;
}

.progress-dot.done { background: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.progress-dot.current { background: var(--accent); }
.progress-dot:hover { transform: scaleY(1.6); }

.article-body {
    font-size: 1.08rem;
}

.article-body h2 {
    margin-top: 2.2em;
    padding-top: 0.4em;
}

.article-body h3 { margin-top: 1.8em; }

.article-body ul, .article-body ol { padding-left: 1.4rem; margin: 0 0 1.2em; }
.article-body li { margin-bottom: 0.45em; }
.article-body li::marker { color: var(--accent); }

.lead { font-size: 1.15em; color: var(--muted); }

/* Callouts */

.callout {
    display: flex;
    gap: 0.8rem;
    background: var(--accent-soft);
    border-left: 4px solid var(--accent);
    border-radius: var(--radius-sm);
    padding: 0.9rem 1.2rem;
    margin: 1.5rem 0;
    font-size: 0.98rem;
}

.callout p { margin: 0; }
.callout .callout-icon { flex-shrink: 0; font-size: 1.1rem; line-height: 1.6; }

.callout-note {
    background: var(--bg-soft);
    border-left-color: var(--muted);
}

/* Chat bubbles for the requirements conversation */

.chat {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    margin: 1.8rem 0;
}

.chat-msg {
    max-width: 88%;
    padding: 0.8rem 1.1rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    font-size: 1rem;
}

.chat-msg p { margin: 0; }

.chat-msg .chat-who {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    margin-bottom: 0.25rem;
    opacity: 0.75;
}

.chat-you {
    align-self: flex-end;
    background: var(--accent-soft);
    border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
    border-bottom-right-radius: 4px;
}

.chat-you .chat-who { color: var(--accent-strong); }

.chat-them {
    align-self: flex-start;
    background: var(--card);
    border: 1px solid var(--border);
    border-bottom-left-radius: 4px;
}

.chat-them .chat-who { color: var(--muted); }

/* Noun/entity chips inside articles */

.word-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin: 1.2rem 0 1.6rem;
}

.word-cloud .chip { font-size: 0.82rem; padding: 0.25rem 0.75rem; }
.word-cloud .chip-entity { border-color: var(--accent); color: var(--accent-strong); background: var(--accent-soft); }

/* Entity definition lists */

.entity-list { margin: 0 0 1.4em; }

.entity-list dt {
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--accent-strong);
    margin-top: 0.9em;
}

.entity-list dd { margin: 0.15em 0 0 0; color: var(--text); }

/* Tables */

.table-scroll {
    overflow-x: auto;
    margin: 1.5rem 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
    background: var(--card);
}

caption {
    text-align: left;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent-strong);
    padding: 0.7rem 1rem 0.4rem;
    background: var(--card);
}

th, td {
    text-align: left;
    padding: 0.6rem 1rem;
    border-top: 1px solid var(--border);
    white-space: nowrap;
}

th {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--muted);
    background: var(--bg-soft);
}

tbody tr:hover { background: var(--accent-soft); }

.key-tag {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    padding: 0.1rem 0.45rem;
    border-radius: 5px;
    background: var(--accent);
    color: #fff;
    margin-right: 0.4rem;
    vertical-align: middle;
}

[data-theme="dark"] .key-tag { color: #0d1412; }

.key-tag.fk { background: var(--dot-amber); color: #3d2c00; }

/* ---------- ER diagram ---------- */

.diagram { margin: 2rem 0; }

.diagram-scroll {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-soft);
    box-shadow: var(--shadow);
    padding: 1rem;
}

.diagram svg { display: block; margin: 0 auto; min-width: 760px; }

.diagram figcaption {
    text-align: center;
    color: var(--muted);
    font-size: 0.9rem;
    margin-top: 0.8rem;
}

.er-body { fill: var(--card); stroke: var(--border); stroke-width: 1.5; }
.er-title-bar { fill: var(--accent-soft); stroke: none; }
.er-junction .er-title-bar { fill: color-mix(in srgb, var(--dot-amber) 22%, transparent); }

.er-title {
    fill: var(--text);
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 700;
    text-anchor: middle;
}

.er-key {
    fill: var(--accent);
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
}

.er-field {
    fill: var(--muted);
    font-family: var(--font-mono);
    font-size: 11.5px;
}

.er-line {
    stroke: var(--muted);
    stroke-width: 1.3;
    opacity: 0.55;
}

.er-card-label {
    fill: var(--accent-strong);
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
}

/* Tutorial figures reuse the er-* styling; .fig releases the wide-diagram min-width. */
.diagram svg.fig { min-width: 0; max-width: 100%; height: auto; }
.fig-arrow { fill: var(--muted); opacity: 0.7; }
.diagram .terminal { font-size: 0.82rem; line-height: 1.75; }

/* ---------- Pager ---------- */

.article-pager {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.pager-link {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    padding: 1rem 1.2rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none !important;
    transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.pager-link:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.pager-next { text-align: right; align-items: flex-end; }

.pager-label {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--accent-strong);
    letter-spacing: 0.04em;
}

.pager-title { color: var(--text); font-weight: 600; font-size: 0.95rem; line-height: 1.4; }

/* ---------- About / prose pages ---------- */

.prose-page { padding: clamp(2.5rem, 6vw, 4rem) 0; }
.prose-page .container { max-width: 780px; }

.about-lede {
    font-size: 1.2rem;
    color: var(--muted);
}

.timeline {
    list-style: none;
    margin: 2rem 0;
    padding: 0;
    border-left: 2px solid var(--border);
}

.timeline li {
    position: relative;
    padding: 0 0 1.6rem 1.6rem;
}

.timeline li::before {
    content: "";
    position: absolute;
    left: -7px;
    top: 0.45em;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent);
    border: 2px solid var(--bg);
}

.timeline .t-year {
    font-family: var(--font-mono);
    font-weight: 700;
    color: var(--accent-strong);
    display: block;
    font-size: 0.9rem;
    margin-bottom: 0.2rem;
}

.contact-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2rem;
    text-align: center;
    margin-top: 2.5rem;
}

.contact-card p { color: var(--muted); max-width: 32rem; margin: 0 auto 1.4rem; }

/* ---------- Contact form ---------- */

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: clamp(1.4rem, 4vw, 2.2rem);
    margin-top: 1.5rem;
}

.contact-form label {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    font-weight: 600;
    font-size: 0.95rem;
}

.form-hint { font-weight: 400; color: var(--muted); }

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.1rem;
}

.contact-form input,
.contact-form textarea {
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.65rem 0.9rem;
    transition: border-color 0.15s ease;
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.contact-form textarea { resize: vertical; min-height: 9rem; }

.contact-form .btn { align-self: flex-start; }

.validation-message {
    color: var(--dot-red);
    font-weight: 500;
    font-size: 0.85rem;
}

/* Honeypot: visually gone, still in the DOM for bots to trip over. */
.hp-field {
    position: absolute !important;
    left: -9999px !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* ---------- 404 & error ---------- */

.error-page {
    text-align: center;
    padding: clamp(4rem, 12vw, 7rem) 1rem;
}

.error-code {
    font-family: var(--font-mono);
    font-size: clamp(4rem, 15vw, 7rem);
    font-weight: 700;
    color: var(--accent);
    opacity: 0.35;
    line-height: 1;
    margin-bottom: 0.5rem;
}

.error-page p { color: var(--muted); max-width: 28rem; margin: 0 auto 1.8rem; }

/* ---------- Footer ---------- */

.site-footer {
    margin-top: 3rem;
    border-top: 1px solid var(--border);
    background: var(--bg-soft);
}

.footer-inner {
    display: grid;
    grid-template-columns: 1.2fr 2fr;
    gap: 2.5rem;
    padding: 3rem 0 2rem;
}

.footer-brand .brand-word { font-size: 1.2rem; }

.footer-tagline {
    color: var(--muted);
    font-size: 0.92rem;
    margin-top: 0.8rem;
    max-width: 20rem;
}

.footer-nav {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.footer-col { display: flex; flex-direction: column; gap: 0.45rem; }

.footer-col h2 {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    margin-bottom: 0.4rem;
}

.footer-col a {
    color: var(--text);
    font-size: 0.92rem;
    text-decoration: none;
}

.footer-col a:hover { color: var(--accent-strong); text-decoration: underline; }

.footer-meta {
    border-top: 1px solid var(--border);
    padding-top: 1.2rem;
    padding-bottom: 1.6rem;
}

.footer-meta p {
    color: var(--muted);
    font-size: 0.85rem;
    margin: 0;
}

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
    .hero-grid { grid-template-columns: 1fr; }
    .series-card { grid-template-columns: 1fr; }
    .footer-inner { grid-template-columns: 1fr; gap: 2rem; }
}

@media (max-width: 720px) {
    .nav-toggle { display: inline-flex; }

    .site-nav {
        display: none;
        position: absolute;
        top: var(--header-h);
        left: 0;
        right: 0;
        flex-direction: column;
        background: var(--bg);
        border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow-lg);
        padding: 0.8rem 1rem 1.2rem;
        gap: 0.2rem;
    }

    body.nav-open .site-nav { display: flex; }

    .site-nav a { padding: 0.8rem 1rem; border-radius: var(--radius-sm); font-size: 1.05rem; }

    .post-card-part { display: none; }
    .post-card-arrow { display: none; }

    .article-pager { grid-template-columns: 1fr; }
    .pager-next { text-align: left; align-items: flex-start; }
    .pager-spacer { display: none; }

    .chat-msg { max-width: 100%; }

    .form-grid { grid-template-columns: 1fr; }

    .footer-nav { grid-template-columns: 1fr 1fr; }
}

/* ---------- Motion & print ---------- */

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

@media print {
    .site-header, .site-footer, .article-pager, .series-progress { display: none; }
    body { background: #fff; color: #000; }
}
