:root {
    --ink: #111314;
    --ink-2: #1b1d1f;
    --ink-3: #272a2d;
    --paper: #f5f1e8;
    --paper-2: #fffaf0;
    --muted: #6b655b;
    --muted-dark: #b9b1a4;
    --line: rgba(17, 19, 20, 0.14);
    --line-dark: rgba(255, 250, 240, 0.16);
    --green: #1f8a70;
    --green-soft: #cdeee4;
    --coral: #d86442;
    --amber: #d8a339;
    --steel: #607d8b;
    --cyan: #1b98a6;
    --shadow: 0 18px 50px rgba(17, 19, 20, 0.18);
    --header-height: 72px;
    --max-width: 1180px;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ink);
    background: var(--paper);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-width: 320px;
    background: var(--paper);
    color: var(--ink);
    letter-spacing: 0;
}

a {
    color: inherit;
}

code,
pre {
    font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
}

.skip-link {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 100;
    padding: 10px 12px;
    color: var(--paper-2);
    background: var(--ink);
    border-radius: 6px;
    transform: translateY(-140%);
    transition: transform 160ms ease;
}

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

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 0 34px;
    color: var(--paper-2);
    background: rgba(17, 19, 20, 0.72);
    border-bottom: 1px solid rgba(255, 250, 240, 0.13);
    backdrop-filter: blur(18px);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    font-weight: 720;
    text-decoration: none;
}

.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 32px;
    height: 32px;
    color: var(--ink);
    background: var(--green-soft);
    border: 1px solid rgba(245, 241, 232, 0.28);
    border-radius: 7px;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.site-nav a,
.language-toggle {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 7px 10px;
    color: rgba(255, 250, 240, 0.78);
    text-decoration: none;
    border-radius: 6px;
}

.language-toggle {
    justify-content: center;
    min-width: 52px;
    font: inherit;
    font-weight: 720;
    cursor: pointer;
    background: rgba(255, 250, 240, 0.08);
    border: 1px solid rgba(255, 250, 240, 0.16);
}

.site-nav a:hover,
.site-nav a:focus-visible,
.site-nav a[aria-current="page"],
.language-toggle:hover,
.language-toggle:focus-visible {
    color: var(--paper-2);
    background: rgba(255, 250, 240, 0.11);
    outline: none;
}

.hero {
    position: relative;
    min-height: 88svh;
    overflow: hidden;
    color: var(--paper-2);
    background: var(--ink);
    isolation: isolate;
}

.hero::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        linear-gradient(90deg, rgba(17, 19, 20, 0.92) 0%, rgba(17, 19, 20, 0.66) 48%, rgba(17, 19, 20, 0.86) 100%),
        repeating-linear-gradient(0deg, rgba(255, 250, 240, 0.03) 0 1px, transparent 1px 42px);
}

.signal-canvas {
    position: absolute;
    inset: 0;
    z-index: -2;
    width: 100%;
    height: 100%;
    background: #101214;
}

.hero-content {
    position: relative;
    width: min(var(--max-width), calc(100% - 48px));
    margin: 0 auto;
    padding: 166px 0 118px;
}

.hero-content h1 {
    max-width: 760px;
    margin: 0;
    font-size: 72px;
    line-height: 0.96;
    font-weight: 760;
    letter-spacing: 0;
}

.hero-copy {
    max-width: 690px;
    margin: 26px 0 0;
    color: rgba(255, 250, 240, 0.82);
    font-size: 21px;
    line-height: 1.64;
}

.home-hero,
.compact-hero {
    min-height: 66svh;
}

.eyebrow {
    margin: 0 0 16px;
    color: var(--coral);
    font-size: 13px;
    line-height: 1.3;
    font-weight: 780;
    text-transform: uppercase;
}

.hero .eyebrow {
    color: var(--green-soft);
}

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

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 11px 16px;
    font-weight: 730;
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: 6px;
}

.button-primary {
    color: var(--ink);
    background: var(--green-soft);
}

.button-primary:hover,
.button-primary:focus-visible {
    background: #e0fff3;
    outline: 2px solid rgba(205, 238, 228, 0.38);
    outline-offset: 2px;
}

.button-secondary {
    color: var(--paper-2);
    background: rgba(255, 250, 240, 0.08);
    border-color: rgba(255, 250, 240, 0.18);
}

.button-secondary:hover,
.button-secondary:focus-visible {
    background: rgba(255, 250, 240, 0.14);
    outline: 2px solid rgba(255, 250, 240, 0.22);
    outline-offset: 2px;
}

.hero-telemetry {
    position: absolute;
    right: max(24px, calc((100vw - var(--max-width)) / 2));
    bottom: 34px;
    width: min(420px, calc(100% - 48px));
    color: var(--paper-2);
    background: rgba(20, 22, 23, 0.78);
    border: 1px solid rgba(255, 250, 240, 0.18);
    border-radius: 8px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(14px);
}

.telemetry-line {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255, 250, 240, 0.13);
}

