/* ───────────────────────────────────────────────────────
   Paradox Feed — ProPublica meets Feedly
   App-feel editorial dark theme
   ─────────────────────────────────────────────────────── */

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

:root {
    --bg:          #0a0a0a;
    --bg-surface:  #111111;
    --bg-card:     #161616;
    --bg-hover:    #1e1e1e;
    --bg-elevated: #1a1a1a;
    --text:        #ececec;
    --text-2:      #a0a0a0;
    --text-3:      #666666;
    --accent:      #f0a500;
    --accent-2:    #ffbf33;
    --success:     #22c55e;
    --error:       #ef4444;
    --border:      #222222;
    --border-2:    #2a2a2a;
    --radius:      8px;
    --radius-lg:   12px;
}

/* ── SVG pattern animations ────────────────────────────── */
@keyframes drift-1 {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-6px); }
}
@keyframes drift-2 {
    0%, 100% { transform: translateY(0) translateX(0); }
    33%      { transform: translateY(4px) translateX(-3px); }
    66%      { transform: translateY(-3px) translateX(2px); }
}
@keyframes drift-3 {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50%      { transform: translateY(-4px) rotate(2deg); }
}
@keyframes pulse {
    0%, 100% { opacity: var(--o, 0.3); }
    50%      { opacity: calc(var(--o, 0.3) + 0.15); }
}

.pattern-svg .drift-1 { animation: drift-1 8s ease-in-out infinite; }
.pattern-svg .drift-2 { animation: drift-2 12s ease-in-out infinite; }
.pattern-svg .drift-3 { animation: drift-3 10s ease-in-out infinite; }
.pattern-svg .pulse    { animation: pulse 6s ease-in-out infinite; }

/* Hover brightens the whole pattern */
.featured-card:hover .pattern-svg,
.card:hover .pattern-svg {
    filter: brightness(1.25);
    transition: filter 0.3s;
}
.pattern-svg { transition: filter 0.3s; }

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    .pattern-svg .drift-1,
    .pattern-svg .drift-2,
    .pattern-svg .drift-3,
    .pattern-svg .pulse { animation: none; }
}

html {
    font-size: 15px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: inherit; text-decoration: none; }

/* ── Layout ────────────────────────────────────────────── */
.container      { max-width: 720px;  margin: 0 auto; padding: 0 1.25rem; width: 100%; }
.container-wide { max-width: 1080px; margin: 0 auto; padding: 0 1.25rem; width: 100%; }
.container-narrow { max-width: 680px; margin: 0 auto; padding: 0 1.25rem; width: 100%; }

.main-content {
    flex: 1;
    padding: 1.5rem 0 4rem;
}

/* Flush content against header */
.article { margin-top: -1.5rem; }

/* ── Header — sticky, compact, app-like ────────────────── */
.site-header {
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.header-inner {
    display: flex;
    align-items: center;
    height: 52px;
    gap: 1rem;
}

.site-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'DM Serif Display', Georgia, serif;
    font-size: 1.15rem;
    color: var(--text);
    flex-shrink: 0;
    transition: color 0.15s;
}
.site-logo:hover { color: var(--accent); }

.logo-icon { display: block; }

.tagline {
    color: var(--text-3);
    font-size: 0.8rem;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}
.site-nav a {
    color: var(--text-2);
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    transition: color 0.15s;
}
.site-nav a:hover { color: var(--accent); }
.nav-icon { display: flex; align-items: center; }
.nav-icon svg { width: 16px; height: 16px; }

/* ── Subnav — persistent category bar ──────────────────── */
.subnav {
    border-top: 1px solid var(--border);
    background: var(--bg-surface);
    position: relative;
    z-index: 99;
}

.subnav-inner {
    display: flex;
    gap: 0.25rem;
    overflow: visible;
    padding: 0.5rem 1.25rem;
    flex-wrap: nowrap;
    align-items: center;
}
.nav-item { flex-shrink: 0; }

