@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: 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-display: "Chakra Petch", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
}

* {
    box-sizing: border-box;
}

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

body {
    min-height: 100vh;
    margin: 0;
    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: -1;
    inset: 0;
    background:
        repeating-linear-gradient(180deg, rgba(125, 255, 147, 0.022) 0 1px, transparent 1px 4px),
        linear-gradient(90deg, rgba(126, 215, 255, 0.03), transparent 30%, transparent 70%, rgba(255, 79, 216, 0.03));
    content: "";
    pointer-events: none;
}

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

a:hover {
    color: #fff;
}

button,
input,
textarea {
    font: inherit;
}

button,
.button {
    min-height: 34px;
    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.7rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    line-height: 1;
    padding: 8px 10px;
    text-decoration: none;
    text-transform: uppercase;
    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);
}

.site-shell {
    width: min(1500px, 100%);
    margin: 0 auto;
    padding: 16px;
}

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

.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: 27px;
    height: 27px;
    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 a {
    border: 1px solid transparent;
    color: var(--muted);
    font-family: var(--font-display);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    padding: 7px 8px;
    text-decoration: none;
    text-transform: uppercase;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
    border-color: rgba(126, 215, 255, 0.25);
    color: var(--phosphor-soft);
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 22px;
    padding: clamp(28px, 4vw, 52px) 2px clamp(20px, 3vw, 32px);
}

.eyebrow,
.section-kicker {
    color: var(--amber);
    font-family: var(--font-display);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.hero h1 {
    max-width: 760px;
    margin: 7px 0 10px;
    font-family: var(--font-display);
    font-size: clamp(2.3rem, 4.9vw, 4.6rem);
    letter-spacing: -0.045em;
    line-height: 0.88;
    text-transform: uppercase;
}

.hero h1 .accent {
    color: var(--phosphor);
}

.lede {
    max-width: 70ch;
    margin: 0;
    color: var(--muted);
    font-size: clamp(0.82rem, 0.9vw, 0.94rem);
    line-height: 1.6;
}

.privacy-badge {
    display: grid;
    min-width: 210px;
    gap: 4px;
    border: 1px solid rgba(126, 215, 255, 0.25);
    border-radius: 6px;
    color: var(--muted);
    background: rgba(5, 15, 9, 0.82);
    padding: 11px;
    font-size: 0.65rem;
    line-height: 1.5;
}

.privacy-badge strong {
    color: var(--ice);
    font-family: var(--font-display);
    font-size: 0.73rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.tool-workspace,
.content-panel,
.tool-card,
.product-bridge {
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--panel);
    box-shadow: 0 20px 55px var(--shadow);
}

.workspace-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border-bottom: 1px solid var(--line);
    background: rgba(7, 18, 11, 0.94);
    padding: 8px 11px;
}

.workspace-title {
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--phosphor-soft);
    font-family: var(--font-display);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.status-lights {
    display: inline-flex;
    gap: 5px;
}

.status-lights span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--muted-2);
}

.status-lights span:first-child {
    background: var(--phosphor);
    box-shadow: 0 0 8px rgba(125, 255, 147, 0.62);
}

.workspace-actions,
.view-tabs,
.search-controls,
.option-controls,
.input-actions,
.result-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.workspace-actions {
    border-bottom: 1px solid rgba(95, 255, 135, 0.18);
    padding: 8px 11px;
}

.workspace-grid {
    display: grid;
    grid-template-columns: minmax(300px, 0.9fr) minmax(380px, 1.1fr);
    min-height: 500px;
}

.workspace-pane {
    min-width: 0;
    padding: 10px;
}

.workspace-pane + .workspace-pane {
    border-left: 1px solid var(--line);
}

.pane-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 34px;
    margin-bottom: 6px;
}

