:root {
    /* PALETTE: Cold, Scientific, Expensive */
    --bg-core: #050507;
    --bg-surface: rgba(255, 255, 255, 0.02);
    --bg-surface-hover: rgba(255, 255, 255, 0.05);
    
    --accent: #3b82f6; /* International Blue - Trustworthy & Digital */
    --accent-dim: rgba(59, 130, 246, 0.1);
    --accent-glow: rgba(59, 130, 246, 0.3);
    
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    --text-muted: #475569;
    
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.15);
    
    --success: #22c55e;
    --success-dim: rgba(34, 197, 94, 0.1);
    
    /* TYPOGRAPHY */
    --font-main: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-core);
    color: var(--text-primary);
    font-family: var(--font-main);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    cursor: none;
}

/* ================================
   CUSTOM CURSOR
================================ */
.cursor-dot,
.cursor-outline {
    position: fixed;
    top: 0;
    left: 0;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    z-index: 9999;
    pointer-events: none;
}

.cursor-dot {
    width: 4px;
    height: 4px;
    background-color: var(--accent);
    box-shadow: 0 0 10px var(--accent);
}

.cursor-outline {
    width: 24px;
    height: 24px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    transition: width 0.15s ease, height 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

body.hovering .cursor-outline {
    width: 48px;
    height: 48px;
    background-color: rgba(59, 130, 246, 0.08);
    border-color: var(--accent);
}

body.hovering .cursor-dot {
    transform: translate(-50%, -50%) scale(1.5);
}

/* Decipher Effect - scrambled characters */
.dud {
    color: var(--accent);
    opacity: 0.6;
    font-weight: inherit;
}

/* Background Canvas */
#bg-canvas {
    position: fixed;
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* ================================
   NAVIGATION
================================ */
.navbar {
    position: fixed;
    top: 0; 
    width: 100%;
    height: 70px;
    z-index: 100;
    background: rgba(5, 5, 7, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
}

.nav-container {
    width: 100%; 
    max-width: 1400px; 
    margin: 0 auto; 
    padding: 0 40px;
    display: flex; 
    justify-content: space-between; 
    align-items: center;
}

.logo-text {
    font-family: var(--font-main);
    font-weight: 700;
    font-size: 20px;
    letter-spacing: -0.02em;
}

.logo-text .accent { 
    color: var(--accent); 
}

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

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    height: 40px;
}

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

.connection-status {
    display: flex; 
    align-items: center; 
    gap: 8px;
    font-family: var(--font-mono); 
    font-size: 11px;
    color: var(--success);
    background: var(--success-dim);
    padding: 6px 12px;
    border-radius: 4px;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.status-dot {
    width: 6px; 
    height: 6px; 
    background: var(--success);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--success);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ================================
   HERO SECTION
================================ */
.hero {
    min-height: 100vh;
    padding: 140px 40px 100px;
    display: flex; 
    align-items: center;
    position: relative;
    z-index: 1;
}

.hero-grid {
    max-width: 1400px; 
    margin: 0 auto; 
    width: 100%;
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 80px;
    align-items: center;
}

.tag-pill {
    display: inline-block;
    padding: 6px 14px;
    border: 1px solid var(--border);
    border-radius: 50px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 24px;
    letter-spacing: 0.02em;
}

.hero-title {
    font-family: var(--font-main);
    font-size: clamp(44px, 5vw, 68px);
    font-weight: 600;
    line-height: 1.08;
    letter-spacing: -0.03em;
    margin-bottom: 24px;
    background: linear-gradient(180deg, #ffffff 0%, #a0a0a0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-description {
    font-size: 18px;
    color: var(--text-secondary);
    max-width: 480px;
    margin-bottom: 48px;
    font-weight: 400;
    line-height: 1.7;
}

/* Buttons */
.cta-buttons { 
    display: flex; 
    gap: 16px; 
}

.btn-primary, 
.btn-secondary {
    height: 48px;
    padding: 0 28px;
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.btn-primary {
    background: var(--text-primary);
    color: var(--bg-core);
    border: none;
}

.btn-primary:hover { 
    background: var(--accent); 
    color: white; 
}

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

.btn-secondary:hover { 
    border-color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
}

.btn-secondary svg {
    width: 16px;
    height: 16px;
}

/* ================================
   BENTO GRID
================================ */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: 140px repeat(2, 110px);
    gap: 12px;
}

.bento-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    padding: 24px;
    display: flex; 
    flex-direction: column; 
    justify-content: space-between;
    transition: border-color 0.3s ease, background 0.3s ease;
    position: relative;
    overflow: hidden;
    transform-style: preserve-3d;
    will-change: transform;
}

.bento-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.bento-card:hover {
    border-color: var(--border-strong);
    background: var(--bg-surface-hover);
}

.bento-card:hover::before {
    opacity: 0.5;
}

.bento-card.large {
    grid-column: span 2;
}

.bento-label {
    font-family: var(--font-mono);
    font-size: 10px;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.12em;
}

.bento-value {
    font-family: var(--font-main);
    font-size: 32px;
    font-weight: 500;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.bento-value .unit {
    font-size: 14px; 
    color: var(--text-secondary);
    margin-left: 2px;
}

/* Status Graph */
.status-graph {
    display: flex; 
    gap: 3px; 
    align-items: flex-end;
    height: 32px; 
    margin-top: 16px;
}

.graph-bar {
    flex: 1;
    background: var(--accent);
    border-radius: 2px;
    opacity: 0.7;
    animation: graphPulse 2.5s infinite ease-in-out;
    animation-delay: calc(var(--delay) * 0.15s);
}

@keyframes graphPulse {
    0%, 100% { height: 25%; opacity: 0.3; }
    50% { height: 100%; opacity: 1; }
}

/* ================================
   SECTIONS
================================ */
.section-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 120px 40px;
    position: relative;
    z-index: 1;
}

.section-header {
    text-align: center;
    margin-bottom: 80px;
}

.section-tag {
    display: inline-block;
    padding: 6px 14px;
    border: 1px solid var(--border);
    border-radius: 50px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--accent);
    margin-bottom: 20px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.section-title {
    font-size: clamp(36px, 4vw, 56px);
    font-weight: 600;
    letter-spacing: -0.03em;
    margin-bottom: 16px;
}

.section-description {
    font-size: 18px;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* ================================
   PROTOCOL FLOW
================================ */
.flow-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.flow-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    padding: 40px 32px;
    transition: all 0.3s ease;
    position: relative;
}

.flow-card:hover {
    border-color: var(--accent);
    background: var(--bg-surface-hover);
}

.flow-number {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--accent);
    margin-bottom: 24px;
    letter-spacing: 0.1em;
}

.flow-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 12px;
    letter-spacing: -0.01em;
}

