/* styles.css — aform.com.ua
   Light editorial / tech theme: warm sand paper + terracotta ink + deep slate-teal
   Mobile-first, no dark mode */

:root {
    /* Palette */
    --bg: #f6f1e9;
    --bg-soft: #efe8dc;
    --surface: #fffdf9;
    --card: #fbf7f0;
    --text: #2a2420;
    --text-soft: #3d3530;
    --muted: #6a5f55;
    --accent: #a4431f;
    --accent-hover: #83341627;
    --accent-strong: #833416;
    --accent-tint: rgba(164, 67, 31, 0.08);
    --accent-tint-2: rgba(164, 67, 31, 0.16);
    --accent2: #2f5d62;
    --accent2-tint: rgba(47, 93, 98, 0.09);
    --warning: #8a5a00;
    --warning-tint: rgba(176, 120, 20, 0.12);
    --line: rgba(42, 36, 32, 0.1);
    --line-strong: rgba(42, 36, 32, 0.18);
    --code-bg: #f1ebe0;
    --focus: #2f5d62;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(60, 40, 20, 0.04), 0 1px 1px rgba(60, 40, 20, 0.03);
    --shadow-md: 0 2px 6px rgba(60, 40, 20, 0.04), 0 10px 28px -12px rgba(60, 40, 20, 0.12);

    /* Typography */
    --font-main: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-head: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Times New Roman", serif;
    --font-mono: ui-monospace, "SFMono-Regular", "JetBrains Mono", Menlo, Consolas, "Liberation Mono", monospace;
    --fs-base: 1rem;
    --lh-base: 1.7;
    --lh-head: 1.3;
    --measure: 70ch;

    /* Spacing scale */
    --space-2xs: 4px;
    --space-xs: 8px;
    --space-sm: 12px;
    --space-md: 20px;
    --space-lg: 32px;
    --space-xl: 48px;
    --space-2xl: 72px;
    --gutter: 16px;

    /* Radius */
    --radius-sm: 4px;
    --radius: 10px;
    --radius-lg: 14px;
    --radius-pill: 999px;

    --container: 1200px;
    --header-h: 64px;
}

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

html {
    font-size: 100%;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
    min-height: 100vh;
    background-color: var(--bg);
    background-image:
        linear-gradient(rgba(42, 36, 32, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(42, 36, 32, 0.025) 1px, transparent 1px);
    background-size: 32px 32px;
    color: var(--text);
    font-family: var(--font-main);
    font-size: var(--fs-base);
    line-height: var(--lh-base);
    font-weight: 400;
    overflow-x: hidden;
    overflow-wrap: break-word;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

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

img, video {
    height: auto;
}

iframe {
    border: 0;
}

button, input, select, textarea {
    font: inherit;
    color: inherit;
}

ul, ol {
    list-style: none;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 3px;
    border-radius: var(--radius-sm);
}

::selection {
    background: rgba(164, 67, 31, 0.18);
    color: var(--text);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-head);
    line-height: var(--lh-head);
    color: var(--text);
    font-weight: 700;
    letter-spacing: -0.005em;
    overflow-wrap: break-word;
    hyphens: auto;
}

/* =============================================
   HEADER
   ============================================= */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(246, 241, 233, 0.92);
    backdrop-filter: saturate(1.2) blur(10px);
    -webkit-backdrop-filter: saturate(1.2) blur(10px);
    border-bottom: 1px solid var(--line);
}

.header-inner {
    max-width: var(--container);
    margin: 0 auto;
    padding: var(--space-xs) var(--gutter);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    column-gap: var(--space-md);
    row-gap: 0;
    min-height: var(--header-h);
}

.logo-name {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    font-family: var(--font-head);
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: 0;
}

.logo-name::before {
    content: "";
    width: 12px;
    height: 12px;
    flex-shrink: 0;
    background: var(--accent);
    border-radius: 2px;
    box-shadow: 4px 4px 0 var(--accent2);
    transform: translate(-2px, -2px);
}

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

