/* styles.css */

:root {
    /* Palette: graphite + muted teal + sand */
    --bg: #0f1113;
    --surface: #161a1e;
    --surface-raised: #1d2227;
    --surface-sunken: #13171a;
    --border: #2a3138;
    --border-strong: #3a434c;

    --text: #e2e5e9;
    --text-heading: #eef0f3;
    --text-muted: #9aa3ad;
    --text-subtle: #7f8891;

    --accent: #5fb7b0;
    --accent-strong: #7fcdc6;
    --accent-soft: rgba(95, 183, 176, 0.12);
    --accent-line: rgba(95, 183, 176, 0.35);
    --link-visited: #a9b4c4;

    --secondary: #d4a373;
    --secondary-soft: rgba(212, 163, 115, 0.12);

    --focus: #7fcdc6;
    --selection-bg: rgba(95, 183, 176, 0.28);

    --code-bg: #0b0d0f;
    --code-inline-bg: #242b31;
    --code-text: #d7dde3;

    /* Spacing scale */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 24px;
    --space-6: 32px;
    --space-7: 48px;
    --space-8: 64px;

    /* Radii */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;

    /* Borders */
    --border-width: 1px;

    /* Typography */
    --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
    --font-serif: 'Lora', Georgia, "Times New Roman", serif;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

    --fs-body: 1.0625rem;
    --fs-small: 0.875rem;
    --fs-xs: 0.75rem;
    --lh-body: 1.7;

    --container: 1160px;
    --measure: 68ch;
    --gutter: var(--space-4);
    --touch: 44px;

    color-scheme: dark;
}

/* ---------- Reset ---------- */

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

html {
    color-scheme: dark;
    background: var(--bg);
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scrollbar-color: var(--border-strong) var(--surface-sunken);
    scrollbar-width: thin;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: var(--fs-body);
    font-weight: 400;
    line-height: var(--lh-body);
    min-height: 100vh;
    min-height: 100dvh;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

::selection {
    background: var(--selection-bg);
    color: var(--text-heading);
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--surface-sunken);
}

::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: 10px;
    border: 2px solid var(--surface-sunken);
}

::-webkit-scrollbar-thumb:hover {
    background: #4a545e;
}

img,
picture,
video,
canvas,
svg,
iframe {
    display: block;
    max-width: 100%;
    height: auto;
}

img,
video {
    border-radius: var(--radius-md);
}

table {
    max-width: 100%;
    border-collapse: collapse;
}

button,
input,
select,
textarea {
    font: inherit;
    color: var(--text);
    background: var(--surface-raised);
    border: var(--border-width) solid var(--border-strong);
    border-radius: var(--radius-sm);
    color-scheme: dark;
}

input,
select,
textarea {
    padding: var(--space-3) var(--space-4);
    min-height: var(--touch);
    max-width: 100%;
    width: 100%;
}

textarea {
    min-height: 120px;
    resize: vertical;
}

input::placeholder,
textarea::placeholder {
    color: var(--text-subtle);
    opacity: 1;
}

button {
    cursor: pointer;
    min-height: var(--touch);
    padding: var(--space-2) var(--space-4);
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

button:hover {
    background: var(--surface);
    border-color: var(--accent);
    color: var(--accent-strong);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ---------- Links & focus ---------- */

a {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-color: var(--accent-line);
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    transition: color 0.2s ease, text-decoration-color 0.2s ease, background-color 0.2s ease;
}

a:visited {
    color: var(--link-visited);
}

a:hover {
    color: var(--accent-strong);
    text-decoration-color: currentColor;
}

:focus {
    outline: none;
}

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

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

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--surface);
    border-bottom: var(--border-width) solid var(--border);
}

.header-inner {
    max-width: var(--container);
    margin: 0 auto;
    padding: var(--space-3) var(--gutter);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3) var(--space-5);
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    min-height: var(--touch);
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--text-heading);
    text-decoration: none;
}

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

.logo-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--accent);
    flex-shrink: 0;
}

.main-nav {
    order: 3;
    width: 100%;
    display: flex;
    flex-wrap: nowrap;
    gap: var(--space-1);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    font-size: var(--fs-small);
    font-weight: 500;
    scrollbar-width: none;
    margin: 0 calc(var(--gutter) * -1);
    padding: 0 var(--gutter);
}

