@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Inter:wght@400;500;600&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
    background: #060910;
}

body {
    background: #060910;
    color: #eaf0f6;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
}

h1, h2, h3, .wordmark {
    font-family: 'Space Grotesk', 'Inter', sans-serif;
}

/* ---- Background layers ---- */

.bg-base {
    position: fixed;
    inset: 0;
    z-index: 0;
    background:
        radial-gradient(ellipse 80% 60% at 50% 0%, #101a2c 0%, #060910 55%),
        linear-gradient(180deg, #060910 0%, #05070c 100%);
}

#freight-canvas {
    position: fixed;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    display: block;
    pointer-events: none;
}

.bg-vignette {
    position: fixed;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    background:
        radial-gradient(ellipse 90% 70% at 50% 10%, rgba(6,9,16,0) 0%, rgba(6,9,16,0.55) 70%, rgba(5,7,12,0.85) 100%);
}

/* ---- Nav ---- */

nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 5vw;
    background: rgba(6, 9, 16, 0.85);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    transition: padding 0.25s ease, background-color 0.25s ease, box-shadow 0.25s ease;
}

nav.nav-scrolled {
    padding: 12px 5vw;
    background: rgba(6, 9, 16, 0.97);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}

.wordmark {
    font-size: 1.35rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: #eaf0f6;
    display: flex;
    align-items: center;
    gap: 2px;
    transition: font-size 0.25s ease;
}

nav.nav-scrolled .wordmark {
    font-size: 1.1rem;
}

.wordmark .seg-json {
    color: #7fa8d9;
    font-weight: 400;
}

.wordmark .seg-load {
    color: #eaf0f6;
    font-weight: 700;
}

.wordmark .seg-dot {
    color: #5eead4;
}

#buy_now_link {
    display: inline-block;
    padding: 10px 22px;
    background: #5eead4;
    color: #06231f;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    border-radius: 999px;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, padding 0.25s ease, font-size 0.25s ease;
    box-shadow: 0 0 0 rgba(94, 234, 212, 0);
}

nav.nav-scrolled #buy_now_link {
    padding: 8px 18px;
    font-size: 0.82rem;
}

#buy_now_link:hover,
#buy_now_link:focus-visible {
    transform: translateY(-2px);
    background: #8ff3e1;
    box-shadow: 0 8px 24px rgba(94, 234, 212, 0.25);
}

#buy_now_link:focus-visible {
    outline: 2px solid #eaf0f6;
    outline-offset: 3px;
}

/* ---- Layout / content stacking ---- */
/* Content sections sit above the fixed background layers (z-index 0-2). */

main {
    position: relative;
    z-index: 10;
}

.hero,
.cards-section,
.signal-line {
    position: relative;
    z-index: 10;
}

/* ---- Hero ---- */

.hero {
    padding: 14vh 6vw 10vh;
    min-height: 88vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.hero .eyebrow {
    font-size: 0.78rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: #5eead4;
    font-weight: 600;
    margin-bottom: 22px;
}

.hero h1 {
    font-size: clamp(2rem, 6vw, 5rem);
    line-height: 1.08;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #f5f8fb;
}

.hero h1 span {
    display: block;
}

.hero h1 .accent {
    background: linear-gradient(100deg, #5eead4, #60a5fa 60%, #a78bfa);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero p.lede {
    margin: 28px auto 0;
    max-width: 680px;
    font-size: clamp(1rem, 1.6vw, 1.15rem);
    line-height: 1.7;
    color: #a9b6c6;
}

.hero .domain-chip {
    margin-top: 40px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.03);
    font-family: 'Space Grotesk', monospace;
    font-size: 1rem;
    color: #eaf0f6;
    letter-spacing: 0.01em;
}

.hero .domain-chip .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #5eead4;
    box-shadow: 0 0 10px 2px rgba(94, 234, 212, 0.6);
    flex-shrink: 0;
}

/* ---- Cards ---- */

.cards-section {
    padding: 4vh 6vw 12vh;
    max-width: 1200px;
    margin: 0 auto;
}

