:root {
    --ink: #161718;
    --muted: #5b626a;
    --paper: #fbfaf7;
    --panel: #ffffff;
    --line: #d8dee4;
    --quiet: #eef3f1;
    --dark: #0e1216;
    --dark-soft: #1d2429;
    --exc: #c93b4f;
    --inh: #10869f;
    --amber: #c4812a;
    --green: #2f7d61;
    --shadow: 0 22px 60px rgba(16, 18, 21, 0.12);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

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

h1,
h2,
h3,
p,
li,
dd {
    overflow-wrap: break-word;
}

img,
svg,
iframe {
    display: block;
}

img {
    max-width: 100%;
}

a {
    color: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

strong {
    font-weight: 760;
}

.skip-link {
    position: fixed;
    left: 16px;
    top: 12px;
    z-index: 100;
    transform: translateY(-140%);
    background: var(--panel);
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 8px 12px;
    text-decoration: none;
}

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

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(251, 250, 247, 0.92);
    border-bottom: 1px solid rgba(217, 222, 228, 0.9);
    backdrop-filter: blur(18px);
}

.nav-shell,
.section-shell {
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
}

.nav-shell {
    min-height: 66px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.brand,
.nav-action,
.button,
.stage-button,
.text-link {
    display: inline-flex;
    align-items: center;
}

.brand {
    gap: 9px;
    text-decoration: none;
    font-weight: 850;
    font-size: 1rem;
}

.brand-mark {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    background: var(--dark);
    color: #fff;
    border-radius: 8px;
}

.brand-mark svg,
.nav-action svg,
.button svg,
.stage-button svg,
.setup-card svg,
.text-link svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    stroke-width: 1.8;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.brand-mark svg {
    width: 22px;
    height: 22px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 26px;
    color: var(--muted);
    font-size: 0.92rem;
    font-weight: 680;
}

.nav-links a,
.footer-links a {
    text-decoration: none;
}

.nav-links a:hover,
.footer-links a:hover {
    color: var(--ink);
}

.nav-action {
    gap: 9px;
    min-height: 40px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    text-decoration: none;
    font-weight: 780;
    font-size: 0.92rem;
}

.hero {
    min-height: min(700px, calc(100svh - 92px));
    position: relative;
    display: grid;
    align-items: end;
    overflow: hidden;
    background: var(--dark);
    color: #fff;
}

.hero-media,
.hero-overlay {
    position: absolute;
    inset: 0;
}

.hero-media {
    background-image: url("assets/site/hero_bg.png");
    background-size: cover;
    background-position: center;
    transform: scale(1.02);
}

.hero-overlay {
    background:
        linear-gradient(90deg, rgba(6, 8, 12, 0.94) 0%, rgba(6, 8, 12, 0.78) 45%, rgba(6, 8, 12, 0.28) 100%),
        linear-gradient(0deg, rgba(6, 8, 12, 0.94) 0%, rgba(6, 8, 12, 0.36) 48%, rgba(6, 8, 12, 0.2) 100%);
}

.hero-content {
    position: relative;
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
    padding: 118px 0 34px;
}

.eyebrow,
.section-kicker {
    margin: 0 0 12px;
    color: var(--amber);
    font-size: 0.78rem;
    font-weight: 850;
    text-transform: uppercase;
}

.hero h1 {
    max-width: 930px;
    margin: 0;
    font-size: 4.55rem;
    line-height: 1;
}

.hero-copy {
    max-width: 750px;
    margin: 26px 0 0;
    color: rgba(255, 255, 255, 0.82);
    font-size: 1.18rem;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 30px;
}

.button {
    gap: 9px;
    min-height: 48px;
    justify-content: center;
    border-radius: 8px;
    padding: 0 18px;
    text-decoration: none;
    font-weight: 820;
}

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

.button-secondary {
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.button:hover,
.nav-action:hover,
.stage-button:hover,
.text-link:hover,
.evidence-card:hover {
    transform: translateY(-1px);
}

.hero-metrics {
    margin: 54px 0 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 8px;
    background: rgba(9, 12, 18, 0.58);
    backdrop-filter: blur(10px);
}

.hero-metrics div {
    padding: 18px 20px;
    border-right: 1px solid rgba(255, 255, 255, 0.16);
}

.hero-metrics div:last-child {
    border-right: 0;
}

.hero-metrics dt {
    margin: 0 0 2px;
    color: rgba(255, 255, 255, 0.68);
    font-size: 0.78rem;
    font-weight: 780;
}

.hero-metrics dd {
    margin: 0;
    font-size: 1.72rem;
    line-height: 1.1;
    font-weight: 850;
}

.inputs-section,
.setup-section,
.method-section,
.geometry-section,
.fit-section,
.examples-section,
.evidence-section,
.circuit-section,
.compare-section,
.explorer-section {
    padding: 92px 0;
}

.inputs-section,
.geometry-section,
.explorer-section {
    background: var(--panel);
}

.setup-section,
.method-section,
.compare-section {
    background: var(--paper);
}

.fit-section {
    background: #eef3f7;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.examples-section {
    background: #eef5f2;
    border-top: 1px solid var(--line);
}

.evidence-section {
    background: #f3f1ec;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.inputs-grid,
.geometry-grid,
.fit-grid,
.circuit-grid,
.compare-grid,
.footer-grid {
    display: grid;
    gap: 52px;
}

.inputs-grid {
    grid-template-columns: minmax(0, 0.82fr) minmax(420px, 1.18fr);
    align-items: start;
}

.inputs-grid > div:first-child p,
.section-heading p,
.geometry-copy p,
.fit-grid > div:first-child p,
.circuit-grid p,
.compare-grid p,
.explorer-section p,
.site-footer p {
    color: var(--muted);
}

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

h2 {
    font-size: 3rem;
}

h3 {
    font-size: 1.55rem;
}

.section-heading {
    max-width: 850px;
    margin-bottom: 38px;
}

.section-heading.compact {
    max-width: 900px;
}

.channel-panel {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.channel-panel h3 {
    padding: 22px 24px;
    border-bottom: 1px solid var(--line);
    font-size: 1.35rem;
}

.channel-table {
    display: grid;
}

.channel-table div {
    display: grid;
    grid-template-columns: 42px minmax(140px, 0.55fr) minmax(0, 1fr);
    gap: 14px;
    padding: 16px 24px;
    border-bottom: 1px solid var(--line);
}

.channel-table div:last-child {
    border-bottom: 0;
}

.channel-table span:first-child {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--quiet);
    color: var(--green);
    font-weight: 850;
}

.channel-table strong {
    color: var(--ink);
}

.channel-table span:last-child {
    color: var(--muted);
}

.setup-grid,
.example-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.setup-card,
.example-card,
.fit-list {
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 14px 34px rgba(16, 18, 21, 0.07);
}

.setup-card {
    min-height: 270px;
    padding: 24px;
}

.setup-card svg {
    width: 28px;
    height: 28px;
    color: var(--green);
    margin-bottom: 22px;
}

.setup-card p,
.example-card p,
.fit-list li {
    color: var(--muted);
}

.method-tool {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 20px;
    align-items: stretch;
}

.stage-rail {
    display: grid;
    gap: 8px;
    align-content: start;
}

.stage-button {
    gap: 9px;
    min-height: 52px;
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    color: var(--muted);
    padding: 0 14px;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
    transition: transform 160ms ease, color 160ms ease, background 160ms ease, border-color 160ms ease;
}

.stage-button.is-active {
    background: var(--dark);
    color: #fff;
    border-color: var(--dark);
}

.stage-panel {
    min-height: 560px;
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
    gap: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: var(--shadow);
}

.stage-figure {
    margin: 0;
    min-height: 560px;
    background: #f5f7f8;
    border-right: 1px solid var(--line);
    display: grid;
    place-items: center;
    overflow: hidden;
}

.stage-figure img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 18px;
}

.stage-copy {
    padding: 34px;
    align-self: center;
}

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

.stage-copy h3 {
    margin-bottom: 16px;
}

.stage-facts {
    margin: 28px 0 0;
    display: grid;
}

.stage-facts div {
    border-top: 1px solid var(--line);
    padding: 14px 0;
}

.stage-facts dt {
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 820;
    text-transform: uppercase;
}

.stage-facts dd {
    margin: 0;
    font-weight: 760;
}

.geometry-grid,
.compare-grid {
    grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr);
    align-items: center;
}

.feature-figure,
.circuit-figure {
    margin: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.feature-figure img {
    width: 100%;
    aspect-ratio: 13 / 9;
    object-fit: contain;
    background: #f8fafb;
}

.feature-figure figcaption {
    padding: 12px 16px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.9rem;
}

.fit-grid {
    grid-template-columns: minmax(0, 0.72fr) minmax(0, 1.28fr);
    align-items: start;
}

.fit-lists {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.fit-list {
    padding: 24px;
}

.fit-list h3 {
    margin-bottom: 16px;
}

.fit-list ul,
.circuit-list {
    display: grid;
    gap: 12px;
    padding: 0;
    margin: 0;
    list-style: none;
}

.fit-list li {
    position: relative;
    padding-left: 18px;
}

.fit-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.72em;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--green);
}

.fit-list.caution li::before {
    background: var(--amber);
}

.example-card {
    min-height: 340px;
    display: grid;
    align-content: start;
    gap: 16px;
    padding: 24px;
}

.example-label {
    color: var(--green) !important;
    font-size: 0.78rem;
    font-weight: 850;
    text-transform: uppercase;
}

.text-link {
    gap: 8px;
    width: max-content;
    max-width: 100%;
    color: var(--ink);
    font-weight: 850;
    text-decoration: none;
}

.text-link:hover {
    color: var(--green);
}

.evidence-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.evidence-card {
    display: grid;
    grid-template-rows: 180px auto;
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
    text-decoration: none;
    box-shadow: 0 12px 28px rgba(16, 18, 21, 0.06);
}

.evidence-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: left top;
    background: #f8fafb;
}

.evidence-card span {
    min-height: 54px;
    display: flex;
    align-items: center;
    padding: 12px 14px;
    border-top: 1px solid var(--line);
    font-weight: 820;
}

.circuit-section {
    background: var(--dark);
    color: #fff;
}

.circuit-grid {
    grid-template-columns: minmax(280px, 0.7fr) minmax(0, 1fr);
    align-items: center;
}

.circuit-figure {
    background: #fff;
    padding: 24px;
}

.circuit-figure img {
    width: min(420px, 100%);
    margin: 0 auto;
}

.circuit-grid p,
.circuit-list {
    color: rgba(255, 255, 255, 0.74);
}

.circuit-list {
    margin-top: 28px;
}

.circuit-list li {
    padding-left: 18px;
    border-left: 3px solid rgba(255, 255, 255, 0.25);
}

.exc {
    color: #ff7b8d;
}

.inh {
    color: #62d3e8;
}

.dashboard-frame {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--shadow);
}

