/* ═══════════════════════════════════════════════════════════════
   CANTICLE.CC — Charm / Lip Gloss / Bubble Tea TUI Aesthetic
   ═══════════════════════════════════════════════════════════════ */

:root {
    --bg: #1a1b26;
    --bg-deep: #16161e;
    --bg-panel: #1f2028;
    --bg-sunk: #13131a;
    --surface: #24253a;

    /* Charm Pastels */
    --pink: #ff6090;
    --magenta: #e478d0;
    --lavender: #c4a7e7;
    --cyan: #7dcfff;
    --mint: #9ece6a;
    --green: #73daca;
    --yellow: #e0af68;
    --orange: #ff9e64;
    --red: #f7768e;
    --blue: #7aa2f7;
    --ice: #b4f9f8;

    --text: #c0caf5;
    --text-dim: #565f89;
    --text-muted: #a9b1d6;
    --border: #3b3d57;
    --border-hi: #565f89;
    --glow-pink: rgba(255, 96, 144, 0.25);
    --glow-cyan: rgba(125, 207, 255, 0.2);
    --glow-mint: rgba(115, 218, 202, 0.2);

    --mono: 'Fira Code', 'JetBrains Mono', 'Cascadia Mono', monospace;
    --sans: 'Outfit', system-ui, sans-serif;
    --radius: 8px;
}

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

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

body {
    font-family: var(--mono);
    background: var(--bg);
    color: var(--text);
    line-height: 1.65;
    overflow-x: hidden;
    min-height: 100vh;
}

/* ── Scanlines overlay ─────────────────────────────────── */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    background: repeating-linear-gradient(to bottom,
            rgba(125, 207, 255, 0.015) 0, rgba(125, 207, 255, 0.015) 1px,
            transparent 1px, transparent 4px);
    mix-blend-mode: screen;
    opacity: 0.5;
}

h1,
h2,
h3,
h4 {
    font-weight: 700;
    line-height: 1.15;
    color: var(--text)
}

p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 1rem
}

a {
    text-decoration: none;
    color: var(--cyan);
    transition: all 0.2s ease
}

a:hover {
    color: var(--ice)
}

@keyframes pulseBox {
    0% {
        box-shadow: 0 0 10px rgba(125, 207, 255, 0.05);
    }

    50% {
        box-shadow: 0 0 25px rgba(125, 207, 255, 0.25);
    }

    100% {
        box-shadow: 0 0 10px rgba(125, 207, 255, 0.05);
    }
}

@keyframes pulsePink {
    0% {
        box-shadow: 0 0 15px rgba(255, 96, 144, 0.1);
    }

    50% {
        box-shadow: 0 0 35px rgba(255, 96, 144, 0.3);
    }

    100% {
        box-shadow: 0 0 15px rgba(255, 96, 144, 0.1);
    }
}

/* Hero gradient titles: bloom in the gradient's own hues (pink + cyan), never white */
@keyframes pulseText {
    0% {
        filter: drop-shadow(0 0 8px rgba(255, 96, 144, 0.20)) drop-shadow(0 0 16px rgba(125, 207, 255, 0.12));
    }

    50% {
        filter: drop-shadow(0 0 16px rgba(255, 96, 144, 0.45)) drop-shadow(0 0 30px rgba(125, 207, 255, 0.28));
    }

    100% {
        filter: drop-shadow(0 0 8px rgba(255, 96, 144, 0.20)) drop-shadow(0 0 16px rgba(125, 207, 255, 0.12));
    }
}

/* Any element tagged .glow takes a halo of its OWN text color */
.glow {
    text-shadow: 0 0 14px currentColor;
}

/* ── TUI Box Characters ───────────────────────────────── */
.tui-box {
    position: relative;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-panel);
    overflow: hidden;
    animation: rgbGlow 8s infinite linear;
}

.tui-box::before {
    content: '';
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--pink), var(--magenta), var(--lavender), var(--cyan), var(--mint));
}

.tui-box-title {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--magenta);
    margin-bottom: 1rem;
    text-shadow: 0 0 8px rgba(228, 120, 208, 0.85), 0 0 18px rgba(228, 120, 208, 0.45);
}

/* ── Navbar ────────────────────────────────────────────── */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 5%;
    background: rgba(26, 27, 38, 0.92);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
    backdrop-filter: blur(12px);
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 0.7rem
}

.logo {
    font-family: var(--mono);
    font-size: 1rem;
    font-weight: 700;
    color: var(--pink);
    letter-spacing: 0.02em;
}

.logo .dot,
.logo span {
    color: var(--cyan)
}

.logo::before {
    content: '❯ ';
    color: var(--mint)
}