.telemetry-line span,
.telemetry-grid span {
    color: var(--muted-dark);
}

.telemetry-grid {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 10px 16px;
    padding: 16px;
}

.device-map {
    position: absolute;
    right: max(24px, calc((100vw - var(--max-width)) / 2));
    bottom: 34px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    width: min(360px, calc(100% - 48px));
    padding: 16px;
    color: var(--paper-2);
    background: rgba(20, 22, 23, 0.78);
    border: 1px solid rgba(255, 250, 240, 0.18);
    border-radius: 8px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(14px);
}

.map-node,
.map-link {
    min-height: 42px;
    display: grid;
    align-items: center;
    padding: 10px 12px;
    border-radius: 6px;
}

.map-node {
    color: var(--ink);
    font-weight: 760;
    background: var(--green-soft);
}

.map-link {
    color: var(--muted-dark);
    border: 1px dashed rgba(255, 250, 240, 0.25);
}

.section {
    padding: 86px 0;
}

.section-inner {
    width: min(var(--max-width), calc(100% - 48px));
    margin: 0 auto;
}

.band-light {
    background: var(--paper);
}

.band-white {
    background: var(--paper-2);
}

.band-ink {
    color: var(--paper-2);
    background: var(--ink-2);
}

.section-heading {
    max-width: 760px;
    margin-bottom: 34px;
}

.section-heading.narrow {
    max-width: 820px;
}

.section h2 {
    margin: 0;
    font-size: 42px;
    line-height: 1.08;
    font-weight: 760;
    letter-spacing: 0;
}

.section-copy {
    margin: 18px 0 0;
    color: var(--muted);
    font-size: 18px;
    line-height: 1.72;
}

.band-ink .section-copy {
    color: var(--muted-dark);
}

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

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

.project-card,
.fact-card,
.trouble-card,
.step-card,
.feature-card,
.parameter-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 250, 240, 0.62);
}

.project-card {
    min-height: 285px;
    padding: 24px;
    display: flex;
    flex-direction: column;
}

.project-card-large {
    min-height: 360px;
    padding: 30px;
}

.project-card-large h3 {
    font-size: 34px;
}

.project-card h3,
.fact-card h3,
.trouble-card h3,
.step-card h3,
.feature-card h3,
.parameter-card h3 {
    margin: 0;
    font-size: 23px;
    line-height: 1.24;
    letter-spacing: 0;
}

.project-card-large h3 {
    font-size: 34px;
}

.project-card p,
.fact-card p,
.trouble-card p,
.step-card p,
.feature-card p,
.note-row p {
    margin: 14px 0 0;
    color: var(--muted);
    line-height: 1.68;
}

.card-kicker {
    margin-bottom: 16px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 780;
    text-transform: uppercase;
}

.accent-green {
    border-top: 4px solid var(--green);
}

.accent-coral {
    border-top: 4px solid var(--coral);
}

.accent-amber {
    border-top: 4px solid var(--amber);
}

.inline-link {
    width: fit-content;
    margin-top: auto;
    padding-top: 24px;
    color: var(--green);
    font-weight: 760;
    text-decoration-thickness: 2px;
    text-underline-offset: 4px;
}

.notes-layout,
.overview-layout,
.code-layout {
    display: grid;
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
    gap: 48px;
    align-items: start;
}

.note-list {
    border-top: 1px solid var(--line-dark);
}

.note-row {
    display: grid;
    grid-template-columns: 54px 1fr;
    gap: 10px 16px;
    padding: 22px 0;
    border-bottom: 1px solid var(--line-dark);
}

.note-row span {
    color: var(--green-soft);
    font-family: "Cascadia Code", Consolas, monospace;
}

.note-row strong {
    font-size: 19px;
}

.note-row p {
    grid-column: 2;
    color: var(--muted-dark);
}

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

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

.feature-card {
    min-height: 210px;
    padding: 22px;
}

.fact-card,
.trouble-card {
    padding: 20px;
}

.fact-card span {
    display: block;
    margin-bottom: 12px;
    color: var(--coral);
    font-size: 12px;
    font-weight: 780;
    text-transform: uppercase;
}

.fact-card strong {
    display: block;
    font-size: 28px;
    line-height: 1.15;
}

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

.flow-list {
    display: grid;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: flow;
}

.flow-list li {
    counter-increment: flow;
    position: relative;
    display: grid;
    grid-template-columns: 72px 0.45fr 1fr;
    gap: 18px;
    align-items: start;
    padding: 18px 0;
    border-top: 1px solid var(--line);
}

.flow-list li::before {
    content: counter(flow, decimal-leading-zero);
    display: inline-grid;
    place-items: center;
    width: 48px;
    height: 34px;
    color: var(--paper-2);
    font-family: "Cascadia Code", Consolas, monospace;
    background: var(--ink-3);
    border-radius: 6px;
}

.flow-list strong {
    font-size: 20px;
    line-height: 1.35;
}