.frame-bar {
    height: 44px;
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 0 16px;
    background: #f5f7f8;
    border-bottom: 1px solid var(--line);
}

.frame-bar span {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: #b6bec7;
}

.frame-bar span:nth-child(1) {
    background: #d36865;
}

.frame-bar span:nth-child(2) {
    background: #d3a446;
}

.frame-bar span:nth-child(3) {
    background: #4d9b72;
}

.dashboard-frame iframe {
    width: 100%;
    height: 820px;
    border: 0;
    background: #fff;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cite-section {
    padding: 100px 0 80px;
    background: var(--panel);
    border-top: 1px solid var(--line);
}

.cite-grid {
    margin-top: 36px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
}

.cite-card {
    padding: 28px 30px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.cite-label {
    margin: 0;
    color: var(--amber);
    font-size: 0.78rem;
    font-weight: 850;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.cite-text {
    margin: 0;
    color: var(--ink);
    font-size: 0.98rem;
    line-height: 1.55;
}

.quickstart {
    margin: 14px 0 0;
    padding: 12px 14px;
    background: var(--dark);
    color: #fff;
    border-radius: 6px;
    font-size: 0.82rem;
    line-height: 1.55;
    overflow-x: auto;
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

.quickstart code {
    color: inherit;
    background: none;
    font-family: inherit;
    white-space: pre;
}

.site-footer {
    padding: 42px 0;
    background: #f2f0eb;
    border-top: 1px solid var(--line);
}

.footer-grid {
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr);
    gap: 32px;
    align-items: start;
}

.footer-brand strong {
    font-size: 1.05rem;
}

.site-footer p {
    margin: 6px 0 0;
}

.footer-meta {
    color: var(--muted);
    font-size: 0.88rem;
}

.footer-meta a {
    color: var(--ink);
    text-decoration: underline;
    text-decoration-color: var(--line);
    text-underline-offset: 2px;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
    color: var(--muted);
    font-weight: 760;
}

.footer-links h4 {
    margin: 0 0 6px;
    color: var(--ink);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

@media (max-width: 1020px) {
    .nav-links {
        display: none;
    }

    .hero {
        min-height: auto;
    }

    .hero-content {
        padding-top: 110px;
    }

    .hero h1 {
        font-size: 3.55rem;
    }

    .inputs-grid,
    .geometry-grid,
    .fit-grid,
    .circuit-grid,
    .compare-grid,
    .cite-grid,
    .footer-grid {
        grid-template-columns: 1fr;
    }

    h2 {
        font-size: 2.35rem;
    }

    .setup-grid,
    .example-grid,
    .fit-lists {
        grid-template-columns: 1fr;
    }

    .method-tool {
        grid-template-columns: 1fr;
    }

    .stage-rail {
        grid-template-columns: repeat(5, minmax(120px, 1fr));
        overflow-x: auto;
        padding-bottom: 4px;
    }

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

    .stage-figure {
        min-height: 420px;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

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

@media (max-width: 680px) {
    .nav-shell,
    .section-shell,
    .hero-content {
        width: calc(100% - 28px);
        max-width: 360px;
        margin-left: 14px;
        margin-right: auto;
    }

    .nav-action span {
        display: none;
    }

    .hero-content {
        padding-top: 86px;
        padding-bottom: 26px;
    }

    .hero h1 {
        font-size: 2.18rem;
    }

    .hero-copy {
        font-size: 1.03rem;
    }

    .button {
        width: 100%;
    }

    .hero-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        margin-top: 36px;
    }

    .hero-metrics div:nth-child(2) {
        border-right: 0;
    }

    .hero-metrics div:nth-child(-n + 2) {
        border-bottom: 1px solid rgba(255, 255, 255, 0.16);
    }

    .inputs-section,
    .setup-section,
    .method-section,
    .geometry-section,
    .fit-section,
    .examples-section,
    .evidence-section,
    .circuit-section,
    .compare-section,
    .explorer-section {
        padding: 66px 0;
    }

    h2 {
        font-size: 1.82rem;
    }

    h3 {
        font-size: 1.35rem;
    }

    .channel-panel h3,
    .channel-table div,
    .setup-card,
    .example-card,
    .fit-list,
    .stage-copy {
        padding-left: 20px;
        padding-right: 20px;
    }

    .channel-table div {
        grid-template-columns: 32px minmax(0, 1fr);
        gap: 8px 12px;
    }

    .channel-table span:last-child {
        grid-column: 2;
    }

    .stage-rail {
        grid-template-columns: repeat(5, 118px);
    }

    .stage-panel {
        min-height: auto;
    }

    .stage-figure {
        min-height: 300px;
    }

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

    .dashboard-frame iframe {
        height: 680px;
    }

    .footer-links {
        flex-wrap: wrap;
    }
}
