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

:root {
    --bg: #111110;
    --bg-alt: #1a1a18;
    --bg-dark: #0a0a09;
    --panel: #171715;
    --panel-2: #20201d;
    --text: #e4e3de;
    --muted: #9a978c;
    --dim: #6f6d65;
    --accent: #6b9fd4;
    --accent-soft: rgba(107, 159, 212, 0.16);
    --border: #2a2a27;
    --border-strong: #393933;
    --font-sans: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --font-tight: "Inter Tight", "Inter", system-ui, sans-serif;
    --max: 1120px;
    --reading: 760px;
    --pad: clamp(1.25rem, 3vw, 2rem);
    --section: clamp(4rem, 8vw, 7rem);
}

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

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(rgba(255,255,255,0.018) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.014) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: linear-gradient(to bottom, black, transparent 70%);
}

a {
    color: inherit;
}

p, h1, h2, h3, h4 {
    margin: 0;
}

ul, ol {
    margin: 0;
    padding: 0;
}

.container {
    width: min(100%, var(--max));
    margin: 0 auto;
    padding: 0 var(--pad);
}

.reading {
    max-width: var(--reading);
}

.site-nav {
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(10, 10, 9, 0.88);
    border-bottom: 1px solid rgba(255,255,255,0.07);
    backdrop-filter: blur(18px);
}

.nav-inner {
    min-height: 4.35rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.wordmark {
    display: inline-flex;
    flex-direction: column;
    text-decoration: none;
    min-width: 8rem;
}

.wordmark strong {
    font-family: var(--font-tight);
    font-size: 0.95rem;
    letter-spacing: 0.24em;
}

.wordmark span {
    color: var(--dim);
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.nav-links {
    display: flex;
    flex-wrap: nowrap;
    flex: 1 1 auto;
    justify-content: flex-end;
    gap: 0.2rem;
    min-width: 0;
    white-space: nowrap;
    overflow: visible;
}

.nav-links a {
    color: var(--muted);
    text-decoration: none;
    flex: 0 0 auto;
    font-size: 0.69rem;
    letter-spacing: 0.055em;
    text-transform: uppercase;
    padding: 0.44rem 0.48rem;
    border: 1px solid transparent;
    border-radius: 999px;
}

.nav-links a:hover {
    color: var(--text);
    border-color: var(--border);
}

.page-index .nav-overview,
.page-problem .nav-problem,
.page-lifecycle .nav-lifecycle,
.page-knowledge .nav-knowledge,
.page-ai .nav-ai,
.page-standards .nav-standards,
.page-reference .nav-reference {
    color: var(--text);
    background: var(--accent-soft);
    border-color: rgba(107, 159, 212, 0.28);
}

.hero {
    min-height: calc(100vh - 4.35rem);
    display: grid;
    align-items: center;
    background: var(--bg-dark);
    border-bottom: 1px solid var(--border);
    padding: clamp(4rem, 8vw, 7rem) 0;
}

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.92fr);
    gap: clamp(2.5rem, 6vw, 5rem);
    align-items: center;
}

.kicker {
    color: var(--accent);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    margin-bottom: 1.25rem;
}

.eyebrow {
    color: var(--dim);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    margin-bottom: 1rem;
}

h1 {
    font-family: var(--font-tight);
    font-size: clamp(3rem, 8vw, 6.4rem);
    line-height: 0.98;
    letter-spacing: 0;
    max-width: 860px;
}

.page-title {
    padding: clamp(4rem, 7vw, 6.5rem) 0 clamp(3rem, 5vw, 4.5rem);
    background: var(--bg-dark);
    border-bottom: 1px solid var(--border);
}

.page-title h1 {
    font-size: clamp(2.8rem, 7vw, 5.2rem);
}

.hero-subhead,
.page-subhead {
    max-width: 720px;
    color: rgba(228, 227, 222, 0.72);
    font-size: clamp(1.05rem, 2vw, 1.28rem);
    line-height: 1.7;
    margin-top: 1.6rem;
}

.hero-statement {
    font-family: var(--font-tight);
    color: rgba(228, 227, 222, 0.62);
    font-size: clamp(1.45rem, 3vw, 2.25rem);
    font-weight: 700;
    line-height: 1.2;
    margin-top: 1rem;
}