/* ── RGB fade keyframes (shared site-wide — the downloads-page effect) ── */
@keyframes rgbGlow {
    0% {
        border-color: var(--pink);
        box-shadow: 0 0 18px rgba(255, 96, 144, 0.35), 0 0 50px rgba(255, 96, 144, 0.12);
    }

    25% {
        border-color: var(--magenta);
        box-shadow: 0 0 18px rgba(228, 120, 208, 0.35), 0 0 50px rgba(228, 120, 208, 0.12);
    }

    50% {
        border-color: var(--lavender);
        box-shadow: 0 0 18px rgba(196, 167, 231, 0.35), 0 0 50px rgba(196, 167, 231, 0.12);
    }

    75% {
        border-color: var(--magenta);
        box-shadow: 0 0 18px rgba(228, 120, 208, 0.35), 0 0 50px rgba(228, 120, 208, 0.12);
    }

    100% {
        border-color: var(--pink);
        box-shadow: 0 0 18px rgba(255, 96, 144, 0.35), 0 0 50px rgba(255, 96, 144, 0.12);
    }
}

@keyframes rgbGlowIcon {
    0% {
        filter: drop-shadow(0 0 12px rgba(255, 96, 144, 0.5));
        color: var(--pink);
    }

    25% {
        filter: drop-shadow(0 0 12px rgba(228, 120, 208, 0.5));
        color: var(--magenta);
    }

    50% {
        filter: drop-shadow(0 0 12px rgba(196, 167, 231, 0.5));
        color: var(--lavender);
    }

    75% {
        filter: drop-shadow(0 0 12px rgba(228, 120, 208, 0.5));
        color: var(--magenta);
    }

    100% {
        filter: drop-shadow(0 0 12px rgba(255, 96, 144, 0.5));
        color: var(--pink);
    }
}

/* RGB fade for blinking cursor blocks (cycles the fill + halo) */
@keyframes rgbBg {
    0% {
        background: var(--pink);
        box-shadow: 0 0 8px var(--pink);
    }

    25% {
        background: var(--magenta);
        box-shadow: 0 0 8px var(--magenta);
    }

    50% {
        background: var(--lavender);
        box-shadow: 0 0 8px var(--lavender);
    }

    75% {
        background: var(--magenta);
        box-shadow: 0 0 8px var(--magenta);
    }

    100% {
        background: var(--pink);
        box-shadow: 0 0 8px var(--pink);
    }
}

/* ── Brand lockup (corner logo: terminal square w/ blinking cursor inside + RGB-glowing wordmark) ── */
.brand-lockup {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    line-height: 1
}

.brand-square {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    height: 30px;
    padding: 0 9px;
    flex-shrink: 0;
    background: #0a0b0a;
    border: 1.5px solid var(--pink);
    border-radius: 7px;
    animation: rgbGlow 8s infinite linear;
    transition: transform 0.2s ease;
}

.brand-lockup:hover .brand-square {
    transform: translateY(-1px)
}

.bs-prompt {
    font-family: var(--mono);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--mint)
}

.brand-cursor {
    display: inline-block;
    width: 8px;
    height: 15px;
    background: var(--pink);
    animation: blinkCursor 0.8s step-end infinite, rgbBg 8s infinite linear;
}

.brand-word {
    font-family: var(--mono);
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: 0.02em;
    color: var(--pink);
    animation: rgbGlowIcon 8s infinite linear;
}

.brand-tld {
    color: var(--red);
    animation: none;
    text-shadow: 0 0 10px rgba(247, 118, 142, 0.5);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 0.3rem;
    align-items: center
}

.nav-links a {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0.4rem 0.7rem;
    border: 1px solid transparent;
    color: var(--text-dim);
    font-family: var(--mono);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-radius: 4px;
}

.nav-links a:hover {
    color: var(--text);
    border-color: var(--border);
    background: var(--surface)
}

.btn-outline {
    border: 1px solid var(--pink) !important;
    color: var(--pink) !important;
    background: rgba(255, 96, 144, 0.08) !important;
}

.btn-outline:hover {
    background: rgba(255, 96, 144, 0.18) !important;
    color: #fff !important
}

.mobile-menu-toggle {
    display: none;
    width: 42px;
    height: 38px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 1.3rem;
    cursor: pointer;
    border-radius: 4px;
}

/* ── GitHub Nav Button ─────────────────────────────── */
.nav-github {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0 !important;
    border: 1px solid var(--border) !important;
    border-radius: 6px;
    background: var(--surface) !important;
    color: var(--text-dim) !important;
    transition: all 0.2s ease;
}

.nav-github:hover {
    color: var(--text) !important;
    border-color: var(--text) !important;
    background: rgba(255, 255, 255, 0.06) !important;
    transform: translateY(-1px);
}

.nav-github svg {
    width: 18px;
    height: 18px;
}

/* ── Buttons ───────────────────────────────────────────── */
.btn-primary,
.btn-secondary,
.dl-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0.75rem 1.2rem;
    border-radius: 6px;
    font-family: var(--mono);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--pink), var(--magenta));
    color: #fff;
    border: none;
    box-shadow: 0 4px 20px var(--glow-pink);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px var(--glow-pink)
}