.cat-link {
    padding: 0.3rem 0.7rem;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-2);
    white-space: nowrap;
    transition: all 0.15s;
    border: 1px solid transparent;
}
.cat-link:hover {
    color: var(--text);
    background: var(--bg-card);
}
.cat-link.active {
    color: var(--bg);
    background: var(--accent);
    border-color: var(--accent);
}

/* More dropdown */
.cat-more {
    position: relative;
    flex-shrink: 0;
}
.cat-more-toggle {
    cursor: pointer;
    background: none;
    border: 1px solid transparent;
    font-family: inherit;
}
.cat-more-arrow {
    font-size: 0.65rem;
    margin-left: 0.1rem;
}
.cat-more.open .cat-more-arrow { display: inline-block; transform: rotate(45deg); }

.cat-more-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: var(--bg-elevated);
    border: 1px solid var(--border-2);
    border-radius: var(--radius);
    padding: 0.35rem;
    min-width: 180px;
    z-index: 999;
    box-shadow: 0 12px 32px rgba(0,0,0,0.7);
}
.cat-more.open .cat-more-dropdown { display: flex; flex-direction: column; }

.cat-more-item {
    padding: 0.45rem 0.75rem;
    font-size: 0.8rem;
    color: var(--text-2);
    border-radius: 4px;
    transition: all 0.1s;
}
.cat-more-item:hover { background: var(--bg-hover); color: var(--text); }
.cat-more-item.active { color: var(--accent); }

.category-desc {
    color: var(--text-2);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

/* ── Featured card (first post, large) ─────────────────── */
.featured-card {
    display: block;
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 1.5rem;
    transition: transform 0.25s, box-shadow 0.25s;
    aspect-ratio: 21 / 9;
}
.featured-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.5);
}

.featured-svg {
    position: absolute;
    inset: -10%;
    width: 120%;
    height: 120%;
}
.featured-svg svg {
    width: 100%;
    height: 100%;
    display: block;
}

.featured-content {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 2rem 2.25rem;
    background: linear-gradient(
        to top,
        rgba(0,0,0,0.95) 0%,
        rgba(0,0,0,0.7) 40%,
        rgba(0,0,0,0.15) 70%,
        transparent 100%
    );
}

.featured-top {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.6rem;
}

.featured-title {
    font-family: 'DM Serif Display', Georgia, serif;
    font-size: 1.8rem;
    line-height: 1.2;
    margin-bottom: 0.5rem;
    color: #fff;
}
.featured-card:hover .featured-title { color: var(--accent); }

.featured-excerpt {
    color: rgba(255,255,255,0.65);
    font-size: 0.9rem;
    line-height: 1.55;
    margin-bottom: 0.75rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-width: 640px;
}

/* ── Card grid ─────────────────────────────────────────── */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

.card {
    display: flex;
    flex-direction: column;
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: transform 0.25s, box-shadow 0.25s;
    aspect-ratio: 16 / 11;
}
.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.5);
}

.card-svg {
    position: absolute;
    inset: -10%;
    width: 120%;
    height: 120%;
}
.card-svg svg {
    width: 100%;
    height: 100%;
    display: block;
}

.card-body {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 1rem 1.25rem 1.25rem;
    background: linear-gradient(
        to top,
        rgba(0,0,0,0.95) 0%,
        rgba(0,0,0,0.65) 45%,
        rgba(0,0,0,0.1) 70%,
        transparent 100%
    );
}

.card-top {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.4rem;
}

.card-title {
    font-family: 'DM Serif Display', Georgia, serif;
    font-size: 1.1rem;
    line-height: 1.3;
    margin-bottom: 0.4rem;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.4);
}
.card:hover .card-title { color: var(--accent); }

.card-excerpt {
    color: rgba(255,255,255,0.65);
    font-size: 0.82rem;
    line-height: 1.5;
    margin-bottom: 0.6rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.72rem;
    color: rgba(255,255,255,0.45);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 500;
}