.cards-section .section-head {
    text-align: center;
    max-width: 620px;
    margin: 0 auto 48px;
}

.cards-section .section-head h2 {
    font-size: clamp(1.5rem, 3vw, 2.1rem);
    font-weight: 600;
    color: #f5f8fb;
    margin-bottom: 14px;
}

.cards-section .section-head p {
    color: #a9b6c6;
    font-size: 1rem;
    line-height: 1.65;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
}

.card {
    padding: 38px 34px;
    background: linear-gradient(165deg, rgba(255,255,255,0.045), rgba(255,255,255,0.015));
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 18px;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.card:hover {
    transform: translateY(-6px);
    border-color: rgba(94, 234, 212, 0.35);
    box-shadow: 0 20px 40px -18px rgba(0, 0, 0, 0.6);
}

.card .card-index {
    font-family: 'Space Grotesk', monospace;
    font-size: 0.8rem;
    color: #5eead4;
    letter-spacing: 0.08em;
    margin-bottom: 18px;
    display: block;
}

.card h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #f5f8fb;
    margin-bottom: 12px;
    letter-spacing: -0.01em;
}

.card p {
    color: #a9b6c6;
    font-size: 0.96rem;
    line-height: 1.65;
}

/* ---- Signal line / CTA ---- */

.signal-line {
    padding: 10vh 6vw 14vh;
    text-align: center;
}

.signal-inner {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
}

.signal-status {
    font-family: 'Space Grotesk', monospace;
    font-size: 0.78rem;
    letter-spacing: 0.22em;
    color: #5eead4;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.signal-status::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #5eead4;
    box-shadow: 0 0 10px 2px rgba(94, 234, 212, 0.6);
    flex-shrink: 0;
}

.signal-cta {
    display: inline-block;
    padding: 20px 52px;
    background: linear-gradient(100deg, #5eead4, #60a5fa);
    color: #06111f;
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: 0.01em;
    text-decoration: none;
    border-radius: 999px;
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
    box-shadow: 0 12px 30px -8px rgba(94, 234, 212, 0.35);
}

.signal-cta:hover,
.signal-cta:focus-visible {
    transform: translateY(-3px);
    filter: brightness(1.06);
    box-shadow: 0 18px 40px -10px rgba(94, 234, 212, 0.5);
}

.signal-cta:focus-visible {
    outline: 2px solid #eaf0f6;
    outline-offset: 4px;
}

.signal-sub {
    color: #7c8aa0;
    font-size: 0.9rem;
}

/* ---- Footer ---- */
/* Footer markup itself is injected via SSI and shouldn't be edited per-domain -
   contrast, background, and spacing live here so the footer stays legible
   over the fixed background / canvas animation. */

footer {
    position: relative;
    z-index: 10;
    text-align: center;
    padding: 28px 6vw 40px;
    color: #a9b6c6;
    font-size: 0.82rem;
    background: rgba(6, 9, 16, 0.92);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

footer div {
    margin: 4px 0;
}

footer a {
    color: #a9b6c6;
    text-decoration: underline;
}

footer a:hover {
    color: #5eead4;
}

/* ---- Reduced motion ---- */

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    nav, .wordmark, .card, #buy_now_link, .signal-cta { transition: none; }
}

/* ---- Mobile ---- */

@media (max-width: 480px) {
    nav {
        padding: 16px 5vw;
    }

    .wordmark {
        font-size: 1.1rem;
    }

    #buy_now_link {
        padding: 9px 16px;
        font-size: 0.82rem;
    }

    nav.nav-scrolled {
        padding: 8px 5vw;
    }

    nav.nav-scrolled .wordmark {
        font-size: 1rem;
    }

    nav.nav-scrolled #buy_now_link {
        padding: 7px 14px;
        font-size: 0.76rem;
    }

    .hero {
        padding: 12vh 6vw 8vh;
        min-height: unset;
    }

    .hero .domain-chip {
        font-size: 0.85rem;
        padding: 10px 18px;
    }

    .cards-section {
        padding: 2vh 6vw 8vh;
    }

    .card {
        padding: 30px 26px;
    }

    .signal-cta {
        padding: 18px 36px;
        font-size: 1rem;
        width: 100%;
    }

    .signal-line {
        padding: 8vh 6vw 10vh;
    }
}

