/* styles.css */
:root {
    /* Colors - Deep Dark Base */
    --bg-dark: #050508;
    --bg-card: #0c0c12;
    --bg-glass: rgba(15, 15, 23, 0.9);
    
    /* Text Colors */
    --text-main: #e8e8ed;
    --text-dim: #9ca3af;
    --text-muted: #55556a;
    --text-white: #ffffff;
    
    /* Semantic Accents */
    --accent-red: #e63946;
    --accent-red-glow: rgba(230, 57, 70, 0.3);
    --accent-red-muted: rgba(230, 57, 70, 0.1);
    
    --accent-blue: #4a90d9;
    --accent-blue-glow: rgba(74, 144, 217, 0.3);
    --accent-blue-muted: rgba(74, 144, 217, 0.1);
    
    --accent-amber: #d4a843;
    --accent-green: #4af0a0;

    /* Typography */
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', 'Courier New', monospace;

    /* Geometry */
    --nav-height: 80px;
    --border-subtle: rgba(255, 255, 255, 0.05);
    
    /* Transitions */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
    scroll-behavior: smooth;
    background-color: var(--bg-dark);
    color: var(--text-main);
}

body {
    font-family: var(--font-sans);
    line-height: 1.7;
    font-size: 16px;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    position: relative;
}

/* ====================================================
   PERFORMANCE OPTIMIZATIONS 
   ==================================================== */

/* Removed expensive SVG noise filter that caused full screen repaints when scrolling */
.noise-overlay {
    display: none;
}

/* Removed 'background-position' animation from scanlines. 
   Static scanlines still look futuristic but cost 0 CPU/GPU to maintain. */
.scanlines {
    position: fixed; inset: 0; z-index: 9998; pointer-events: none;
    background: linear-gradient(to bottom, rgba(255,255,255,0), rgba(255,255,255,0) 50%, rgba(0,0,0,0.15) 50%, rgba(0,0,0,0.15));
    background-size: 100% 4px; opacity: 0.3;
}

/* Typography & Utilities */
.mono { font-family: var(--font-mono); }
.italic { font-style: italic; }
.text-sm { font-size: 0.875rem; }
.text-dim { color: var(--text-dim); }
.text-muted { color: var(--text-muted); }
.text-white { color: var(--text-white); }

/* Optimized Highlight (using solid color instead of text-shadow for better performance) */
.highlight { color: var(--accent-red); font-weight: 600; }

/* Accent Colors */
.accent-red { color: var(--accent-red); }
.accent-blue { color: var(--accent-blue); }
.accent-amber { color: var(--accent-amber); }
.accent-green { color: var(--accent-green); }

.text-red { color: var(--text-main); }
.text-blue { color: var(--text-main); }
.text-amber { color: var(--text-main); }
.text-green { color: var(--accent-green); }

.mt-md { margin-top: 2rem; }
.mt-large { margin-top: 3.5rem; }
.mt-extra { margin-top: 5rem; }
.mt-sm { margin-top: 0.5rem; }
.text-center-mx { margin-left: auto; margin-right: auto; }

/* Layout Containers */
.container {
    width: 100%; max-width: 1200px;
    margin: 0 auto; padding: 0 2rem;
    position: relative; z-index: 10;
}

section { padding: 6rem 0; position: relative; border-bottom: 1px solid var(--border-subtle); }