.btn-secondary {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    border-color: var(--cyan);
    color: var(--cyan);
    box-shadow: 0 4px 16px var(--glow-cyan)
}

.w-100 {
    width: 100%
}

/* ── Sections ──────────────────────────────────────────── */
.section {
    padding: 7rem 5% 5rem;
    position: relative;
    width: 100%;
}

.alt-bg {
    background: var(--bg-sunk);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto
}

#interfaces {
    padding-bottom: 2rem;
}

#layers {
    padding-top: 3rem;
}

.section-header h2 {
    font-size: clamp(2rem, 4.5vw, 3.2rem);
    margin-bottom: 0.8rem;
    color: var(--text)
}

.section-header p {
    max-width: 60ch;
    margin-left: auto;
    margin-right: auto;
    font-size: 1rem
}

/* ── Hero Tag (Charm-style) ───────────────────────────── */
.hero-tag {
    display: inline-block;
    padding: 0.35rem 0.9rem;
    margin-bottom: 1.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-family: var(--mono);
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--lavender);
    letter-spacing: 0.06em;
    text-transform: lowercase;
    animation: rgbGlow 8s infinite linear;
}

/* ── Visual Showcases ─────────────────────────────────── */
.visual-section {
    overflow: hidden;
    padding-top: 2rem;
    padding-bottom: 2rem;
}

.visual-showcase {
    max-width: 800px;
    margin: 0 auto 2.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-sunk);
    animation: rgbGlow 8s infinite linear;
    transition: all 0.3s ease;
}

.visual-showcase:hover {
    border-color: var(--cyan);
    box-shadow: 0 20px 80px rgba(0, 0, 0, 0.5), 0 0 60px var(--glow-cyan);
    transform: translateY(-4px);
}

.showcase-img {
    width: 100%;
    height: auto;
    display: block;
    image-rendering: auto;
}

/* ── Split Layout (text + visual) ─────────────────────── */
.visual-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.split-text-block {
    max-width: 560px
}

.split-text-block h2 {
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    margin-bottom: 1rem;
    line-height: 1.1;
}

.split-visual-block {
    display: flex;
    justify-content: center
}

/* System Context diagram sits toward the right of its column */
.visual-section .split-visual-block {
    justify-content: flex-end;
}

.split-visual-block .showcase-img {
    border-radius: var(--radius);
    border: 1px solid var(--border);
    animation: pulsePink 5s infinite ease-in-out;
    transition: all 0.3s ease;
}

.split-visual-block .showcase-img:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 60px rgba(0, 0, 0, 0.5), 0 0 40px var(--glow-pink);
    animation: none;
}

/* ── Stat Pills (Charm-style badges) ──────────────────── */
.stat-row {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
    margin-top: 1.5rem
}

.stat-pill {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.9rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-family: var(--mono);
    font-size: 0.75rem;
}

.stat-label {
    color: var(--text-dim);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.65rem
}

.stat-value {
    font-weight: 800
}

/* ── Hero ──────────────────────────────────────────────── */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 2.5rem;
    padding: 7rem 2% 4rem 4%;
    width: 100%;
    max-width: 1800px;
    margin: 0 auto;
    position: relative;
}

.hero-row {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 3rem;
    width: 100%;
}

.hero-content {
    position: absolute;
    left: 0;
    width: 32%;
    max-width: 700px;
    z-index: 2;
}

.hero-visual {
    display: flex;
    justify-content: flex-start;
    z-index: 2;
    width: 62%;
    margin-left: 34%;
}

.glow-text {
    font-size: clamp(2.6rem, 6vw, 5.5rem);
    line-height: 0.95;
    background: linear-gradient(135deg, var(--pink) 0%, var(--magenta) 35%, var(--lavender) 70%, var(--cyan) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1.2rem;
    font-weight: 800;
    animation: pulseText 5s infinite ease-in-out;
}

/* Centered hero quote (full-width banner above the terminal row) */
.hero-quote {
    text-align: center;
    max-width: 100%;
    margin: 0 auto;
    font-size: clamp(0.9rem, 2.4vw, 1.85rem);
    line-height: 1.1;
    z-index: 2;
    white-space: nowrap;
}

.hero .subtitle {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    color: var(--text-muted);
    font-family: var(--mono)
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap
}

.hero-visual {
    display: flex;
    justify-content: flex-start;
    z-index: 2;
    width: 62%;
    margin-left: 34%;
}

/* ── Terminal Card ─────────────────────────────────────── */
.terminal-card {
    width: 100%;
    max-width: 100%;
    padding: 0;
    overflow: hidden;
    transform: perspective(1100px) rotateY(-3deg) rotateX(2deg);
    transition: transform 0.5s ease;
    background: #07080c !important;
    animation: rgbGlow 8s infinite linear;
}

.terminal-card .terminal-body {
    max-width: 100%;
    margin-left: 0;
}

.terminal-card.terminal-expanded {
    transform: none
}

.terminal-card:hover {
    transform: none
}

.terminal-header {
    background: rgba(0, 0, 0, 0.3);
    padding: 0.7rem 0.95rem;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border);
    font-family: var(--mono);
}

