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

html, body {
    background: #0b1220;
    color: #d4dbe8;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", sans-serif;
    line-height: 1.55;
}

.topbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 28px; background: #0a101c; border-bottom: 1px solid #1a2236;
}
.brand { display: flex; align-items: center; gap: 10px; color: #e6edf8; text-decoration: none; font-weight: 700; letter-spacing: 0.01em; }
.brand-mark { color: #4fa3ff; font-size: 22px; }
.brand-name { font-size: 15px; }
.nav { display: flex; gap: 22px; }
.nav a { color: #8a96ad; text-decoration: none; font-size: 13px; }
.nav a:hover { color: #e6edf8; }

.hero {
    padding: 80px 28px 60px; text-align: center;
    background: radial-gradient(ellipse at top, #14213a 0%, #0b1220 60%);
}
.hero h1 { font-size: 38px; line-height: 1.2; color: #e6edf8; max-width: 820px; margin: 0 auto 18px; font-weight: 700; }
.hero-sub { font-size: 16px; color: #8a96ad; max-width: 640px; margin: 0 auto 28px; }
.cta {
    display: inline-block; padding: 12px 28px; background: #4fa3ff; color: #0b1220;
    text-decoration: none; border-radius: 6px; font-weight: 600; font-size: 14px;
}
.cta:hover { background: #6db4ff; }

.latest, .topics, .newsletter { max-width: 1100px; margin: 0 auto; padding: 60px 28px; }
.latest h2, .topics h2, .newsletter h2 { font-size: 22px; color: #e6edf8; margin-bottom: 24px; font-weight: 600; }

.article-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
.article-card {
    display: block; padding: 22px; background: #0f1828; border: 1px solid #1a2236;
    border-radius: 8px; text-decoration: none; transition: border-color 0.2s, transform 0.2s;
}
.article-card:hover { border-color: #4fa3ff; transform: translateY(-2px); }
.article-tag { font-size: 11px; color: #4fa3ff; letter-spacing: 0.08em; margin-bottom: 8px; }
.article-card h3 { color: #e6edf8; font-size: 16px; line-height: 1.4; margin-bottom: 10px; font-weight: 600; }
.article-meta { color: #687389; font-size: 12px; }

.topics-list { list-style: none; }
.topics-list li { padding: 10px 0; border-bottom: 1px solid #1a2236; color: #b6becd; font-size: 14px; }
.topics-list li:last-child { border-bottom: none; }
.topics-list strong { color: #e6edf8; margin-right: 6px; }

.newsletter p { color: #8a96ad; margin-bottom: 20px; }
#subscribe-form { display: flex; gap: 8px; max-width: 480px; }
#subscribe-form input {
    flex: 1; padding: 11px 14px; background: #0f1828; border: 1px solid #1a2236;
    color: #e6edf8; border-radius: 6px; font-size: 14px;
}
#subscribe-form input:focus { outline: none; border-color: #4fa3ff; }
#subscribe-form button {
    padding: 11px 22px; background: #4fa3ff; color: #0b1220; border: none;
    border-radius: 6px; font-weight: 600; cursor: pointer; font-size: 14px;
}
.toast { margin-top: 14px; min-height: 20px; color: #4fa3ff; font-size: 13px; }

.footer { padding: 30px 28px; background: #0a101c; border-top: 1px solid #1a2236; }
.footer-cols { max-width: 1100px; margin: 0 auto; display: flex; justify-content: space-between; color: #687389; font-size: 12px; }
.footer-cols a { color: #8a96ad; text-decoration: none; }
.footer-cols a:hover { color: #e6edf8; }

.modal-backdrop {
    position: fixed; inset: 0; background: rgba(0,0,0,0.7);
    display: flex; align-items: center; justify-content: center; z-index: 1000;
}
.modal-backdrop[hidden] { display: none; }
.modal { background: #0f1828; border: 1px solid #1a2236; border-radius: 10px; padding: 28px; min-width: 360px; }
.modal-header { color: #e6edf8; font-size: 16px; font-weight: 600; margin-bottom: 12px; }
.modal-help { color: #8a96ad; font-size: 13px; margin-bottom: 18px; }
#pw-form { display: flex; gap: 8px; }
#pw-form input {
    flex: 1; padding: 10px 12px; background: #0a101c; border: 1px solid #1a2236;
    color: #e6edf8; border-radius: 6px; font-size: 14px;
}
#pw-form button {
    padding: 10px 20px; background: #4fa3ff; color: #0b1220; border: none;
    border-radius: 6px; font-weight: 600; cursor: pointer; font-size: 14px;
}
.modal-err { margin-top: 10px; color: #f85149; font-size: 13px; min-height: 18px; }

@media (max-width: 640px) {
    .hero h1 { font-size: 28px; }
    .nav { gap: 14px; }
    .footer-cols { flex-direction: column; gap: 8px; text-align: center; }
}

/* ── Pro polish: smooth scroll, optical sizing ───────────────────── */
html { scroll-behavior: smooth; }
body { font-feature-settings: "liga" 1, "kern" 1; text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { letter-spacing: -0.01em; }

/* ── Refined typography (drop cap, pull quote, article body) ─────── */
.article-body > p:first-of-type::first-letter {
    font-size: 3.6em;
    line-height: 0.9;
    float: left;
    padding: 4px 12px 0 0;
    color: #4fa3ff;
    font-weight: 700;
    font-feature-settings: "lnum" 1;
}

blockquote.pull {
    border-left: 3px solid #4fa3ff;
    padding: 4px 0 4px 22px;
    margin: 32px 0;
    color: #e6edf8;
    font-size: 19px;
    line-height: 1.45;
    font-style: italic;
    font-weight: 500;
    letter-spacing: -0.005em;
}

.article-body {
    color: #b6becd;
    font-size: 16px;
    line-height: 1.75;
    letter-spacing: 0.005em;
}
.article-body p { margin-bottom: 20px; }
.article-body strong { color: #e6edf8; }
.article-body a { color: #4fa3ff; }

.article-diagram {
    background: #0f1828;
    border: 1px solid #1a2236;
    border-radius: 8px;
    padding: 28px 24px 22px;
    margin: 32px 0;
    text-align: center;
}
.article-diagram svg { max-width: 100%; height: auto; display: block; margin: 0 auto; }
.article-diagram-caption {
    color: #687389;
    font-size: 12.5px;
    margin-top: 16px;
    text-align: center;
    font-style: italic;
    line-height: 1.5;
}

/* ── Byline avatar (initials-in-circle) ───────────────────────────── */
.byline-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    color: #e6edf8;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
    margin-right: 10px;
    vertical-align: middle;
}
.byline-name { vertical-align: middle; color: #c9d1d9; font-weight: 500; }
.byline-meta { color: #687389; font-size: 12px; margin-left: 10px; vertical-align: middle; }

/* ── Issue masthead (cover + articles) ────────────────────────────── */
.issue-masthead {
    display: inline-block;
    padding: 5px 13px;
    background: #14213a;
    color: #4fa3ff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    border-radius: 4px;
    margin-bottom: 18px;
}

/* ── Two-column featured + latest grid (homepage) ─────────────────── */
.featured-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: 40px;
    max-width: 1100px;
    margin: 0 auto;
    padding: 60px 28px;
}
.featured-grid h2 {
    font-size: 13px;
    color: #687389;
    margin-bottom: 22px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding-bottom: 12px;
    border-bottom: 1px solid #1a2236;
}

.featured-card {
    display: block;
    padding: 30px 32px;
    background: #0f1828;
    border: 1px solid #1a2236;
    border-radius: 10px;
    text-decoration: none;
    transition: border-color 0.25s, transform 0.25s;
}
.featured-card:hover {
    border-color: #4fa3ff;
    transform: translateY(-3px);
}
.featured-card .article-tag {
    font-size: 11px;
    color: #4fa3ff;
    letter-spacing: 0.1em;
    margin-bottom: 14px;
    font-weight: 600;
}
.featured-card h3 {
    color: #e6edf8;
    font-size: 27px;
    line-height: 1.25;
    margin-bottom: 16px;
    font-weight: 700;
    letter-spacing: -0.015em;
}
.featured-card .featured-teaser {
    color: #8a96ad;
    font-size: 14.5px;
    line-height: 1.7;
    margin-bottom: 20px;
}
.featured-diagram {
    background: #0a101c;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 22px;
    text-align: center;
}
.featured-diagram img, .featured-diagram svg { max-width: 100%; height: auto; display: block; margin: 0 auto; }

.latest-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.latest-list a.latest-item {
    display: block;
    padding: 16px 0;
    border-bottom: 1px solid #1a2236;
    text-decoration: none;
    transition: padding-left 0.18s, border-color 0.2s;
}
.latest-list a.latest-item:hover {
    padding-left: 8px;
    border-color: #243049;
}
.latest-list a.latest-item:last-child {
    border-bottom: none;
}
.latest-list .article-tag { font-size: 10px; color: #4fa3ff; letter-spacing: 0.1em; font-weight: 600; }
.latest-list h4 {
    color: #e6edf8;
    font-size: 14.5px;
    line-height: 1.4;
    margin: 5px 0;
    font-weight: 600;
    letter-spacing: -0.005em;
}
.latest-list .latest-meta {
    color: #687389;
    font-size: 11.5px;
}

/* ── Article header block (above the body) ────────────────────────── */
.article-header {
    max-width: 720px;
    margin: 0 auto;
    padding: 64px 28px 28px;
    border-bottom: 1px solid #1a2236;
}
.article-header h1 {
    color: #e6edf8;
    font-size: 34px;
    line-height: 1.2;
    margin: 14px 0;
    font-weight: 700;
    letter-spacing: -0.02em;
}
.article-header .article-tag {
    font-size: 11px;
    color: #4fa3ff;
    letter-spacing: 0.1em;
    font-weight: 600;
}
.article-header .byline-row {
    margin-top: 20px;
    font-size: 13px;
}

.article-main {
    max-width: 720px;
    margin: 0 auto;
    padding: 40px 28px 60px;
}

/* ── Archive page ─────────────────────────────────────────────────── */
.archive-wrap { max-width: 880px; margin: 0 auto; padding: 64px 28px; }
.archive-wrap h1 {
    color: #e6edf8;
    font-size: 30px;
    margin-bottom: 36px;
    font-weight: 700;
    letter-spacing: -0.015em;
}
.archive-wrap > p.archive-sub {
    color: #8a96ad;
    font-size: 14px;
    margin-bottom: 36px;
    margin-top: -28px;
}
.archive-month {
    margin-bottom: 36px;
}
.archive-month-label {
    color: #687389;
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-weight: 700;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid #1a2236;
}
.archive-issue {
    display: block;
    padding: 16px 0;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid #1a2236;
    transition: padding-left 0.18s;
}
.archive-issue:hover { padding-left: 8px; }
.archive-issue:last-child { border-bottom: none; }
.archive-issue-num {
    color: #4fa3ff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    margin-right: 14px;
}
.archive-issue h3 {
    display: inline;
    color: #e6edf8;
    font-size: 15.5px;
    font-weight: 600;
    letter-spacing: -0.005em;
}
.archive-issue p {
    color: #8a96ad;
    font-size: 13px;
    margin-top: 8px;
    line-height: 1.6;
}

@media (max-width: 760px) {
    .featured-grid {
        grid-template-columns: 1fr;
        gap: 36px;
    }
    .featured-card h3 { font-size: 23px; }
    .article-header h1 { font-size: 26px; }
    .archive-wrap h1 { font-size: 24px; }
}