.main-nav {
    order: 3;
    width: 100%;
    display: flex;
    gap: var(--space-2xs);
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    border-top: 1px solid var(--line);
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

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

.main-nav a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 var(--space-sm);
    white-space: nowrap;
    color: var(--muted);
    border-bottom: 2px solid transparent;
}

.main-nav a:first-child {
    padding-left: 0;
}

.main-nav a:hover,
.main-nav a:focus-visible,
.main-nav a.active,
.main-nav a[aria-current="page"] {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.lang-switcher {
    display: flex;
    gap: var(--space-2xs);
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.lang-switcher a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    padding: 0 var(--space-xs);
    color: var(--muted);
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
}

.lang-switcher a:hover {
    color: var(--accent);
    background: var(--accent-tint);
}

.lang-switcher a.active {
    color: var(--accent);
    border-color: var(--accent-tint-2);
    background: var(--surface);
}

/* =============================================
   MAIN LAYOUT
   ============================================= */
main {
    display: block;
    max-width: var(--container);
    margin: 0 auto;
    padding: var(--space-lg) var(--gutter) var(--space-xl);
}

/* =============================================
   HERO
   ============================================= */
.hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-lg);
    align-items: center;
    margin-bottom: var(--space-xl);
}

.hero-visual {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 10;
    border-radius: var(--radius-lg);
    background: var(--bg-soft);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-md);
}

.hero-visual::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: inherit;
    box-shadow: inset 0 0 0 6px rgba(255, 253, 249, 0.5);
}

.hero-visual img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
}

.hero-content {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.hero-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    max-width: 100%;
    padding: 5px 12px;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent2);
    background: var(--accent2-tint);
    border: 1px solid rgba(47, 93, 98, 0.2);
    border-radius: var(--radius-sm);
}

.hero-tag::before {
    content: "//";
    color: var(--accent);
    font-weight: 700;
}

.article-title {
    font-family: var(--font-head);
    font-size: clamp(1.25rem, 1.05rem + 1vw, 1.45rem);
    font-weight: 700;
    line-height: 1.3;
    color: var(--text);
    max-width: 32ch;
    overflow-wrap: anywhere;
    hyphens: auto;
}

.lead {
    font-size: 1.0625rem;
    line-height: 1.7;
    color: var(--text-soft);
    max-width: var(--measure);
    padding-left: var(--space-sm);
    border-left: 2px solid var(--accent);
}

.meta-panel {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: var(--space-sm) var(--space-md);
    padding-top: var(--space-md);
    border-top: 1px dashed var(--line-strong);
}

.meta-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.meta-item .label {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

.meta-item .value {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text);
    overflow-wrap: anywhere;
}

.meta-divider {
    display: none;
    width: 1px;
    align-self: stretch;
    background: var(--line-strong);
}

/* =============================================
   CONTENT WRAPPER
   ============================================= */
.content-wrapper {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-xl);
    align-items: start;
    margin-bottom: var(--space-xl);
}

.author-sidebar {
    order: -1;
}

/* =============================================
   ARTICLE CONTENT
   ============================================= */
.content-body {
    min-width: 0;
    max-width: var(--measure);
    width: 100%;
    margin-inline: auto;
    color: var(--text-soft);
    font-size: 1.0625rem;
    line-height: 1.72;
}

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

.content-body p {
    margin: 0 0 var(--space-md);
    color: var(--text-soft);
    font-size: inherit;
    line-height: inherit;
}

.content-body a {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-decoration-color: rgba(164, 67, 31, 0.45);
    text-underline-offset: 0.2em;
    overflow-wrap: anywhere;
}

.content-body a:hover {
    color: var(--accent-strong);
    text-decoration-thickness: 2px;
    text-decoration-color: currentColor;
}

.content-body h2 {
    position: relative;
    margin: var(--space-xl) 0 var(--space-sm);
    padding-top: var(--space-md);
    font-size: clamp(1.15rem, 1rem + 0.7vw, 1.4rem);
    font-weight: 700;
    color: var(--text);
    border-top: 1px solid var(--line);
}