.mac-btn {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 7px
}

.close {
    background: var(--red)
}

.minimize {
    background: var(--yellow)
}

.maximize {
    background: var(--mint)
}

.terminal-title {
    margin-left: auto;
    color: var(--text-dim);
    font-size: 0.72rem;
    font-family: var(--mono);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.terminal-body {
    padding: 1.2rem;
    padding-bottom: 1.5rem;
    font-family: var(--mono);
    font-size: 0.84rem;
    color: var(--text);
    /* Start compact and grow with each typed line, then the dashboard
       launch is the big reveal (see .dashboard-ui.active). */
    height: auto;
    min-height: 40px;
    max-height: 140px;
    overflow-y: auto;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: var(--magenta) transparent;
    background: transparent;
    transition: max-height 0.5s ease;
}

.terminal-body::-webkit-scrollbar {
    width: 5px
}

.terminal-body::-webkit-scrollbar-track {
    background: transparent
}

.terminal-body::-webkit-scrollbar-thumb {
    background: var(--magenta);
    border-radius: 3px
}

.terminal-body p {
    margin-bottom: 0.45rem;
    color: var(--text);
    font-size: 0.84rem
}

.terminal-body .prompt {
    color: var(--mint);
    margin-right: 0.5rem
}

.terminal-body .output {
    color: var(--text-dim);
    margin-bottom: 1.2rem
}

/* Doc terminals: size to fit contained code/text exactly */
.terminal-card.doc-terminal .terminal-body {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
    padding-bottom: 0.75rem;
    scrollbar-width: none;
    max-width: 100% !important;
    margin-left: 0 !important;
}
.terminal-card.doc-terminal .terminal-body::-webkit-scrollbar {
    display: none;
}

.terminal-card.doc-terminal {
    max-width: 680px;
}

/* ── Blinking Cursor ───────────────────────────────── */
@keyframes blinkCursor {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

.terminal-cursor {
    display: inline-block;
    width: 8px;
    height: 1.1em;
    background: var(--mint);
    vertical-align: text-bottom;
    margin-left: 1px;
    animation: blinkCursor 0.8s step-end infinite, rgbBg 8s infinite linear;
}

.dashboard-ui {
    display: block;
    width: 100%;
    height: 0;
    background: var(--bg-sunk);
    border: none;
    border-top: 1px solid var(--border);
    opacity: 0;
    transition: opacity 0.8s ease, height 0.8s ease;
}

.dashboard-ui.active {
    opacity: 1;
    height: 600px
}

/* ── Surface Compile embed (interactive animation) ─────── */
.surface-embed-header {
    text-align: center;
    max-width: 800px;
    margin: 4rem auto 2rem;
}

.surface-embed-header h3 {
    font-size: clamp(1.6rem, 3.5vw, 2.4rem);
    margin: 0.8rem 0;
    color: var(--text);
}

.surface-embed-header p {
    max-width: 60ch;
    margin: 0 auto;
    font-size: 1rem;
}

.surface-embed {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    background: #08080C;
    padding: 2px 0 0;
}

.surface-frame {
    display: block;
    width: 100%;
    /* Initial height only — script.js grows this to the fully-populated content
       height as the compile demo streams in, then holds it (never shrinks). */
    height: 820px;
    border: none;
    background: #08080C;
}

/* Stacked layout starts taller (no-JS fallback; JS sizes it exactly). */
@media(max-width:920px) {
    .surface-frame {
        height: 1200px
    }
}

/* ── Feature Cards ─────────────────────────────────────── */
.grid-3,
.grid-4,
.beta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.2rem;
}

.grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr))
}

.feature-card,
.beta-card {
    padding: 1.5rem;
    transition: all 0.2s ease;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-panel);
    position: relative;
    overflow: hidden;
}

.feature-card::before,
.beta-card::before {
    content: '';
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--pink), var(--magenta), var(--cyan));
}

.feature-card:hover,
.beta-card:hover {
    border-color: var(--cyan);
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(125, 207, 255, 0.1);
}

.feature-card .icon {
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    margin-bottom: 1rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    color: var(--magenta);
    font-size: 1.3rem;
}

.feature-card h3,
.beta-card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.6rem;
    color: var(--text)
}

.feature-card p,
.beta-card p {
    font-size: 0.9rem
}

