:root {
    --color-bg: #05070d;
    --color-bg-soft: rgba(12, 16, 28, 0.78);
    --color-surface: rgba(16, 20, 34, 0.78);
    --color-surface-strong: #11192a;
    --color-border: rgba(140, 163, 205, 0.14);
    --color-border-strong: rgba(130, 176, 255, 0.24);
    --color-text: #edf3ff;
    --color-text-muted: #b4bfd7;
    --color-text-dim: #7f8bab;
    --color-accent: #7b9bf0;
    --color-accent-strong: #8277e6;
    --color-accent-teal: #53cdbd;
    --gradient-accent: linear-gradient(135deg, #7697ea 0%, #7d74dc 52%, #4bc9bb 100%);
    --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.34);
    --shadow-md: 0 16px 34px rgba(0, 0, 0, 0.24);
    --radius-sm: 0.75rem;
    --radius-md: 1.25rem;
    --radius-lg: 1.75rem;
    --space-1: 0.5rem;
    --space-2: 0.75rem;
    --space-3: 1rem;
    --space-4: 1.5rem;
    --space-5: 2rem;
    --space-6: 3rem;
    --space-7: 4.5rem;
    --space-8: 6rem;
    --container: 1180px;
    --font-display: "Manrope", sans-serif;
    --font-body: "Plus Jakarta Sans", sans-serif;
    --nav-height: 5.25rem;
}

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

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-width: 320px;
    font-family: var(--font-body);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.72;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body.menu-open {
    overflow: hidden;
}

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

a {
    color: inherit;
}

button,
input,
textarea,
select {
    font: inherit;
}

:focus-visible {
    outline: 2px solid rgba(123, 155, 240, 0.95);
    outline-offset: 4px;
}

/* Background */
.site-background {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
}

.background-gradient {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 12% 18%, rgba(129, 168, 255, 0.14), transparent 34%),
        radial-gradient(circle at 85% 22%, rgba(135, 124, 255, 0.13), transparent 30%),
        radial-gradient(circle at 55% 78%, rgba(71, 215, 199, 0.08), transparent 28%),
        linear-gradient(180deg, #05070d 0%, #070b14 48%, #04060a 100%);
}

.background-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(133, 161, 224, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(133, 161, 224, 0.05) 1px, transparent 1px);
    background-size: 72px 72px;
    mask-image: radial-gradient(circle at center, rgba(0, 0, 0, 1), transparent 82%);
}

#neural-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0.16;
}

/* Utilities */
.container {
    width: min(var(--container), calc(100% - 2rem));
    margin: 0 auto;
}

.section {
    padding: 4.25rem 0;
}

.section-heading {
    max-width: 40rem;
    margin-bottom: 2rem;
}

.section-heading h2,
.hero h1,
.hero-panel h2,
.card h3,
.identity-copy h2 {
    margin: 0;
    font-family: var(--font-display);
    letter-spacing: -0.03em;
}

.section-heading h2 {
    font-size: clamp(1.85rem, 3.4vw, 2.7rem);
    line-height: 1.12;
    margin-bottom: 0.85rem;
}

.section-heading p,
.mission-copy p,
.identity-copy p,
.card p,
.hero-intro,
.hero-panel p,
.site-footer p {
    color: var(--color-text-muted);
    max-width: 40rem;
}

.section-label,
.eyebrow,
.panel-kicker,
.card-label,
.math-caption {
    margin: 0 0 var(--space-3);
    color: rgba(123, 155, 240, 0.78);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.eyebrow {
    color: rgba(83, 205, 189, 0.8);
}

.skip-link {
    position: absolute;
    left: 1rem;
    top: -3rem;
    z-index: 2000;
    padding: 0.75rem 1rem;
    background: #ffffff;
    color: #000000;
    border-radius: var(--radius-sm);
    text-decoration: none;
}

.skip-link:focus {
    top: 1rem;
}

/* Header */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar {
    min-height: var(--nav-height);
    border-bottom: 1px solid transparent;
    background: rgba(5, 7, 13, 0.7);
    backdrop-filter: blur(22px);
    transition: background 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.navbar.is-scrolled {
    background: rgba(5, 7, 13, 0.92);
    border-color: rgba(129, 168, 255, 0.12);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.24);
}

.navbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    min-height: var(--nav-height);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    text-decoration: none;
    color: var(--color-text);
}

