/* ═══════════════════════════════════════════════════════════════
   SignalBrain-OS Design System v3 — Apple / Steve Jobs Style
   Monochrome palette, cinematic whitespace, typography-led.
   ═══════════════════════════════════════════════════════════════ */

/* ═══ Reset ═══ */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box
}

/* ═══ Tokens ═══ */
:root {
    --bg: #000000;
    --s1: #1d1d1f;
    --s2: #2d2d2f;
    --bdr: rgba(255, 255, 255, .08);
    --acc: #2997ff;
    --acc-warm: #bf8540;
    --grn: #30d158;
    --pur: #bf5af2;
    --org: #ff9f0a;
    --red: #ff453a;
    --txt: #f5f5f7;
    --txt-2: #86868b;
    --txt-3: #6e6e73;
    --glass: rgba(28, 28, 30, .6);
    --radius: 20px;
    --max-w: 980px;
    --section-pad: clamp(60px, 8vw, 100px);
}

/* ═══ Base ═══ */
html {
    scroll-behavior: smooth
}

body {
    background: var(--bg);
    color: var(--txt);
    font-family: -apple-system, 'SF Pro Text', 'SF Pro Display', 'Inter', 'Helvetica Neue', system-ui, sans-serif;
    overflow-x: hidden;
    line-height: 1.47;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-size: 17px;
}

a {
    color: var(--acc);
    text-decoration: none
}

a:hover {
    text-decoration: underline
}

/* ═══ Typography Scale (Apple-style) ═══ */
.display-xl {
    font-size: clamp(48px, 7vw, 96px);
    font-weight: 700;
    line-height: 1.04;
    letter-spacing: -0.045em;
}

.display-lg {
    font-size: clamp(36px, 5vw, 64px);
    font-weight: 600;
    line-height: 1.07;
    letter-spacing: -0.03em;
}

.display-md {
    font-size: clamp(28px, 3.5vw, 48px);
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: -0.025em;
}

.display-sm {
    font-size: clamp(21px, 2.5vw, 32px);
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -0.015em;
}

.body-xl {
    font-size: 21px;
    line-height: 1.52;
    font-weight: 400;
    color: var(--txt-2);
}

.body-lg {
    font-size: 19px;
    line-height: 1.5;
    font-weight: 400;
    color: var(--txt-2);
}

.body-md {
    font-size: 17px;
    line-height: 1.47;
    font-weight: 400;
    color: var(--txt-2);
}

.mono {
    font-family: 'SF Mono', 'JetBrains Mono', 'Menlo', monospace;
}

.caption {
    font-size: 12px;
    line-height: 1.34;
    font-weight: 500;
    color: var(--txt-3);
    letter-spacing: 0.01em;
}

.eyebrow {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--txt-3);
}

/* ═══ Mesh Background (subtle) ═══ */
.mesh {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.mesh::before {
    content: '';
    position: absolute;
    width: 1200px;
    height: 1200px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(41, 151, 255, .02), transparent 60%);
    top: -500px;
    right: -400px;
    animation: mesh-float 40s ease-in-out infinite;
}

.mesh::after {
    content: '';
    position: absolute;
    width: 900px;
    height: 900px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(191, 133, 64, .015), transparent 60%);
    bottom: -300px;
    left: -200px;
    animation: mesh-float 50s ease-in-out infinite reverse;
}

@keyframes mesh-float {

    0%,
    100% {
        transform: translate(0, 0)
    }

    50% {
        transform: translate(40px, 30px)
    }
}

/* ═══ Navigation (Minimal Apple) ═══ */
nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 0 max(22px, env(safe-area-inset-left));
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(0, 0, 0, .72);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, .06);
}