.grid-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
.grid-3col { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.grid-1col { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }

@media (max-width: 900px) {
    .grid-3col { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
    .grid-2col, .grid-3col { grid-template-columns: 1fr; }
}

/* Headings */
h1, h2, h3, h4 { font-weight: 700; line-height: 1.25; margin-bottom: 1rem; letter-spacing: -0.02em; }
.sub-header { font-size: 1.1rem; margin-bottom: 2rem; letter-spacing: 0.05em; text-transform: uppercase; }
.section-title { font-size: clamp(2rem, 4vw, 2.75rem); margin-bottom: 2.5rem; }
.section-intro { font-size: 1.1rem; color: var(--text-dim); margin-bottom: 2rem; max-width: 750px; }
.sub-title { font-size: 1.6rem; margin-bottom: 1rem; }

.section-label {
    font-size: 0.75rem; letter-spacing: 0.15em; opacity: 0.7;
    margin-bottom: 1.5rem; padding-left: 0;
}

/* Navigation - Optimized blur */
.global-nav {
    position: fixed; top: 0; left: 0; width: 100%; height: var(--nav-height);
    background: rgba(5, 5, 8, 0.95); /* Replaced expensive backdrop filter with solid opacity */
    border-bottom: 1px solid var(--border-subtle); z-index: 1000;
    transition: background 0.3s ease;
}
.global-nav.scrolled { background: rgba(5, 5, 8, 1); box-shadow: 0 4px 15px rgba(0,0,0,0.3); }

.nav-container {
    max-width: 1400px; margin: 0 auto; padding: 0 2rem; height: 100%;
    display: flex; justify-content: space-between; align-items: center;
}
.logo a { font-family: var(--font-mono); font-weight: 800; font-size: 1.3rem; color: var(--text-main); text-decoration: none; }
.blink { animation: blink-anim 1s step-end infinite; }
@keyframes blink-anim { 0%,100% { opacity: 1; } 50% { opacity: 0; } }
.blink-slow { animation: blink-anim 2s step-end infinite; }

.nav-links { display: flex; list-style: none; gap: 2rem; align-items: center; }
.nav-links li a {
    font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-dim); text-decoration: none;
    text-transform: uppercase; letter-spacing: 0.1em; transition: color 0.15s ease;
}
.nav-links li a:hover { color: var(--text-main); }
.nav-cta { border: 1px solid var(--accent-red); padding: 0.5rem 1.25rem; border-radius: 4px; color: var(--accent-red) !important; }
.nav-links li a.nav-cta:hover { background: var(--accent-red-muted); }

.hamburger { display: none; cursor: pointer; border: none; background: transparent; }
.hamburger .bar { display: block; width: 25px; height: 2px; margin: 5px auto; background-color: var(--text-main); transition: 0.3s ease; }

@media (max-width: 900px) {
    .hamburger { display: block; }
    .nav-links {
        position: fixed; left: 100%; top: var(--nav-height); flex-direction: column;
        background: rgba(5,5,8,1); width: 100%; height: calc(100vh - var(--nav-height));
        padding-top: 2rem; transition: 0.3s; border-top: 1px solid rgba(255,255,255,0.05);
    }
    .nav-links.active { left: 0; }
}

/* Buttons - Optimized pulse animation */
.btn {
    display: inline-flex; align-items: center; padding: 1rem 2.5rem;
    font-family: var(--font-mono); font-size: 0.8rem; font-weight: 700;
    text-decoration: none; text-transform: uppercase; letter-spacing: 0.1em;
    border: 1px solid transparent; border-radius: 4px;
    transition: all 0.2s ease; cursor: pointer; position: relative;
}
.primary-btn { border-color: var(--accent-red); color: var(--accent-red); background: transparent; }
.primary-btn:hover { background: var(--accent-red); color: var(--bg-dark); }

/* Changed to use pseudo element scaling to avoid painting lag from box-shadow */
.pulse-glow::after {
    content: ''; position: absolute; inset: 0; border-radius: 4px;
    border: 2px solid var(--accent-red);
    animation: pulse-shadow 2.5s cubic-bezier(0.16, 1, 0.3, 1) infinite;
    z-index: -1; pointer-events: none;
}
@keyframes pulse-shadow {
    0% { transform: scale(1); opacity: 0.6; }
    70% { transform: scale(1.05, 1.25); opacity: 0; }
    100% { transform: scale(1); opacity: 0; }
}

/* Sections Borders */
.border-red { position: relative; }
.border-red::after { content:''; position: absolute; left:0; top:0; bottom:0; width:3px; background: linear-gradient(to bottom, transparent, var(--accent-red), transparent); opacity:0.5;}
.border-blue { position: relative; }
.border-blue::after { content:''; position: absolute; left:0; top:0; bottom:0; width:3px; background: linear-gradient(to bottom, transparent, var(--accent-blue), transparent); opacity:0.5;}
.border-amber { position: relative; }
.border-amber::after { content:''; position: absolute; left:0; top:0; bottom:0; width:3px; background: linear-gradient(to bottom, transparent, var(--accent-amber), transparent); opacity:0.5;}

/* Cards & Holders */
/* Optimization: Removed expensive box shadows and backdrop-filters */
.card {
    background: var(--bg-card); border: 1px solid var(--border-subtle);
    padding: 2.5rem; border-radius: 6px; height: 100%; transition: transform 0.2s ease;
    will-change: transform;
}
.glass-card { background: var(--bg-glass); }
.service-card {
    background: var(--bg-card); border: 1px solid var(--border-subtle);
    padding: 2rem; border-radius: 6px; position: relative; display: flex; flex-direction: column;
    transition: transform 0.2s ease; will-change: transform;
}

.hover-lift:hover {
    transform: translateY(-4px);
    border-color: rgba(255,255,255,0.15);
}

/* Colored Cards */
.red-card::before, .blue-card::before {
    content:''; position:absolute; top:0; left:0; width:100%; height:3px; opacity:0.5; transition: opacity 0.2s ease;
}
.red-card::before { background: var(--accent-red); }
.blue-card::before { background: var(--accent-blue); }
.red-card:hover { border-color: var(--accent-red-muted); }
.red-card:hover::before { opacity: 1; }
.blue-card:hover { border-color: var(--accent-blue-muted); }
.blue-card:hover::before { opacity: 1; }

.card-icon { font-family: var(--font-mono); font-size: 0.85rem; font-weight: 700; margin-bottom: 1.5rem; transition: transform 0.2s; }
.red-icon { color: var(--accent-red); }
.blue-icon { color: var(--accent-blue); }
.service-card:hover .card-icon { transform: translateY(-3px); }

/* Philosophy */
.philosophy-quote { font-size: clamp(1.2rem, 2vw, 1.5rem); font-weight: 600; color: var(--text-white); border-left: 3px solid var(--accent-amber); padding-left: 1.5rem; }
.separator { border: 0; height: 1px; background: var(--border-subtle); margin: 2rem 0; }

/* Hero */
.hero-section { min-height: 100vh; display: flex; align-items: center; padding-top: var(--nav-height); background: var(--bg-dark); }

/* Optimized Background Grid */
.grid-overlay {
    position: absolute; inset: 0; pointer-events: none; opacity: 0.15;
    background-image: linear-gradient(rgba(255,255,255,0.1) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.1) 1px, transparent 1px);
    background-size: 50px 50px; 
}