.main-nav::-webkit-scrollbar {
    display: none;
}

.main-nav a {
    display: inline-flex;
    align-items: center;
    min-height: var(--touch);
    padding: 0 var(--space-3);
    white-space: nowrap;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

.main-nav a:visited {
    color: var(--text-muted);
}

.main-nav a:hover {
    color: var(--text-heading);
    background: var(--surface-raised);
}

.main-nav a.active {
    color: var(--accent);
    background: var(--accent-soft);
}

.lang-switcher {
    display: inline-flex;
    gap: var(--space-1);
    padding: var(--space-1);
    background: var(--surface-sunken);
    border: var(--border-width) solid var(--border);
    border-radius: var(--radius-sm);
}

.lang-switcher a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    min-height: 36px;
    padding: 0 var(--space-2);
    font-size: var(--fs-xs);
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 4px;
}

.lang-switcher a:visited {
    color: var(--text-muted);
}

.lang-switcher a:hover {
    color: var(--text-heading);
    background: var(--surface-raised);
}

.lang-switcher a.active {
    color: var(--bg);
    background: var(--accent);
}

/* ---------- Layout ---------- */

main {
    max-width: var(--container);
    margin: 0 auto;
    padding: var(--space-6) var(--gutter) var(--space-8);
}

.hero {
    max-width: var(--measure);
    margin: 0 auto var(--space-7);
}

.hero-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2) var(--space-4);
    margin-bottom: var(--space-4);
}

.hero-tag {
    display: inline-flex;
    align-items: center;
    padding: var(--space-1) var(--space-3);
    font-size: var(--fs-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent);
    background: var(--accent-soft);
    border: var(--border-width) solid var(--accent-line);
    border-radius: 999px;
}

.reading-time {
    font-size: var(--fs-small);
    color: var(--text-muted);
    font-weight: 500;
}

.article-title {
    font-family: var(--font-sans);
    font-size: clamp(1.25rem, 1rem + 1.2vw, 1.75rem);
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.015em;
    color: var(--text-heading);
    margin-bottom: var(--space-4);
    overflow-wrap: anywhere;
    hyphens: auto;
}

.lead {
    font-size: 1.0625rem;
    line-height: 1.7;
    color: var(--text-muted);
    font-weight: 400;
    margin-bottom: var(--space-5);
}

.meta-panel {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-4) var(--space-6);
    padding: var(--space-4) 0;
    margin-bottom: var(--space-6);
    border-top: var(--border-width) solid var(--border);
    border-bottom: var(--border-width) solid var(--border);
}

.meta-item {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    min-width: 0;
}

.meta-item .label {
    font-size: var(--fs-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-subtle);
}

.meta-item .value {
    font-size: var(--fs-small);
    font-weight: 500;
    color: var(--text-heading);
    overflow-wrap: anywhere;
}

.hero-visual {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: var(--radius-lg);
    border: var(--border-width) solid var(--border);
    background: var(--surface-raised);
}

.hero-visual img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
    filter: brightness(0.92);
}

.content-wrapper {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-7);
    align-items: start;
}

.content-body {
    min-width: 0;
    max-width: var(--measure);
    width: 100%;
}

.sidebar {
    min-width: 0;
    order: 2;
}

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

.content-body > * + * {
    margin-top: 0;
}

.content-body p {
    font-family: var(--font-serif);
    font-size: 1.0625rem;
    line-height: 1.8;
    color: var(--text);
    margin-bottom: var(--space-5);
}

.content-body h2 {
    font-family: var(--font-sans);
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: -0.01em;
    color: var(--text-heading);
    margin: var(--space-7) 0 var(--space-4);
    overflow-wrap: anywhere;
}

.content-body h3 {
    font-family: var(--font-sans);
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text-heading);
    margin: var(--space-6) 0 var(--space-3);
    overflow-wrap: anywhere;
}

.content-body h4,
.content-body h5,
.content-body h6 {
    font-family: var(--font-sans);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-heading);
    margin: var(--space-5) 0 var(--space-2);
}

.content-body strong,
.content-body b {
    font-family: var(--font-sans);
    font-weight: 600;
    color: var(--text-heading);
}

.content-body em,
.content-body i {
    font-style: italic;
}