/* ── Labels & pills ────────────────────────────────────── */
.label {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    background: var(--border-2);
    color: var(--text-2);
    transition: background 0.15s, color 0.15s;
}
a.label:hover { background: var(--accent); color: var(--bg); }

/* ── Anomaly dots ──────────────────────────────────────── */
.anomaly-dots {
    display: inline-flex;
    gap: 2px;
    font-size: 0.45rem;
    line-height: 1;
}
.dot.filled { color: var(--accent); }
.dot.empty  { color: var(--border-2); }

/* ── Article page ──────────────────────────────────────── */
.article-hero {
    position: relative;
    width: 100%;
    height: 480px;
    overflow: hidden;
    margin-bottom: 0;
}
.article-hero-svg {
    position: absolute;
    inset: -10%;
    width: 120%;
    height: 120%;
}
.article-hero-svg svg {
    width: 100%;
    height: 100%;
    display: block;
}

.article-hero-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 2.5rem;
    background: linear-gradient(
        to top,
        rgba(10,10,10,1) 0%,
        rgba(10,10,10,0.85) 30%,
        rgba(10,10,10,0.3) 60%,
        rgba(10,10,10,0.05) 100%
    );
}
.article-hero-overlay .container-narrow {
    padding: 0;
}

.article-hero-overlay .label {
    margin-bottom: 0.75rem;
    background: rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.8);
    backdrop-filter: blur(4px);
}

.article-hero-overlay h1 {
    font-family: 'DM Serif Display', Georgia, serif;
    font-size: 2.6rem;
    line-height: 1.15;
    margin-bottom: 1rem;
    letter-spacing: -0.01em;
    color: #fff;
    text-shadow: 0 2px 8px rgba(0,0,0,0.4);
    max-width: 720px;
}

.article-hero-overlay .article-meta {
    color: rgba(255,255,255,0.6);
}
.article-hero-overlay .sep { color: rgba(255,255,255,0.25); }
.article-hero-overlay .dot.filled { color: var(--accent); }
.article-hero-overlay .dot.empty { color: rgba(255,255,255,0.15); }

/* Article body spacing after hero */
.article .container-narrow {
    padding-top: 2rem;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.82rem;
    color: var(--text-2);
}
.sep { color: var(--text-3); }

.article-body {
    font-size: 1.05rem;
    line-height: 1.85;
    color: var(--text);
}
.article-body p { margin-bottom: 1.5rem; }
.article-body strong { font-weight: 600; }
.article-body em { font-style: italic; }
.article-body a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }

/* Sources */
.article-sources {
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}
.article-sources h3 {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-2);
    margin-bottom: 0.75rem;
}
.source-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.source-item {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius);
    font-size: 0.88rem;
    color: var(--text-2);
    transition: background 0.15s, color 0.15s;
}
.source-item:hover {
    background: var(--bg-card);
    color: var(--accent);
}
.source-arrow { color: var(--accent); font-weight: 600; }

.article-nav {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

/* ── Share bar ─────────────────────────────────────────── */
.share-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 2rem;
}
.article-sources + .share-bar {
    border-bottom: none;
    border-top: 1px solid var(--border);
    margin-bottom: 0;
    margin-top: 2rem;
    padding-top: 1.25rem;
}
.share-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-3);
    margin-right: 0.25rem;
}
.share-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border-2);
    background: transparent;
    color: var(--text-2);
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}
.share-icon:hover {
    color: var(--accent);
    border-color: var(--accent);
    background: rgba(240, 165, 0, 0.08);
}
.share-icon.copied {
    color: var(--success);
    border-color: var(--success);
}
.share-icon svg { flex-shrink: 0; }