.pane-head h2,
.input-heading {
    margin: 0;
    color: var(--phosphor-soft);
    font-family: var(--font-display);
    font-size: 0.76rem;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.input-zone {
    position: relative;
    height: calc(100% - 40px);
    min-height: 400px;
    border: 1px solid rgba(126, 215, 255, 0.24);
    border-radius: 5px;
    background: rgba(1, 6, 3, 0.9);
    transition: border-color 120ms ease, background 120ms ease;
}

.input-zone.drag-active {
    border-color: var(--phosphor);
    background: rgba(22, 63, 32, 0.35);
}

.code-input,
.code-output {
    width: 100%;
    height: 100%;
    min-height: inherit;
    resize: none;
    border: 0;
    border-radius: inherit;
    outline: 0;
    color: var(--text);
    background: transparent;
    caret-color: var(--phosphor);
    font-size: 0.74rem;
    line-height: 1.52;
    padding: 12px;
    tab-size: 2;
    white-space: pre;
}

.code-input::placeholder {
    color: #66816a;
}

.code-input:focus,
.code-output:focus {
    box-shadow: inset 0 0 0 2px rgba(126, 215, 255, 0.55);
}

.file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

.view-tabs {
    gap: 4px;
}

.view-tabs button {
    min-height: 30px;
    padding: 6px 9px;
}

.view-tabs button[aria-selected="true"] {
    border-color: var(--line-strong);
    color: #031006;
    background: var(--phosphor);
}

.view-panel[hidden] {
    display: none;
}

.result-surface,
.tree-surface {
    height: 100%;
    min-height: 400px;
    overflow: auto;
    border: 1px solid rgba(126, 215, 255, 0.24);
    border-radius: 5px;
    background: rgba(1, 6, 3, 0.9);
}

.tree-surface {
    padding: 9px;
}

.empty-state {
    display: grid;
    min-height: 375px;
    place-items: center;
    color: var(--muted-2);
    font-size: 0.74rem;
    line-height: 1.6;
    padding: 24px;
    text-align: center;
}

.tree-list,
.tree-list ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.tree-list ul {
    margin-left: 19px;
    border-left: 1px solid rgba(126, 215, 255, 0.16);
    padding-left: 10px;
}

.tree-node {
    position: relative;
    min-width: max-content;
}

.tree-summary,
.tree-leaf,
.tree-flat-row {
    display: flex;
    align-items: baseline;
    gap: 6px;
    min-height: 25px;
    border-radius: 4px;
    padding: 3px 5px;
    font-size: 0.72rem;
    line-height: 1.4;
}

.tree-summary {
    cursor: pointer;
}

.tree-summary:hover,
.tree-leaf:hover,
.tree-flat-row:hover,
.tree-node.search-hit > .tree-summary,
.tree-node.search-hit > .tree-leaf,
.tree-flat-row.search-hit {
    background: rgba(126, 215, 255, 0.1);
}

.tree-key {
    color: var(--ice);
}

.tree-string {
    color: var(--phosphor-soft);
}

.tree-number {
    color: var(--amber);
}

.tree-boolean {
    color: var(--magenta);
}

.tree-null {
    color: var(--muted-2);
    font-style: italic;
}

.tree-meta {
    color: var(--muted-2);
}

.tree-node-actions {
    display: inline-flex;
    gap: 4px;
    margin-left: auto;
    padding-left: 8px;
}

.tree-node-actions button {
    min-height: 25px;
    border-color: transparent;
    color: var(--muted-2);
    background: transparent;
    font-size: 0.62rem;
    padding: 3px 5px;
}

.tree-node-actions button:hover {
    border-color: rgba(126, 215, 255, 0.25);
    color: var(--phosphor-soft);
}

.tree-flat-row {
    padding-left: calc(7px + (var(--tree-depth, 0) * 20px));
}

.search-controls {
    width: 100%;
    border-top: 1px solid rgba(95, 255, 135, 0.18);
    padding: 7px 11px;
}

.search-controls input {
    min-width: 180px;
    flex: 1 1 230px;
    min-height: 34px;
    border: 1px solid rgba(126, 215, 255, 0.28);
    border-radius: 5px;
    outline: 0;
    color: var(--text);
    background: rgba(1, 7, 3, 0.96);
    font-size: 0.74rem;
    padding: 7px 9px;
}

.search-controls input:focus {
    border-color: var(--ice);
}

.status-line {
    min-height: 24px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    background: rgba(5, 15, 9, 0.92);
    font-size: 0.66rem;
    line-height: 1.5;
    padding: 8px 11px;
}

.status-line[data-state="success"] {
    color: var(--phosphor-soft);
    background: var(--success-bg);
}

.status-line[data-state="error"] {
    color: #ffd0d0;
    background: var(--danger-bg);
}

.status-line[data-state="busy"] {
    color: var(--ice);
}

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

.tools-grid {
    margin-bottom: 18px;
}

.tool-card {
    display: flex;
    min-height: 230px;
    flex-direction: column;
    padding: clamp(20px, 3vw, 30px);
}

.tool-card .tool-number {
    color: var(--amber);
    font-family: var(--font-display);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.tool-card h2 {
    margin: 15px 0 9px;
    color: var(--phosphor-soft);
    font-family: var(--font-display);
    font-size: clamp(1.55rem, 3vw, 2.35rem);
    line-height: 0.98;
    text-transform: uppercase;
}

.tool-card p {
    margin: 0 0 16px;
    color: var(--muted);
    font-size: 0.84rem;
    line-height: 1.6;
}

.tool-card .button {
    align-self: flex-start;
    margin-top: auto;
}

.content-stack {
    display: grid;
    gap: 14px;
    margin-top: 18px;
}

.content-panel {
    padding: clamp(20px, 3vw, 28px);
}

.content-panel h2,
.product-bridge h2 {
    margin: 6px 0 11px;
    color: var(--phosphor-soft);
    font-family: var(--font-display);
    font-size: clamp(1.35rem, 2.4vw, 1.9rem);
    line-height: 1.05;
    text-transform: uppercase;
}

.content-panel h3 {
    margin: 0 0 9px;
    color: var(--ice);
    font-family: var(--font-display);
    font-size: 0.9rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.content-panel p,
.content-panel li,
.product-bridge p {
    color: var(--muted);
    font-size: 0.84rem;
    line-height: 1.65;
}

.content-panel ul,
.content-panel ol {
    padding-left: 21px;
}

.faq-list {
    display: grid;
    gap: 9px;
}

.faq-list details {
    border: 1px solid rgba(126, 215, 255, 0.18);
    border-radius: 5px;
    background: rgba(5, 15, 9, 0.65);
    padding: 11px 13px;
}

.faq-list summary {
    color: var(--phosphor-soft);
    cursor: pointer;
    font-family: var(--font-display);
    font-weight: 700;
}

.faq-list p {
    margin: 10px 0 0;
}

.product-bridge {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 20px;
    margin-top: 18px;
    padding: clamp(20px, 3vw, 27px);
}

.product-bridge p {
    max-width: 75ch;
    margin: 0;
}

.site-footer {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 20px;
    margin-top: 18px;
    border-top: 1px solid var(--line);
    color: var(--muted-2);
    font-size: 0.7rem;
    line-height: 1.6;
    padding: 20px 3px 12px;
}

.site-footer nav {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

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

.compare-workspace .workspace-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-height: 0;
}

.compare-input {
    min-width: 0;
    padding: 10px;
}

.compare-input + .compare-input {
    border-left: 1px solid var(--line);
}

.compare-input .input-zone {
    height: 270px;
    min-height: 270px;
}

.compare-input .code-input {
    min-height: 268px;
}

.compare-results {
    border-top: 1px solid var(--line);
}

.results-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid rgba(95, 255, 135, 0.18);
    padding: 8px 11px;
}

.diff-summary {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    color: var(--muted);
    font-size: 0.72rem;
}

.diff-summary span {
    border: 1px solid rgba(126, 215, 255, 0.18);
    border-radius: 4px;
    padding: 6px 8px;
}

.diff-summary .added {
    color: var(--phosphor-soft);
}

.diff-summary .removed {
    color: #ffb0b0;
}

.diff-surface {
    min-height: 270px;
    max-height: 560px;
    overflow: auto;
    background: rgba(1, 6, 3, 0.92);
    font-size: 0.71rem;
}

.diff-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    min-width: 760px;
    border-bottom: 1px solid rgba(126, 215, 255, 0.06);
}

.diff-cell {
    display: grid;
    grid-template-columns: 48px 22px minmax(0, 1fr);
    min-width: 0;
}

.diff-cell + .diff-cell {
    border-left: 1px solid rgba(126, 215, 255, 0.16);
}

.line-number,
.change-symbol {
    color: var(--muted-2);
    background: rgba(8, 20, 12, 0.72);
    padding: 4px 6px;
    text-align: right;
    user-select: none;
}

.change-symbol {
    padding-left: 4px;
    padding-right: 4px;
    text-align: center;
}

.diff-text {
    min-height: 25px;
    overflow-wrap: anywhere;
    padding: 4px 7px;
    white-space: pre;
}

.wrap-lines .diff-text {
    white-space: pre-wrap;
}

.diff-cell.add,
.unified-line.add {
    background: rgba(66, 255, 116, 0.08);
}

.diff-cell.delete,
.unified-line.delete {
    background: rgba(255, 83, 83, 0.1);
}

.diff-cell.add .change-symbol,
.unified-line.add .change-symbol {
    color: var(--phosphor);
}

.diff-cell.delete .change-symbol,
.unified-line.delete .change-symbol {
    color: var(--danger);
}

.diff-text mark {
    border-radius: 2px;
    color: inherit;
    background: rgba(255, 176, 64, 0.26);
}

.diff-skip {
    min-width: 760px;
    border-block: 1px solid rgba(126, 215, 255, 0.13);
    color: var(--muted-2);
    background: rgba(9, 24, 14, 0.88);
    padding: 8px 14px;
    text-align: center;
}

.diff-coarse {
    color: #ffe0a3;
    background: rgba(255, 176, 64, 0.1);
    padding: 18px;
    line-height: 1.7;
}

.unified-line {
    display: grid;
    grid-template-columns: 48px 48px 22px minmax(0, 1fr);
    min-width: 680px;
    border-bottom: 1px solid rgba(126, 215, 255, 0.06);
}

.unified-line .diff-text {
    overflow-wrap: anywhere;
}

.load-more {
    display: flex;
    justify-content: center;
    border-top: 1px solid rgba(126, 215, 255, 0.16);
    padding: 12px;
}

.option-controls {
    padding: 0 11px 8px;
}

.check-option {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--muted);
    font-size: 0.72rem;
}

