:root {
    /* Technical Authority Palette v2.1: Terminal-Core Mobile-First */
    --bg-dark: #000000;
    --bg-card: rgba(255, 255, 255, 0.02);
    --fg-main: #ffffff;
    --fg-muted: #888888;
    --fg-dim: #444444;
    --accent-blue: #0070f3;
    --accent-green: #00FF41;
    --border-subtle: #1a1a1a;
    --border-harden: #333333;
    --glass-bg: rgba(0, 0, 0, 0.9);
    --font-mono: 'JetBrains Mono', monospace;
    --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-touch: all 0s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Global Reset */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { 
    scroll-behavior: smooth; 
    font-size: 16px;
    scroll-snap-type: y proximity;
}

body {
    background-color: var(--bg-dark);
    color: var(--fg-main);
    font-family: 'Inter', -apple-system, sans-serif;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px; /* Mobile Gutter */
}

@media (min-width: 768px) {
    .container { padding: 0 32px; }
}

.mono { font-family: var(--font-mono); }

/* Typography (Fluid) */
h1 {
    font-family: 'Outfit', sans-serif;
    font-size: clamp(2.5rem, 10vw, 4.5rem);
    line-height: 1.25;
    letter-spacing: -0.05em;
    text-transform: uppercase;
}

.section-title {
    font-family: 'Outfit', sans-serif;
    font-size: clamp(1.75rem, 7vw, 2.5rem);
    line-height: 1.3;
    letter-spacing: -0.04em;
    text-transform: uppercase;
    margin-bottom: 3rem;
}

.gradient-text {
    background: linear-gradient(180deg, #FFFFFF 0%, #444444 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.section-tag {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--accent-blue);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
    display: block;
}
.section-tag.green { color: var(--accent-green); }

/* Navigation (The Drawer Protocol) */
.glass-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-subtle);
}

nav {
    height: 70px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
}

.logo { font-weight: 800; font-size: 1.2rem; letter-spacing: 0.1em; font-family: 'Outfit', sans-serif; }
.nav-links { display: none; } /* Hidden by default */

@media (min-width: 1024px) {
    .nav-links { display: flex; gap: 2.5rem; }
    .nav-links a { 
        color: var(--fg-muted); 
        text-decoration: none; 
        font-size: 0.8rem; 
        text-transform: uppercase; 
        letter-spacing: 0.05em; 
        transition: var(--transition-smooth); 
    }
    .nav-links a:hover { color: var(--fg-main); }
}

/* Global Interactive Layers */
@keyframes scanline {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(100vh); }
}

body::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: rgba(0, 255, 65, 0.05); /* 5% Opacity */
    z-index: 1001;
    pointer-events: none;
    animation: scanline 8s linear infinite;
}

/* Sections */
section { 
    padding: 6rem 0; 
    border-top: 1px solid var(--border-subtle);
    scroll-snap-align: start;
}

/* Buttons (Touch Optimized) */
.btn-primary, .btn-outline {
    display: inline-block;
    height: 48px; /* Touch Hit Area */
    line-height: 48px;
    padding: 0 2rem;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition-smooth);
    text-decoration: none;
    text-align: center;
    width: 100%;
}

.btn-primary { background: var(--fg-main); color: var(--bg-dark); border: none; }
.btn-outline { background: transparent; color: var(--fg-main); border: 1px solid var(--border-subtle); }

/* Touch State Feedback */
.btn-primary:active, .btn-outline:active {
    border-color: var(--accent-green);
    background: rgba(0, 255, 65, 0.1);
    transition: var(--transition-touch);
}

@media (min-width: 768px) {
    .btn-primary, .btn-outline { width: auto; }
}

.btn-lg { height: 60px; line-height: 60px; padding: 0 3rem; font-size: 1rem; }

/* 1. Hero */
.hero-section { padding-top: 140px; min-height: 85vh; display: flex; flex-direction: column; justify-content: center; }
.hero-subtitle { font-size: 1.15rem; color: var(--fg-muted); line-height: 1.5; margin: 2rem 0 3rem; }
.hero-actions { display: flex; flex-direction: column; gap: 1rem; }

@media (min-width: 768px) {
    .hero-actions { flex-direction: row; }
}

/* 2. Marquee */
.marquee-section { padding: 4rem 0; }
.marquee-wrapper { overflow: hidden; width: 100%; }
.marquee-content {
    display: flex;
    gap: 4rem;
    animation: marquee-scroll 30s linear infinite;
}
@keyframes marquee-scroll {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}
.logo-item { 
    font-family: 'Outfit', sans-serif; 
    font-weight: 800; 
    font-size: 1.5rem; 
    color: var(--fg-dim); 
    white-space: nowrap; 
    opacity: 0.3; 
    filter: grayscale(1);
}

/* 3. Engine (Suture Flow) */
.engine-layout { display: flex; flex-direction: column; gap: 4rem; }
.suture-flow { display: flex; flex-direction: column; gap: 1.5rem; }