.content-body ul,
.content-body ol {
    font-family: var(--font-serif);
    font-size: 1.0625rem;
    line-height: 1.75;
    color: var(--text);
    margin: 0 0 var(--space-5);
    padding-left: var(--space-5);
}

.content-body li {
    margin-bottom: var(--space-2);
    padding-left: var(--space-1);
}

.content-body li:last-child {
    margin-bottom: 0;
}

.content-body ul {
    list-style: none;
}

.content-body ul > li {
    position: relative;
}

.content-body ul > li::before {
    content: "";
    position: absolute;
    left: calc(var(--space-4) * -1 - 2px);
    top: 0.72em;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
}

.content-body ol {
    list-style: none;
    counter-reset: item;
}

.content-body ol > li {
    position: relative;
    counter-increment: item;
}

.content-body ol > li::before {
    content: counter(item) ".";
    position: absolute;
    left: calc(var(--space-5) * -1);
    top: 0;
    width: calc(var(--space-5) - var(--space-1));
    text-align: right;
    font-family: var(--font-sans);
    font-size: var(--fs-small);
    font-weight: 600;
    color: var(--accent);
}

.content-body ul ul,
.content-body ol ol,
.content-body ul ol,
.content-body ol ul {
    margin: var(--space-2) 0 0;
    padding-left: var(--space-5);
}

.content-body ul ul > li::before {
    width: 4px;
    height: 4px;
    background: transparent;
    border: 1px solid var(--accent);
}

.content-body a {
    font-weight: 500;
}

/* Inline code */
.content-body code,
code,
kbd,
samp {
    font-family: var(--font-mono);
    font-size: 0.88em;
}

.content-body :not(pre) > code,
p code,
li code,
td code,
h2 code,
h3 code {
    padding: 0.1em 0.4em;
    color: var(--code-text);
    background: var(--code-inline-bg);
    border: var(--border-width) solid var(--border);
    border-radius: 4px;
    overflow-wrap: anywhere;
}

pre {
    position: relative;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--code-text);
    background: var(--code-bg);
    border: var(--border-width) solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--space-4) var(--space-5);
    margin: var(--space-5) 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: pre;
    tab-size: 4;
    max-width: 100%;
}

pre code {
    padding: 0;
    background: none;
    border: 0;
    border-radius: 0;
    color: inherit;
    font-size: inherit;
    overflow-wrap: normal;
    white-space: inherit;
}

kbd {
    display: inline-block;
    min-width: 1.6em;
    padding: 0.1em 0.45em;
    color: var(--text-heading);
    background: var(--surface-raised);
    border: var(--border-width) solid var(--border-strong);
    border-bottom-width: 2px;
    border-radius: 4px;
    line-height: 1.4;
    text-align: center;
}

mark {
    padding: 0.05em 0.3em;
    color: var(--text-heading);
    background: var(--secondary-soft);
    border-bottom: 1px solid var(--secondary);
    border-radius: 3px;
}

small,
.small {
    font-size: var(--fs-small);
    color: var(--text-muted);
}

sub,
sup {
    font-size: 0.75em;
    line-height: 0;
}

hr {
    height: 0;
    margin: var(--space-7) 0;
    border: 0;
    border-top: var(--border-width) solid var(--border);
}

figure {
    margin: var(--space-6) 0;
    min-width: 0;
}

figure img {
    width: 100%;
}

figcaption {
    margin-top: var(--space-3);
    font-size: var(--fs-small);
    line-height: 1.5;
    color: var(--text-subtle);
    text-align: left;
}

.content-body blockquote {
    position: relative;
    margin: var(--space-6) 0;
    padding: var(--space-5) var(--space-5) var(--space-5) var(--space-6);
    background: var(--surface);
    border: var(--border-width) solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 1.0625rem;
    line-height: 1.75;
    color: var(--text-muted);
}

.content-body blockquote p {
    color: var(--text-muted);
    margin-bottom: var(--space-3);
}

.content-body blockquote p:last-child {
    margin-bottom: 0;
}

.content-body blockquote cite {
    display: block;
    margin-top: var(--space-3);
    font-family: var(--font-sans);
    font-size: var(--fs-small);
    font-style: normal;
    font-weight: 600;
    color: var(--accent);
}

/* ---------- Tables ---------- */