/* ── Buttons ───────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.15s;
}
.btn-ghost {
    color: var(--text-2);
    border: 1px solid var(--border-2);
}
.btn-ghost:hover {
    color: var(--text);
    border-color: var(--text-3);
}

/* ── Search overlay ────────────────────────────────────── */
.search-toggle {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-family: inherit;
    color: var(--text-2);
}
.search-toggle:hover { color: var(--accent); }
.search-toggle.active { color: var(--accent); }

.search-overlay {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 200;
    background: rgba(10,10,10,0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding-top: 80px;
    transform: translateY(-100%);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.2s ease;
    pointer-events: none;
    min-height: 120px;
}
.search-overlay.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: all;
}

.search-overlay-form {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 0;
}
.search-overlay-form svg { color: var(--text-3); flex-shrink: 0; }
.search-overlay-form input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--text);
    font-size: 1.5rem;
    font-family: 'DM Serif Display', Georgia, serif;
    caret-color: var(--accent);
}
.search-overlay-form input::placeholder { color: var(--text-3); }
.search-overlay-form kbd {
    font-family: inherit;
    font-size: 0.7rem;
    color: var(--text-3);
    border: 1px solid var(--border-2);
    border-radius: 4px;
    padding: 0.15rem 0.4rem;
}

/* ── Search results page ──────────────────────────────── */
.search-page-form {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}
.search-page-form input {
    flex: 1;
    padding: 0.65rem 1rem;
    border-radius: var(--radius);
    border: 1px solid var(--border-2);
    background: var(--bg-card);
    color: var(--text);
    font-size: 1rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.15s;
}
.search-page-form input:focus {
    border-color: var(--accent);
}
.search-page-form input::placeholder { color: var(--text-3); }
.search-page-form button {
    padding: 0.65rem 1.25rem;
    border-radius: var(--radius);
    border: none;
    background: var(--accent);
    color: var(--bg);
    font-size: 0.85rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s;
}
.search-page-form button:hover { background: var(--accent-2); }

.search-meta {
    font-size: 0.85rem;
    color: var(--text-2);
    margin-bottom: 1.25rem;
}

/* ── Pagination ────────────────────────────────────────── */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    padding: 2.5rem 0 1rem;
}
.page-link {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.page-link:hover { color: var(--accent-2); }
.page-info {
    font-size: 0.75rem;
    color: var(--text-3);
}

/* ── Stats page ────────────────────────────────────────── */
.stats-page { padding-top: 0.5rem; }

.stats-title {
    font-family: 'DM Serif Display', Georgia, serif;
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.stats-intro {
    color: var(--text-2);
    font-size: 0.9rem;
    line-height: 1.65;
    margin-bottom: 2rem;
}

.stats-section {
    margin-bottom: 2.5rem;
}
.stats-section h3 {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent);
    margin-bottom: 1rem;
}

/* Stats grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem 1rem;
    text-align: center;
}
.stat-number {
    font-family: 'DM Serif Display', Georgia, serif;
    font-size: 1.8rem;
    color: var(--text);
    line-height: 1.2;
}
.stat-label {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: 0.2rem;
}

.stat-detail {
    margin-top: 0.75rem;
    font-size: 0.85rem;
    color: var(--text-2);
}

/* Stats tables */
.stats-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}
.stats-table th,
.stats-table td {
    padding: 0.55rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
.stats-table th {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-3);
    font-weight: 500;
}
.stats-table .num { text-align: right; }
.stats-table .nowrap { white-space: nowrap; }

/* Top posts */
.top-posts-list {
    padding-left: 1.5rem;
    font-size: 0.9rem;
}
.top-posts-list li { padding: 0.3rem 0; }
.top-posts-list a { color: var(--accent); }
.top-posts-list a:hover { color: var(--accent-2); }