/* Optimized Glow Orbs - Uses cheap radial gradients instead of extremely heavy CSS filter: blur()! */
.glow-orb { 
    position: absolute; width: 800px; height: 800px; border-radius: 50%; 
    pointer-events: none; opacity: 0.12; z-index: 0; 
}
.red-orb { background: radial-gradient(circle at center, var(--accent-red) 0%, transparent 60%); top: -10%; left: -20%; }
.blue-orb { background: radial-gradient(circle at center, var(--accent-blue) 0%, transparent 60%); bottom: -10%; right: -20%; }

.hero-content { position: relative; z-index: 10; max-width: 800px; }
.hero-title { font-size: clamp(2.5rem, 6vw, 4.5rem); text-transform: uppercase; line-height:1.1; margin-bottom: 1rem;}
.text-box p { font-size: 1.15rem; color: var(--text-dim); margin-bottom: 1.5rem; line-height: 1.8; }

/* Glitch Effect */
.glitch { position: relative; display: inline-block; color: var(--text-white); }
.glitch::before, .glitch::after { content: attr(data-text); position: absolute; top:0; left:0; width:100%; height:100%; opacity:0.8; pointer-events: none; }
.glitch::before { left: 2px; text-shadow: -2px 0 var(--accent-red); clip: rect(44px, 9999px, 56px, 0); animation: glitch-anim 5s infinite linear alternate-reverse; }
.glitch::after { left: -2px; text-shadow: -2px 0 var(--accent-blue); clip: rect(44px, 9999px, 56px, 0); animation: glitch-anim2 5s infinite linear alternate-reverse; }

@keyframes glitch-anim {
    0% { clip: rect(13px, 9999px, 83px, 0); }
    5% { clip: rect(61px, 9999px, 5px, 0); }
    10% { clip: rect(79px, 9999px, 86px, 0); }
    15% { clip: rect(75px, 9999px, 20px, 0); }
    20% { clip: rect(4px, 9999px, 48px, 0); }
    25% { clip: rect(51px, 9999px, 14px, 0); }
    30% { clip: rect(93px, 9999px, 3px, 0); }
    35% { clip: rect(50px, 9999px, 14px, 0); }
    40% { clip: rect(21px, 9999px, 43px, 0); }
    45% { clip: rect(32px, 9999px, 98px, 0); }
    50% { clip: rect(62px, 9999px, 60px, 0); }
    55% { clip: rect(84px, 9999px, 49px, 0); }
    60% { clip: rect(15px, 9999px, 63px, 0); }
    65% { clip: rect(70px, 9999px, 21px, 0); }
    70% { clip: rect(3px, 9999px, 5px, 0); }
    75% { clip: rect(8px, 9999px, 26px, 0); }
    80% { clip: rect(44px, 9999px, 12px, 0); }
    85% { clip: rect(95px, 9999px, 87px, 0); }
    90% { clip: rect(66px, 9999px, 2px, 0); }
    95% { clip: rect(19px, 9999px, 65px, 0); }
    100% { clip: rect(9px, 9999px, 44px, 0); }
}