.content-body table,
table {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    font-family: var(--font-sans);
    font-size: var(--fs-small);
    line-height: 1.5;
    border: var(--border-width) solid var(--border);
    border-radius: var(--radius-md);
    margin: var(--space-5) 0;
    background: var(--surface);
}

table thead,
table tbody,
table tfoot {
    display: table;
    width: 100%;
    table-layout: auto;
}

th,
td {
    padding: var(--space-3) var(--space-4);
    text-align: left;
    vertical-align: top;
    border-bottom: var(--border-width) solid var(--border);
    overflow-wrap: anywhere;
    min-width: 8ch;
}

th {
    font-weight: 600;
    color: var(--text-heading);
    background: var(--surface-raised);
    white-space: nowrap;
}

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

tbody tr:nth-child(even) td {
    background: rgba(255, 255, 255, 0.012);
}

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

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

/* ---------- Info box ---------- */

.info-box {
    margin: var(--space-6) 0;
    padding: var(--space-5);
    background: var(--surface);
    border: var(--border-width) solid var(--border);
    border-radius: var(--radius-lg);
    min-width: 0;
}

.info-box-title {
    font-size: var(--fs-small);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--secondary);
    margin-bottom: var(--space-4);
}

.info-box ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    padding: 0;
}

.info-box li {
    position: relative;
    padding-left: var(--space-5);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text);
}

.info-box li::before {
    content: "";
    position: absolute;
    left: var(--space-1);
    top: 0.6em;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--secondary);
}

/* ---------- Sidebar ---------- */

.sidebar-sticky {
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
}

.author-card,
.toc-card {
    padding: var(--space-5);
    background: var(--surface);
    border: var(--border-width) solid var(--border);
    border-radius: var(--radius-lg);
    min-width: 0;
}

.author-header {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-3);
}

.author-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: var(--border-width) solid var(--border-strong);
    flex-shrink: 0;
}

.author-badge {
    display: block;
    font-size: var(--fs-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-subtle);
    margin-bottom: 2px;
}

.author-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-heading);
    overflow-wrap: anywhere;
}

.author-bio {
    font-size: var(--fs-small);
    line-height: 1.6;
    color: var(--text-muted);
    margin-bottom: var(--space-4);
}

.author-socials {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.author-socials a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: var(--touch);
    min-height: var(--touch);
    color: var(--text-muted);
    background: var(--surface-raised);
    border: var(--border-width) solid var(--border);
    border-radius: var(--radius-sm);
    text-decoration: none;
}

.author-socials a:visited {
    color: var(--text-muted);
}

.author-socials a:hover {
    color: var(--accent);
    border-color: var(--accent-line);
    background: var(--accent-soft);
}

.toc-title {
    font-size: var(--fs-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-subtle);
    margin-bottom: var(--space-3);
}

.toc-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0;
    border-top: var(--border-width) solid var(--border);
}

.toc-list li {
    border-bottom: var(--border-width) solid var(--border);
}

.toc-list li a {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    min-height: var(--touch);
    padding: var(--space-2) 0;
    font-size: var(--fs-small);
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    overflow-wrap: anywhere;
}

.toc-list li a:visited {
    color: var(--text-muted);
}

.toc-list li a span {
    flex-shrink: 0;
    min-width: 2ch;
    font-family: var(--font-mono);
    font-size: var(--fs-xs);
    font-weight: 600;
    color: var(--accent);
}

.toc-list li a:hover {
    color: var(--text-heading);
    text-decoration: underline;
    text-decoration-color: var(--accent-line);
}

/* ---------- Related / cards ---------- */

.related-section {
    margin-top: var(--space-8);
    padding-top: var(--space-7);
    border-top: var(--border-width) solid var(--border);
}

.section-header {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    margin-bottom: var(--space-5);
}

.section-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-heading);
    white-space: nowrap;
}

.section-line {
    flex-grow: 1;
    height: 1px;
    background: var(--border);
}

.cards-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-4);
}

.card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: var(--space-5);
    background: var(--surface);
    border: var(--border-width) solid var(--border);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.card:hover {
    border-color: var(--accent-line);
    background: var(--surface-raised);
}

.card:focus-within {
    border-color: var(--accent-line);
}

.card-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-2) var(--space-3);
    margin-bottom: var(--space-4);
}