/* Bar chart */
.bar-chart {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.bar-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.bar-label {
    width: 130px;
    flex-shrink: 0;
    font-size: 0.8rem;
    color: var(--text-2);
    text-align: right;
}
.bar-track {
    flex: 1;
    height: 20px;
    background: var(--bg-card);
    border-radius: 4px;
    overflow: hidden;
}
.bar-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 4px;
    min-width: 3px;
    transition: width 0.4s ease;
}
.bar-value {
    width: 2rem;
    font-size: 0.8rem;
    color: var(--text-3);
    text-align: right;
    font-weight: 500;
}

/* Direction notes */
.direction-notes {
    background: var(--bg-card);
    border-left: 3px solid var(--accent);
    padding: 1rem 1.25rem;
    border-radius: 0 var(--radius) var(--radius) 0;
    font-style: italic;
    color: var(--text-2);
    line-height: 1.7;
    font-size: 0.92rem;
}

/* Log table */
.log-table .log-msg {
    font-size: 0.78rem;
    color: var(--text-3);
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.log-success .log-status { color: var(--success); }
.log-error .log-status   { color: var(--error); }

.last-updated {
    font-size: 0.75rem;
    color: var(--text-3);
    text-align: center;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

/* ── Author bylines ───────────────────────────────────── */
.article-byline {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: color 0.15s;
}
.article-byline:hover { color: var(--accent); }
.byline-avatar { display: flex; flex-shrink: 0; }
.byline-avatar svg,
.byline-avatar img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: block;
}
.byline-name { font-weight: 500; }

.card-byline { font-weight: 500; }

/* ── Writers page ─────────────────────────────────────── */
.writers-page { padding-top: 0.5rem; }

.writers-title {
    font-family: 'DM Serif Display', Georgia, serif;
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.writers-intro {
    color: var(--text-2);
    font-size: 0.9rem;
    line-height: 1.65;
    margin-bottom: 2.5rem;
}

.writers-section { margin-bottom: 2.5rem; }

.writers-section-label {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent);
    margin-bottom: 1rem;
}

.writers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

.writer-card {
    display: flex;
    gap: 1rem;
    padding: 1.25rem;
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    border: 1px solid var(--border);
    transition: all 0.2s;
}
.writer-card:hover {
    border-color: var(--accent);
    background: var(--bg-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.writer-card-featured {
    padding: 1.75rem;
    gap: 1.5rem;
}

.writer-avatar { flex-shrink: 0; }
.writer-avatar svg,
.writer-avatar img {
    border-radius: 50%;
    display: block;
}
.writer-avatar-lg svg,
.writer-avatar-lg img { width: 120px; height: 120px; }
.writer-avatar-xl svg,
.writer-avatar-xl img { width: 160px; height: 160px; }

.author-img { object-fit: cover; }

.writer-info { min-width: 0; }

.writer-name {
    font-family: 'DM Serif Display', Georgia, serif;
    font-size: 1.1rem;
    margin-bottom: 0.15rem;
    color: var(--text);
}
.writer-card-featured .writer-name { font-size: 1.4rem; }

.writer-role {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--accent);
    margin-bottom: 0.5rem;
}

.writer-bio {
    font-size: 0.88rem;
    color: var(--text-2);
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

.writer-bio-short {
    font-size: 0.82rem;
    color: var(--text-3);
    line-height: 1.5;
    margin-bottom: 0.4rem;
}

.writer-post-count {
    font-size: 0.72rem;
    color: var(--text-3);
    font-weight: 500;
}

/* ── Writer profile page ──────────────────────────────── */
.writer-profile { padding-top: 0.5rem; }

.writer-profile-header {
    display: flex;
    gap: 1.75rem;
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border);
}

.writer-profile-name {
    font-family: 'DM Serif Display', Georgia, serif;
    font-size: 2rem;
    margin-bottom: 0.2rem;
}

.writer-profile-bio {
    font-size: 0.95rem;
    color: var(--text-2);
    line-height: 1.7;
    margin-bottom: 0.75rem;
    max-width: 520px;
}

.writer-beats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.75rem;
}

.writer-beat {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 100px;
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-2);
    border: 1px solid var(--border-2);
    transition: all 0.15s;
}
.writer-beat:hover {
    color: var(--accent);
    border-color: var(--accent);
}

