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

:root {
    --bg: #fafbfc;
    --text: #1e293b;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --accent: #1e293b;
    --accent-gold: #3b5998;
    --border: #e2e8f0;
    --alpha-bg: #f1f5f9;
    --alpha-border: #94a3b8;
    --surface-elevated: rgba(255, 255, 255, 0.78);
    --surface-elevated-hover: rgba(255, 255, 255, 0.92);
    --nav-bg: rgba(250, 251, 252, 0.92);
    --nav-border: rgba(226, 232, 240, 0.68);
    --deco-num: rgba(148, 163, 184, 0.22);
    --nav-h: 50px;
    --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --serif: 'Benne', Georgia, 'Times New Roman', serif;
}

body.blog-site[data-theme='dark'] {
    --bg: #0c1019;
    --text: #e5ebf5;
    --text-secondary: #a7b3c7;
    --text-muted: #718198;
    --accent: #f4f7fb;
    --accent-gold: #7ea5ff;
    --border: #202b3d;
    --alpha-bg: #121a2a;
    --alpha-border: #55617a;
    --surface-elevated: rgba(17, 25, 40, 0.78);
    --surface-elevated-hover: rgba(19, 30, 47, 0.9);
    --nav-bg: rgba(12, 16, 25, 0.92);
    --nav-border: rgba(32, 43, 61, 0.88);
    --deco-num: rgba(113, 129, 152, 0.2);
}

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

body.blog-site {
    font-family: var(--serif);
    color: var(--text);
    background: var(--bg);
    line-height: 1.7;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

#progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-gold), var(--accent));
    z-index: 1002;
    transition: width 0.08s linear;
}

.blog-nav {
    position: sticky;
    top: 0;
    z-index: 1000;
    height: var(--nav-h);
    background: var(--nav-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--nav-border);
}

