:root {
    --bg-dark: #08070d;
    --surface-dark: rgba(26, 22, 38, 0.4);
    --surface-border: rgba(255, 255, 255, 0.08);

    --acc-cyan: #00e5ff;
    --acc-magenta: #ff2a6d;
    --acc-gold: #ffbe0b;

    --text-primary: #ffffff;
    --text-dim: #a5a2b5;

    --transient: 0.4s cubic-bezier(0.16, 1, 0.3, 1);

    /* Extreme springy bezier for jumpy reveal animations */
    --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* ----------------------------------------
 * CUSTOM SCROLLBAR
 * ---------------------------------------- */
html {
    scrollbar-color: var(--surface-border) var(--bg-dark);
    scrollbar-width: thin;
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--surface-border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    position: relative;
    overflow-x: hidden;
    /* Added to keep normal site from horizontal wobble */
}

/* ----------------------------------------
 * LAUNCH INTRO OVERLAY — Premium Typography Reveal
 * ---------------------------------------- */
.launch-intro {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    background: rgba(8, 7, 13, 0.4);
    backdrop-filter: blur(30px) saturate(1.5);
    -webkit-backdrop-filter: blur(30px) saturate(1.5);
    transition: opacity 1000ms ease;
    pointer-events: auto;
    overflow: hidden;
}

.launch-intro__center {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.launch-intro__mask-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.launch-intro__divider {
    width: 120%;
    height: 1px;
    background: var(--acc-cyan);
    margin: 0 -10%;
    transform: scaleX(0);
    transform-origin: center;
    animation: introDividerIn 800ms cubic-bezier(0.22, 1, 0.36, 1) forwards, introDividerOut 600ms 1500ms ease forwards;
    box-shadow: 0 0 10px var(--acc-cyan);
    position: relative;
    z-index: 2;
}

.launch-intro__mask {
    overflow: hidden;
    line-height: 1.1;
}

.launch-intro__mask--top {
    padding-bottom: 2px;
}

.launch-intro__mask--bottom {
    padding-top: 2px;
}

.launch-intro__word {
    display: block;
    font-size: clamp(4rem, 12vw, 8rem);
    font-weight: 800;
    letter-spacing: 0.05em;
    color: #ffffff;
    text-transform: uppercase;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
}

/* Animations for the words sliding out from behind the divider */
.launch-intro__mask--top .launch-intro__word {
    transform: translateY(100%);
    animation: introWordTopIn 800ms 400ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.launch-intro__mask--bottom .launch-intro__word {
    transform: translateY(-100%);
    animation: introWordBottomIn 800ms 400ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* Exit state */
body.intro-complete .launch-intro {
    opacity: 0;
    pointer-events: none;
}

/* Keyframes */
@keyframes introDividerIn {
    0% {
        transform: scaleX(0);
        opacity: 0;
    }

    30% {
        opacity: 1;
    }

    100% {
        transform: scaleX(1);
        opacity: 1;
    }
}

@keyframes introDividerOut {
    to {
        transform: scaleX(0);
        opacity: 0;
    }
}

@keyframes introWordTopIn {
    to {
        transform: translateY(0);
    }
}

@keyframes introWordBottomIn {
    to {
        transform: translateY(0);
    }
}


/* Elegant, WARMER Ambient Background */
.ambient-background {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 10% 20%, rgba(255, 42, 109, 0.05), transparent 35%),
        radial-gradient(circle at 90% 80%, rgba(255, 190, 11, 0.05), transparent 40%),
        radial-gradient(circle at 50% 50%, rgba(0, 229, 255, 0.02), transparent 50%);
    z-index: -1;
    pointer-events: none;
}

.page-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 3rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 6rem;
}

/* Header */
.sys-header {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--surface-border);
}

.sys-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.sys-logo {
    width: 32px;
    height: 32px;
    filter: invert(1);
    opacity: 0.9;
}

.sys-title {
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.5px;
}

.sys-nav {
    display: flex;
    gap: 2rem;
}

.nav-link {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    transition: color var(--transient);
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-primary);
}

.sys-status {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    justify-content: flex-end;
    font-size: 0.85rem;
    color: var(--text-dim);
    font-weight: 400;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--acc-gold);
    box-shadow: 0 0 12px var(--acc-gold);
    animation: smoothPulse 3s infinite ease-in-out;
}

@keyframes smoothPulse {

    0%,
    100% {
        opacity: 0.5;
        transform: scale(0.9);
    }

    50% {
        opacity: 1;
        transform: scale(1.1);
    }
}

/* Typography */
.eyebrow {
    color: var(--acc-magenta);
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 1.5rem;
    display: block;
}

/* Hero Section */
.hero-module {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-top: 2rem;
}