.flow-step {
    padding: 2.5rem;
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    position: relative;
    transition: var(--transition-smooth);
}
.flow-step.active { border-color: var(--accent-green); background: rgba(0, 255, 65, 0.01); }

/* Sequential Vertical Scanline for Simulation */
.step-scanline {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--accent-green);
    opacity: 0;
    pointer-events: none;
}
.flow-step.simulating .step-scanline {
    animation: step-scan 1s linear infinite;
    opacity: 0.5;
}
@keyframes step-scan {
    from { top: 0; }
    to { top: 100%; }
}

@media (min-width: 1024px) {
    .engine-layout { grid-template-columns: 1fr 1fr; display: grid; gap: 8rem; }
    .suture-flow { gap: 0; }
    .flow-step { border: none; border-left: 1px solid var(--border-subtle); border-radius: 0; }
}

/* 4. Capabilities Grid (2x2 Mobile Hybrid) */
.capabilities-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}
@media (min-width: 480px) { .capabilities-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1024px) { .capabilities-grid { grid-template-columns: repeat(2, 2fr); } }

.cap-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    padding: 2.5rem;
    border-radius: 8px;
}
.cap-visual img { height: 40px; margin-bottom: 2rem; opacity: 0.8; }

/* 5. Metrics */
.metrics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
@media (min-width: 768px) { .metrics-grid { grid-template-columns: repeat(4, 1fr); } }

.metric-card {
    border: 1px solid var(--border-subtle);
    padding: 2rem 1rem;
    text-align: center;
    border-radius: 8px;
}
.metric-value { font-family: 'Outfit', sans-serif; font-size: clamp(1.5rem, 5vw, 3rem); font-weight: 800; display: block; }
.metric-delta { font-family: var(--font-mono); font-size: 0.6rem; color: var(--accent-green); margin-top: 0.5rem; display: block; }

/* 6. Health (Infrastructure Breath) */
.health-grid { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }
@media (min-width: 768px) { .health-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1024px) { .health-grid { grid-template-columns: repeat(4, 1fr); } }

.health-card { border: 1px solid var(--border-subtle); padding: 2rem; border-radius: 12px; }
.health-status { font-family: var(--font-mono); font-size: 0.65rem; color: var(--accent-green); margin-bottom: 1.5rem; display: block; }
.health-value { font-family: 'Outfit', sans-serif; font-size: 1.5rem; font-weight: 700; }
.pulse-wave { width: 100%; height: 2px; background: var(--border-subtle); margin: 2rem 0; position: relative; overflow: hidden; }
.pulse-wave::after {
    content: ""; position: absolute; left: -100%; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, var(--accent-green), transparent);
    animation: health-pulse 3s linear infinite; /* 3s Breath */
}
@keyframes health-pulse { from { left: -100%; } to { left: 100%; } }

/* 7. Stack (List on Mobile, Schematic on Desktop) */
.stack-schematic { display: grid; grid-template-columns: 1fr; gap: 1rem; }
@media (min-width: 768px) { .stack-schematic { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1024px) { .stack-schematic { grid-template-columns: repeat(3, 1fr); } }

.chip-module {
    background: #050505;
    border: 1px solid var(--border-subtle);
    padding: 2rem;
    border-radius: 4px;
}
.chip-meta { font-family: var(--font-mono); font-size: 0.7rem; color: var(--accent-blue); margin-top: 1rem; display: block; }

/* 8. Registry (Sticky Tabs on Mobile) */
.registry-layout { display: flex; flex-direction: column; gap: 3rem; }
.registry-sidebar {
    position: sticky;
    top: 70px;
    z-index: 90;
    background: var(--bg-dark);
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-subtle);
}

.registry-search { 
    width: 100%; 
    padding: 14px; 
    background: #050505; 
    border: 1px solid var(--border-subtle); 
    color: var(--accent-green); 
    font-family: var(--font-mono); 
    font-size: 0.8rem;
    border-radius: 4px;
    margin-bottom: 1.5rem;
}

.registry-tabs {
    display: flex;
    overflow-x: auto;
    gap: 1.5rem;
    scrollbar-width: none;
}
.registry-tabs::-webkit-scrollbar { display: none; }
.tab-link {
    white-space: nowrap;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--fg-dim);
    text-decoration: none;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid transparent;
}
.tab-link.active { color: var(--accent-green); border-bottom-color: var(--accent-green); }

@media (min-width: 900px) {
    .registry-layout { grid-template-columns: 300px 1fr; display: grid; }
    .registry-sidebar { position: static; border-bottom: none; border-right: 1px solid var(--border-subtle); padding-right: 3rem; }
    .registry-tabs { flex-direction: column; overflow: visible; }
}

/* 9. Footer */
.command-footer { padding: 5rem 0 3rem; background: #020202; }
.footer-status { display: flex; flex-direction: column; gap: 3rem; text-align: center; }
.status-bar { display: flex; flex-direction: column; gap: 1.5rem; align-items: center; }

@media (min-width: 900px) {
    .footer-status { flex-direction: row; justify-content: space-between; text-align: left; }
    .status-bar { flex-direction: row; align-items: flex-start; }
}