.flow-description {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 24px;
}

.flow-code {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
    padding: 16px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.flow-code code {
    display: block;
}

/* ================================
   INSTRUMENTS
================================ */
.instruments-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.instrument-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    padding: 28px;
    transition: border-color 0.3s ease, background 0.3s ease;
    transform-style: preserve-3d;
    will-change: transform;
}

.instrument-card:hover {
    border-color: var(--border-strong);
}

.instrument-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.instrument-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-dim);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 8px;
    color: var(--accent);
}

.instrument-availability {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--success);
    background: var(--success-dim);
    padding: 4px 8px;
    border-radius: 4px;
}

.instrument-name {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 6px;
    letter-spacing: -0.01em;
}

.instrument-specs {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.instrument-price {
    border-top: 1px solid var(--border);
    padding-top: 16px;
}

.price-value {
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.price-unit {
    font-size: 12px;
    color: var(--text-muted);
}

/* ================================
   NETWORK / LABS
================================ */
.labs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.lab-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    padding: 28px;
    transition: border-color 0.3s ease, background 0.3s ease;
    transform-style: preserve-3d;
    will-change: transform;
}

.lab-card:hover {
    border-color: var(--border-strong);
}

.lab-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.lab-name {
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.lab-status {
    font-family: var(--font-mono);
    font-size: 10px;
    text-transform: uppercase;
    padding: 4px 8px;
    border-radius: 4px;
    letter-spacing: 0.05em;
}

.lab-status.online {
    color: var(--success);
    background: var(--success-dim);
}

.lab-location {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.lab-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.lab-stat {
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.stat-label {
    font-family: var(--font-mono);
    font-size: 9px;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.08em;
}

.lab-certs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.cert-badge {
    font-family: var(--font-mono);
    font-size: 9px;
    text-transform: uppercase;
    padding: 4px 8px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
}

/* ================================
   FOOTER
================================ */
.footer {
    border-top: 1px solid var(--border);
    position: relative;
    z-index: 1;
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 60px 40px;
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 60px;
    align-items: center;
}

.footer-tagline {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 8px;
}

.footer-links {
    display: flex;
    gap: 32px;
}

.footer-link {
    font-size: 13px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-link:hover {
    color: var(--text-primary);
}

.footer-contract {
    text-align: right;
}

.contract-label {
    display: block;
    font-family: var(--font-mono);
    font-size: 10px;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.1em;
    margin-bottom: 6px;
}

.contract-address {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-secondary);
}

/* ================================
   SYSTEM LOGS (Live Ticker)
================================ */
.system-logs {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 32px;
    background: #08080a;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 20px;
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-muted);
    z-index: 90;
    overflow: hidden;
}

.log-indicator {
    width: 6px;
    height: 6px;
    background: var(--success);
    border-radius: 50%;
    margin-right: 12px;
    box-shadow: 0 0 8px var(--success);
    flex-shrink: 0;
}

.log-content {
    display: flex;
    gap: 48px;
    animation: ticker 40s linear infinite;
    white-space: nowrap;
}

.log-item {
    opacity: 0.7;
}

.log-item span {
    color: var(--accent);
}

@keyframes ticker {
    0% { transform: translateX(0); }
    100% { transform: translateX(-33.33%); }
}

/* ================================
   COMMAND PALETTE (Ctrl+K)
================================ */
.cmd-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 15vh;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.cmd-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.cmd-modal {
    width: 100%;
    max-width: 560px;
    background: #0a0a0c;
    border: 1px solid var(--border-strong);
    box-shadow: 
        0 25px 80px rgba(0, 0, 0, 0.8),
        0 0 0 1px var(--accent-dim),
        0 0 40px rgba(59, 130, 246, 0.1);
    border-radius: 12px;
    overflow: hidden;
    transform: scale(0.96) translateY(-10px);
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.cmd-overlay.active .cmd-modal {
    transform: scale(1) translateY(0);
}

.cmd-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
}

.cmd-icon {
    color: var(--accent);
    flex-shrink: 0;
}

.cmd-input {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 15px;
    width: 100%;
    outline: none;
}

.cmd-input::placeholder {
    color: var(--text-muted);
}

.cmd-body {
    padding: 8px;
    max-height: 320px;
    overflow-y: auto;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}

.cmd-body::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.cmd-section-label {
    font-family: var(--font-mono);
    font-size: 10px;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.1em;
    padding: 8px 12px 4px;
}

.cmd-item {
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    border-radius: 6px;
    color: var(--text-secondary);
    transition: all 0.1s ease;
    font-family: var(--font-main);
    font-size: 14px;
}

/* Reset cursor inside modal for usability */
.cmd-modal,
.cmd-modal * {
    cursor: auto;
}

.cmd-item {
    cursor: pointer;
}

.cmd-input {
    cursor: text;
}

.cmd-item:hover,
.cmd-item.selected {
    background: var(--bg-surface-hover);
    color: var(--text-primary);
}

.cmd-item.selected {
    background: var(--accent-dim);
}

.cmd-item-icon {
    width: 16px;
    height: 16px;
    margin-right: 12px;
    opacity: 0.6;
}

.cmd-item-left {
    display: flex;
    align-items: center;
}

.cmd-shortcut {
    font-family: var(--font-mono);
    font-size: 10px;
    background: rgba(255, 255, 255, 0.08);
    padding: 3px 6px;
    border-radius: 4px;
    letter-spacing: 0.02em;
}

.cmd-footer {
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.02);
    border-top: 1px solid var(--border);
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
}

.cmd-footer kbd {
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 5px;
    border-radius: 3px;
    margin: 0 2px;
}

/* Nav trigger button */
.cmd-trigger {
    display: flex;
    align-items: center;
    gap: 6px;
}

.cmd-trigger-key {
    font-family: var(--font-mono);
    font-size: 10px;
    opacity: 0.5;
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
}

/* Nav Icon Links */
.nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-icon svg {
    transition: transform 0.2s ease;
}

.nav-icon:hover svg {
    transform: scale(1.15);
}

/* Floating Search Button (FAB) */
.search-fab {
    position: fixed;
    right: 24px;
    bottom: 56px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--accent);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 95;
    transition: all 0.2s ease;
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.4), 0 0 40px rgba(59, 130, 246, 0.2);
}

