/* ──────────────────────────────────────────────────────────────────────────
   Blog stylesheet — shared across blog/index.html and individual posts.
   Mirrors the design tokens used elsewhere on headroomstudio.dev.
   ────────────────────────────────────────────────────────────────────────── */

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

:root {
    --bg:           #0b0b0f;
    --bg-card:      #111118;
    --border:       #1c1c28;
    --border-hover: #28283a;
    --text:         #eeeef6;
    --text-2:       #a8a8c0;
    --text-3:       #6e6e90;
    --text-4:       #3a3a52;
    --accent:       #7c84f6;
    --accent-soft:  #a0aaff;
    --accent-dim:   rgba(124, 132, 246, 0.14);
    --green:        #3ecf7c;
    --amber:        #d8a04c;
    --radius-card:  16px;
    --radius-btn:   9px;
    --radius-badge: 5px;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.65;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ─── Nav ─── */

nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 28px 0;
}

.brand {
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--text);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-mark { width: 28px; height: 28px; color: #c8c6f0; }
.brand-word { font-weight: 600; color: #c8c6f0; }
.brand-word span { font-weight: 500; color: #7a78a8; }

.nav-back {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-3);
    text-decoration: none;
    transition: color 0.18s;
}

.nav-back:hover { color: var(--text); }
.nav-back svg { width: 14px; height: 14px; }

/* ─── Article header ─── */

.article-header {
    padding: 56px 0 28px;
}

.article-eyebrow {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 14px;
}

.article-header h1 {
    font-size: clamp(1.7rem, 4vw, 2.3rem);
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.2;
    color: var(--text);
    margin-bottom: 14px;
}

.article-subtitle {
    font-size: 1.1rem;
    color: var(--text-2);
    line-height: 1.55;
    font-weight: 400;
    margin-bottom: 22px;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.8125rem;
    color: var(--text-3);
}

.article-meta .dot {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--text-4);
}

.article-meta a {
    color: var(--text-3);
    text-decoration: none;
}

.article-meta a:hover { color: var(--text-2); }

/* ─── Article body ─── */

.article {
    padding: 0 0 64px;
    font-size: 1.0625rem;
    color: var(--text-2);
    line-height: 1.75;
}

.article p {
    margin-bottom: 22px;
}

.article p + p { margin-top: 0; }

.article h2 {
    font-size: 1.4rem;
    font-weight: 650;
    letter-spacing: -0.02em;
    color: var(--text);
    line-height: 1.35;
    margin: 44px 0 18px;
}

.article h3 {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text);
    margin: 32px 0 12px;
}

.article a {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px solid rgba(124, 132, 246, 0.3);
    transition: color 0.18s, border-color 0.18s;
}

.article a:hover {
    color: var(--accent-soft);
    border-color: rgba(160, 170, 255, 0.55);
}

.article strong {
    color: var(--text);
    font-weight: 600;
}

.article em { font-style: italic; }

.article code {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.88em;
    color: var(--text);
    background: rgba(255, 255, 255, 0.045);
    padding: 1px 6px;
    border-radius: 4px;
    border: 1px solid var(--border);
}

.article ul, .article ol {
    margin: 0 0 22px 22px;
    padding: 0;
}

.article li {
    margin-bottom: 8px;
}

.article ul li::marker { color: var(--text-4); }
.article ol li::marker { color: var(--text-3); font-weight: 600; }

.article blockquote {
    margin: 28px 0;
    padding: 4px 0 4px 18px;
    border-left: 2px solid var(--accent);
    color: var(--text);
    font-style: italic;
    font-size: 1.05rem;
    line-height: 1.6;
}

.article blockquote p { margin-bottom: 8px; }
.article blockquote p:last-child { margin-bottom: 0; }

/* ─── Inline figure ─── */

.figure {
    margin: 32px 0;
}

.figure img {
    display: block;
    width: 100%;
    border-radius: 12px;
    border: 1px solid var(--border);
    cursor: zoom-in;
    transition: opacity 0.18s;
}

.figure img:hover { opacity: 0.88; }

.figure figcaption {
    margin-top: 10px;
    font-size: 0.85rem;
    color: var(--text-3);
    text-align: center;
    line-height: 1.5;
    font-style: italic;
}

/* ─── Data table ─── */