.hero-visual {
    border-left: 1px solid var(--border);
    padding-left: clamp(1.5rem, 4vw, 3rem);
}

.hero-visual svg,
.diagram svg {
    display: block;
    width: 100%;
    height: auto;
}

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

.section.alt {
    background: var(--bg-alt);
}

.section.dark {
    background: var(--bg-dark);
}

.section-header {
    display: grid;
    grid-template-columns: minmax(160px, 0.34fr) minmax(0, 1fr);
    gap: clamp(2rem, 5vw, 4rem);
    align-items: start;
    margin-bottom: clamp(2.5rem, 5vw, 4rem);
}

.section-header h2 {
    font-family: var(--font-tight);
    font-size: clamp(2rem, 4vw, 3.6rem);
    line-height: 1.05;
    letter-spacing: 0;
}

.section-copy {
    color: var(--muted);
    font-size: 1.03rem;
    line-height: 1.75;
}

.section-copy p + p {
    margin-top: 1rem;
}

.label {
    color: var(--dim);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.definition-grid,
.card-grid,
.scenario-grid,
.framework-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    border: 1px solid var(--border);
    background: var(--border);
}

.definition,
.card,
.scenario,
.framework {
    background: var(--panel);
    padding: clamp(1.35rem, 3vw, 2rem);
    min-height: 100%;
}

.definition strong {
    display: block;
    color: var(--accent);
    font-family: var(--font-tight);
    font-size: 2.25rem;
    line-height: 1;
}

.definition-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.65rem;
}

.definition-icon {
    width: clamp(3.8rem, 7vw, 4.8rem);
    aspect-ratio: 1;
    flex: 0 0 auto;
    fill: none;
    stroke: var(--accent);
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 0.68;
}

.definition-icon circle,
.definition-icon rect {
    fill: none;
}

.definition span,
.card span,
.scenario span,
.framework span {
    display: block;
    color: var(--dim);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 0.75rem;
}

.definition p,
.card p,
.scenario p,
.framework p {
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.65;
}

.card h3,
.scenario h3,
.framework h3 {
    font-family: var(--font-tight);
    color: var(--text);
    font-size: 1.18rem;
    line-height: 1.22;
    margin-bottom: 0.7rem;
}

.card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.9rem;
}

.card-top span {
    margin-bottom: 0;
}

.tile-icon {
    width: clamp(3.2rem, 6vw, 4.2rem);
    aspect-ratio: 1;
    flex: 0 0 auto;
    fill: none;
    stroke: var(--accent);
    stroke-width: 1.65;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 0.62;
}

.tile-icon circle,
.tile-icon rect {
    fill: none;
}

.two-col {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(2rem, 5vw, 4rem);
    align-items: start;
}

.panel {
    background: var(--panel);
    border: 1px solid var(--border);
    padding: clamp(1.5rem, 3vw, 2.4rem);
}

.panel h3 {
    font-family: var(--font-tight);
    font-size: 1.35rem;
    margin-bottom: 1rem;
}

.panel p {
    color: var(--muted);
}

.panel ul,
.plain-list {
    list-style: none;
}

.panel li,
.plain-list li {
    color: var(--muted);
    border-top: 1px solid var(--border);
    padding: 0.8rem 0;
}

.panel li:first-child,
.plain-list li:first-child {
    border-top: 0;
}

.contrast {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border: 1px solid var(--border);
    background: var(--border);
    gap: 1px;
}

.contrast-side {
    background: var(--panel);
    padding: clamp(1.5rem, 3vw, 2.25rem);
}

.contrast-side.intentional {
    background: linear-gradient(180deg, rgba(107,159,212,0.08), var(--panel));
}

.contrast-head,
.process-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.contrast-side h3,
.process-node h3 {
    font-family: var(--font-tight);
    font-size: 1.45rem;
    margin-bottom: 0;
}

.contrast-side li {
    list-style: none;
    color: var(--muted);
    border-top: 1px solid var(--border);
    padding: 0.75rem 0;
}

.quote-band {
    padding: clamp(3rem, 6vw, 5rem) 0;
    background: var(--bg-dark);
    border-bottom: 1px solid var(--border);
}

.quote-band p {
    font-family: var(--font-tight);
    font-size: clamp(1.7rem, 4vw, 3.3rem);
    line-height: 1.1;
    letter-spacing: 0;
    max-width: 900px;
}

