:root {
    --bg: #050505;
    --panel: #111;
    --ink: #f6f6f2;
    --muted: #a7a7a2;
    --line: #2a2a28;
    --accent: #d31f2b;
    --accent-dark: #8f121c;
    --max: 1120px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.6;
}

a {
    color: inherit;
    text-decoration-color: var(--accent);
    text-underline-offset: 0.18em;
}

a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 4px;
}

.skip-link {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 100;
    transform: translateY(-160%);
    padding: 10px 14px;
    border-radius: 4px;
    background: var(--ink);
    color: var(--bg);
    font-weight: 800;
    text-decoration: none;
}

.skip-link:focus {
    transform: translateY(0);
}

.wrap {
    width: min(var(--max), calc(100% - 40px));
    margin-inline: auto;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 72px;
    padding: 0 28px;
    border-bottom: 1px solid var(--line);
    background: rgba(5, 5, 5, 0.92);
    backdrop-filter: blur(14px);
}

.site-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-weight: 800;
    letter-spacing: 0;
    text-decoration: none;
    white-space: nowrap;
}

.brand-mark {
    width: 16px;
    height: 16px;
    border-left: 8px solid var(--accent);
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 24px;
    color: var(--muted);
    font-size: 0.95rem;
    font-weight: 700;
}

.site-nav a {
    text-decoration: none;
}

.site-nav a:hover,
.site-nav .current-lang a {
    color: var(--ink);
}

.language-switcher {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 32px;
    padding-left: 18px;
    border-left: 1px solid var(--line);
    text-transform: uppercase;
    font-size: 0.82rem;
    font-weight: 700;
}

.language-switcher ul {
    display: flex;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.nav-toggle {
    display: none;
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: transparent;
    color: var(--ink);
    cursor: pointer;
}

.nav-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    margin: 5px auto;
    background: currentColor;
}

.hero {
    position: relative;
    min-height: 620px;
    display: grid;
    align-items: center;
    overflow: hidden;
    border-bottom: 1px solid var(--line);
}

.hero-grid {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(211, 31, 43, 0.12) 1px, transparent 1px),
        linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px);
    background-size: 88px 88px;
    mask-image: linear-gradient(90deg, black, transparent 72%);
}

.hero::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 6px;
    background: linear-gradient(90deg, var(--accent), transparent);
}

.hero-content {
    position: relative;
    max-width: 860px;
    margin-left: max(20px, calc((100vw - var(--max)) / 2));
}