.brand-mark {
    width: 2.1rem;
    height: 2.1rem;
    padding: 0.1rem;
    border-radius: 0.8rem;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.brand-text {
    font-family: var(--font-display);
    font-size: 0.98rem;
    font-weight: 750;
    letter-spacing: -0.02em;
    white-space: nowrap;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.nav-contact {
    border-color: rgba(140, 163, 205, 0.18);
    background: rgba(255, 255, 255, 0.02);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.35rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.nav-links a {
    color: var(--color-text-muted);
    text-decoration: none;
    font-size: 0.92rem;
    transition: color 160ms ease, opacity 160ms ease;
}

.nav-links a:hover,
.nav-links a:focus-visible {
    color: var(--color-text);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 0.28rem;
    width: 2.8rem;
    height: 2.8rem;
    padding: 0.7rem;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--color-text);
    cursor: pointer;
}

.nav-toggle span {
    width: 100%;
    height: 2px;
    background: currentColor;
    border-radius: 999px;
    transition: transform 180ms ease, opacity 180ms ease;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

/* Buttons and links */
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.85rem;
    padding: 0.75rem 1.15rem;
    border: 1px solid transparent;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 600;
    transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, color 180ms ease, box-shadow 180ms ease;
}

.button:hover,
.button:focus-visible {
    transform: translateY(-1px);
}

.button-primary {
    color: #f8fbff;
    background: var(--gradient-accent);
    box-shadow: 0 10px 22px rgba(79, 122, 240, 0.14);
}

.button-secondary {
    color: var(--color-text);
    border-color: var(--color-border);
    background: rgba(255, 255, 255, 0.025);
}

.text-link {
    display: inline-flex;
    align-items: center;
    color: var(--color-text);
    text-decoration: none;
    font-weight: 650;
    font-size: 1rem;
    letter-spacing: -0.01em;
    transition: color 160ms ease, opacity 160ms ease;
}

.text-link:hover,
.text-link:focus-visible {
    color: #f4f7ff;
}

/* Hero */
.hero {
    padding-top: calc(5rem + 1rem);
    padding-bottom: 3.25rem;
}

.hero-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(18rem, 0.95fr);
    gap: 1.75rem;
    align-items: end;
}

.hero-copy {
    max-width: 39rem;
}

.hero h1 {
    font-size: clamp(2.7rem, 6vw, 4.45rem);
    line-height: 0.98;
    max-width: 11ch;
    margin-bottom: 1rem;
}

.hero-intro {
    max-width: 35rem;
    font-size: 1.03rem;
    margin: 0 0 1.5rem;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    margin-bottom: 1rem;
}

.hero-note {
    margin: 0;
    color: var(--color-text-dim);
    letter-spacing: 0.02em;
    font-size: 0.84rem;
}

.hero-panel,
.card,
.proof-card,
.math-panel {
    position: relative;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, rgba(18, 24, 39, 0.76), rgba(11, 16, 28, 0.9));
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.hero-panel::before,
.card::before,
.proof-card::before,
.math-panel::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(129, 168, 255, 0.45), transparent);
}

.hero-panel {
    padding: 1.55rem;
}

.hero-panel h2 {
    font-size: 1.36rem;
    line-height: 1.2;
    margin-bottom: 0.8rem;
}

.hero-facts {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.9rem;
    margin: 1.3rem 0 0;
}

.hero-facts div {
    padding-top: var(--space-3);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.hero-facts dt {
    color: var(--color-text-dim);
    font-size: 0.8rem;
    margin-bottom: 0.35rem;
}

.hero-facts dd {
    margin: 0;
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
}

/* Ecosystem */
.ecosystem-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
    align-items: stretch;
}

.card {
    padding: 1.65rem;
    display: flex;
    flex-direction: column;
    transition: border-color 180ms ease, transform 180ms ease, background 180ms ease;
}

.card:hover,
.card:focus-within {
    transform: translateY(-2px);
    border-color: rgba(130, 176, 255, 0.22);
    background: linear-gradient(180deg, rgba(18, 24, 39, 0.82), rgba(12, 17, 29, 0.94));
}

.card h3 {
    font-size: 1.3rem;
    line-height: 1.22;
    margin-bottom: 0.8rem;
}

.card p {
    margin-top: 0;
    margin-bottom: 1.25rem;
}

.card .text-link {
    margin-top: auto;
    padding-top: 0.6rem;
}

/* Consulting */
.consulting-shell {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, rgba(18, 24, 39, 0.72), rgba(11, 16, 28, 0.88));
    box-shadow: var(--shadow-md);
    padding: 1.65rem;
}

.consulting-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.1rem;
    margin-bottom: 1.35rem;
}

.consulting-card {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.02);
    padding: 1.35rem;
}