/* ── Architecture Visual (Data Path) ──────────────────── */
.flow-diagram {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin: 3rem auto 0;
    flex-wrap: nowrap;
    max-width: 1100px;
    overflow-x: visible;
    padding: 2rem 1rem;
}

.flow-node {
    background: var(--bg-sunk);
    border: 2px solid;
    padding: 1rem 0.8rem;
    border-radius: 12px;
    font-family: var(--mono);
    font-size: 0.8rem;
    font-weight: 700;
    text-align: center;
    min-width: 90px;
    position: relative;
    z-index: 2;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex-shrink: 1;
}

.flow-node:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 0 28px currentColor, 0 0 55px currentColor, inset 0 0 18px currentColor;
    text-shadow: 0 0 10px currentColor;
}

.flow-node.pink {
    border-color: var(--pink);
    color: var(--pink);
    box-shadow: 0 0 20px var(--glow-pink), inset 0 0 10px var(--glow-pink);
}

.flow-node.magenta {
    border-color: var(--magenta);
    color: var(--magenta);
    box-shadow: 0 0 20px rgba(228, 120, 208, 0.2), inset 0 0 10px rgba(228, 120, 208, 0.2);
}

.flow-node.lavender {
    border-color: var(--lavender);
    color: var(--lavender);
    box-shadow: 0 0 20px rgba(196, 167, 231, 0.2), inset 0 0 10px rgba(196, 167, 231, 0.2);
}

.flow-node.cyan {
    border-color: var(--cyan);
    color: var(--cyan);
    box-shadow: 0 0 20px var(--glow-cyan), inset 0 0 10px var(--glow-cyan);
}

.flow-node.green {
    border-color: var(--mint);
    color: var(--mint);
    box-shadow: 0 0 30px var(--glow-mint), inset 0 0 15px var(--glow-mint);
    padding: 1.2rem 0.8rem;
    font-size: 0.9rem;
    min-width: 100px;
}

.flow-node.yellow {
    border-color: var(--yellow);
    color: var(--yellow);
    box-shadow: 0 0 20px rgba(224, 175, 104, 0.2), inset 0 0 10px rgba(224, 175, 104, 0.2);
}

.flow-line {
    height: 3px;
    flex-grow: 1;
    min-width: 15px;
    max-width: 35px;
    background: linear-gradient(90deg, var(--magenta), var(--cyan));
    box-shadow: 0 0 10px var(--cyan);
    z-index: 1;
}

/* ── System-context hub diagram ───────────────────────── */
.system-map {
    width: 100%;
    max-width: 600px;
    aspect-ratio: 1 / 1;
    /* calmer pulse cadence, matching the square design's intent */
    --dur: 9s;
    border-radius: 22px;
    /* framed panel with a subtle grid, like the reference image */
    background-color: #070709;
    background-image:
        radial-gradient(110% 110% at 50% 45%, rgba(46, 34, 78, 0.45) 0%, transparent 62%),
        linear-gradient(rgba(150, 160, 215, 0.055) 0.55px, transparent 0.55px),
        linear-gradient(90deg, rgba(150, 160, 215, 0.055) 0.55px, transparent 0.55px);
    background-size: 100% 100%, 34px 34px, 34px 34px;
    background-position: center center;
    border: 1px solid var(--border);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    /* same cycling RGB glow as the Surface Compile block */
    animation: rgbGlow 8s infinite linear;
}

.system-map-svg {
    width: 100%;
    height: 100%;
    display: block;
}

.system-map-svg .node {
    transform-box: fill-box;
    transform-origin: center;
    transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.25, 1);
    cursor: pointer;
}

.system-map-svg .node:hover {
    transform: scale(1.09);
}

/* ── System Context — animated pulses + breathing core ── */
@keyframes scFlow {
    0%   { offset-distance: 0%;   opacity: 0; }
    8%   { opacity: 1; }
    92%  { opacity: 1; }
    100% { offset-distance: 100%; opacity: 0; }
}

@keyframes scBreathe {
    0%, 100% { opacity: 0.35; }
    50%      { opacity: 0.8; }
}

.system-map-svg .pulse {
    animation: scFlow var(--dur, 3s) linear infinite;
    offset-rotate: 0deg;
}

.system-map-svg .core-halo {
    animation: scBreathe 3.4s ease-in-out infinite;
    transform-origin: center;
}

@media (prefers-reduced-motion: reduce) {

    .system-map-svg .pulse,
    .system-map-svg .core-halo {
        animation: none;
    }
}

.sm-label {
    font-family: var(--mono);
    font-weight: 700;
    font-size: 30px;
    text-anchor: middle;
    dominant-baseline: middle;
    letter-spacing: 0.02em;
}

.sm-title {
    font-size: 46px;
}

.sm-sm {
    font-size: 26px;
}

.sm-sub {
    font-size: 20px;
    font-weight: 500;
}