@keyframes glitch-anim2 {
    0% { clip: rect(65px, 9999px, 100px, 0); }
    5% { clip: rect(52px, 9999px, 74px, 0); }
    10% { clip: rect(79px, 9999px, 85px, 0); }
    15% { clip: rect(75px, 9999px, 5px, 0); }
    20% { clip: rect(46px, 9999px, 28px, 0); }
    25% { clip: rect(3px, 9999px, 5px, 0); }
    30% { clip: rect(81px, 9999px, 47px, 0); }
    35% { clip: rect(10px, 9999px, 48px, 0); }
    40% { clip: rect(68px, 9999px, 85px, 0); }
    45% { clip: rect(18px, 9999px, 28px, 0); }
    50% { clip: rect(87px, 9999px, 43px, 0); }
    55% { clip: rect(6px, 9999px, 51px, 0); }
    60% { clip: rect(90px, 9999px, 58px, 0); }
    65% { clip: rect(24px, 9999px, 43px, 0); }
    70% { clip: rect(38px, 9999px, 48px, 0); }
    75% { clip: rect(66px, 9999px, 50px, 0); }
    80% { clip: rect(4px, 9999px, 3px, 0); }
    85% { clip: rect(86px, 9999px, 56px, 0); }
    90% { clip: rect(93px, 9999px, 45px, 0); }
    95% { clip: rect(8px, 9999px, 10px, 0); }
    100% { clip: rect(38px, 9999px, 7px, 0); }
}

/* AI Triage Cards */
.dot-indicator { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 10px; }
.red-dot { background: var(--accent-red); }
.green-dot { background: var(--accent-green); }
.card-header { display: flex; align-items: center; margin-bottom: 1.5rem; border-bottom: 1px solid var(--border-subtle); padding-bottom: 1rem; }
.card-subtitle { font-size: 1.2rem; margin-bottom: 1rem; color: var(--text-white); }

.hover-glow-red { border-top: 2px solid transparent; }
.hover-glow-red:hover { border-top-color: var(--accent-red); transform: translateY(-4px); }
.hover-glow-green { border-top: 2px solid transparent; }
.hover-glow-green:hover { border-top-color: var(--accent-green); transform: translateY(-4px); }

/* Terminal */
.terminal-window { background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: 8px; overflow: hidden; }
.terminal-header { background: rgba(0,0,0,0.6); padding: 0.75rem 1.5rem; display: flex; align-items: center; border-bottom: 1px solid rgba(255,255,255,0.05); }
.term-buttons { display: flex; gap: 8px; margin-right: 1.5rem; }
.term-buttons span { width: 12px; height: 12px; border-radius: 50%; }
.btn-close { background: #ff5f56; } .btn-min { background: #ffbd2e; } .btn-max { background: #27c93f; }
.terminal-title { color: var(--text-muted); }
.terminal-body { padding: 2rem; font-size: 0.95rem; line-height: 1.6; }
.prompt { color: var(--accent-green); margin-right: 0.75rem; }
.cmd { color: var(--text-white); }
.term-output { margin-top: 1rem; margin-bottom: 1.5rem; padding-left: 1rem; border-left: 2px solid rgba(255,255,255,0.05); }
.term-cursor { display: inline-block; width: 10px; height: 1.2em; background: var(--text-white); vertical-align: middle; }
.terminal-link { text-decoration: none; border-bottom: 1px solid var(--accent-blue); padding-bottom: 2px; }
.terminal-link:hover { color: var(--text-white); border-color: var(--text-white); }

/* Contact */
.contact-info-card { padding: 2rem; text-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center; border: 1px solid var(--border-subtle); border-radius: 6px; }
.icon-wrap { font-family: var(--font-mono); font-weight: 700; color: var(--accent-amber); margin-bottom: 1rem; font-size: 0.9rem;}
.contact-info-card h4 { color: var(--text-white); font-size: 1rem; margin-bottom: 0.5rem; }
.contact-info-card p, .contact-info-card a { color: var(--text-dim); transition: 0.2s ease; }
.contact-info-card a:hover { color: var(--text-white); }
.nda-note { padding: 2rem; text-align: center; border: 1px solid var(--border-subtle); border-radius: 6px; }

/* Footer */
.global-footer { padding: 2rem 0; border-top: 1px solid var(--border-subtle); background: var(--bg-card); font-size: 0.85rem; }
.flex-footer { display: flex; justify-content: space-between; align-items: center; }
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }

/* Reveal Animations - Optimized using transform3d for hardware acceleration */
.reveal { opacity: 0; transform: translate3d(0, 30px, 0); transition: opacity 0.6s ease, transform 0.6s ease; will-change: opacity, transform; }
.reveal.active { opacity: 1; transform: translate3d(0, 0, 0); }
.delay-1 { transition-delay: 0.1s; }
.delay-2 { transition-delay: 0.2s; }
.delay-3 { transition-delay: 0.3s; }
