:root {
    --ink: #080a09;
    --ink-1: #0d100e;
    --ink-2: #141815;
    --ink-3: #1b201c;
    --paper: #f0eee5;
    --white: #f9f7f0;
    --muted: #939990;
    --line: #303630;
    --line-soft: rgba(255, 255, 255, 0.12);
    --acid: #c7ff38;
    --blue: #6673ff;
    --sky: #85dcff;
    --coral: #ff806d;
    --violet: #a58aff;
    --scroll-track: #101411;
    --scroll-thumb: #3f4741;
    --scroll-thumb-hover: #59625b;
    --sans: "Manrope", Arial, sans-serif;
    --mono: "DM Mono", Consolas, monospace;
    --shell: min(1360px, calc(100% - 80px));
    --header-height: 72px;
}

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

* {
    scrollbar-color: var(--scroll-thumb) var(--scroll-track);
    scrollbar-width: thin;
}

*::-webkit-scrollbar {
    width: 9px;
    height: 9px;
    background: var(--scroll-track);
}

*::-webkit-scrollbar-track,
*::-webkit-scrollbar-corner {
    background: var(--scroll-track);
}

*::-webkit-scrollbar-thumb {
    min-height: 34px;
    border: 2px solid var(--scroll-track);
    border-radius: 8px;
    background: var(--scroll-thumb);
}

*::-webkit-scrollbar-thumb:hover {
    background: var(--scroll-thumb-hover);
}

html {
    scroll-behavior: smooth;
    background: var(--ink);
}

body {
    min-width: 320px;
    margin: 0;
    overflow-x: hidden;
    background: var(--ink);
    color: var(--white);
    font-family: var(--sans);
    -webkit-font-smoothing: antialiased;
}

body.menu-open {
    overflow: hidden;
}

button,
a {
    color: inherit;
}

a {
    text-decoration: none;
}

button {
    font: inherit;
}

button:focus-visible,
a:focus-visible {
    outline: 3px solid var(--sky);
    outline-offset: 3px;
}

img {
    display: block;
    max-width: 100%;
}

pre,
code {
    font-family: var(--mono);
}

.page-shell {
    width: var(--shell);
    margin: 0 auto;
}

.skip-link {
    position: fixed;
    z-index: 1000;
    top: 10px;
    left: 10px;
    padding: 10px 15px;
    transform: translateY(-160%);
    border: 1px solid var(--ink);
    background: var(--acid);
    color: var(--ink);
    font-weight: 800;
}

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

.lexicon-field {
    position: fixed;
    z-index: 0;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0.4;
    pointer-events: none;
}

.site-header {
    position: fixed;
    z-index: 100;
    top: 0;
    right: 0;
    left: 0;
    display: flex;
    height: var(--header-height);
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    border-bottom: 1px solid var(--line-soft);
    background: rgba(8, 10, 9, 0.84);
    backdrop-filter: blur(14px);
}

.site-header.is-scrolled {
    background: rgba(8, 10, 9, 0.96);
}

.scroll-progress {
    position: absolute;
    right: 0;
    bottom: -1px;
    left: 0;
    height: 2px;
    transform: scaleX(0);
    transform-origin: left;
    background: var(--acid);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    letter-spacing: -0.04em;
}

.brand-logo {
    width: 36px;
    height: 36px;
    filter: drop-shadow(0 0 12px rgba(133, 220, 255, 0.22));
}

.brand-name {
    font-size: 1.08rem;
}

.brand-mode {
    padding: 3px 5px;
    border: 1px solid #555c55;
    color: #9fa59e;
    font: 500 0.55rem/1 var(--mono);
    letter-spacing: 0.12em;
}

.primary-nav {
    display: flex;
    align-items: center;
    gap: 28px;
    color: #b2b7b0;
    font-size: 0.78rem;
    font-weight: 600;
}

.primary-nav > a:not(.nav-launch) {
    transition: color 140ms ease;
}

.primary-nav > a:not(.nav-launch):hover {
    color: var(--white);
}

.nav-launch {
    display: inline-flex;
    min-height: 38px;
    align-items: center;
    gap: 25px;
    padding: 0 13px;
    border: 1px solid #70766f;
    color: var(--white);
    font-family: var(--mono);
    font-size: 0.68rem;
    letter-spacing: 0.04em;
    transition: border-color 140ms ease, background-color 140ms ease;
}

.nav-launch i {
    color: var(--acid);
    font-style: normal;
}