.content-body h2::before {
    content: "";
    position: absolute;
    top: -1px;
    left: 0;
    width: 48px;
    height: 3px;
    background: var(--accent);
}

.content-body h3 {
    margin: var(--space-lg) 0 var(--space-xs);
    font-size: clamp(1.05rem, 0.98rem + 0.4vw, 1.2rem);
    font-weight: 700;
    color: var(--accent2);
}

.content-body h4 {
    margin: var(--space-md) 0 var(--space-xs);
    font-size: 1.0625rem;
    color: var(--text);
}

.content-body strong,
.content-body b {
    font-weight: 650;
    color: var(--text);
}

/* Lists */
.content-body ul,
.content-body ol {
    margin: 0 0 var(--space-md);
    padding-left: 1.4em;
}

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

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

.content-body ul > li::before {
    content: "";
    position: absolute;
    left: -1.05em;
    top: 0.72em;
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 1px;
    transform: rotate(45deg);
}

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

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

.content-body li {
    margin-bottom: var(--space-xs);
}

.content-body li > ul,
.content-body li > ol {
    margin-top: var(--space-xs);
    margin-bottom: 0;
}

/* Blockquote */
.content-body blockquote {
    position: relative;
    margin: var(--space-lg) 0;
    padding: var(--space-md) var(--space-md) var(--space-md) calc(var(--space-md) + 4px);
    background: var(--accent2-tint);
    border-left: 3px solid var(--accent2);
    border-radius: 0 var(--radius) var(--radius) 0;
    font-family: var(--font-head);
    font-style: italic;
    font-size: 1.125rem;
    line-height: 1.6;
    color: var(--text);
}

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

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

.content-body blockquote cite {
    display: block;
    margin-top: var(--space-sm);
    font-family: var(--font-mono);
    font-style: normal;
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    color: var(--muted);
}

.content-body blockquote cite::before {
    content: "— ";
    color: var(--accent);
}

/* Code */
.content-body code,
.content-body kbd,
.content-body samp {
    font-family: var(--font-mono);
    font-size: 0.875em;
    padding: 0.12em 0.4em;
    background: var(--code-bg);
    color: var(--accent-strong);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    overflow-wrap: anywhere;
    word-break: break-word;
}

.content-body pre {
    margin: var(--space-md) 0 var(--space-lg);
    padding: var(--space-md);
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    background: var(--code-bg);
    border: 1px solid var(--line);
    border-left: 3px solid var(--accent2);
    border-radius: var(--radius);
    font-family: var(--font-mono);
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--text);
    tab-size: 4;
}

.content-body pre code {
    padding: 0;
    background: none;
    border: 0;
    color: inherit;
    font-size: inherit;
    white-space: pre;
    word-break: normal;
    overflow-wrap: normal;
}

/* Media */
.content-body img,
.content-body video,
.content-body iframe {
    max-width: 100%;
    margin: var(--space-md) 0;
    border-radius: var(--radius);
}

.content-body img,
.content-body video {
    height: auto;
}

.content-body iframe {
    width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
}

.content-body figure {
    margin: var(--space-lg) 0;
}

.content-body figcaption {
    margin-top: var(--space-xs);
    font-size: 0.85rem;
    color: var(--muted);
}

/* Tables */
.content-body table {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: var(--space-md) 0 var(--space-lg);
    border-collapse: collapse;
    font-size: 0.9375rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.content-body th,
.content-body td {
    padding: 10px 14px;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--line);
    min-width: 120px;
}

.content-body th {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--accent2);
    background: var(--card);
    white-space: nowrap;
}

.content-body tbody tr:nth-child(even) {
    background: rgba(239, 232, 220, 0.45);
}

.content-body tbody tr:hover {
    background: var(--accent-tint);
}

.content-body tr:last-child td {
    border-bottom: 0;
}

.content-body hr {
    margin: var(--space-xl) 0;
    border: 0;
    height: 1px;
    background: var(--line-strong);
}