.flow-list span {
    color: var(--muted);
    line-height: 1.68;
}

.step-card {
    min-height: 270px;
    padding: 20px;
}

.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 32px;
    margin-bottom: 18px;
    color: var(--paper-2);
    font-family: "Cascadia Code", Consolas, monospace;
    background: var(--ink-3);
    border-radius: 6px;
}

.code-panels {
    display: grid;
    gap: 14px;
}

.code-panel {
    margin: 0;
    overflow: hidden;
    color: var(--paper-2);
    background: #0f1112;
    border: 1px solid var(--line-dark);
    border-radius: 8px;
}

.code-panel figcaption {
    padding: 12px 14px;
    color: var(--green-soft);
    font-weight: 760;
    border-bottom: 1px solid var(--line-dark);
}

.code-panel pre {
    margin: 0;
    padding: 16px;
    overflow-x: auto;
    font-size: 14px;
    line-height: 1.64;
}

.code-panel code {
    white-space: pre;
}

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

.parameter-card {
    min-width: 0;
    padding: 22px;
    background: rgba(255, 250, 240, 0.06);
    border-color: var(--line-dark);
}

.parameter-card h3 {
    color: var(--paper-2);
}

.parameter-table {
    width: 100%;
    margin-top: 18px;
    border-collapse: collapse;
    table-layout: fixed;
    color: var(--paper-2);
    font-size: 14px;
}

.parameter-table tr {
    border-top: 1px solid var(--line-dark);
}

.parameter-table th,
.parameter-table td {
    padding: 9px 0;
    vertical-align: top;
    text-align: left;
    overflow-wrap: anywhere;
}

.parameter-table th {
    width: 42%;
    padding-right: 14px;
    color: var(--muted-dark);
    font-weight: 640;
}

.parameter-table td {
    color: var(--paper-2);
    font-family: "Cascadia Code", Consolas, monospace;
}

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

.trouble-card {
    background: rgba(255, 250, 240, 0.72);
}

.site-footer {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    padding: 28px 34px;
    color: rgba(255, 250, 240, 0.72);
    background: var(--ink);
    border-top: 1px solid var(--line-dark);
}

@media (max-width: 980px) {
    .hero-content {
        padding-top: 138px;
        padding-bottom: 220px;
    }

    .hero-content h1 {
        font-size: 58px;
    }

    .hero-copy {
        font-size: 19px;
    }

    .project-grid,
    .project-grid.two-up,
    .trouble-grid,
    .steps,
    .feature-grid,
    .parameter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .flow-list li {
        grid-template-columns: 56px 1fr;
    }

    .flow-list span {
        grid-column: 2;
    }

    .notes-layout,
    .overview-layout,
    .code-layout {
        grid-template-columns: 1fr;
        gap: 28px;
    }
}

@media (max-width: 720px) {
    :root {
        --header-height: 64px;
    }

    .site-header {
        padding: 0 18px;
        gap: 10px;
    }

    .brand span:last-child {
        max-width: 84px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .header-actions {
        gap: 5px;
    }

    .site-nav {
        gap: 2px;
    }

    .site-nav a,
    .language-toggle {
        min-height: 32px;
        padding: 6px 7px;
        font-size: 14px;
    }

    .language-toggle {
        min-width: 42px;
    }

    .hero {
        min-height: 92svh;
    }

    .hero-content,
    .section-inner {
        width: min(100% - 32px, var(--max-width));
    }

    .hero-content {
        padding-top: 116px;
        padding-bottom: 244px;
    }

    .hero-content h1 {
        font-size: 44px;
        line-height: 1.02;
    }

    .hero-copy {
        margin-top: 20px;
        font-size: 17px;
        line-height: 1.62;
    }

    .hero-actions {
        gap: 10px;
    }

    .button {
        min-height: 42px;
        padding: 10px 12px;
        font-size: 15px;
    }

    .hero-telemetry,
    .device-map {
        right: 16px;
        bottom: 20px;
        width: calc(100% - 32px);
    }

    .section {
        padding: 64px 0;
    }

    .section h2 {
        font-size: 32px;
        line-height: 1.14;
    }

    .section-copy {
        font-size: 16px;
    }

    .project-grid,
    .project-grid.two-up,
    .facts-grid,
    .trouble-grid,
    .steps,
    .feature-grid,
    .parameter-grid {
        grid-template-columns: 1fr;
    }

    .project-card,
    .step-card {
        min-height: auto;
    }

    .project-card-large {
        padding: 24px;
    }

    .project-card-large h3 {
        font-size: 29px;
    }

    .flow-list li {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 18px 0;
    }

    .flow-list span {
        grid-column: auto;
    }

    .note-row {
        grid-template-columns: 42px 1fr;
    }

    .site-footer {
        flex-direction: column;
        padding: 24px 18px;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        transition-duration: 1ms !important;
        animation-duration: 1ms !important;
        animation-iteration-count: 1 !important;
    }
}