.hero-title {
    font-size: 4.5rem;
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -2px;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, #fff 0%, #d4d1e0 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-lead {
    font-size: 1.35rem;
    color: var(--text-dim);
    max-width: 700px;
    font-weight: 400;
    line-height: 1.6;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

/* Buttons */
.btn {
    padding: 0.875rem 2rem;
    font-size: 0.95rem;
    text-decoration: none;
    font-weight: 600;
    border-radius: 4px;
    transition: all var(--transient);
    cursor: pointer;
    text-align: center;
}

.btn-primary {
    background: var(--text-primary);
    color: var(--bg-dark);
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.1);
}

.btn-primary:hover {
    background: var(--acc-cyan);
    color: var(--bg-dark);
    box-shadow: 0 4px 20px rgba(0, 229, 255, 0.3);
    transform: translateY(-2px);
}

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

.btn-secondary:hover {
    border-color: var(--acc-magenta);
    transform: translateY(-2px);
}

/* Narrative Architecture Flow */
.arch-flow {
    margin-top: 6rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    width: 100%;
}

.flow-connector {
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.flow-line {
    width: 2px;
    height: 100%;
    background-color: var(--surface-border);
    position: relative;
    overflow: hidden;
}

.flow-line::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, transparent, var(--acc-cyan));
    animation: dripDown 2s infinite linear;
}

@keyframes dripDown {
    0% {
        transform: scaleY(0);
        transform-origin: top;
        opacity: 1;
    }

    50% {
        transform: scaleY(1);
        transform-origin: top;
        opacity: 1;
    }

    50.1% {
        transform-origin: bottom;
    }

    100% {
        transform: scaleY(0);
        transform-origin: bottom;
        opacity: 0;
    }
}

.arch-segment {
    background: var(--surface-dark);
    border: 1px solid var(--surface-border);
    border-radius: 8px;
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    gap: 3rem;
    padding: 3rem;
    width: 100%;
    transition: all var(--transient);
}

.arch-segment:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.15);
    background: rgba(35, 30, 48, 0.6);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.segment-full {
    max-width: 900px;
}

.segment-half {
    flex: 1;
    flex-direction: column;
    text-align: center;
    gap: 2rem;
    padding: 2.5rem;
}

.arch-split {
    display: flex;
    width: 100%;
    max-width: 1100px;
    gap: 2rem;
    position: relative;
    align-items: stretch;
    margin: 60px 0;
}

.split-center {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    width: 120px;
    flex-shrink: 0;
}

/* Single continuous line spanning level 1→2→3, drawn on arch-split
   and extending into its 60px top/bottom margins */
.arch-split::before {
    content: '';
    position: absolute;
    top: -60px;
    bottom: -60px;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    background-color: var(--surface-border);
    z-index: 0;
    pointer-events: none;
}

.arch-split::after {
    content: '';
    position: absolute;
    top: -60px;
    bottom: -60px;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    overflow: hidden;
    background: linear-gradient(to bottom, transparent, var(--acc-cyan));
    animation: dripDown 2s infinite linear;
    z-index: 0;
    pointer-events: none;
}

.center-node {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--text-primary);
    box-shadow: 0 0 15px var(--text-primary);
    animation: smoothPulse 1.5s infinite ease-in-out;
}

.center-label {
    font-size: 0.75rem;
    color: var(--text-dim);
    letter-spacing: 2px;
    font-weight: 800;
    text-align: center;
}