.nav-launch:hover {
    border-color: var(--acid);
    background: #161b16;
}

.menu-toggle {
    display: none;
    border: 0;
    background: transparent;
}

.hero-workbench {
    position: relative;
    z-index: 1;
    min-height: 100svh;
    overflow: hidden;
    padding: calc(var(--header-height) + 70px) 0 90px;
    border-bottom: 1px solid var(--line);
}

.hero-grid {
    position: absolute;
    inset: 0;
    opacity: 0.16;
    background-image: linear-gradient(rgba(255, 255, 255, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
    background-size: 64px 64px;
    pointer-events: none;
}

.hero-grid::after {
    position: absolute;
    top: 8%;
    right: 5%;
    width: 460px;
    height: 460px;
    border: 1px solid var(--blue);
    border-radius: 50%;
    content: "";
    opacity: 0.7;
}

.hero-shell {
    position: relative;
    z-index: 2;
}

.hero-heading {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.45fr);
    gap: clamp(50px, 8vw, 130px);
    align-items: end;
}

.signal-label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 24px;
    color: #a8aea6;
    font: 500 0.64rem/1 var(--mono);
    letter-spacing: 0.14em;
}

.signal-label span,
.workbench-state i,
.footer-state i {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--acid);
    box-shadow: 0 0 10px var(--acid);
}

.hero-heading h2 {
    max-width: 1000px;
    margin: 0;
    font-size: clamp(3.8rem, 7.6vw, 8.5rem);
    font-weight: 600;
    letter-spacing: -0.085em;
    line-height: 0.86;
}

.hero-heading h2 em {
    color: var(--sky);
    font-style: normal;
}

.hero-intro {
    padding-bottom: 6px;
}

.hero-intro > p {
    margin: 0;
    color: #adb2ab;
    font-size: 0.98rem;
    line-height: 1.7;
}

.hero-tools {
    display: grid;
    margin-top: 25px;
    border-top: 1px solid var(--line);
}

.hero-tools a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
    font: 500 0.69rem/1.2 var(--mono);
    transition: color 140ms ease, padding 140ms ease;
}

.hero-tools a span {
    color: var(--acid);
}

.hero-tools a:hover {
    padding-left: 7px;
    color: var(--sky);
}

.workbench-window {
    margin-top: 75px;
    border: 1px solid #586058;
    background: var(--ink-1);
    box-shadow: 12px 12px 0 var(--blue);
}

.workbench-bar {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    min-height: 52px;
    border-bottom: 1px solid var(--line);
}

.workbench-identity {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 0 18px;
}

.workbench-identity span,
.workbench-state,
.workbench-bar > a,
.pane-label {
    font-family: var(--mono);
    letter-spacing: 0.08em;
}

.workbench-identity span {
    color: var(--blue);
    font-size: 0.59rem;
}

.workbench-identity strong {
    font: 500 0.69rem/1 var(--mono);
}

.workbench-state {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 22px;
    color: #9da39c;
    font-size: 0.59rem;
}

.workbench-state i,
.footer-state i {
    width: 6px;
    height: 6px;
}

.workbench-bar > .snippet-run {
    align-self: stretch;
    display: grid;
    place-items: center;
    min-width: 90px;
    border: 0;
    border-left: 1px solid var(--line);
    background: var(--acid);
    color: var(--ink);
    cursor: pointer;
    font-size: 0.62rem;
    font-weight: 500;
}

.workbench-bar > .snippet-run:hover:not(:disabled) {
    background: var(--sky);
}

.snippet-run:disabled,
[data-snippet-run]:disabled {
    cursor: wait;
    opacity: 0.62;
}

.workbench-body {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(360px, 0.7fr);
    min-height: 470px;
}

.workbench-code,
.workbench-result {
    min-width: 0;
}

.workbench-code {
    border-right: 1px solid var(--line);
}

.pane-label {
    display: flex;
    min-height: 44px;
    align-items: center;
    justify-content: space-between;
    padding: 0 18px;
    border-bottom: 1px solid var(--line);
    color: #9aa099;
    font-size: 0.58rem;
}

.pane-label small {
    color: #626861;
    font-size: inherit;
}

.snippet-editor {
    display: block;
    width: 100%;
    min-width: 0;
    margin: 0;
    border: 0;
    border-radius: 0;
    outline: 0;
    background: transparent;
    color: #dce2da;
    caret-color: var(--acid);
    font: 400 0.82rem/1.8 var(--mono);
    tab-size: 4;
    resize: none;
}