.quote-band span {
    display: block;
    color: var(--accent);
    margin-top: 0.65rem;
}

.lifecycle-map {
    display: grid;
    grid-template-columns: minmax(320px, 0.92fr) minmax(0, 1.08fr);
    gap: clamp(2.5rem, 6vw, 5rem);
    align-items: center;
}

.stage-list {
    display: grid;
    gap: 1px;
    border: 1px solid var(--border);
    background: var(--border);
}

.stage {
    display: grid;
    grid-template-columns: 3.2rem 1fr;
    gap: 1rem;
    background: var(--panel);
    padding: 1.2rem 1.35rem;
}

.stage-list-linear .stage {
    grid-template-columns: 1fr;
}

.stage-num {
    color: rgba(107,159,212,0.55);
    font-family: var(--font-tight);
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.12em;
}

.stage h3 {
    color: var(--accent);
    font-family: var(--font-tight);
    font-size: 1.06rem;
    margin-bottom: 0.25rem;
}

.stage p {
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.55;
}

.process-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 1rem;
    align-items: stretch;
    margin-top: 2rem;
}

.process-node {
    background: var(--panel);
    border: 1px solid var(--border);
    padding: 1.4rem;
}

.process-node p {
    color: var(--muted);
    font-size: 0.92rem;
}

.process-arrow {
    display: grid;
    place-items: center;
    color: var(--accent);
    font-family: var(--font-tight);
    font-weight: 800;
}

.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
    background: var(--panel);
}

th, td {
    text-align: left;
    vertical-align: top;
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    border-right: 1px solid var(--border);
}

th {
    color: var(--text);
    font-family: var(--font-tight);
    font-size: 0.9rem;
    background: var(--panel-2);
}

td {
    color: var(--muted);
    font-size: 0.9rem;
}

tr:last-child td {
    border-bottom: 0;
}

.glossary {
    display: grid;
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
}

.glossary-item {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 1rem;
    background: var(--panel);
    padding: 1.1rem 1.25rem;
}

.glossary-item strong {
    color: var(--accent);
    font-family: var(--font-tight);
    font-size: 1rem;
}

.glossary-item p {
    color: var(--muted);
    font-size: 0.94rem;
}

.page-footer {
    background: var(--bg-dark);
    border-top: 1px solid rgba(255,255,255,0.07);
}

.pager {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1px;
    background: var(--border);
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
}

.pager a,
.pager span {
    min-height: 7rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-decoration: none;
    background: var(--bg-dark);
    padding: 1.5rem;
}

.pager span {
    color: var(--dim);
}

.pager a:hover {
    background: var(--panel);
}

.pager small {
    color: var(--dim);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    margin-bottom: 0.35rem;
}

.pager strong {
    font-family: var(--font-tight);
    font-size: 1.15rem;
}

.site-meta {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    color: var(--dim);
    font-size: 0.78rem;
    padding: 1.5rem 0;
}

.site-meta a {
    color: var(--muted);
    text-decoration: none;
}

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

@media (max-width: 900px) {
    .nav-inner {
        align-items: flex-start;
        flex-direction: column;
        padding-top: 1rem;
        padding-bottom: 1rem;
        gap: 0.8rem;
    }

    .nav-links {
        flex-wrap: wrap;
        flex: none;
        justify-content: flex-start;
        white-space: normal;
    }

    .hero {
        min-height: auto;
    }

    .hero-grid,
    .section-header,
    .two-col,
    .lifecycle-map,
    .process-row {
        grid-template-columns: 1fr;
    }

    .hero-visual {
        border-left: 0;
        padding-left: 0;
    }

    .definition-grid,
    .card-grid,
    .scenario-grid,
    .framework-grid {
        grid-template-columns: 1fr;
    }

    .contrast {
        grid-template-columns: 1fr;
    }

    .process-arrow {
        min-height: 2rem;
    }
}

@media (max-width: 620px) {
    html {
        font-size: 16px;
    }

    .nav-links a {
        padding: 0.42rem 0.5rem;
        font-size: 0.68rem;
    }

    .glossary-item,
    .stage {
        grid-template-columns: 1fr;
    }

    .pager {
        grid-template-columns: 1fr;
    }

    .site-meta {
        flex-direction: column;
    }
}