.logo {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.02em;
    text-decoration: none;
    color: var(--txt);
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-img {
    height: 28px;
    width: auto;
}

.logo span {
    color: var(--acc)
}

.nav-links {
    display: flex;
    gap: 28px;
    align-items: center;
}

.nav-links a {
    color: var(--txt-2);
    font-size: 12px;
    font-weight: 400;
    transition: color .2s;
    letter-spacing: 0;
}

.nav-links a:hover {
    color: var(--txt);
    text-decoration: none
}

.nav-links a.active {
    color: var(--txt)
}

.cta-sm {
    padding: 4px 12px;
    background: var(--acc);
    border: none;
    border-radius: 980px;
    color: #fff !important;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: .2s;
}

.cta-sm:hover {
    background: #0077ed;
    text-decoration: none !important;
}

/* ═══ Sections (Cinematic spacing) ═══ */
section {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: var(--section-pad) 24px;
}

section h2 {
    font-size: clamp(28px, 4vw, 48px);
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.08;
    margin-bottom: 16px;
}

.desc {
    color: var(--txt-2);
    margin-bottom: 36px;
    max-width: 680px;
    font-size: 17px;
    line-height: 1.47;
}

/* Section tags — subtle */
.section-tag {
    display: inline-block;
    padding: 0;
    border: none;
    background: none;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 16px;
    color: var(--txt-3);
}

.tag-g {
    color: var(--grn)
}

.tag-a {
    color: var(--acc)
}

.tag-p {
    color: var(--pur)
}

.tag-o {
    color: var(--org)
}

.tag-r {
    color: var(--red)
}

.tag-y {
    color: var(--acc-warm)
}

/* ═══ Divider (almost invisible) ═══ */
.divider {
    height: 1px;
    max-width: 260px;
    margin: 0 auto;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .06), transparent);
}

/* ═══ Cards (Borderless depth) ═══ */
.card {
    background: var(--glass);
    border: 1px solid var(--bdr);
    border-radius: var(--radius);
    padding: 28px;
    transition: transform .3s cubic-bezier(.16, 1, .3, 1);
}

.card:hover {
    transform: translateY(-4px);
}

/* ═══ Color Utility Classes ═══ */
.ac {
    color: var(--acc)
}

.gn {
    color: var(--grn)
}

.pu {
    color: var(--pur)
}

.og {
    color: var(--org)
}

.rd {
    color: var(--red)
}

.gl {
    color: var(--acc-warm)
}

/* ═══ Terminal Block ═══ */
.terminal {
    background: #161617;
    border: 1px solid rgba(255, 255, 255, .06);
    border-radius: 16px;
    padding: 28px;
    margin-top: 28px;
    overflow-x: auto;
}

.terminal-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
}

.terminal-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%
}

.terminal-title {
    font: 500 12px 'SF Mono', 'JetBrains Mono', monospace;
    color: var(--txt-3);
    margin-left: 8px;
}

.terminal pre {
    font: 400 13px/1.65 'SF Mono', 'JetBrains Mono', monospace;
    color: var(--txt-2);
    white-space: pre;
    overflow-x: auto;
}

.terminal .cmd {
    color: var(--acc)
}

.terminal .comment {
    color: var(--txt-3)
}

.terminal .result {
    color: var(--txt)
}

.terminal .highlight {
    color: var(--grn);
    font-weight: 600
}

/* ═══ Tables ═══ */
table.scale-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 24px;
    font-size: 14px;
}

.scale-table th {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, .1);
    color: var(--txt-2);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.scale-table td {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, .04);
}

.scale-table .mono {
    font-family: 'SF Mono', 'JetBrains Mono', monospace;
    font-weight: 600;
}

.class-tag {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 6px;
    letter-spacing: 0.02em;
    font-family: 'SF Mono', 'JetBrains Mono', monospace;
}

.class-o1 {
    background: rgba(48, 209, 88, .08);
    color: var(--grn);
    border: 1px solid rgba(48, 209, 88, .15)
}

.class-on {
    background: rgba(255, 159, 10, .08);
    color: var(--org);
    border: 1px solid rgba(255, 159, 10, .15)
}

/* ═══ CTA Button (Apple pill) ═══ */
.cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 32px;
    background: var(--acc);
    border: none;
    border-radius: 980px;
    font-size: 17px;
    font-weight: 500;
    color: #fff;
    cursor: pointer;
    transition: .25s;
    text-decoration: none;
}

.cta-btn:hover {
    background: #0077ed;
    transform: scale(1.02);
    text-decoration: none;
}

.cta-btn .arrow {
    font-size: 18px;
    transition: transform .2s;
}

.cta-btn:hover .arrow {
    transform: translateX(4px)
}

/* ═══ Footer (Minimal Apple) ═══ */
footer {
    padding: 20px 24px;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, .06);
}

footer p {
    font-size: 12px;
    color: var(--txt-3);
}