.nav-inner {
    max-width: 1100px;
    margin: 0 auto;
    height: 100%;
    padding: 0 1.2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-title {
    font-family: var(--sans);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--accent);
    text-decoration: none;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.nav-link-secondary {
    font-family: var(--sans);
    font-size: 0.64rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s ease;
}

.nav-link-secondary:hover {
    color: var(--accent);
}

.theme-toggle {
    font-family: var(--sans);
    font-size: 0.64rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: 999px;
    background: transparent;
    padding: 0.24rem 0.65rem;
    cursor: pointer;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.theme-toggle:hover {
    color: var(--accent);
    border-color: var(--accent-gold);
}

.nav-toggle {
    display: none;
    border: 0;
    background: none;
    color: var(--accent);
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
    padding: 0.2rem;
}

.mobile-drawer-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1100;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.mobile-drawer-overlay.open {
    display: block;
    opacity: 1;
}

.mobile-drawer {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(320px, 85vw);
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    background: var(--bg);
    border-right: 1px solid var(--border);
    z-index: 1101;
    padding: 1.5rem;
    overflow-y: auto;
}

.mobile-drawer.open {
    transform: translateX(0);
}

.mobile-drawer-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    border: 0;
    background: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.4rem;
    line-height: 1;
}

.mobile-drawer-title {
    font-family: var(--sans);
    font-size: 0.64rem;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 1.3rem;
}

.mobile-drawer-links {
    list-style: none;
}

.mobile-drawer-links a {
    display: block;
    text-decoration: none;
    color: var(--text-secondary);
    font-family: var(--sans);
    font-size: 0.84rem;
    border-bottom: 1px solid var(--border);
    padding: 0.7rem 0;
}

.hero {
    min-height: 70svh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    padding: 3rem 1.5rem 2.2rem;
}

.hero-label {
    font-family: var(--sans);
    font-size: 0.64rem;
    letter-spacing: 0.38em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 1.4rem;
}

.hero h1 {
    font-size: clamp(2.4rem, 8vw, 3.8rem);
    line-height: 1.1;
    letter-spacing: 0.06em;
    font-weight: normal;
    color: var(--accent);
    margin-bottom: 0.16em;
}

.hero .subtitle {
    max-width: 780px;
    margin: 0 auto 0.95rem;
    color: var(--text-secondary);
    font-size: clamp(1.2rem, 3.3vw, 1.62rem);
    line-height: 1.25;
}

.hero-rule {
    width: 62px;
    border: 0;
    border-top: 2px solid var(--accent-gold);
    margin: 1.8rem auto;
}

.hero-intro {
    max-width: 700px;
    margin: 0 auto;
    text-align: left;
    font-size: 1.02rem;
    color: var(--text-secondary);
}

.toc-section {
    max-width: 780px;
    margin: 0 auto;
    padding: 0 1.5rem 2.8rem;
}

.toc-section h2 {
    font-family: var(--sans);
    font-size: 0.65rem;
    letter-spacing: 0.35em;
    text-transform: uppercase;
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 2rem;
    font-weight: 500;
}

.toc-list {
    list-style: none;
}

.toc-list > li {
    border-top: 1px solid var(--border);
    padding: 1.2rem 0;
}

.toc-list > li:last-child {
    border-bottom: 1px solid var(--border);
}

.toc-list > li > a {
    display: block;
    text-decoration: none;
    color: var(--text);
    transition: color 0.2s ease;
}

.toc-list > li > a:hover {
    color: var(--text-muted);
}

.toc-chapter-num {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-family: var(--sans);
    font-size: 0.69rem;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
    text-transform: uppercase;
}

.toc-chapter-title {
    display: block;
    font-size: 1.28rem;
    line-height: 1.3;
    margin-bottom: 0.28rem;
}

.toc-chapter-desc {
    display: block;
    font-size: 0.83rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.toc-row-meta {
    display: flex;
    gap: 0.65rem;
    flex-wrap: wrap;
    margin-top: 0.55rem;
    font-family: var(--sans);
    font-size: 0.63rem;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.toc-action-row {
    margin-top: 0.8rem;
    font-family: var(--sans);
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent-gold);
}

.toc-action-row a {
    text-decoration: none;
    color: var(--accent-gold);
}

.content {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 1.5rem 4rem;
}

.chapter {
    padding-top: 4rem;
    margin-bottom: 2.8rem;
    position: relative;
}

.chapter-deco-num {
    display: block;
    font-family: var(--sans);
    font-size: 6.3rem;
    line-height: 1;
    font-weight: 700;
    color: var(--deco-num);
    letter-spacing: -0.02em;
    margin-bottom: -1.3rem;
    pointer-events: none;
    user-select: none;
}

.chapter-label {
    font-family: var(--sans);
    font-size: 0.65rem;
    letter-spacing: 0.34em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.7rem;
}

.post-title {
    font-size: clamp(1.85rem, 5vw, 2.6rem);
    line-height: 1.15;
    font-weight: normal;
    color: var(--accent);
    margin-bottom: 0.65rem;
}

.post-excerpt {
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

.post-meta {
    font-family: var(--sans);
    font-size: 0.66rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-bottom: 1rem;
}

.chapter-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.9rem;
    font-family: var(--sans);
    font-size: 0.66rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 2rem;
}

.chapter-actions a {
    text-decoration: none;
    color: var(--accent-gold);
}

.article-body h2 {
    font-size: 1.95rem;
    line-height: 1.2;
    font-weight: normal;
    color: var(--accent);
    margin: 1.85rem 0 0.82rem;
}

.article-body p {
    margin-bottom: 1.05rem;
    color: var(--text-secondary);
}

.article-body figure {
    margin: 1.35rem 0 1.6rem;
}

.article-body figure img {
    display: block;
    width: 100%;
    height: auto;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--alpha-bg);
}

.article-body figcaption {
    margin-top: 0.5rem;
    font-family: var(--sans);
    font-size: 0.72rem;
    letter-spacing: 0.02em;
    color: var(--text-muted);
    line-height: 1.45;
}

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

.article-body blockquote {
    background: var(--alpha-bg);
    border-left: 3px solid var(--alpha-border);
    padding: 1rem 1.2rem;
    margin: 1.35rem 0;
    border-radius: 0 6px 6px 0;
}

.article-body ul,
.article-body ol {
    margin: 0.95rem 0 1.1rem 1.45rem;
    color: var(--text-secondary);
}

.article-body li {
    margin-bottom: 0.35rem;
}

.section-rule {
    max-width: 720px;
    margin: 0 auto 1.4rem;
    border: 0;
    border-top: 1px solid var(--border);
}

.page-footer {
    border-top: 1px solid var(--border);
    margin-top: 2rem;
    padding: 1.6rem 1.5rem 2rem;
}

.page-footer p {
    max-width: 780px;
    margin: 0 auto;
    font-family: var(--sans);
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    text-align: center;
}

.empty-state {
    color: var(--text-muted);
    font-family: var(--sans);
    font-size: 0.82rem;
}

@media (max-width: 900px) {
    .nav-link-secondary {
        display: none;
    }

    .nav-toggle {
        display: inline-block;
    }
}

@media (max-width: 767px) {
    html {
        font-size: 17px;
    }

    .hero {
        min-height: 62svh;
        padding-top: 2.4rem;
    }

    .hero-intro {
        text-align: left;
    }

    .toc-chapter-title {
        font-size: 1.12rem;
    }

    .chapter {
        padding-top: 3rem;
    }

    .chapter-deco-num {
        font-size: 4.3rem;
    }

    .theme-toggle-label {
        display: none;
    }
}
