/* styles.css — dark editorial / tech theme (graphite + amber) */

:root {
    /* palette */
    --bg: #0f1115;
    --bg-deep: #0b0d10;
    --surface: #161920;
    --surface-raised: #1d212a;
    --surface-inset: #13161c;

    --border: #2a303b;
    --border-strong: #3a4250;

    --text: #e3e6eb;
    --text-heading: #eef0f3;
    --text-muted: #a2aab7;
    --text-subtle: #8a93a1;

    --accent: #d9a441;
    --accent-strong: #ebb85c;
    --accent-soft: rgba(217, 164, 65, 0.12);
    --accent-line: rgba(217, 164, 65, 0.35);

    --secondary: #7fb3a3;
    --secondary-soft: rgba(127, 179, 163, 0.12);

    --warning: #d98a7a;
    --warning-soft: rgba(217, 138, 122, 0.12);

    --focus: #f2c46d;
    --selection-bg: rgba(217, 164, 65, 0.28);

    --code-bg: #0b0d10;
    --code-inline-bg: #232833;

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

    --fs-body: 1rem;
    --fs-body-lg: 1.0625rem;
    --fs-small: 0.875rem;
    --fs-xs: 0.75rem;
    --fs-xxs: 0.6875rem;

    --lh-body: 1.7;
    --lh-tight: 1.3;

    /* spacing scale */
    --s-1: 4px;
    --s-2: 8px;
    --s-3: 12px;
    --s-4: 16px;
    --s-5: 20px;
    --s-6: 24px;
    --s-8: 32px;
    --s-12: 48px;
    --s-16: 64px;

    /* radii & borders */
    --radius-xs: 4px;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --border-w: 1px;

    /* layout */
    --container: 1180px;
    --measure: 68ch;
    --gutter: 16px;
    --sidebar-w: 300px;

    --ease: 180ms ease;
}

/* ---------- reset ---------- */

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

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

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

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

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

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

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

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

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

img {
    border-radius: var(--radius-md);
    filter: brightness(0.94);
}

/* ---------- links ---------- */

a {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-color: transparent;
    text-underline-offset: 0.2em;
    text-decoration-thickness: 1px;
    transition: color var(--ease), text-decoration-color var(--ease);
    overflow-wrap: anywhere;
}

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

a:visited {
    color: #c59a58;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
summary:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 3px;
    border-radius: var(--radius-xs);
}

/* ---------- headings & text ---------- */

h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--text-heading);
    font-weight: 700;
    line-height: var(--lh-tight);
    letter-spacing: -0.01em;
    overflow-wrap: anywhere;
    text-wrap: balance;
}

p {
    overflow-wrap: break-word;
}

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

strong,
b {
    color: var(--text-heading);
    font-weight: 700;
}

em,
i {
    color: var(--text);
}

mark {
    background: var(--accent-soft);
    color: var(--accent-strong);
    padding: 0 var(--s-1);
    border-radius: var(--radius-xs);
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
}

hr {
    border: 0;
    height: var(--border-w);
    background: var(--border);
    margin: var(--s-12) 0;
}

/* ---------- forms & buttons ---------- */

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

input,
textarea,
select {
    width: 100%;
    max-width: 100%;
    padding: var(--s-3) var(--s-4);
    min-height: 44px;
    transition: border-color var(--ease), background-color var(--ease);
}

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

input:hover,
textarea:hover,
select:hover {
    border-color: #4a5366;
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--accent);
    background: var(--surface);
    outline: none;
}

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

button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--s-2);
    min-height: 44px;
    padding: var(--s-2) var(--s-5);
    background: var(--surface-raised);
    color: var(--text-heading);
    font-weight: 600;
    cursor: pointer;
    transition: background-color var(--ease), border-color var(--ease), color var(--ease);
}

button:hover {
    background: #252a35;
    border-color: var(--border-strong);
}

button:active {
    background: var(--surface-inset);
}

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

/* ---------- lists ---------- */

ul,
ol {
    padding-left: var(--s-6);
    margin: 0 0 var(--s-6);
}

li {
    margin-top: var(--s-2);
}

li::marker {
    color: var(--accent);
}

ul ul,
ol ol,
ul ol,
ol ul {
    margin: var(--s-2) 0 0;
    padding-left: var(--s-6);
}

ul ul {
    list-style-type: circle;
}

/* ---------- code ---------- */

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

code {
    background: var(--code-inline-bg);
    color: #f0c985;
    padding: 0.15em 0.4em;
    border-radius: var(--radius-xs);
    overflow-wrap: anywhere;
}

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

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

