:root {
    --ink: #161817;
    --ink-2: #242725;
    --paper: #ffffff;
    --canvas: #f2f2ee;
    --line: #d9dcd7;
    --muted: #606761;
    --red: #dc4037;
    --red-dark: #b62d27;
    --green: #24785b;
    --green-light: #6bc49a;
    --yellow: #e8bb44;
    --shell: 1240px;
    --reading: 780px;
    --radius: 6px;
    --shadow: 0 18px 44px rgba(18, 22, 19, .12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    color: var(--ink);
    background: var(--paper);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 17px;
    line-height: 1.65;
    letter-spacing: 0;
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--red-dark); }
img { display: block; max-width: 100%; height: auto; }
button, input, textarea { font: inherit; letter-spacing: 0; }
h1, h2, h3, h4 { margin: 0 0 .5em; font-weight: 820; line-height: 1.08; letter-spacing: 0; }
h1 { font-size: clamp(3rem, 7vw, 6.5rem); }
h2 { font-size: clamp(2rem, 4vw, 3.5rem); }
h3 { font-size: 1.4rem; }
p { margin: 0 0 1.2em; }
.site-shell { width: min(calc(100% - 48px), var(--shell)); margin-inline: auto; }
.skip-link { position: fixed; top: -120px; left: 18px; z-index: 1000; padding: 10px 14px; color: #fff; background: var(--ink); }
.skip-link:focus { top: 18px; }

.utility-bar { color: #d8dcd9; background: #101211; border-bottom: 1px solid #303431; font-size: .72rem; font-weight: 760; text-transform: uppercase; }
.utility-bar__inner { min-height: 34px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.site-header { position: sticky; top: 0; z-index: 100; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line); backdrop-filter: blur(14px); }
.header-main { min-height: 82px; display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 28px; }
.brand { min-width: 235px; display: inline-flex; align-items: center; gap: 12px; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand img, .custom-logo { width: auto; max-width: 270px; height: 48px; object-fit: contain; }
.brand > span { display: grid; line-height: 1; }
.brand strong { font-size: 1.3rem; font-weight: 900; }
.brand strong span { color: var(--red); }
.brand small { margin-top: 6px; color: #737a74; font-size: .62rem; font-weight: 750; text-transform: uppercase; }
.primary-nav { justify-self: end; }
.primary-nav .menu, .primary-nav > ul { display: flex; align-items: center; gap: 23px; margin: 0; padding: 0; list-style: none; }
.primary-nav a { padding: 29px 0 26px; border-bottom: 3px solid transparent; font-size: .78rem; font-weight: 820; text-transform: uppercase; }
.primary-nav a:hover, .primary-nav .current-menu-item > a { color: var(--ink); border-color: var(--red); }
.header-search, .nav-toggle { width: 42px; height: 42px; display: grid; place-items: center; color: var(--ink); background: transparent; border: 1px solid var(--line); border-radius: 50%; cursor: pointer; }
.header-search:hover, .nav-toggle:hover { color: #fff; background: var(--ink); border-color: var(--ink); }
.nav-toggle { display: none; }

.home-hero { position: relative; min-height: min(680px, calc(100vh - 116px)); display: flex; align-items: center; color: #fff; background: #161817; overflow: hidden; }
.home-hero__image { position: absolute; inset: 0; background: url('../images/hero.webp') 58% center / cover no-repeat; }
.home-hero__shade { position: absolute; inset: 0; background: rgba(12, 14, 13, .68); }
.home-hero::after { position: absolute; inset: auto 0 0; height: 7px; content: ""; background: var(--red); box-shadow: inset -33vw 0 0 var(--green); }
.home-hero__inner { position: relative; z-index: 1; padding-block: 105px 96px; }
.home-hero__content { max-width: 760px; }
.home-hero h1 { margin: 14px 0 20px; color: #fff; }
.home-hero__lead { max-width: 700px; color: #edf0ed; font-size: 1.23rem; line-height: 1.58; }
.kicker { display: inline-flex; align-items: center; gap: 9px; color: var(--red-dark); font-size: .74rem; font-weight: 900; text-transform: uppercase; }
.kicker::before { width: 25px; height: 3px; content: ""; background: currentColor; }
.kicker--light { color: var(--green-light); }
.eyebrow { color: var(--green); font-size: .72rem; font-weight: 900; text-transform: uppercase; }
.eyebrow a { color: inherit; }
.eyebrow--light { color: #96dfb9; }
.button-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.button { min-height: 50px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 12px 20px; border: 1px solid transparent; border-radius: var(--radius); font-size: .82rem; font-weight: 900; text-transform: uppercase; }
.button--accent { color: #fff; background: var(--red); }
.button--accent:hover { color: #fff; background: var(--red-dark); }
.button--dark { color: #fff; background: var(--ink); }
.button--dark:hover { color: #fff; background: var(--green); }
.button--ghost { color: #fff; background: rgba(17, 20, 18, .42); border-color: rgba(255,255,255,.55); }
.button--ghost:hover { color: var(--ink); background: #fff; }
.hero-notes { display: flex; flex-wrap: wrap; gap: 22px; margin-top: 34px; color: #d5dad6; font-size: .76rem; font-weight: 760; text-transform: uppercase; }
.hero-notes span { display: inline-flex; align-items: center; gap: 8px; }
.hero-notes span::before { width: 6px; height: 6px; content: ""; background: var(--yellow); border-radius: 50%; }

.topic-rail { border-bottom: 1px solid var(--line); background: var(--paper); }
.topic-rail__inner { min-height: 72px; display: flex; align-items: center; gap: 10px; overflow-x: auto; scrollbar-width: none; }
.topic-rail__label { margin-right: 10px; color: #747b75; font-size: .7rem; font-weight: 900; text-transform: uppercase; }
.topic-rail a { white-space: nowrap; padding: 8px 13px; border: 1px solid var(--line); border-radius: 999px; font-size: .8rem; font-weight: 800; }
.topic-rail a:hover { color: #fff; background: var(--ink); border-color: var(--ink); }

.section { padding-block: 90px; }
.section-heading { margin-bottom: 38px; display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.section-heading h2 { margin: 8px 0 0; }
.text-link { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); border-bottom: 2px solid var(--red); font-size: .82rem; font-weight: 900; text-transform: uppercase; }
.post-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.post-grid--latest .post-card--lead { grid-column: span 2; }
.post-grid--latest .post-card--lead .post-card__image { aspect-ratio: 16 / 8; }
.post-card { min-width: 0; overflow: hidden; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); transition: transform .2s ease, box-shadow .2s ease; }
.post-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.post-card__image { aspect-ratio: 16 / 10; display: block; overflow: hidden; background: var(--ink); }
.post-card__image img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.post-card:hover .post-card__image img { transform: scale(1.035); }
.post-card__body { padding: 24px; }
.post-card h3 { margin: 9px 0 12px; font-size: 1.42rem; }
.post-card h3 a:hover { color: var(--red-dark); }
.post-card p { color: var(--muted); font-size: .93rem; line-height: 1.55; }
.post-meta { display: flex; justify-content: space-between; gap: 12px; padding-top: 18px; border-top: 1px solid var(--line); color: #737a74; font-size: .67rem; font-weight: 820; text-transform: uppercase; }

.method-band { color: #fff; background: var(--ink); }
.method-band__grid { display: grid; grid-template-columns: 1.45fr repeat(3, 1fr); }
.method-band__intro, .method-step { min-height: 390px; padding: 58px 32px; border-right: 1px solid #343835; }
.method-band__intro { padding-left: 0; }
.method-band__intro h2 { margin-top: 20px; font-size: 2.5rem; }
.method-band__intro p, .method-step p { color: #bbc1bc; }
.method-step { display: flex; flex-direction: column; justify-content: flex-end; }
.method-step > span { margin-bottom: auto; color: var(--red); font-weight: 900; }
.method-step h3 { font-size: 1.45rem; }

.legacy-section { display: grid; grid-template-columns: 1.1fr 1fr; gap: 80px; align-items: start; }
.legacy-section__intro { max-width: 650px; }
.legacy-section__intro h2 { margin-top: 10px; }
.legacy-section__intro p { color: var(--muted); font-size: 1.08rem; }
.legacy-links { border-top: 1px solid var(--line); }
.legacy-links a { display: grid; grid-template-columns: 150px 1fr; gap: 22px; padding: 24px 0; border-bottom: 1px solid var(--line); }
.legacy-links a:hover { color: var(--red-dark); }
.legacy-links span { color: var(--green); font-size: .72rem; font-weight: 900; text-transform: uppercase; }
.legacy-links strong { font-size: 1.06rem; }

.archive-hero, .standard-page__header { padding-block: 100px 76px; color: #fff; background: var(--ink); border-bottom: 7px solid var(--green); }
.archive-hero h1, .standard-page__header h1 { margin-top: 14px; font-size: clamp(3rem, 7vw, 5.8rem); }
.archive-hero p, .archive-description, .standard-page__header p { max-width: 720px; color: #c6cbc7; font-size: 1.12rem; }
.archive-main .section { min-height: 520px; }
.pagination { margin-top: 52px; }
.pagination .nav-links { display: flex; align-items: center; justify-content: center; gap: 7px; }
.pagination a, .pagination span { min-width: 42px; min-height: 42px; display: grid; place-items: center; padding: 8px; border: 1px solid var(--line); border-radius: 4px; font-weight: 800; }
.pagination .current { color: #fff; background: var(--ink); border-color: var(--ink); }

.article-header { padding-block: 92px 64px; color: #fff; background: var(--ink); }
.article-header__inner { max-width: 1050px; margin-inline: auto; }
.article-header h1 { max-width: 1000px; margin-block: 16px 22px; font-size: clamp(2.8rem, 6vw, 5.4rem); }
.article-deck { max-width: 820px; color: #d0d5d1; font-size: 1.22rem; line-height: 1.55; }
.article-meta { display: flex; flex-wrap: wrap; gap: 20px; color: #aeb6b0; font-size: .72rem; font-weight: 800; text-transform: uppercase; }
.article-meta span { display: inline-flex; align-items: center; gap: 8px; }
.article-meta span::before { width: 5px; height: 5px; content: ""; background: var(--red); border-radius: 50%; }
.article-media { margin-top: 0; }
.article-media img { width: 100%; aspect-ratio: 16 / 8.2; object-fit: cover; }
.article-layout { display: grid; grid-template-columns: 260px minmax(0, var(--reading)); justify-content: center; gap: 72px; padding-block: 72px 100px; }
.article-aside { min-width: 0; }
.article-toc { position: sticky; top: 122px; padding-top: 18px; border-top: 5px solid var(--red); }
.article-toc strong { font-size: .8rem; text-transform: uppercase; }
.article-toc ol { margin: 16px 0 0; padding: 0; list-style: none; counter-reset: toc; }
.article-toc li { counter-increment: toc; display: grid; grid-template-columns: 25px 1fr; gap: 5px; margin-bottom: 10px; color: var(--muted); font-size: .82rem; line-height: 1.35; }
.article-toc li::before { content: counter(toc, decimal-leading-zero); color: var(--green); font-size: .68rem; font-weight: 900; }
.article-toc a:hover { color: var(--red-dark); }
.article-updated { margin-top: 28px; color: #7a817b; font-size: .72rem; text-transform: uppercase; }
.article-content { min-width: 0; font-family: Georgia, "Times New Roman", serif; font-size: 1.13rem; line-height: 1.82; }
.article-content > *:first-child { margin-top: 0; }
.article-content h2, .article-content h3, .article-content h4 { margin-top: 1.7em; font-family: Inter, ui-sans-serif, system-ui, sans-serif; scroll-margin-top: 120px; }
.article-content h2 { padding-top: .35em; font-size: 2rem; }
.article-content h3 { font-size: 1.42rem; }
.article-content a { color: var(--green); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; overflow-wrap: anywhere; }
.article-content ul, .article-content ol { padding-left: 1.35em; }
.article-content li { margin-bottom: .55em; }
.article-content blockquote { margin: 2em 0; padding: 24px 28px; color: #202421; background: #edf5f0; border-left: 5px solid var(--green); }
.article-content table { width: 100%; max-width: 100%; margin: 2em 0; display: block; overflow-x: auto; border-collapse: collapse; font-family: Inter, ui-sans-serif, system-ui, sans-serif; font-size: .88rem; }
.article-content th, .article-content td { min-width: 150px; padding: 14px; text-align: left; border: 1px solid var(--line); vertical-align: top; }
.article-content th { color: #fff; background: var(--ink); }
.article-content code { padding: 2px 5px; background: var(--canvas); font-size: .9em; }
.article-figure { width: min(900px, calc(100vw - 48px)); margin: 2.3em 0 2.3em 50%; transform: translateX(-50%); }
.article-figure img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius); }
.article-figure figcaption { margin-top: 9px; color: #757c76; font-family: Inter, ui-sans-serif, system-ui, sans-serif; font-size: .72rem; }
.standard-page__content { width: min(calc(100% - 48px), 820px); min-height: 480px; padding-block: 70px 100px; }
.standard-page__content h2, .standard-page__content h3 { margin-top: 1.7em; }
.related-section { padding-bottom: 100px; border-top: 1px solid var(--line); }
.related-section .section-heading { padding-top: 72px; }
.post-grid--related { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.error-page { min-height: 68vh; display: grid; place-items: center; padding-block: 90px; color: #fff; background: var(--ink); }
.error-page__inner { max-width: 760px; text-align: center; }
.error-code { color: var(--red); font-size: 5rem; font-weight: 900; }
.error-page p { color: #c0c6c1; font-size: 1.1rem; }

.site-footer { color: #d8dcd9; background: #0e100f; }
.footer-grid { display: grid; grid-template-columns: 1.45fr .9fr 1.1fr; gap: 70px; padding-block: 80px 64px; }
.footer-brand .brand { color: #fff; }
.footer-brand .brand strong { color: #fff; }
.footer-brand .brand small { color: #9da49e; }
.footer-brand > p { max-width: 480px; margin-top: 24px; color: #9da49e; }
.site-footer h2 { color: #fff; font-size: 1rem; text-transform: uppercase; }
.site-footer ul { margin: 18px 0 0; padding: 0; list-style: none; }
.site-footer li { margin-bottom: 8px; }
.site-footer p { color: #9da49e; font-size: .9rem; }
.site-footer .text-link { color: #fff; }
.footer-bottom { min-height: 70px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-top: 1px solid #2a2e2b; color: #8d958f; font-size: .76rem; }
.footer-bottom div { display: flex; flex-wrap: wrap; gap: 18px; }

@media (max-width: 1080px) {
    .nav-toggle { display: grid; justify-self: end; }
    .primary-nav { display: none; position: fixed; inset: 116px 0 0; padding: 28px 24px; background: #fff; overflow-y: auto; }
    .primary-nav.is-open { display: block; }
    .primary-nav .menu, .primary-nav > ul { display: grid; gap: 0; }
    .primary-nav li { border-bottom: 1px solid var(--line); }
    .primary-nav a { display: block; padding: 18px 4px; border: 0; font-size: 1.05rem; }
    .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .post-grid--latest .post-card--lead { grid-column: span 2; }
    .method-band__grid { grid-template-columns: repeat(3, 1fr); }
    .method-band__intro { grid-column: 1 / -1; min-height: auto; padding: 58px 0; border-bottom: 1px solid #343835; }
    .method-step { min-height: 300px; }
    .legacy-section { grid-template-columns: 1fr; gap: 48px; }
    .article-layout { grid-template-columns: minmax(0, var(--reading)); }
    .article-aside { display: none; }
}

@media (max-width: 720px) {
    body { font-size: 16px; }
    .site-shell { width: min(calc(100% - 28px), var(--shell)); }
    .utility-bar__inner { justify-content: center; }
    .utility-bar__inner span:last-child { display: none; }
    .header-main { min-height: 70px; grid-template-columns: 1fr auto auto; gap: 9px; }
    .brand { min-width: 0; }
    .brand img { width: 40px; height: 40px; }
    .brand strong { font-size: 1.08rem; }
    .brand small { display: none; }
    .primary-nav { inset: 104px 0 0; }
    .home-hero { min-height: 620px; align-items: flex-end; }
    .home-hero__image { background-position: 66% center; }
    .home-hero__shade { background: rgba(12, 14, 13, .76); }
    .home-hero__inner { padding-block: 110px 72px; }
    .home-hero h1 { font-size: 3.5rem; }
    .home-hero__lead { font-size: 1.03rem; }
    .button-row { align-items: stretch; flex-direction: column; }
    .button { width: 100%; }
    .hero-notes { gap: 14px; }
    .section { padding-block: 64px; }
    .section-heading { align-items: flex-start; flex-direction: column; }
    .post-grid, .post-grid--related { grid-template-columns: 1fr; }
    .post-grid--latest .post-card--lead { grid-column: auto; }
    .post-grid--latest .post-card--lead .post-card__image { aspect-ratio: 16 / 10; }
    .method-band__grid { grid-template-columns: 1fr; }
    .method-step { min-height: 235px; padding: 34px 0; border-right: 0; border-bottom: 1px solid #343835; }
    .method-band__intro h2 { font-size: 2.15rem; }
    .legacy-links a { grid-template-columns: 1fr; gap: 7px; }
    .archive-hero, .standard-page__header { padding-block: 74px 54px; }
    .article-header { padding-block: 66px 42px; }
    .article-header h1 { font-size: 2.7rem; }
    .article-deck { font-size: 1.04rem; }
    .article-media { width: 100%; }
    .article-media img { aspect-ratio: 16 / 10; }
    .article-layout { padding-block: 48px 74px; }
    .article-content { font-size: 1.04rem; }
    .article-content h2 { font-size: 1.62rem; }
    .article-figure { width: 100%; margin-inline: 0; transform: none; }
    .footer-grid { grid-template-columns: 1fr; gap: 38px; padding-block: 60px; }
    .footer-bottom { align-items: flex-start; flex-direction: column; padding-block: 22px; }
}