.search-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(59, 130, 246, 0.5), 0 0 60px rgba(59, 130, 246, 0.3);
}

/* Reset cursor for FAB */
.search-fab,
.search-fab * {
    cursor: pointer !important;
}

.search-fab svg {
    pointer-events: none;
}

/* ================================
   FOOTER (Adjust for logs bar)
================================ */
.footer {
    border-top: 1px solid var(--border);
    position: relative;
    z-index: 1;
    margin-bottom: 32px; /* Space for system logs */
}

/* ================================
   RESPONSIVE
================================ */
@media (max-width: 1024px) {
    .hero-grid { 
        grid-template-columns: 1fr; 
        gap: 60px;
    }
    
    .flow-grid {
        grid-template-columns: 1fr;
    }
    
    .instruments-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .footer-container {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 40px;
    }
    
    .footer-links {
        justify-content: center;
    }
    
    .footer-contract {
        text-align: center;
    }
}

@media (max-width: 768px) {
    body {
        cursor: auto;
    }
    
    .cursor-dot,
    .cursor-outline {
        display: none !important;
    }
    
    .nav-links {
        display: none;
    }
    
    .hero {
        padding: 120px 24px 80px;
    }
    
    .section-container {
        padding: 80px 24px;
    }
    
    .bento-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }
    
    .bento-card.large {
        grid-column: span 1;
    }
    
    .instruments-grid {
        grid-template-columns: 1fr;
    }
    
    .cta-buttons {
        flex-direction: column;
    }
    
    .btn-primary,
    .btn-secondary {
        width: 100%;
        justify-content: center;
    }
    
    /* Command Palette Mobile */
    .cmd-overlay {
        padding: 10vh 16px;
    }
    
    .cmd-modal {
        max-width: 100%;
    }
    
    /* System Logs Mobile */
    .system-logs {
        display: none;
    }
    
    /* Search FAB Mobile - move up since no logs bar */
    .search-fab {
        bottom: 24px;
    }
    
    .footer {
        margin-bottom: 0;
    }
}

/* Touch devices */
@media (hover: none) and (pointer: coarse) {
    body {
        cursor: auto;
    }
    
    .cursor-dot,
    .cursor-outline {
        display: none !important;
    }
}

/* ================================
   ANIMATIONS
================================ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-left {
    animation: fadeInUp 0.8s ease forwards;
}

.hero-right {
    animation: fadeInUp 0.8s ease 0.2s forwards;
    opacity: 0;
}