kbd {
    display: inline-block;
    background: var(--surface-raised);
    color: var(--text-heading);
    border: var(--border-w) solid var(--border-strong);
    border-bottom-width: 2px;
    border-radius: var(--radius-xs);
    padding: 0 var(--s-2);
    line-height: 1.6;
    font-size: 0.8125em;
}

/* ---------- tables ---------- */

table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    font-size: var(--fs-small);
    margin: var(--s-6) 0;
}

thead th {
    background: var(--surface-raised);
    color: var(--text-heading);
    font-weight: 600;
    text-align: left;
    letter-spacing: 0.01em;
}

th,
td {
    padding: var(--s-3) var(--s-4);
    border: var(--border-w) solid var(--border);
    vertical-align: top;
    text-align: left;
    overflow-wrap: anywhere;
}

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

tbody tr {
    transition: background-color var(--ease);
}

tbody tr:hover {
    background: rgba(255, 255, 255, 0.04);
}

/* wrapper for wide tables: table inside a container with overflow-x: auto */
.table-wrap,
.content-body > .table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-md);
    border: var(--border-w) solid var(--border);
    margin: var(--s-6) 0;
}

.table-wrap table {
    margin: 0;
    min-width: 480px;
}

.table-wrap th,
.table-wrap td {
    border: 0;
    border-bottom: var(--border-w) solid var(--border);
}

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

table:not(.table-wrap table) {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-md);
}

/* ---------- figure ---------- */

figure {
    margin: var(--s-8) 0;
}

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

/* ---------- layout ---------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(15, 17, 21, 0.94);
    border-bottom: var(--border-w) solid var(--border);
}

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

.logo {
    display: inline-flex;
    align-items: center;
    gap: var(--s-2);
    min-height: 44px;
    font-weight: 800;
    font-size: 1.0625rem;
    letter-spacing: -0.02em;
    color: var(--text-heading);
    text-decoration: none;
}

.logo:hover {
    color: var(--text-heading);
}

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

.main-nav {
    display: flex;
    align-items: center;
    gap: var(--s-1);
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    font-size: var(--fs-small);
    font-weight: 500;
    scrollbar-width: none;
    order: 3;
    padding-bottom: 2px;
}

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

.main-nav a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 var(--s-3);
    color: var(--text-muted);
    text-decoration: none;
    white-space: nowrap;
    border-radius: var(--radius-sm);
    border-bottom: 2px solid transparent;
    transition: color var(--ease), background-color var(--ease);
}

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

.main-nav a.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
    text-decoration: none;
}

.lang-switcher {
    display: inline-flex;
    gap: var(--s-1);
    padding: 3px;
    background: var(--surface);
    border: var(--border-w) solid var(--border);
    border-radius: var(--radius-sm);
}

.lang-switcher a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 36px;
    padding: 0 var(--s-3);
    font-size: var(--fs-xs);
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: var(--radius-xs);
    transition: color var(--ease), background-color var(--ease);
}

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

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

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

/* ---------- hero ---------- */

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

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

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

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

.article-title {
    font-family: var(--font-sans);
    font-size: 1.375rem;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.015em;
    color: var(--text-heading);
    margin-bottom: var(--s-4);
    text-wrap: balance;
}

.lead {
    font-size: var(--fs-body-lg);
    line-height: 1.7;
    color: var(--text-muted);
    margin-bottom: var(--s-6);
    border-left: 2px solid var(--accent-line);
    padding-left: var(--s-4);
}

.meta-panel {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-4) var(--s-8);
    padding: var(--s-4) 0;
    border-top: var(--border-w) solid var(--border);
    border-bottom: var(--border-w) solid var(--border);
    margin-bottom: var(--s-8);
}

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

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

.meta-item .value {
    font-size: var(--fs-small);
    font-weight: 600;
    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-w) solid var(--border);
    background: var(--surface-raised);
}

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

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

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

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

.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(--s-6);
}

.content-body h2 {
    font-family: var(--font-sans);
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--text-heading);
    margin: var(--s-12) 0 var(--s-4);
    padding-top: var(--s-2);
    border-top: var(--border-w) solid var(--border);
}

.content-body h3 {
    font-family: var(--font-sans);
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--text-heading);
    margin: var(--s-8) 0 var(--s-3);
}

.content-body h4 {
    font-size: var(--fs-body);
    font-weight: 600;
    color: var(--text-heading);
    margin: var(--s-6) 0 var(--s-2);
}

.content-body ul,
.content-body ol {
    font-family: var(--font-serif);
    font-size: 1.0625rem;
    line-height: 1.75;
    margin-bottom: var(--s-6);
}

.content-body li {
    margin-top: var(--s-2);
}

.content-body ul > li {
    list-style: none;
    position: relative;
    padding-left: var(--s-5);
}

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

.content-body ol {
    list-style: decimal;
}