/* ── About / Capabilities Section ─────────────────────── */
.capabilities-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.capability-item {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    padding: 1.2rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-panel);
    transition: all 0.2s ease;
    animation: rgbGlow 8s infinite linear;
}

.capability-item:hover {
    border-color: var(--mint);
    transform: translateY(-2px)
}

.capability-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
}

.capability-icon svg {
    width: 20px;
    height: 20px;
    display: block;
}

.capability-item h4 {
    font-size: 0.85rem;
    color: var(--lavender);
    margin-bottom: 0.3rem;
    text-transform: uppercase;
    letter-spacing: 0.05em
}

.capability-item p {
    font-size: 0.85rem;
    margin: 0
}

/* ── Interfaces Section ───────────────────────────────── */
.interface-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    max-width: 1000px;
    margin: 0 auto;
}

.interface-card {
    text-align: center;
    padding: 1.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-panel);
    transition: all 0.2s ease;
}

.interface-card:hover {
    border-color: var(--lavender);
    transform: translateY(-3px)
}

.interface-card .if-icon {
    font-size: 1.8rem;
    margin-bottom: 0.8rem;
    display: block
}

/* ── Rendered interface icons (replace emojis) ────────── */
.interface-card .if-icon--render {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 0.8rem;
}

.if-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

/* -- SVG icons (MCP, REST) -- */
.if-svg {
    width: 56px;
    height: 56px;
    display: block;
    margin: 0 auto;
}

/* ── Pixel Art Interface Cards (CLI & Dashboard) ──────── */
.px-frame {
    width: 100%;
    max-width: 200px;
    background: #1e1e2e;
    border: 2px solid #000;
    border-radius: 2px;
    box-shadow: 
        inset -2px -2px 0px 0px rgba(0,0,0,0.5),
        inset 2px 2px 0px 0px rgba(255,255,255,0.2),
        4px 4px 0px rgba(0,0,0,0.3);
    font-family: 'Press Start 2P', monospace;
    text-align: left;
    image-rendering: pixelated;
    margin: 0 auto;
}

.px-titlebar {
    background: #313244;
    padding: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
    border-bottom: 2px solid #000;
}

.px-btn {
    width: 8px;
    height: 8px;
    background: #45475a;
    border: 1px solid #11111b;
    box-shadow: inset -1px -1px 0px #181825, inset 1px 1px 0px #585b70;
}

.px-btn-r {
    margin-left: auto;
}

.px-title {
    color: #cdd6f4;
    font-size: 8px;
    margin: 0 auto;
    text-transform: lowercase;
    letter-spacing: 1px;
}

.px-body {
    padding: 8px;
    background: #181825;
    color: #cdd6f4;
    font-size: 8px;
    line-height: 1.6;
    height: 110px;
    display: flex;
    flex-direction: column;
}

.px-line {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: clip;
}