.snippet-editor-shell {
    --snippet-default: #dce2da;
    --snippet-function: var(--sky);
    --snippet-section: var(--acid);
    --snippet-variable: #f0f3ee;
    --snippet-comment: #7f887f;
    --snippet-pattern: #aab1ff;
    --snippet-number: #bfb1ff;
    --snippet-string: #ffd787;
    --snippet-intrinsic: var(--acid);
    --snippet-type: #ffad9c;
    --snippet-keyword: var(--coral);
    position: relative;
    flex: 1;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    color: var(--snippet-default);
}

.snippet-editor-shell > textarea.snippet-editor {
    position: relative;
    z-index: 1;
    height: 100%;
    color: transparent;
    -webkit-text-fill-color: transparent;
}

.snippet-highlight {
    position: absolute;
    z-index: 0;
    inset: 0;
    overflow: hidden;
    margin: 0 !important;
    pointer-events: none;
    color: var(--snippet-default);
    white-space: pre;
}

.snippet-highlight code {
    display: block;
    min-width: max-content;
    color: inherit;
    font: inherit;
    white-space: inherit;
    transform: translate(var(--snippet-scroll-x, 0), var(--snippet-scroll-y, 0));
}

.snippet-token-function {
    color: var(--snippet-function);
}

.snippet-token-section {
    color: var(--snippet-section);
    font-weight: 600;
}

.snippet-token-variable {
    color: var(--snippet-variable);
}

.snippet-token-comment {
    color: var(--snippet-comment);
    font-style: italic;
}

.snippet-token-patterndefinition {
    color: var(--snippet-pattern);
    font-weight: 600;
}

.snippet-token-number {
    color: var(--snippet-number);
}

.snippet-token-string {
    color: var(--snippet-string);
}

.snippet-token-intrinsic {
    color: var(--snippet-intrinsic);
    font-weight: 600;
}

.snippet-token-type {
    color: var(--snippet-type);
}

.snippet-token-keyword {
    color: var(--snippet-keyword);
    font-weight: 600;
}

.snippet-editor::selection {
    background: rgba(133, 220, 255, 0.3);
}

.snippet-editor:focus {
    background: rgba(133, 220, 255, 0.035);
    box-shadow: inset 0 0 0 1px var(--sky);
}

.hero-snippet-editor-shell {
    height: 426px;
}

.hero-snippet-editor {
    padding: 48px 42px;
    font-size: clamp(0.72rem, 1.1vw, 0.92rem);
}

.snippet-diagnostics {
    padding: 12px 15px;
    border-top: 1px solid rgba(255, 128, 109, 0.45);
    background: rgba(255, 128, 109, 0.08);
    color: #ffad9f;
    font: 400 0.61rem/1.55 var(--mono);
    white-space: pre-wrap;
}

.snippet-diagnostics[hidden] {
    display: none;
}

[data-runnable-sketch][data-run-state="running"] [data-snippet-status] {
    color: var(--sky);
}

[data-runnable-sketch][data-run-state="error"] [data-snippet-status] {
    color: var(--coral);
}

[data-runnable-sketch][data-run-state="done"] [data-snippet-status] {
    color: var(--acid);
}

.workbench-result {
    position: relative;
    overflow: hidden;
    background: var(--ink);
}

.dot-field {
    position: absolute;
    inset: 44px 0 0;
    opacity: 0.54;
    background-image: radial-gradient(circle, var(--blue) 1.7px, transparent 2px);
    background-size: 28px 28px;
    mask-image: linear-gradient(to bottom right, #000 10%, transparent 82%);
}

.workbench-result::before,
.workbench-result::after {
    position: absolute;
    border: 1px solid rgba(133, 220, 255, 0.3);
    border-radius: 50%;
    content: "";
}

.workbench-result::before {
    right: -80px;
    bottom: -100px;
    width: 340px;
    height: 340px;
}

.workbench-result::after {
    right: 55px;
    bottom: 45px;
    width: 110px;
    height: 110px;
    background: var(--acid);
    opacity: 0.8;
}

.result-value {
    position: absolute;
    z-index: 2;
    right: 34px;
    bottom: 50px;
    font-size: clamp(5rem, 10vw, 9rem);
    letter-spacing: -0.1em;
    line-height: 0.8;
}

.result-caption {
    position: absolute;
    z-index: 2;
    right: 38px;
    bottom: 24px;
    color: var(--sky);
    font: 500 0.62rem/1 var(--mono);
}