.article .data-table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0 28px;
    font-size: 0.95rem;
}

.article .data-table th {
    text-align: left;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-3);
    padding: 8px 14px 8px 0;
    border-bottom: 1px solid var(--border);
}

.article .data-table td {
    color: var(--text-2);
    padding: 10px 14px 10px 0;
    border-bottom: 1px solid rgba(28, 28, 40, 0.6);
    vertical-align: top;
}

.article .data-table td:first-child {
    color: var(--text);
    font-weight: 500;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

/* ─── Callout ─── */

.callout {
    margin: 28px 0;
    padding: 16px 20px;
    border-radius: 10px;
    background: var(--accent-dim);
    border: 1px solid rgba(124, 132, 246, 0.22);
    font-size: 0.95rem;
    color: var(--text);
    line-height: 1.6;
}

.callout strong { color: var(--text); }

/* ─── Footnote / kicker ─── */

.kicker {
    margin: 48px 0 0;
    padding: 20px 0 0;
    border-top: 1px solid var(--border);
    font-size: 0.85rem;
    color: var(--text-3);
    line-height: 1.6;
}

.kicker a { color: var(--accent); text-decoration: none; }

/* ─── Related posts ─── */

.related {
    padding: 32px 0 12px;
    border-top: 1px solid var(--border);
}

.related-label {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-3);
    margin-bottom: 16px;
}

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

.related-list li {
    margin-bottom: 0;
}

.related-list a {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    text-decoration: none;
    transition: color 0.18s;
}

.related-list li:first-child a { border-top: 1px solid var(--border); }

.related-list a:hover { color: var(--accent-soft); }

.related-list .arrow {
    color: var(--text-4);
    font-size: 0.95rem;
    transition: color 0.18s;
}

.related-list a:hover .arrow { color: var(--accent); }

/* ─── Footer ─── */

footer {
    padding: 28px 0 52px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.footer-copy { font-size: 0.8125rem; color: var(--text-4); }

.footer-links { display: flex; gap: 22px; list-style: none; padding: 0; }

.footer-links a {
    font-size: 0.8rem;
    color: var(--text-4);
    text-decoration: none;
    transition: color 0.18s;
}

.footer-links a:hover { color: var(--text-2); }

/* ─── Lightbox ─── */

.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
    backdrop-filter: blur(6px);
}

.lightbox.active { display: flex; }

.lightbox img {
    max-width: 92vw;
    max-height: 90vh;
    border-radius: 12px;
    box-shadow: 0 32px 80px rgba(0,0,0,0.6);
    object-fit: contain;
}

/* ─── Blog index ─── */

.blog-hero {
    padding: 56px 0 16px;
}

.blog-hero h1 {
    font-size: clamp(1.7rem, 4vw, 2.2rem);
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.2;
    color: var(--text);
    margin-bottom: 12px;
}

.blog-hero p {
    font-size: 1.05rem;
    color: var(--text-2);
    line-height: 1.6;
    max-width: 580px;
}

.post-list {
    padding: 32px 0 64px;
    display: flex;
    flex-direction: column;
    gap: 0;
    list-style: none;
    margin: 0;
}

.post-card {
    padding: 28px 0;
    border-bottom: 1px solid var(--border);
}

.post-card:first-child { border-top: 1px solid var(--border); }

.post-card a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.post-tag {
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 10px;
}

.post-card h2 {
    font-size: 1.3rem;
    font-weight: 650;
    letter-spacing: -0.02em;
    color: var(--text);
    line-height: 1.3;
    margin-bottom: 8px;
    transition: color 0.18s;
}

.post-card a:hover h2 { color: var(--accent-soft); }

.post-card p {
    font-size: 0.95rem;
    color: var(--text-2);
    line-height: 1.6;
    margin-bottom: 12px;
}

.post-card .meta {
    font-size: 0.78rem;
    color: var(--text-4);
    display: flex;
    gap: 10px;
    align-items: center;
}

.post-card .meta .dot {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--text-4);
}

/* ─── Responsive ─── */

@media (max-width: 560px) {
    .article-header { padding: 36px 0 20px; }
    .article-header h1 { font-size: 1.55rem; }
    .article-subtitle { font-size: 1rem; }
    .article { font-size: 1rem; line-height: 1.7; }
    .article h2 { font-size: 1.2rem; }
}