/* Info Box */
.info-box {
    margin: var(--space-md) 0 var(--space-lg);
    padding: var(--space-md);
    background: var(--surface);
    border: 1px solid var(--line);
    border-top: 3px solid var(--accent2);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.info-box ul,
.content-body .info-box ul {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    margin: 0;
    padding: 0;
}

.info-box ul li,
.content-body .info-box ul li {
    position: relative;
    margin: 0;
    padding-left: 24px;
    color: var(--text-soft);
    font-size: 0.975rem;
    line-height: 1.65;
}

.info-box ul li::before,
.content-body .info-box ul li::before {
    content: "→";
    position: absolute;
    left: 0;
    top: 0;
    width: auto;
    height: auto;
    background: none;
    transform: none;
    color: var(--accent);
    font-family: var(--font-mono);
    font-weight: 700;
    line-height: 1.65;
}

.info-box ul li strong {
    color: var(--text);
    font-weight: 650;
}

/* =============================================
   SIDEBAR
   ============================================= */
.author-sidebar {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-md);
    min-width: 0;
}

.author-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.author-avatar {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--bg-soft);
}

.author-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
}

.author-info {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    padding: var(--space-md);
    min-width: 0;
}

.author-label {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent);
}

.author-name {
    font-family: var(--font-head);
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--text);
}

.author-bio {
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--muted);
}

.author-socials {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
    margin-top: var(--space-2xs);
    padding-top: var(--space-sm);
    border-top: 1px solid var(--line);
}

.author-socials a,
.footer-socials a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    color: var(--muted);
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.author-socials a:hover,
.footer-socials a:hover {
    color: var(--accent);
    background: var(--accent-tint);
    border-color: var(--accent-tint-2);
}

.author-socials svg,
.footer-socials svg {
    width: 18px;
    height: 18px;
}

/* TOC */
.toc-card {
    padding: var(--space-md);
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
}

.toc-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: var(--space-sm);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
}

.toc-title::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--line-strong);
}

.toc-list {
    counter-reset: toc-counter;
    display: flex;
    flex-direction: column;
}

.toc-list li {
    counter-increment: toc-counter;
    display: flex;
    align-items: baseline;
    gap: 10px;
    font-size: 0.9rem;
    color: var(--muted);
    border-bottom: 1px dashed var(--line);
}

.toc-list li:last-child {
    border-bottom: 0;
}

.toc-list li::before {
    content: counter(toc-counter, decimal-leading-zero);
    min-width: 22px;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--accent2);
}

.toc-list li a {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
    min-height: 44px;
    padding: 6px 0;
    color: var(--text-soft);
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.toc-list li a:hover {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 0.2em;
}

/* =============================================
   RELATED
   ============================================= */
.related-section {
    margin-top: var(--space-xl);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--line-strong);
}

.section-header {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
    min-width: 0;
}

.section-header h3 {
    font-family: var(--font-head);
    font-size: clamp(1.1rem, 1rem + 0.5vw, 1.3rem);
    font-weight: 700;
    color: var(--text);
    min-width: 0;
    overflow-wrap: anywhere;
}

.decoder-line {
    flex: 1 1 40px;
    min-width: 24px;
    height: 6px;
    background-image: repeating-linear-gradient(90deg, var(--line-strong) 0 6px, transparent 6px 12px);
    background-size: 100% 1px;
    background-repeat: no-repeat;
    background-position: center;
}

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

.card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    min-width: 0;
    padding: var(--space-md);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.card::before {
    content: "";
    position: absolute;
    top: -1px;
    left: var(--space-md);
    width: 28px;
    height: 3px;
    background: var(--accent);
    border-radius: 0 0 2px 2px;
    transition: width 0.2s ease;
}

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

.card:hover::before {
    width: 56px;
}

.card:focus-within {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
}

.card-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-xs);
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--accent2);
    background: var(--accent2-tint);
    border-radius: var(--radius-sm);
}