/* ---- JSON tool ---- */
/* .wordmark is now an <a> (was a <div>) so the nav logo links home -
   reset link defaults, visuals unchanged. */

a.wordmark {
    text-decoration: none;
    cursor: pointer;
}

.jl-hero {
    padding: 12vh 6vw 4vh;
    min-height: unset;
}

.jl-tool {
    position: relative;
    z-index: 10;
    max-width: 900px;
    margin: 0 auto;
    padding: 0 6vw 8vh;
}

.jl-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.jl-btn {
    font-family: 'Space Grotesk', monospace;
    font-size: 0.85rem;
    font-weight: 600;
    color: #eaf0f6;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    padding: 10px 22px;
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.jl-btn:hover {
    border-color: rgba(94, 234, 212, 0.4);
    transform: translateY(-1px);
}

.jl-btn-primary {
    background: linear-gradient(100deg, #5eead4, #60a5fa);
    color: #06111f;
    border-color: transparent;
}

.jl-btn-primary:hover {
    filter: brightness(1.06);
}

.jl-feedback {
    font-size: 0.82rem;
    color: #5eead4;
}

.jl-input {
    width: 100%;
    min-height: 220px;
    resize: vertical;
    font-family: 'Space Grotesk', monospace;
    font-size: 0.92rem;
    line-height: 1.6;
    color: #eaf0f6;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 14px;
    padding: 20px;
    outline: none;
    transition: border-color 0.2s;
}

.jl-input:focus {
    border-color: rgba(94, 234, 212, 0.4);
}

.jl-input::placeholder {
    color: #6b7889;
}

.jl-warning {
    font-size: 0.8rem;
    color: #f0b060;
    margin: 12px 0 0;
}

.jl-status {
    font-family: 'Space Grotesk', monospace;
    font-size: 0.85rem;
    font-weight: 600;
    margin: 16px 0;
    padding: 12px 18px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.09);
}

.jl-status-empty {
    color: #7c8aa0;
    background: rgba(255, 255, 255, 0.02);
}

.jl-status-valid {
    color: #5eead4;
    background: rgba(94, 234, 212, 0.08);
    border-color: rgba(94, 234, 212, 0.25);
}

.jl-status-invalid {
    color: #fca5a5;
    background: rgba(252, 165, 165, 0.08);
    border-color: rgba(252, 165, 165, 0.28);
}

.jl-tree {
    font-family: 'Space Grotesk', monospace;
    font-size: 0.88rem;
    line-height: 1.75;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 14px;
    padding: 18px 22px;
    overflow-x: auto;
}

.jl-tree:empty {
    display: none;
}

.jt-children {
    display: block;
    margin-left: 22px;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    padding-left: 14px;
}

.jt-node:not(.jt-open) > .jt-children,
.jt-node:not(.jt-open) > .jt-close {
    display: none;
}

.jt-node.jt-open > .jt-toggle .jt-preview {
    display: none;
}

.jt-toggle {
    cursor: pointer;
    user-select: none;
    border-radius: 4px;
}

.jt-toggle:focus-visible {
    outline: 2px solid #5eead4;
    outline-offset: 2px;
}

.jt-row {
    cursor: pointer;
    border-radius: 4px;
}

.jt-row:focus-visible {
    outline: 2px solid #60a5fa;
    outline-offset: 2px;
}

.jt-caret {
    display: inline-block;
    width: 14px;
    color: #7c8aa0;
    font-size: 0.7rem;
}

.jt-preview {
    color: #7c8aa0;
    font-style: italic;
    margin-left: 4px;
}

.jt-row {
    margin: 2px 0;
}

.jt-key { color: #60a5fa; }
.jt-string { color: #5eead4; }
.jt-number { color: #a78bfa; }
.jt-boolean { color: #f0b060; }
.jt-null { color: #7c8aa0; font-style: italic; }
.jt-punct { color: #7c8aa0; }

.jl-privacy {
    margin-top: 18px;
    font-size: 0.78rem;
    color: #7c8aa0;
}

/* ---- Error snippet ---- */

.jl-error-snippet {
    margin: -8px 0 16px;
    padding: 14px 18px;
    background: rgba(252, 165, 165, 0.06);
    border: 1px solid rgba(252, 165, 165, 0.22);
    border-radius: 10px;
    color: #fca5a5;
    font-family: 'Space Grotesk', monospace;
    font-size: 0.82rem;
    line-height: 1.5;
    overflow-x: auto;
    white-space: pre;
}

/* ---- Statistics ---- */

.jl-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 20px 30px;
    margin: 0 0 18px;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 14px;
}

.jl-stat {
    display: flex;
    flex-direction: column;
    min-width: 64px;
}

.jl-stat-value {
    font-family: 'Space Grotesk', monospace;
    font-size: 1.3rem;
    font-weight: 700;
    color: #eaf0f6;
    line-height: 1.2;
}

.jl-stat-label {
    font-size: 0.68rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #7c8aa0;
    margin-top: 4px;
}

/* ---- Tree controls (search + expand/collapse) ---- */

.jl-tree-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.jl-search-label {
    font-size: 0.78rem;
    color: #a9b6c6;
}

.jl-search-input {
    flex: 1 1 200px;
    min-width: 160px;
    font-family: 'Inter', sans-serif;
    font-size: 0.88rem;
    color: #eaf0f6;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    padding: 9px 16px;
    outline: none;
    transition: border-color 0.2s;
}

.jl-search-input:focus {
    border-color: rgba(94, 234, 212, 0.4);
}

.jl-search-count {
    font-size: 0.78rem;
    color: #7c8aa0;
    min-width: 70px;
}

.jl-tree-controls-sep {
    width: 1px;
    align-self: stretch;
    background: rgba(255, 255, 255, 0.1);
    margin: 0 4px;
}

.jl-btn-small {
    padding: 7px 16px;
    font-size: 0.78rem;
}

.jl-btn-small:disabled {
    opacity: 0.4;
    cursor: default;
    transform: none;
}

/* ---- Path bar ---- */

.jl-path-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    padding: 10px 18px;
    background: rgba(96, 165, 250, 0.06);
    border: 1px solid rgba(96, 165, 250, 0.22);
    border-radius: 10px;
}

.jl-path-label {
    font-size: 0.75rem;
    color: #7c8aa0;
    flex-shrink: 0;
}

.jl-path-value {
    font-family: 'Space Grotesk', monospace;
    font-size: 0.85rem;
    color: #60a5fa;
    word-break: break-all;
    flex: 1;
}

/* ---- Tree selection / search states ---- */

.jt-selected {
    outline: 1px solid rgba(96, 165, 250, 0.6);
    outline-offset: 2px;
    border-radius: 3px;
    background: rgba(96, 165, 250, 0.08);
}

.jt-match {
    background: rgba(240, 176, 96, 0.28);
    border-radius: 3px;
}

.jt-match-current {
    background: rgba(240, 176, 96, 0.55);
    box-shadow: 0 0 0 1px rgba(240, 176, 96, 0.7);
}

/* ---- Educational section ---- */

.jl-edu {
    position: relative;
    z-index: 10;
    max-width: 1000px;
    margin: 0 auto;
    padding: 4vh 6vw 6vh;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 28px;
}

.jl-edu-item h2 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.05rem;
    font-weight: 600;
    color: #f5f8fb;
    margin-bottom: 10px;
}

.jl-edu-item p {
    color: #a9b6c6;
    font-size: 0.92rem;
    line-height: 1.7;
}

@media (max-width: 480px) {
    .jl-tool { padding: 0 6vw 6vh; }
    .jl-input { min-height: 180px; padding: 16px; }
    .jl-tree { padding: 14px 16px; font-size: 0.82rem; }
    .jt-children { margin-left: 14px; padding-left: 10px; }
    .jl-stats { gap: 14px 22px; padding: 14px 16px; }
    .jl-tree-controls-sep { display: none; }
    .jl-path-value { font-size: 0.78rem; }
}