.check-option input {
    width: 16px;
    height: 16px;
    accent-color: var(--phosphor);
}

.noscript-note {
    border: 1px solid rgba(255, 176, 64, 0.36);
    border-radius: 5px;
    color: #ffe0a3;
    background: rgba(255, 176, 64, 0.08);
    margin-bottom: 18px;
    padding: 14px;
}

@media (max-width: 900px) {
    .hero {
        grid-template-columns: 1fr;
        align-items: start;
    }

    .privacy-badge {
        width: min(100%, 420px);
    }

    .workspace-grid,
    .compare-workspace .workspace-grid {
        grid-template-columns: 1fr;
    }

    .workspace-pane + .workspace-pane,
    .compare-input + .compare-input {
        border-top: 1px solid var(--line);
        border-left: 0;
    }

    .workspace-pane {
        min-height: 390px;
    }

    .input-zone,
    .result-surface,
    .tree-surface {
        min-height: 320px;
    }

    .code-input,
    .code-output {
        min-height: 318px;
    }

    .compare-input .input-zone {
        height: 260px;
        min-height: 260px;
    }

    .compare-input .code-input {
        min-height: 258px;
    }
}

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

    .site-header,
    .workspace-bar,
    .results-toolbar,
    .product-bridge,
    .site-footer {
        grid-template-columns: 1fr;
        align-items: start;
    }

    .site-header,
    .workspace-bar,
    .results-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .site-nav {
        justify-content: flex-start;
    }

    .hero {
        gap: 16px;
        padding: 30px 2px 20px;
    }

    .hero h1 {
        font-size: clamp(2.15rem, 10vw, 2.7rem);
    }

    .lede {
        font-size: 0.78rem;
        line-height: 1.55;
    }

    .tools-grid,
    .content-grid {
        grid-template-columns: 1fr;
    }

    .workspace-actions,
    .search-controls,
    .option-controls {
        align-items: stretch;
    }

    .workspace-actions button,
    .workspace-actions .button {
        flex: 1 1 140px;
    }

    button,
    .button,
    .search-controls input {
        min-height: 40px;
    }

    .view-tabs button,
    .tree-node-actions button {
        min-height: 36px;
    }

    .workspace-pane {
        min-height: 360px;
        padding: 9px;
    }

    .input-zone,
    .result-surface,
    .tree-surface {
        min-height: 290px;
    }

    .code-input,
    .code-output {
        min-height: 288px;
        font-size: 0.72rem;
        padding: 10px;
    }

    .compare-input .input-zone {
        height: 250px;
        min-height: 250px;
    }

    .compare-input .code-input {
        min-height: 248px;
    }

    .tool-card {
        min-height: 210px;
    }

    .content-panel p,
    .content-panel li,
    .product-bridge p {
        font-size: 0.8rem;
    }

    .product-bridge,
    .site-footer {
        display: grid;
    }

    .diff-row {
        min-width: 680px;
    }
}

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

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}