.badge.warning {
    color: var(--warning);
    background: var(--warning-tint);
}

.card h4 {
    font-family: var(--font-head);
    font-size: 1.0625rem;
    font-weight: 700;
    line-height: 1.35;
    color: var(--text);
    overflow-wrap: anywhere;
}

.card h4 a {
    color: inherit;
}

.card h4 a:hover {
    color: var(--accent);
}

.card p {
    flex-grow: 1;
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--muted);
}

.card-status {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: auto;
    padding-top: var(--space-xs);
    border-top: 1px solid var(--line);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.02em;
    color: var(--muted);
}

.status-dot {
    display: inline-block;
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent2);
    box-shadow: 0 0 0 3px var(--accent2-tint);
}

/* =============================================
   FOOTER
   ============================================= */
footer {
    margin-top: var(--space-xl);
    background: var(--surface);
    border-top: 1px solid var(--line);
}

.footer-inner {
    max-width: var(--container);
    margin: 0 auto;
    padding: var(--space-lg) var(--gutter) var(--space-md);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-md);
}

.footer-left {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.footer-left .brand {
    font-family: var(--font-head);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
}

.footer-left .copy {
    font-size: 0.85rem;
    color: var(--muted);
}

.footer-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0 var(--space-md);
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

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

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

.footer-socials {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
    align-items: center;
}

.footer-bottom {
    max-width: var(--container);
    margin: 0 auto;
    padding: var(--space-md) var(--gutter) var(--space-lg);
    border-top: 1px dashed var(--line-strong);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.footer-bottom p {
    font-size: 0.75rem;
    line-height: 1.55;
    letter-spacing: 0.02em;
    color: var(--muted);
}

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

    .meta-divider {
        display: block;
    }

    .author-card {
        grid-template-columns: 140px minmax(0, 1fr);
    }

    .author-avatar {
        aspect-ratio: auto;
        height: 100%;
        min-height: 160px;
    }
}

@media (min-width: 768px) {
    :root {
        --gutter: 32px;
        --fs-base: 1.0625rem;
    }

    .header-inner {
        flex-wrap: nowrap;
        padding-top: 0;
        padding-bottom: 0;
    }

    .main-nav {
        order: 0;
        width: auto;
        flex: 0 1 auto;
        border-top: 0;
        gap: var(--space-xs);
    }

    .main-nav a:first-child {
        padding-left: var(--space-sm);
    }

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

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

    .lead {
        font-size: 1.125rem;
    }

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

    .author-sidebar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: start;
    }

    .author-card {
        grid-template-columns: minmax(0, 1fr);
    }

    .author-avatar {
        aspect-ratio: 16 / 10;
        height: auto;
        min-height: 0;
    }

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

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

    .hero {
        grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
        gap: var(--space-xl);
        margin-bottom: var(--space-2xl);
    }

    .hero-visual {
        order: 2;
        aspect-ratio: 4 / 5;
        max-height: 620px;
    }

    .hero-content {
        order: 1;
    }

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

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

    .content-body {
        margin-inline: 0;
        font-size: 1.125rem;
    }

    .author-sidebar {
        order: 0;
        grid-template-columns: minmax(0, 1fr);
        position: sticky;
        top: calc(var(--header-h) + 24px);
        max-height: calc(100vh - var(--header-h) - 48px);
        overflow-y: auto;
        scrollbar-width: thin;
    }

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

@media (min-width: 1280px) {
    .content-wrapper {
        grid-template-columns: minmax(0, 1fr) 320px;
        gap: var(--space-2xl);
    }

    .cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    }
}

/* =============================================
   REDUCED MOTION
   ============================================= */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

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

    .card:hover {
        transform: none;
    }
}

/* =============================================
   PRINT
   ============================================= */
@media print {
    body {
        background: #fff;
    }

    .site-header,
    .author-sidebar,
    .related-section,
    footer {
        display: none;
    }

    .content-wrapper {
        grid-template-columns: 1fr;
    }
}