.tag {
    display: inline-flex;
    align-items: center;
    padding: 2px var(--space-2);
    font-size: var(--fs-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--accent);
    background: var(--accent-soft);
    border: var(--border-width) solid var(--accent-line);
    border-radius: 4px;
}

.tag.warning {
    color: var(--secondary);
    background: var(--secondary-soft);
    border-color: rgba(212, 163, 115, 0.35);
}

.card-meta .date {
    font-size: var(--fs-xs);
    color: var(--text-subtle);
}

.card h3 {
    font-size: 1.0625rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text-heading);
    margin-bottom: var(--space-2);
    overflow-wrap: anywhere;
}

.card p {
    font-size: var(--fs-small);
    line-height: 1.6;
    color: var(--text-muted);
    margin-bottom: var(--space-4);
    flex-grow: 1;
}

.card-footer {
    display: flex;
    align-items: center;
    min-height: var(--touch);
}

.read-more {
    display: inline-flex;
    align-items: center;
    font-size: var(--fs-small);
    font-weight: 600;
    color: var(--accent);
    text-decoration: none;
}

.read-more:hover {
    color: var(--accent-strong);
    text-decoration: underline;
    text-decoration-color: var(--accent-line);
}

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

.site-footer {
    margin-top: var(--space-8);
    background: var(--surface-sunken);
    border-top: var(--border-width) solid var(--border);
}

.footer-inner {
    max-width: var(--container);
    margin: 0 auto;
    padding: var(--space-7) var(--gutter) var(--space-6);
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
}

.footer-brand {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.brand-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-heading);
}

.brand-desc {
    font-size: var(--fs-small);
    line-height: 1.6;
    color: var(--text-muted);
}

.footer-nav {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1) var(--space-2);
    font-size: var(--fs-small);
    font-weight: 500;
}

.footer-nav a {
    display: inline-flex;
    align-items: center;
    min-height: var(--touch);
    padding: 0 var(--space-3);
    color: var(--text-muted);
    text-decoration: none;
    border-radius: var(--radius-sm);
}

.footer-nav a:visited {
    color: var(--text-muted);
}

.footer-nav a:hover {
    color: var(--text-heading);
    background: var(--surface-raised);
}

.footer-copy {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    padding-top: var(--space-4);
    border-top: var(--border-width) solid var(--border);
}

.footer-copy p {
    font-size: var(--fs-xs);
    line-height: 1.6;
    color: var(--text-subtle);
}

/* ---------- Breakpoints ---------- */

@media (min-width: 480px) {
    :root {
        --gutter: var(--space-5);
    }

    .article-title {
        font-size: clamp(1.3rem, 1.1rem + 1vw, 1.75rem);
    }

    .cards-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .meta-panel {
        gap: var(--space-4) var(--space-7);
    }
}

@media (min-width: 768px) {
    .header-inner {
        flex-wrap: nowrap;
    }

    .main-nav {
        order: 0;
        width: auto;
        margin: 0;
        padding: 0;
        overflow: visible;
        font-size: 0.9375rem;
        gap: var(--space-1);
    }

    .main-nav a {
        padding: 0 var(--space-3);
    }

    .article-title {
        font-size: clamp(1.5rem, 1.2rem + 1.2vw, 1.875rem);
    }

    .hero-visual {
        border-radius: var(--radius-lg);
    }

    .content-body p,
    .content-body ul,
    .content-body ol {
        font-size: 1.125rem;
    }

    .content-body h2 {
        font-size: 1.45rem;
    }

    .cards-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: var(--space-5);
    }

    .section-header h2 {
        font-size: 1.35rem;
    }
}

@media (min-width: 1024px) {
    :root {
        --fs-body: 1.125rem;
    }

    main {
        padding-top: var(--space-7);
    }

    .content-wrapper {
        grid-template-columns: minmax(0, 1fr) 300px;
        gap: var(--space-8);
    }

    .sidebar {
        order: 0;
    }

    .sidebar-sticky {
        position: sticky;
        top: 84px;
    }

    .article-title {
        font-size: clamp(1.625rem, 1.25rem + 0.9vw, 2rem);
    }
}

@media (min-width: 1280px) {
    .article-title {
        font-size: 2rem;
    }
}

/* ---------- Reduced motion ---------- */

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

    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
        transition-delay: 0ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
    }
}