.content-body ol > li::marker {
    color: var(--accent);
    font-family: var(--font-sans);
    font-weight: 600;
}

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

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

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

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

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

.content-body a {
    text-decoration-color: var(--accent-line);
}

.content-body a:hover {
    text-decoration-color: currentColor;
}

.content-body img {
    margin: var(--s-6) 0;
}

.content-body figure img {
    margin: 0;
}

/* ---------- info box ---------- */

.info-box {
    margin: var(--s-8) 0;
    padding: var(--s-5) var(--s-6);
    background: var(--surface);
    border: var(--border-w) solid var(--border);
    border-radius: var(--radius-md);
}

.info-box-title {
    font-size: var(--fs-small);
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: var(--s-3);
}

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

.info-box li {
    position: relative;
    margin: 0;
    padding-left: var(--s-5);
    font-size: var(--fs-small);
    line-height: 1.65;
    color: var(--text);
}

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

/* ---------- sidebar ---------- */

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

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

.author-card,
.toc-card {
    background: var(--surface);
    border: var(--border-w) solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--s-5);
}

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

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

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

.author-name {
    font-size: var(--fs-body);
    font-weight: 700;
    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(--s-4);
}

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

.author-socials a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    background: var(--surface-inset);
    border: var(--border-w) solid var(--border);
    color: var(--text-muted);
    text-decoration: none;
    transition: color var(--ease), border-color var(--ease), background-color var(--ease);
}

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

.toc-title {
    font-size: var(--fs-xxs);
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-subtle);
    margin-bottom: var(--s-3);
}

.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.toc-list li {
    margin: 0;
    border-top: var(--border-w) solid var(--border);
}

.toc-list li:first-child {
    border-top: 0;
}

.toc-list li a {
    display: flex;
    align-items: center;
    gap: var(--s-3);
    min-height: 44px;
    padding: var(--s-2) 0;
    font-size: var(--fs-small);
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    transition: color var(--ease);
}

.toc-list li a span {
    flex-shrink: 0;
    min-width: 24px;
    font-size: var(--fs-xs);
    font-weight: 700;
    color: var(--accent);
    font-variant-numeric: tabular-nums;
}

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

/* ---------- related / cards ---------- */

.related-section {
    margin-top: var(--s-16);
    padding-top: var(--s-12);
    border-top: var(--border-w) solid var(--border);
}

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

.section-header h2 {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-heading);
    white-space: nowrap;
    letter-spacing: -0.01em;
}

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

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

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

.card:hover {
    border-color: var(--border-strong);
    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(--s-2);
    margin-bottom: var(--s-3);
}

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

.tag.warning {
    color: var(--warning);
    background: var(--warning-soft);
}

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

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

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

.card-footer {
    display: flex;
    align-items: center;
    padding-top: var(--s-3);
    border-top: var(--border-w) solid var(--border);
}

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

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

/* ---------- footer ---------- */

.site-footer {
    margin-top: var(--s-16);
    background: var(--bg-deep);
    border-top: var(--border-w) solid var(--border);
}

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

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

.brand-title {
    font-weight: 800;
    font-size: 1.0625rem;
    letter-spacing: -0.01em;
    color: var(--text-heading);
}

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

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

.footer-nav a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    color: var(--text-muted);
    text-decoration: none;
}

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

.footer-copy {
    display: flex;
    flex-direction: column;
    gap: var(--s-2);
    padding-top: var(--s-5);
    border-top: var(--border-w) solid var(--border);
}

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

/* ---------- breakpoints (mobile-first) ---------- */

@media (min-width: 480px) {
    :root {
        --gutter: 20px;
    }

    .article-title {
        font-size: 1.5rem;
    }

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

    .footer-inner {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: space-between;
        align-items: flex-start;
    }

    .footer-copy {
        width: 100%;
    }
}

@media (min-width: 768px) {
    :root {
        --gutter: 24px;
    }

    .header-inner {
        flex-wrap: nowrap;
    }

    .main-nav {
        display: flex;
        width: auto;
        order: 0;
        padding-bottom: 0;
        gap: var(--s-2);
        overflow: visible;
    }

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

    .article-title {
        font-size: 1.75rem;
    }

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

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

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

    .cards-grid {
        gap: var(--s-6);
    }
}

@media (min-width: 1024px) {
    :root {
        --gutter: 32px;
    }

    .content-wrapper {
        grid-template-columns: minmax(0, 1fr) var(--sidebar-w);
        gap: var(--s-16);
    }

    .sidebar {
        order: 0;
    }

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

    .article-title {
        font-size: 2rem;
    }

    .content-body {
        margin: 0;
    }
}

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

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

/* ---------- reduced motion ---------- */

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

    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}