.eyebrow {
    margin: 0 0 16px;
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

h1,
h2,
h3,
p {
    overflow-wrap: anywhere;
}

h1,
h2,
h3 {
    line-height: 1.05;
    margin: 0;
}

h1 {
    max-width: 900px;
    font-size: clamp(3rem, 7vw, 6.8rem);
}

h2 {
    font-size: clamp(1.7rem, 3vw, 3rem);
}

h3 {
    font-size: 1.25rem;
}

.subtitle {
    max-width: 720px;
    margin: 24px 0 0;
    color: #deded8;
    font-size: clamp(1.1rem, 2vw, 1.45rem);
}

.intro {
    max-width: 780px;
    margin: 20px 0 0;
    color: var(--muted);
    font-size: 1.02rem;
}

.cta-row,
.section-head,
.split,
.contact-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.cta-row {
    justify-content: flex-start;
    flex-wrap: wrap;
    margin-top: 34px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 18px;
    border: 1px solid var(--line);
    border-radius: 4px;
    font-weight: 800;
    text-decoration: none;
    transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.button.primary {
    border-color: var(--accent);
    background: var(--accent);
    color: #fff;
}

.button.secondary:hover,
.button.primary:hover {
    border-color: var(--accent-dark);
    background: var(--accent-dark);
    color: #fff;
}

.section {
    padding: 74px 0;
}

.section.alt {
    background: #0d0d0c;
    border-block: 1px solid var(--line);
}

.section-head {
    margin-bottom: 30px;
}

.post-grid,
.resource-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.resource-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.post-card,
.resource-block,
.list-item {
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--panel);
}

.post-card,
.resource-block {
    padding: 24px;
}

.post-card time,
.list-item time,
.byline {
    color: var(--muted);
    font-size: 0.88rem;
}

.empty-state {
    margin: 0;
    padding: 28px;
    border-left: 4px solid var(--accent);
    background: var(--panel);
    color: #deded8;
}

.page-hero {
    padding: 86px 0 36px;
}

.page-content {
    padding-top: 34px;
}

.post-list {
    display: grid;
    gap: 18px;
}

.list-item {
    padding: 26px;
}

.list-item h2 {
    margin-top: 8px;
    font-size: clamp(1.4rem, 2vw, 2rem);
}

.article {
    width: min(820px, calc(100% - 40px));
    padding: 82px 0 92px;
}

.article-header {
    max-width: 820px;
    padding-bottom: 30px;
    border-bottom: 1px solid var(--line);
}

.article-header h1 {
    max-width: 820px;
    font-size: clamp(2.35rem, 5vw, 4.8rem);
    line-height: 1.02;
}

.article-deck {
    max-width: 780px;
    margin: 22px 0 0;
    color: #c9c9c1;
    font-size: clamp(1.15rem, 2.2vw, 1.38rem);
    line-height: 1.55;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    margin-top: 24px;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 700;
}

.article-meta span,
.article-meta time {
    display: inline-flex;
    align-items: center;
}

.article-meta time::before {
    content: "";
    width: 5px;
    height: 5px;
    margin-right: 18px;
    border-radius: 50%;
    background: var(--accent);
}

.article-toc {
    max-width: 780px;
    margin-top: 32px;
    padding: 22px 24px;
    border-left: 4px solid var(--accent);
    background: #0d0d0c;
}

.article-toc h2 {
    font-size: 1rem;
    text-transform: uppercase;
    color: var(--ink);
}

.article-toc ol {
    display: grid;
    gap: 10px;
    margin: 16px 0 0;
    padding-left: 22px;
    color: var(--muted);
}

.article-toc a {
    text-decoration: none;
}

.article-toc a:hover {
    color: var(--ink);
    text-decoration: underline;
    text-decoration-color: var(--accent);
}

.article-body {
    max-width: 780px;
    padding-top: 42px;
    color: #e5e5df;
    font-size: 1.1rem;
    line-height: 1.78;
}

.article-body p {
    margin: 0 0 1.45em;
}

.article-body h2 {
    margin: 2.4em 0 0.85em;
    padding-top: 0.15em;
    color: var(--ink);
    font-size: clamp(1.55rem, 3vw, 2.25rem);
    line-height: 1.16;
}

.article-body h2:first-child {
    margin-top: 0;
}

.article-body h2::before {
    content: "";
    display: block;
    width: 42px;
    height: 3px;
    margin-bottom: 16px;
    background: var(--accent);
}

.article-footer {
    max-width: 780px;
    margin-top: 52px;
    padding-top: 28px;
    border-top: 1px solid var(--line);
}

.back-link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    color: var(--ink);
    font-weight: 800;
    text-decoration: none;
}

.back-link::before {
    content: "";
    width: 18px;
    height: 2px;
    margin-right: 10px;
    background: var(--accent);
}

.site-footer {
    padding: 34px 28px;
    border-top: 1px solid var(--line);
    color: var(--muted);
}

@media (max-width: 820px) {
    .site-header {
        min-height: 64px;
        padding-inline: 18px;
    }

    .site-brand span:last-child {
        max-width: calc(100vw - 96px);
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .nav-toggle {
        display: block;
        flex: 0 0 auto;
    }

    .site-nav {
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        display: none;
        flex-direction: column;
        align-items: flex-start;
        padding: 20px;
        border-bottom: 1px solid var(--line);
        background: var(--bg);
        box-shadow: 0 16px 28px rgba(0, 0, 0, 0.38);
    }

    .site-nav.is-open {
        display: flex;
    }

    .language-switcher {
        padding-left: 0;
        border-left: 0;
    }

    .hero {
        min-height: 520px;
    }

    .hero-content {
        width: min(var(--max), calc(100% - 40px));
        margin-inline: auto;
    }

    .cta-row,
    .section-head,
    .split,
    .contact-strip {
        align-items: flex-start;
        flex-direction: column;
    }

    .post-grid,
    .resource-grid {
        grid-template-columns: 1fr;
    }

    .button {
        width: 100%;
    }

    .article {
        width: min(100% - 32px, 820px);
        padding: 58px 0 68px;
    }

    .article-header h1 {
        font-size: clamp(2rem, 12vw, 3.2rem);
    }

    .article-meta {
        display: grid;
        gap: 6px;
    }

    .article-deck {
        font-size: 1.08rem;
        line-height: 1.52;
    }

    .article-meta time::before {
        display: none;
    }

    .article-toc {
        padding: 18px;
    }

    .article-body {
        padding-top: 34px;
        font-size: 1.03rem;
        line-height: 1.72;
    }

    .article-body p {
        margin-bottom: 1.25em;
    }

    .article-body h2 {
        margin-top: 2.1em;
    }
}
