/* === ARTICLE (LETTERS) ============================================ */
/* Canonical styles for individual letter pages (letters/NNN-slug/).   */
/* Load AFTER global.css, BEFORE any page-specific overrides.          */
/* Extracted 2026-04-18 from 17 per-letter inline <style> blocks.      */

/* --- READING PROGRESS BAR (injected via JS) ---------------------- */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0%;
    background: var(--accent, #76FB56);
    z-index: 9999;
    transition: width 80ms linear;
    will-change: width;
    pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
    .reading-progress { transition: none; }
}

/* --- HERO --------------------------------------------------------- */
.article-hero {
    position: relative;
    padding: 132px 0 56px;
    border-bottom: 1px solid var(--border);
    overflow: hidden;
}
.article-hero::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image:
        linear-gradient(rgba(118, 251, 86, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(118, 251, 86, 0.03) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
}
.article-hero::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(ellipse at center top, transparent 0%, var(--bg) 70%);
    pointer-events: none;
}
.article-hero .container {
    position: relative;
    z-index: 1;
    max-width: 760px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    text-decoration: none;
    margin-bottom: 32px;
    transition: color 0.2s ease, gap 0.2s ease;
}
.back-link:hover {
    color: var(--accent);
    gap: 12px;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}
.article-number {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    color: var(--accent);
    font-weight: 700;
    letter-spacing: 0.08em;
}
.article-date {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: var(--text-muted);
}
.article-date::before {
    content: '·';
    margin-right: 12px;
    color: var(--text-muted);
    opacity: 0.5;
}
.article-tag {
    margin-left: auto;
    border: 1px solid var(--border);
    padding: 4px 10px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.article-title {
    font-size: clamp(34px, 4.2vw, 52px);
    line-height: 1.1;
    margin-bottom: 24px;
    font-weight: 800;
    letter-spacing: -0.025em;
}
.article-excerpt {
    font-size: 19px;
    color: #CFCFCF;
    line-height: 1.6;
    max-width: 62ch;
    font-weight: 400;
}

/* --- BODY --------------------------------------------------------- */
.article-content {
    padding: 64px 0 72px;
    border-bottom: 1px solid var(--border);
}
.article-content .container { max-width: 680px; }

.article-body {
    font-size: 17px;
    line-height: 1.75;
    color: #D1D1D1;
    max-width: 68ch;
    margin: 0 auto;
}
.article-body p { margin-bottom: 22px; }

/* Editorial drop cap on first paragraph */
.article-body > p:first-of-type::first-letter {
    font-family: var(--font-sans, 'Satoshi', sans-serif);
    font-weight: 800;
    float: left;
    font-size: 68px;
    line-height: 0.9;
    padding: 6px 12px 0 0;
    color: #fff;
    letter-spacing: -0.04em;
}

.article-body h2 {
    font-size: 26px;
    color: #fff;
    margin: 48px 0 16px;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.015em;
    position: relative;
    padding-top: 12px;
}
.article-body h2::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 36px;
    height: 2px;
    background: var(--accent, #76FB56);
}
.article-body h3 {
    font-size: 19px;
    color: #fff;
    margin: 36px 0 12px;
    font-weight: 700;
    letter-spacing: -0.005em;
}
.article-body strong {
    color: #fff;
    font-weight: 600;
}
.article-body em {
    color: #EDEDED;
}
.article-body a {
    color: var(--accent, #76FB56);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    transition: color 0.2s ease;
}
.article-body a:hover {
    color: #fff;
}
.article-body blockquote {
    margin: 32px 0;
    padding: 8px 0 8px 24px;
    border-left: 3px solid var(--accent, #76FB56);
    font-style: italic;
    font-size: 19px;
    line-height: 1.6;
    color: #E5E5E5;
}
.article-body ul,
.article-body ol {
    margin: 24px 0;
    padding-left: 24px;
}
.article-body li {
    margin-bottom: 12px;
    color: #D1D1D1;
}
.article-body ul li::marker {
    color: var(--accent, #76FB56);
}

/* --- TL;DR / KEY FINDING ------------------------------------------ */
.article-lead {
    position: relative;
    background: rgba(118, 251, 86, 0.06);
    border-left: 4px solid var(--accent, #76FB56);
    padding: 22px 28px 24px;
    margin: 0 0 36px;
    font-size: 17px;
    line-height: 1.55;
    color: #EDEDED;
}
.article-lead-label {
    display: block;
    font-family: var(--font-mono, 'JetBrains Mono', monospace);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--accent, #76FB56);
    margin-bottom: 10px;
    font-weight: 500;
}
.article-lead p {
    margin: 0;
    color: #fff;
    font-weight: 500;
}
.article-lead p + p {
    margin-top: 10px;
    color: #D1D1D1;
    font-weight: 400;
}

/* --- INLINE BLOCKS ------------------------------------------------ */
.highlight-box {
    position: relative;
    background: rgba(118, 251, 86, 0.04);
    border: 1px solid rgba(118, 251, 86, 0.22);
    border-left-width: 3px;
    padding: 24px 28px;
    margin: 32px 0;
    font-size: 16px;
    color: #EDEDED;
    line-height: 1.6;
}
.highlight-box p { margin-bottom: 12px; }
.highlight-box p:last-child { margin-bottom: 0; }

.failure-list {
    margin: 32px 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.failure-item {
    padding: 18px 22px;
    border-left: 3px solid var(--accent);
    background: rgba(255, 255, 255, 0.025);
    transition: background 0.2s ease, transform 0.2s ease;
}
.failure-item:hover {
    background: rgba(118, 251, 86, 0.04);
}
.failure-item h4 {
    color: #fff;
    font-size: 15px;
    margin-bottom: 6px;
    font-weight: 600;
}
.failure-item p {
    color: var(--text-muted);
    font-size: 14px;
    margin: 0;
    line-height: 1.6;
}

.comparison-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin: 32px 0;
}
.comparison-col {
    padding: 22px 24px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
    transition: border-color 0.2s ease, background 0.2s ease;
}
.comparison-col:hover {
    border-color: rgba(255, 255, 255, 0.2);
}
.comparison-col.accent:hover {
    border-color: rgba(118, 251, 86, 0.5);
}
.comparison-col h4 {
    color: #fff;
    font-size: 14px;
    margin-bottom: 12px;
    font-weight: 600;
}
.comparison-col.accent {
    border-color: rgba(118, 251, 86, 0.3);
    background: rgba(118, 251, 86, 0.03);
}
.comparison-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.comparison-col li {
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 14px;
}
.comparison-col li:last-child { border-bottom: none; }

/* --- AUTHOR BOX --------------------------------------------------- */
.author-box {
    display: flex;
    gap: 18px;
    align-items: center;
    padding: 24px 28px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent, #76FB56);
    margin-top: 56px;
    margin-bottom: 0;
}
.author-avatar {
    width: 52px;
    height: 52px;
    background: var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 800;
    color: #000;
    flex-shrink: 0;
    letter-spacing: -0.02em;
}
.author-info h4 {
    color: #fff;
    font-size: 16px;
    margin-bottom: 4px;
    font-weight: 700;
}
.author-info p {
    color: var(--text-muted);
    font-size: 13px;
    margin: 0;
    line-height: 1.55;
}

/* --- PREV/NEXT NAV ------------------------------------------------ */
.article-nav {
    padding: 48px 0;
    border-bottom: 1px solid var(--border);
}
/* Override legacy inline max-width: 800px on .article-nav .container */
.article-nav .container {
    max-width: 760px !important;
}
.nav-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.nav-item {
    display: block;
    padding: 20px 24px;
    border: 1px solid var(--border);
    text-decoration: none;
    transition: border-color 0.25s ease, background 0.25s ease, transform 0.25s ease;
    position: relative;
    overflow: hidden;
}
.nav-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--accent, #76FB56);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}
.nav-item:hover {
    border-color: var(--accent);
    background: rgba(118, 251, 86, 0.03);
}
.nav-item:hover::before {
    transform: scaleX(1);
}
.nav-item.disabled {
    opacity: 0.3;
    pointer-events: none;
}
.nav-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
    margin-bottom: 8px;
    display: block;
}
.nav-title {
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    display: block;
    transition: color 0.2s ease;
}
.nav-item:hover .nav-title { color: var(--accent); }
.nav-item.next {
    text-align: right;
}
.nav-item.next::before {
    transform-origin: right;
}

/* --- SUBSCRIBE CTA ------------------------------------------------ */
.subscribe-cta {
    padding: 64px 0 80px;
    background: linear-gradient(180deg, transparent 0%, rgba(118, 251, 86, 0.02) 100%);
}
.cta-content {
    max-width: 560px;
    margin: 0 auto;
    text-align: center;
}
.cta-label {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--accent);
    margin-bottom: 20px;
    padding: 6px 12px;
    border: 1px solid rgba(118, 251, 86, 0.3);
    background: rgba(118, 251, 86, 0.05);
}
.cta-title {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 12px;
    color: #fff;
    line-height: 1.2;
}
.cta-desc {
    font-size: 15px;
    color: var(--text-muted);
    margin-bottom: 28px;
    line-height: 1.6;
}

/* --- SUBSCRIBE FORM (letter article context) ---------------------- */
.subscribe-form {
    max-width: 480px;
    margin: 0 auto;
}
.subscribe-form .form-row {
    display: flex;
    gap: 12px;
}
.subscribe-form input[type="email"] {
    flex: 1;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: #fff;
    font-size: 15px;
    font-family: inherit;
    transition: all 0.3s ease;
}
.subscribe-form input[type="email"]:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.08);
}
.subscribe-form input[type="email"]::placeholder { color: #666; }

.subscribe-form .btn-primary {
    padding: 14px 28px;
    background: var(--accent);
    color: #000;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}
.subscribe-form .btn-primary:hover { background: #fff; }

.form-message {
    margin-top: 16px;
    font-size: 14px;
    min-height: 20px;
}
.form-message.success { color: var(--accent); }
.form-message.error { color: #ff6b6b; }

/* --- RESPONSIVE --------------------------------------------------- */
@media (max-width: 768px) {
    .article-hero { padding: 108px 0 40px; }
    .article-title { font-size: 28px; }
    .article-excerpt { font-size: 16px; }
    .article-body { font-size: 16px; }
    .article-body h2 { font-size: 22px; margin: 36px 0 14px; }
    .article-body h3 { font-size: 18px; }
    .article-body > p:first-of-type::first-letter {
        font-size: 52px;
        padding: 4px 10px 0 0;
    }
    .article-meta { gap: 8px; margin-bottom: 20px; padding-bottom: 16px; }
    .article-tag { margin-left: 0; }
    .nav-grid { grid-template-columns: 1fr; }
    .nav-item.next { text-align: left; }
    .nav-item.next::before { transform-origin: left; }
    .author-box { flex-direction: column; text-align: center; gap: 12px; padding: 24px; }
    .subscribe-form .form-row { flex-direction: column; }
    .subscribe-form .btn-primary { width: 100%; }
    .comparison-grid { grid-template-columns: 1fr; }
    .cta-title { font-size: 22px; }
    .subscribe-cta { padding: 48px 0 56px; }
    .highlight-box { padding: 20px; }
    .failure-item { padding: 16px 18px; }
}