.px-g { color: #a6e3a1; }
.px-dim { color: #6c7086; }
.px-cy { color: #89dceb; }
.px-mn { color: #94e2d5; }
.px-pk { color: #f5c2e7; }

.px-cursor {
    display: inline-block;
    width: 6px;
    height: 8px;
    background: #cdd6f4;
    vertical-align: bottom;
    animation: blinkCursor 1s step-end infinite;
}

/* -- Dash specific -- */
.px-dash-body {
    padding: 6px;
    gap: 6px;
}

.px-dash-stats {
    display: flex;
    gap: 4px;
    justify-content: space-between;
}

.px-dash-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #11111b;
    border: 1px solid #000;
    padding: 4px 2px;
    width: 30%;
}
.px-dash-stat span:first-child { font-size: 7px; margin-bottom: 2px; }
.px-dash-stat span:last-child { font-size: 5px; }

.px-dash-chart {
    height: 30px;
    border: 1px solid #000;
    background: #11111b;
    padding: 2px;
}
.px-chart-svg {
    width: 100%;
    height: 100%;
    display: block;
}

.px-dash-bars {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-top: 2px;
}

.px-dash-br {
    display: flex;
    align-items: center;
    gap: 4px;
}
.px-dash-br span:first-child {
    font-size: 6px;
    width: 14px;
}
.px-bar-fill {
    height: 4px;
    border: 1px solid #000;
}

.interface-card h3 {
    font-size: 0.95rem;
    margin-bottom: 0.4rem;
    color: var(--text)
}

.interface-card p {
    font-size: 0.82rem;
    margin: 0
}

.interface-card .tag {
    display: inline-block;
    margin-top: 0.6rem;
    padding: 0.2rem 0.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.65rem;
    color: var(--mint);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* ── Invariants / Rules Section ───────────────────────── */
.invariant-list {
    max-width: 900px;
    margin: 0 auto;
    display: grid;
    gap: 0.5rem;
}

.invariant-item {
    display: flex;
    gap: 0.8rem;
    align-items: baseline;
    padding: 0.7rem 1rem;
    border-left: 3px solid var(--magenta);
    background: var(--bg-panel);
    border-radius: 0 var(--radius) var(--radius) 0;
    font-size: 0.88rem;
}

.invariant-num {
    flex-shrink: 0;
    font-weight: 800;
    color: var(--pink);
    font-size: 0.75rem;
    width: 20px;
    text-align: right;
}

.invariant-item span {
    color: var(--text-muted)
}

/* ── Representation Layers ────────────────────────────── */
.layers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    max-width: 1000px;
    margin: 0 auto;
}

.layer-card {
    padding: 1.3rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-panel);
    transition: all 0.2s ease;
    text-align: center;
}

.layer-card:hover {
    border-color: var(--cyan);
    transform: translateY(-2px)
}

.layer-card .layer-name {
    font-size: 1.2rem;
    font-weight: 800;
    margin-bottom: 0.3rem;
    font-family: var(--mono);
}

.layer-card .layer-purpose {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0
}

/* ── Support Buttons ──────────────────────────────────── */
.support-grid {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 2rem
}

.support-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    min-height: 48px;
    padding: 0.75rem 1.3rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    font-family: var(--mono);
    font-weight: 700;
    font-size: 0.82rem;
    color: var(--text);
    background: var(--surface);
    transition: all 0.25s ease;
}

.support-btn:hover {
    transform: translateY(-3px);
    border-color: var(--magenta);
    box-shadow: 0 6px 24px var(--glow-pink)
}

.brand-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.btn-x {
    border-color: var(--text-dim);
    color: var(--text)
}

.btn-x:hover {
    border-color: #fff;
    color: #fff
}

.btn-x .brand-icon {
    width: 18px;
    height: 18px
}

.btn-kofi {
    border-color: #ff5e5b;
    color: #ff5e5b
}

.btn-kofi:hover {
    border-color: #ff5e5b;
    background: rgba(255, 94, 91, 0.12);
    box-shadow: 0 6px 24px rgba(255, 94, 91, 0.25)
}

.btn-bmc {
    border-color: #ffdd00;
    color: #ffdd00
}

.btn-bmc:hover {
    border-color: #ffdd00;
    background: rgba(255, 221, 0, 0.1);
    box-shadow: 0 6px 24px rgba(255, 221, 0, 0.2)
}

.btn-patreon {
    border-color: #ff424d;
    color: #ff424d
}

.btn-patreon:hover {
    border-color: #ff424d;
    background: rgba(255, 66, 77, 0.12);
    box-shadow: 0 6px 24px rgba(255, 66, 77, 0.25)
}

/* ── Footer ────────────────────────────────────────────── */
footer {
    background: var(--bg-deep);
    border-top: 1px solid var(--border);
    padding: 3rem 5% 1.5rem
}

.footer-content {
    display: flex;
    justify-content: space-between;
    gap: 2rem;
    flex-wrap: wrap;
    margin-bottom: 2rem
}

.footer-brand .logo {
    margin-bottom: 0.8rem
}

.footer-links {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap
}

.footer-links a {
    font-family: var(--mono);
    color: var(--text-dim);
    font-size: 0.8rem
}

.footer-links a:hover {
    color: var(--cyan)
}

.footer-bottom {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    font-size: 0.82rem;
    color: var(--text-dim)
}

/* ── Docs / Form (shared pages) ───────────────────────── */
.docs-container {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    overflow: hidden;
    max-width: 1100px;
    margin: 0 auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-panel);
}

.docs-sidebar {
    background: var(--bg-sunk);
    border-right: 1px solid var(--border)
}

.doc-tabs {
    list-style: none
}

.doc-tabs li {
    padding: 0.9rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    color: var(--text-dim);
    font-family: var(--mono);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    transition: all 0.15s ease;
}

.doc-tabs li:hover {
    background: var(--surface);
    color: var(--text)
}

.doc-tabs li.active {
    background: rgba(228, 120, 208, 0.1);
    color: var(--magenta);
    border-left: 3px solid var(--magenta)
}

.docs-content {
    padding: 1.5rem
}

.docs-content h3 {
    font-size: 1.1rem;
    margin-bottom: 0.6rem
}

.docs-content pre {
    background: var(--bg-sunk);
    padding: 1rem;
    border-radius: 6px;
    overflow-x: auto;
    font-family: var(--mono);
    font-size: 0.84rem;
    color: var(--lavender);
    border: 1px solid var(--border);
    margin: 0.7rem 0 1.4rem;
    border-left: 3px solid var(--mint);
}

.tab-pane {
    display: none;
    animation: fadeIn 0.2s ease
}

.tab-pane.active {
    display: block
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(4px)
    }

    to {
        opacity: 1;
        transform: translateY(0)
    }
}

.form-container {
    max-width: 680px;
    margin: 0 auto;
    padding: 1.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-panel);
}