/* ═══ Scroll Reveal ═══ */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity .8s cubic-bezier(.16, 1, .3, 1),
        transform .8s cubic-bezier(.16, 1, .3, 1);
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger children in grids */
.reveal.visible>* {
    opacity: 1;
    transform: translateY(0);
}

/* ═══ Live System Pulse (Minimal) ═══ */
@keyframes pulse-blink {

    0%,
    100% {
        opacity: 1;
        box-shadow: 0 0 3px var(--grn)
    }

    50% {
        opacity: .4;
        box-shadow: 0 0 8px var(--grn)
    }
}

.pulse-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 980px;
    font-size: 11px;
}

.pulse-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--grn);
    animation: pulse-blink 2.5s ease-in-out infinite;
    flex-shrink: 0;
}

.pulse-text {
    color: var(--txt-3);
    font: 400 11px -apple-system, 'SF Pro Text', system-ui, sans-serif;
}

.pulse-text strong {
    color: var(--grn);
    font-weight: 500
}

.pulse-sep {
    color: rgba(255, 255, 255, .12)
}

.pulse-metric {
    color: var(--txt-3);
    font: 400 11px -apple-system, 'SF Pro Text', system-ui, sans-serif;
}

.pulse-metric strong {
    color: var(--txt);
    font-weight: 500
}

/* ═══ Comparison Matrix (Clean) ═══ */
.compare-matrix {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 28px;
    font-size: 14px;
    overflow: hidden;
    border-radius: 16px;
    border: 1px solid var(--bdr);
}

.compare-matrix th {
    padding: 14px 18px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    background: rgba(28, 28, 30, .4);
    color: var(--txt-3);
    text-align: center;
}

.compare-matrix th:first-child {
    text-align: left;
    color: var(--txt-2)
}

.compare-matrix th.highlight-col {
    background: rgba(41, 151, 255, .04);
    color: var(--acc);
    border-bottom-color: var(--acc);
}

.compare-matrix td {
    padding: 13px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, .04);
    text-align: center;
    color: var(--txt-3);
}

.compare-matrix td:first-child {
    text-align: left;
    color: var(--txt);
    font-weight: 500
}

.compare-matrix td.highlight-col {
    background: rgba(41, 151, 255, .02);
    color: var(--txt);
    font-weight: 600;
    font-family: 'SF Mono', 'JetBrains Mono', monospace;
}

.compare-matrix tr:last-child td {
    border-bottom: none
}

.compare-matrix .val-win {
    color: var(--grn);
    font-weight: 700
}

.compare-matrix .val-lose {
    color: var(--red);
    opacity: .6
}

.compare-matrix .val-bad {
    color: var(--txt-3);
    font-weight: 400
}

.compare-matrix .check {
    color: var(--grn);
    font-size: 16px
}

.compare-matrix .cross {
    color: var(--red);
    font-size: 16px;
    opacity: .5
}

.compare-matrix .logo-cell {
    font-weight: 700;
    font-size: 12px
}

/* ═══ Responsive ═══ */
@media (max-width: 800px) {
    nav {
        padding: 0 12px;
        height: auto !important;
        min-height: 44px;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0;
    }

    .logo {
        font-size: 11px;
        gap: 6px;
        flex-shrink: 0;
        padding: 8px 0;
        white-space: nowrap;
    }

    .logo-img {
        height: 20px;
    }

    .pulse-bar {
        display: none
    }

    .nav-links {
        display: flex;
        width: 100%;
        gap: 0;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 6px;
        border-top: 1px solid rgba(255, 255, 255, .04);
    }

    .nav-links::-webkit-scrollbar {
        display: none;
    }

    .nav-links a {
        font-size: 10px;
        white-space: nowrap;
        padding: 4px 8px;
        flex-shrink: 0;
    }

    .cta-sm {
        display: none
    }

    section {
        padding: clamp(60px, 8vw, 100px) 20px
    }

    .compare-matrix {
        font-size: 12px
    }

    .compare-matrix th,
    .compare-matrix td {
        padding: 10px 10px
    }

    /* Footer About/Contact responsive */
    footer #about>div>div {
        grid-template-columns: 1fr !important;
        gap: 40px !important;
    }

    /* Footer links grid responsive */
    footer>div>div[style*="grid-template-columns:repeat(4"] {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 24px !important;
    }
}

@media (max-width: 600px) {
    .nav-links {
        gap: 0;
    }

    .nav-links a {
        font-size: 9px;
        padding: 4px 6px;
    }
}