.writer-profile-stats {
    font-size: 0.82rem;
    color: var(--text-3);
}

.writer-articles { margin-bottom: 1.5rem; }

/* ── 404 ───────────────────────────────────────────────── */
.not-found {
    text-align: center;
    padding: 6rem 0;
}
.not-found h2 {
    font-family: 'DM Serif Display', Georgia, serif;
    font-size: 5rem;
    color: var(--accent);
    margin-bottom: 0.5rem;
}
.not-found p {
    color: var(--text-2);
    margin-bottom: 1.5rem;
}

.empty-state {
    text-align: center;
    color: var(--text-3);
    padding: 4rem 0;
    font-size: 0.95rem;
}

/* ── Footer ────────────────────────────────────────────── */
.site-footer {
    border-top: 1px solid var(--border);
    padding: 3rem 0 2rem;
    margin-top: auto;
    background: var(--bg-surface);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-brand .footer-logo {
    font-family: 'DM Serif Display', Georgia, serif;
    font-size: 1.15rem;
    margin-bottom: 0.4rem;
}
.footer-brand .footer-desc {
    font-size: 0.82rem;
    color: var(--text-3);
    font-style: italic;
}

.footer-links h4 {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-3);
    margin-bottom: 0.75rem;
}
.footer-links a {
    display: block;
    font-size: 0.85rem;
    color: var(--text-2);
    padding: 0.2rem 0;
    transition: color 0.15s;
}
.footer-links a:hover { color: var(--accent); }

.footer-bottom {
    border-top: 1px solid var(--border);
    padding-top: 1.25rem;
}
.footer-bottom p {
    font-size: 0.75rem;
    color: var(--text-3);
}

/* ── Infinite scroll ───────────────────────────────────── */
.scroll-status {
    display: flex;
    justify-content: center;
    padding: 2rem 0;
    min-height: 60px;
}
.scroll-loading {
    display: flex;
    gap: 6px;
    align-items: center;
}
.scroll-loading span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    animation: scroll-dot 1s ease-in-out infinite;
}
.scroll-loading span:nth-child(2) { animation-delay: 0.15s; }
.scroll-loading span:nth-child(3) { animation-delay: 0.3s; }
@keyframes scroll-dot {
    0%, 80%, 100% { opacity: 0.2; transform: scale(0.8); }
    40% { opacity: 1; transform: scale(1.2); }
}

#scroll-sentinel { height: 1px; }

/* ── Utilities ─────────────────────────────────────────── */
.muted { color: var(--text-3); font-size: 0.82rem; }

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 768px) {
    html { font-size: 14px; }

    .tagline { display: none; }

    .feed-header { flex-direction: column; gap: 0.75rem; }

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

    .featured-card { aspect-ratio: 16 / 10; }
    .featured-title { font-size: 1.3rem; }
    .featured-content { padding: 1.25rem; }

    .article-hero { height: 320px; }
    .article-hero-overlay h1 { font-size: 1.6rem; }
    .article-hero-overlay { padding: 1.5rem; }

    .article-meta { flex-wrap: wrap; gap: 0.5rem; }

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

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .bar-label { width: 90px; font-size: 0.72rem; }

    .log-table .log-msg { max-width: 140px; }

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

    .writer-card-featured { flex-direction: column; align-items: center; text-align: center; }

    .writer-profile-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .writer-profile-name { font-size: 1.5rem; }
    .writer-beats { justify-content: center; }
}

@media (max-width: 400px) {
    .header-inner { gap: 0.5rem; }
    .site-nav { gap: 0.6rem; }
    .category-nav { gap: 0.15rem; }
    .cat-link { padding: 0.25rem 0.5rem; font-size: 0.7rem; }
}
