@font-face {
    font-family: "Space Mono";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("/assets/fonts/space-mono-400.ttf") format("truetype");
}

@font-face {
    font-family: "Space Mono";
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url("/assets/fonts/space-mono-700.ttf") format("truetype");
}

@font-face {
    font-family: "Chakra Petch";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("/assets/fonts/chakra-petch-400.ttf") format("truetype");
}

@font-face {
    font-family: "Chakra Petch";
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url("/assets/fonts/chakra-petch-600.ttf") format("truetype");
}

@font-face {
    font-family: "Chakra Petch";
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url("/assets/fonts/chakra-petch-700.ttf") format("truetype");
}

:root {
    color-scheme: dark;
    --bg: #030603;
    --bg-deep: #071009;
    --panel: rgba(4, 12, 7, 0.95);
    --panel-raised: rgba(7, 18, 11, 0.98);
    --panel-soft: rgba(9, 23, 14, 0.78);
    --line: rgba(95, 255, 135, 0.3);
    --line-strong: rgba(125, 255, 147, 0.68);
    --phosphor: #7dff93;
    --phosphor-soft: #caffcf;
    --amber: #ffb040;
    --ice: #7ed7ff;
    --magenta: #ff71dd;
    --danger: #ff8f8f;
    --danger-bg: rgba(255, 77, 77, 0.12);
    --success-bg: rgba(73, 255, 120, 0.1);
    --text: #e7ffe9;
    --muted: #abc9ad;
    --muted-2: #7f9d83;
    --shadow: rgba(0, 0, 0, 0.62);
    --font-body: "Space Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    --font-copy: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    --font-display: "Chakra Petch", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
    --font-ui: var(--font-display);
    --layout-width-standard: 1500px;
    --layout-width-tool: 1880px;
    --site-shell-max: var(--layout-width-standard);
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 24px;
    --space-6: 32px;
    --space-7: 48px;
    --space-8: 64px;
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

html {
    min-width: 320px;
    min-height: 100%;
    scroll-behavior: smooth;
}

body {
    position: relative;
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
    color: var(--text);
    font-family: var(--font-body);
    background:
        linear-gradient(135deg, rgba(126, 215, 255, 0.045) 0 1px, transparent 1px 42px),
        linear-gradient(225deg, rgba(255, 79, 216, 0.035) 0 1px, transparent 1px 54px),
        linear-gradient(180deg, #020402 0%, var(--bg) 42%, var(--bg-deep) 100%);
}

body::before {
    position: fixed;
    z-index: 0;
    inset: 0;
    background:
        repeating-linear-gradient(
            180deg,
            rgba(125, 255, 147, 0.028) 0,
            rgba(125, 255, 147, 0.028) 1px,
            transparent 1px,
            transparent 3px
        ),
        linear-gradient(90deg, rgba(126, 215, 255, 0.035), transparent 28%, transparent 68%, rgba(255, 79, 216, 0.035));
    content: "";
    opacity: 0.3;
    pointer-events: none;
}

body::after {
    position: fixed;
    z-index: 0;
    inset: 0;
    background: radial-gradient(circle at center, transparent 58%, rgba(0, 0, 0, 0.28) 100%);
    content: "";
    pointer-events: none;
}

a {
    color: var(--phosphor-soft);
    text-underline-offset: 0.2em;
}

a:hover {
    color: #fff;
}

:where(.page) :where(
    p:not(.eyebrow):not(.kicker):not(.section-kicker):not(.product-signal),
    .reading-panel li,
    .content-panel li
) {
    font-family: var(--font-copy);
}

button,
input,
textarea {
    font: inherit;
}

button,
.button {
    display: inline-flex;
    min-height: 36px;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(126, 215, 255, 0.3);
    border-radius: 5px;
    color: var(--text);
    background: rgba(7, 19, 12, 0.96);
    cursor: pointer;
    font-family: var(--font-display);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    line-height: 1;
    padding: 8px 10px;
    text-decoration: none;
    text-transform: uppercase;
    user-select: none;
    vertical-align: middle;
    transition: border-color 120ms ease, background 120ms ease, color 120ms ease, transform 120ms ease;
}

button:hover,
.button:hover {
    border-color: var(--line-strong);
    color: var(--phosphor-soft);
    background: rgba(12, 33, 19, 0.98);
}

button:active,
.button:active {
    transform: translateY(1px);
}

button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
}

button.primary,
.button.primary {
    border-color: rgba(125, 255, 147, 0.72);
    color: #031006;
    background: var(--phosphor);
}

button.primary:hover,
.button.primary:hover {
    color: #020602;
    background: #a2ffb2;
}

button.danger {
    border-color: rgba(255, 143, 143, 0.35);
    color: #ffd0d0;
}

:focus-visible {
    outline: 3px solid var(--ice);
    outline-offset: 3px;
}

.skip-link {
    position: fixed;
    z-index: 50;
    top: 10px;
    left: 10px;
    transform: translateY(-180%);
    border-radius: 4px;
    color: #020602;
    background: var(--ice);
    padding: 10px 14px;
}

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

.page--tool {
    --site-shell-max: var(--layout-width-tool);
}

.page--standard-shell {
    --site-shell-max: var(--layout-width-standard);
}

.site-shell {
    position: relative;
    z-index: 1;
    width: min(var(--site-shell-max), 100%);
    margin: 0 auto;
    padding: 16px;
}

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border: 1px solid rgba(95, 255, 135, 0.3);
    border-radius: 7px;
    background: rgba(3, 10, 6, 0.88);
    box-shadow: 0 18px 50px var(--shadow);
    padding: 9px 12px;
}