.form-group {
    margin-bottom: 1.2rem
}

.form-group label {
    display: block;
    margin-bottom: 0.4rem;
    font-family: var(--mono);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--lavender);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.85rem 1rem;
    background: var(--bg-sunk);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-family: var(--mono);
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-dim)
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--cyan);
    box-shadow: 0 0 12px var(--glow-cyan);
}

.hidden {
    display: none
}

.form-success {
    text-align: center;
    padding: 2rem;
    background: rgba(115, 218, 202, 0.08);
    border: 1px solid var(--green);
    border-radius: var(--radius);
    color: var(--green)
}

.beta-version {
    display: inline-flex;
    padding: 0.3rem 0.5rem;
    background: rgba(115, 218, 202, 0.08);
    color: var(--mint);
    border: 1px solid rgba(115, 218, 202, 0.3);
    border-radius: 4px;
    font-family: var(--mono);
    font-size: 0.68rem;
    font-weight: 800;
    margin-bottom: 0.8rem;
    text-transform: uppercase;
}

.dl-btn {
    margin-top: 0.5rem
}

/* ── Responsive ────────────────────────────────────────── */
@media(prefers-reduced-motion:reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        transition-duration: 0.001ms !important
    }
}

@media(max-width:980px) {
    .hero {
        padding-top: 7rem;
        padding-left: 4%;
        padding-right: 4%;
        gap: 2.5rem
    }

    /* Stack the hero vertically. .hero-row is display:flex, so use
       flex-direction (grid-template-columns has no effect on a flex box). */
    .hero-row {
        flex-direction: column;
        align-items: stretch;
        gap: 2rem
    }

    .hero-quote {
        white-space: normal;
        text-wrap: balance;
        font-size: clamp(1.35rem, 5.2vw, 2rem)
    }

    /* Drop the desktop absolute/offset layout so the text and terminal no
       longer overlap and the row no longer overflows the viewport. */
    .hero-content {
        position: static;
        width: 100%;
        max-width: 100%
    }

    .hero-visual {
        justify-content: center;
        width: 100%;
        margin-left: 0
    }

    .terminal-card {
        transform: none;
        max-width: 100%
    }

    /* Use the full card width for the CLI text on mobile (desktop indents it). */
    .terminal-card .terminal-body {
        max-width: 100%;
        margin-left: 0
    }

    .visual-split {
        grid-template-columns: 1fr;
        gap: 2rem
    }

    .docs-container {
        grid-template-columns: 1fr
    }

    .docs-sidebar {
        border-right: none;
        border-bottom: 1px solid var(--border)
    }

    .doc-tabs {
        display: flex;
        overflow-x: auto
    }

    .doc-tabs li {
        min-width: max-content;
        border-left: 0 !important;
        border-bottom: 3px solid transparent
    }

    .doc-tabs li.active {
        border-bottom-color: var(--magenta)
    }
}

@media(max-width:768px) {
    .navbar {
        padding: 0.8rem 5%
    }

    .nav-links {
        display: none
    }

    .nav-links.nav-open {
        position: absolute;
        left: 5%;
        right: 5%;
        top: calc(100% + 8px);
        display: grid;
        gap: 0.2rem;
        padding: 0.6rem;
        background: var(--bg-panel);
        border: 1px solid var(--border);
        border-radius: var(--radius);
        box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
    }

    .nav-links.nav-open a {
        width: 100%
    }

    .mobile-menu-toggle {
        display: grid;
        place-items: center
    }

    .hero {
        min-height: auto;
        padding-top: 6.5rem
    }

    .hero-buttons a,
    .support-btn {
        width: 100%
    }

    .section {
        padding: 5rem 5% 3.5rem
    }

    .grid-3,
    .grid-4,
    .beta-grid,
    .capabilities-grid,
    .interface-grid,
    .layers-grid {
        grid-template-columns: 1fr
    }

    .architecture-visual {
        flex-direction: column;
        align-items: stretch
    }

    .arch-step,
    .arch-arrow {
        text-align: center
    }

    .dashboard-ui.active {
        height: 0
    }

    .footer-content,
    .footer-links {
        flex-direction: column
    }

    /* ── Mobile Architecture Flow — vertical stack ──── */
    .flow-diagram {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 1.5rem 0.5rem;
        overflow-x: visible;
    }

    .flow-node {
        min-width: 0;
        width: 100%;
        padding: 0.9rem 1rem;
        font-size: 0.78rem;
        border-radius: 8px;
    }

    .flow-node br {
        display: none
    }

    .flow-node.green {
        padding: 1rem;
        font-size: 0.85rem;
        min-width: 0;
    }

    .flow-line {
        width: 3px;
        height: 20px;
        min-width: 3px;
        max-width: 3px;
        align-self: center;
        flex-grow: 0;
    }
}