.segment-visual {
    width: 120px;
    height: 120px;
    flex-shrink: 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.builder-segment .segment-visual {
    width: 180px;
    height: 180px;
}

.segment-half .segment-visual {
    margin: 0 auto;
}

.segment-content {
    flex: 1;
}

.status-tag.mainline {
    background: rgba(0, 229, 255, 0.1);
    color: var(--acc-cyan);
    border: 1px solid rgba(0, 229, 255, 0.2);
}

.status-tag.downstream {
    background: rgba(255, 0, 230, 0.1);
    color: var(--acc-magenta);
    border: 1px solid rgba(255, 0, 230, 0.2);
}

/* Custom SVG Animations */
.anim-svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

/* Level 1: Builder Assembler */
.svg-builder-core {
    transform-origin: center;
    animation: coreEnergy 2s infinite ease-in-out;
}

@keyframes coreEnergy {
    0%, 100% {
        opacity: 0.8;
        filter: drop-shadow(0 0 2px var(--acc-cyan));
    }
    50% {
        opacity: 1;
        filter: drop-shadow(0 0 10px var(--acc-cyan));
    }
}

.svg-packet {
    opacity: 0;
    animation: packetStream 1.5s infinite linear;
}

.p-top { animation-delay: 0s; --tx: 0; --ty: 30px; }
.p-left { animation-delay: 0.5s; --tx: 30px; --ty: 0; }
.p-right { animation-delay: 1s; --tx: -30px; --ty: 0; }

@keyframes packetStream {
    0% { transform: translate(0, 0); opacity: 0; }
    20% { opacity: 1; }
    80% { opacity: 1; }
    100% { transform: translate(var(--tx), var(--ty)); opacity: 0; }
}

.svg-build-output {
    transform-origin: center;
    animation: outputBuild 3s infinite ease-in-out;
}

@keyframes outputBuild {
    0% { transform: translateY(0) scale(0.8); opacity: 0; }
    40% { transform: translateY(0) scale(1.1); opacity: 1; }
    60% { transform: translateY(20px) scale(1.2); opacity: 0.5; }
    100% { transform: translateY(40px) scale(1.4); opacity: 0; }
}

/* Level 2: Blueprint Animations */
.draw-path {
    fill: transparent;
    stroke-width: 14;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 4000;
    stroke-dashoffset: 4000;
}

.magenta-path {
    stroke: var(--acc-magenta);
    animation: drawMagenta 4s infinite cubic-bezier(0.4, 0, 0.2, 1) alternate;
}

.cyan-path {
    stroke: var(--acc-cyan);
    animation: drawCyan 4s infinite cubic-bezier(0.4, 0, 0.2, 1) alternate;
    animation-delay: 0.5s;
}

@keyframes drawMagenta {
    0% {
        stroke-dashoffset: 4000;
        fill: transparent;
    }

    60%,
    70% {
        stroke-dashoffset: 0;
        fill: transparent;
    }

    100% {
        stroke-dashoffset: 0;
        fill: rgba(255, 42, 109, 0.7);
    }
}

@keyframes drawCyan {
    0% {
        stroke-dashoffset: 4000;
        fill: transparent;
    }

    60%,
    70% {
        stroke-dashoffset: 0;
        fill: transparent;
    }

    100% {
        stroke-dashoffset: 0;
        fill: rgba(0, 229, 255, 0.7);
    }
}

/* Level 3: Core OS Layer Stack */
.svg-os-core {
    animation: smoothPulseOS 3s infinite alternate ease-in-out;
    transform-origin: center;
}

@keyframes smoothPulseOS {
    0% {
        transform: scale(0.95);
        opacity: 0.8;
    }

    100% {
        transform: scale(1.05);
        opacity: 1;
    }
}

.svg-ripple-new {
    animation: rippleHeartbeat 4s infinite cubic-bezier(0.1, 0.9, 0.2, 1);
    transform-origin: center;
}

.svg-ripple-new.delay-2 {
    animation-delay: 2s;
}

@keyframes rippleHeartbeat {
    0% {
        transform: scale(0.4);
        opacity: 0;
        stroke-width: 2;
    }

    5% {
        transform: scale(0.5);
        opacity: 1.0;
        stroke-width: 18;
    }

    /* LUB (First powerful flash) */
    10% {
        transform: scale(1.0);
        opacity: 0.2;
        stroke-width: 4;
    }

    /* Heartbeat gap */
    15% {
        transform: scale(1.15);
        opacity: 0.8;
        stroke-width: 14;
    }

    /* DUB (Second powerful flash) */
    100% {
        transform: scale(12.0);
        opacity: 0;
        stroke-width: 1;
    }

    /* Massive expansion and long fade */
}

/* Level 4: Rescue Hands Choreography */
.hand-bottom {
    animation: beckonHelp 5s infinite cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
}

.hand-top {
    animation: swoopRescue 5s infinite cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
}

@keyframes beckonHelp {
    0% {
        transform: translateY(400px);
        opacity: 0;
    }

    40%,
    45% {
        transform: translateY(0px);
        opacity: 1;
    }

    /* Reaches out extremely slowly */
    65%,
    85% {
        transform: translateY(-200px);
        opacity: 1;
    }

    /* Synchronized lift up */
    100% {
        transform: translateY(-200px);
        opacity: 0;
    }
}

@keyframes swoopRescue {

    0%,
    25% {
        transform: translateY(-400px);
        opacity: 0;
    }

    45% {
        transform: translateY(-80px);
        opacity: 1;
    }

    /* Swoops down to meet precisely */
    65%,
    85% {
        transform: translateY(-280px);
        opacity: 1;
    }

    /* Synchronized lift up identically */
    100% {
        transform: translateY(-280px);
        opacity: 0;
    }
}

/* Reused card content styling */
.tool-index {
    font-size: 0.75rem;
    color: var(--acc-magenta);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 1rem;
}

.tool-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.1;
}

.segment-half .tool-title {
    font-size: 1.5rem;
}

.tool-desc {
    color: var(--text-dim);
    font-size: 1.05rem;
    line-height: 1.6;
}