.consulting-card h3 {
    margin: 0 0 0.65rem;
    font-family: var(--font-display);
    font-size: 1.14rem;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.consulting-card p {
    margin: 0;
    color: var(--color-text-muted);
}

.consulting-link {
    font-size: 1rem;
}

/* Mission */
.mission-layout,
.identity-layout {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: 1.5rem;
    align-items: start;
}

.mission-copy {
    padding-top: 0.1rem;
    max-width: 39rem;
}

.mission-copy p:first-child {
    margin-top: 0;
}

.mission-copy p:last-child {
    margin-bottom: 0;
}

/* Proof */
.proof-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.1rem;
}

.proof-card {
    padding: 1.5rem;
    min-height: 11rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 1rem;
}

.proof-card strong {
    font-family: var(--font-display);
    font-size: clamp(1.35rem, 2.3vw, 2.2rem);
    line-height: 1.08;
    letter-spacing: -0.03em;
}

.proof-card span {
    color: var(--color-text-muted);
    max-width: 16rem;
}

/* Identity */
.identity-copy h2 {
    font-size: clamp(1.8rem, 3.5vw, 2.7rem);
    line-height: 1.14;
    margin-bottom: 0.85rem;
}

.math-panel {
    padding: 1.55rem;
    min-height: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.math-expression {
    font-size: clamp(1.15rem, 2.7vw, 1.85rem);
    color: var(--color-text);
    overflow-x: auto;
    padding-bottom: 0.25rem;
    margin-bottom: 0.85rem;
}

.math-note {
    margin: 0;
    color: var(--color-text-muted);
    font-size: 0.94rem;
    line-height: 1.6;
}

/* Footer */
.site-footer {
    padding: 3.4rem 0 1.8rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(5, 7, 13, 0.86);
}

.footer-layout {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: var(--space-5);
}

.footer-brand {
    max-width: 28rem;
}

.footer-brand-link {
    margin-bottom: var(--space-3);
}

.footer-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(8rem, 1fr));
    gap: 0.9rem 2rem;
}

.footer-links a {
    text-decoration: none;
    color: var(--color-text-muted);
}

.footer-links a:hover,
.footer-links a:focus-visible {
    color: var(--color-text);
}

.footer-bottom {
    margin-top: 2.2rem;
    padding-top: 1.2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--color-text-dim);
    font-size: 0.92rem;
}

/* Motion */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 700ms ease, transform 700ms ease;
}

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

/* Responsive */
@media (max-width: 980px) {
    .hero-layout,
    .mission-layout,
    .identity-layout,
    .ecosystem-grid,
    .consulting-grid,
    .proof-grid,
    .footer-layout {
        grid-template-columns: 1fr;
    }

    .footer-layout {
        display: grid;
    }

    .hero-facts {
        grid-template-columns: 1fr;
    }

    .section {
        padding: 3.5rem 0;
    }
}

@media (max-width: 820px) {
    .nav-toggle {
        display: inline-flex;
    }

    .nav-menu {
        position: absolute;
        top: calc(100% + 0.75rem);
        right: 1rem;
        left: 1rem;
        display: grid;
        gap: 1rem;
        padding: 1.2rem;
        border: 1px solid var(--color-border-strong);
        border-radius: var(--radius-md);
        background: rgba(9, 12, 21, 0.98);
        box-shadow: var(--shadow-lg);
        opacity: 0;
        visibility: hidden;
        transform: translateY(-8px);
        transition: opacity 180ms ease, transform 180ms ease, visibility 180ms ease;
    }

    .nav-menu.is-open {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    .nav-links {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.9rem;
    }

    .nav-cta {
        width: 100%;
    }
}

@media (max-width: 640px) {
    :root {
        --space-5: 1.5rem;
        --space-6: 2.4rem;
        --space-7: 3.5rem;
        --space-8: 4.5rem;
    }

    .brand-text {
        font-size: 0.88rem;
    }

    .container {
        width: min(var(--container), calc(100% - 1.25rem));
    }

    .hero {
        padding-top: 4.5rem;
        padding-bottom: 2.75rem;
    }

    .hero h1 {
        font-size: clamp(2.05rem, 10vw, 2.9rem);
        max-width: 12ch;
    }

    .hero-intro {
        font-size: 0.98rem;
    }

    .section-heading h2,
    .identity-copy h2 {
        font-size: clamp(1.55rem, 7vw, 2.1rem);
    }

    .button {
        width: 100%;
    }

    .card,
    .hero-panel,
    .math-panel,
    .proof-card {
        padding: 1.35rem;
    }

    .proof-card {
        min-height: auto;
        gap: 0.9rem;
    }

    .footer-links {
        grid-template-columns: 1fr;
    }

    .math-expression {
        font-size: 1.1rem;
    }
}

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

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

    .reveal {
        opacity: 1;
        transform: none;
    }

    #neural-canvas {
        display: none;
    }
}