.brand-lockup {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--phosphor-soft);
    font-family: var(--font-display);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-decoration: none;
    text-transform: uppercase;
}

.brand-mark {
    display: grid;
    width: 29px;
    height: 29px;
    flex: 0 0 auto;
    place-items: center;
    border: 1px solid rgba(125, 255, 147, 0.62);
    border-radius: 5px;
    color: var(--phosphor);
    box-shadow: inset 0 0 12px rgba(125, 255, 147, 0.08);
}

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

.site-nav-toggle {
    display: none;
}

.site-nav a,
.context-nav a {
    display: inline-flex;
    min-height: 38px;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    color: var(--muted);
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    padding: 7px 9px;
    text-decoration: none;
    text-transform: uppercase;
}

.site-nav a:hover,
.site-nav a[aria-current="page"],
.context-nav a:hover,
.context-nav a[aria-current="page"] {
    border-color: rgba(126, 215, 255, 0.32);
    color: var(--phosphor-soft);
    background: rgba(7, 19, 12, 0.72);
}

.context-nav {
    display: flex;
    min-height: 38px;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    border-right: 1px solid rgba(95, 255, 135, 0.18);
    border-bottom: 1px solid rgba(95, 255, 135, 0.18);
    border-left: 1px solid rgba(95, 255, 135, 0.18);
    border-radius: 0 0 6px 6px;
    background: rgba(3, 10, 6, 0.58);
    padding: 3px 8px;
}

.context-nav::before {
    margin-right: auto;
    color: var(--muted-2);
    content: attr(data-label);
    font-size: 0.66rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.site-footer {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 20px;
    margin-top: 18px;
    border-top: 1px solid var(--line);
    color: var(--muted-2);
    font-size: 0.75rem;
    line-height: 1.65;
    padding: 20px 3px 12px;
}

.site-footer strong {
    color: var(--phosphor-soft);
    font-family: var(--font-display);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.site-footer nav {
    display: flex;
    max-width: 660px;
    justify-content: flex-end;
    gap: 8px 14px;
    flex-wrap: wrap;
}

.site-footer a {
    color: var(--muted);
}

@media (max-width: 720px) {
    .site-shell {
        padding: 10px;
    }

    .site-header {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: 8px 12px;
        padding: 8px 10px;
    }

    .brand-lockup {
        min-width: 0;
    }

    .brand-lockup span:last-child {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .site-nav-toggle {
        display: inline-flex;
        min-width: 82px;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
    }

    .site-nav-toggle::after {
        content: "+";
        color: var(--phosphor);
        font-family: var(--font-body);
        font-size: 1rem;
        line-height: 1;
    }

    .site-nav-toggle[aria-expanded="true"]::after {
        content: "−";
    }

    .site-nav {
        display: grid;
        grid-column: 1 / -1;
        width: 100%;
        grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
        gap: 4px;
        border-top: 1px solid rgba(95, 255, 135, 0.16);
        padding-top: 8px;
    }

    .site-header--nav-enhanced .site-nav {
        display: none;
    }

    .site-header--nav-enhanced.site-header--nav-open .site-nav {
        display: grid;
    }

    .site-nav a,
    .context-nav a,
    button,
    .button {
        min-height: 44px;
    }

    .site-nav a,
    .context-nav a {
        font-size: 0.75rem;
        text-align: center;
    }

    .context-nav {
        justify-content: flex-start;
        overflow-x: auto;
        overscroll-behavior-x: contain;
        padding: 6px;
        scroll-snap-type: x proximity;
        scrollbar-width: thin;
    }

    .context-nav::before {
        flex: 0 0 auto;
        margin: 0;
        padding: 2px 4px;
    }

    .context-nav a {
        flex: 0 0 auto;
        scroll-snap-align: start;
        white-space: nowrap;
    }

    .site-footer {
        grid-template-columns: 1fr;
    }

    .site-footer nav {
        display: grid;
        width: 100%;
        max-width: none;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        justify-content: stretch;
    }

    .site-footer nav a {
        min-height: 36px;
        align-content: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-delay: 0ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}