/* Signals Section */
.signal-container {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 4rem;
    align-items: center;
    background: var(--surface-dark);
    border: 1px solid var(--surface-border);
    border-radius: 8px;
    padding: 3.5rem;
}

.signal-copy h2 {
    font-size: 2rem;
    font-weight: 600;
    letter-spacing: -1px;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.signal-copy p {
    color: var(--text-dim);
    font-size: 1.1rem;
}

.visualizer-wrapper {
    width: 100%;
}

.visualizer {
    height: 140px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.vis-bar {
    flex: 1;
    border-radius: 8px;
    background: linear-gradient(to top, var(--acc-cyan), var(--acc-magenta));
    min-height: 4px;
    /* Removed CSS transition because JS will handle fluidity */
    will-change: height;
}

/* Footer */
.sys-footer {
    border-top: 1px solid var(--surface-border);
    padding-top: 3rem;
    padding-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    font-size: 0.95rem;
    color: var(--text-dim);
}

.footer-brand {
    color: var(--text-primary);
    font-weight: 600;
    height: 1.4em;
    position: relative;
    user-select: none;
    min-width: 160px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.brand-roller {
    position: relative;
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-areas: "stack";
    place-items: center end;
}

.brand-item {
    grid-area: stack;
    /* Extra snappy transition: fast opacity, springy scale */
    transition: 
        opacity 0.15s ease-out,
        transform 0.5s var(--spring);
    opacity: 0;
    pointer-events: none;
    transform: scale(0.65);
    white-space: nowrap;
}

/* Active state: Snaps in from scale(0.65) to scale(1) with spring overshoot */
.brand-roller:not(.is-alt) .brand-item:first-child,
.brand-roller.is-alt .brand-item:last-child {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1);
    transition-delay: 0.1s; /* Slight delay to let the previous one clear */
}

/* 
 * ----------------------------------------------------
 * DEVICE MATRIX STYLING
 * ----------------------------------------------------
 */

.matrix-disclaimer {
    font-size: 0.9rem;
    color: var(--text-dim);
    background: rgba(255, 255, 255, 0.03);
    padding: 1rem 1.5rem;
    border-left: 2px solid var(--acc-cyan);
    margin-top: 2rem;
    margin-bottom: 2.5rem;
    border-radius: 0 4px 4px 0;
    max-width: 800px;
    line-height: 1.5;
}

.hardware-matrix {
    display: flex;
    flex-direction: column;
    width: 100%;
    background: rgba(20, 18, 28, 0.4);
    border: 1px solid var(--surface-border);
    border-radius: 8px;
    overflow-x: auto;
    /* Custom scrollbar for the table if it overflows */
    scrollbar-width: thin;
}

.matrix-header, .matrix-row {
    display: grid;
    /* Device column wider, feature columns expanded to 140px for "Downstream" */
    grid-template-columns: 280px repeat(7, 140px);
    align-items: center;
    padding: 1.25rem 1.5rem;
    gap: 2rem;
    width: max-content;
    min-width: 100%;
}

.matrix-header {
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid var(--surface-border);
    font-weight: 800;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-dim);
    line-height: 1.2;
}

.matrix-row {
    border-bottom: 1px solid var(--surface-border);
    transition: background var(--transient);
}

.matrix-row:last-child {
    border-bottom: none;
}

.matrix-row:hover {
    background: rgba(255, 255, 255, 0.02);
}

.col-device {
    font-weight: 600;
    color: var(--acc-cyan);
    font-size: 1.05rem;
    text-align: left;
}

.col-feature {
    display: flex;
    justify-content: center;
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-dim);
    min-height: 1.5em;
}

.status-tag {
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-tag.mainline {
    background: rgba(0, 229, 255, 0.1);
    color: var(--acc-cyan);
    border: 1px solid rgba(0, 229, 255, 0.2);
}

.status-tag.downstream {
    background: rgba(255, 0, 230, 0.1);
    color: var(--acc-magenta);
    border: 1px solid rgba(255, 0, 230, 0.2);
}

/* 
 * ----------------------------------------
 * ENERGETIC SCROLL ANIMATIONS (JUMPY)
 * ----------------------------------------
 */
.reveal-jump {
    opacity: 0;
    /* Start pushed down and slightly scaled down */
    transform: translateY(60px) scale(0.95);
    /* The transition will only apply when class .is-visible is toggled */
    transition: opacity 0.8s ease-out, transform 0.8s var(--spring);
}

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

/* Staggering for grid items */
article[style*="--stagger: 1"] {
    transition-delay: 0.0s;
}

article[style*="--stagger: 2"] {
    transition-delay: 0.1s;
}

article[style*="--stagger: 3"] {
    transition-delay: 0.2s;
}

article[style*="--stagger: 4"] {
    transition-delay: 0.3s;
}