/* ==========================================================================
   CSS Variables & Spatial UI / Cosmic Theme
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Cabinet+Grotesk:wght@400;500;700;800&family=Satoshi:wght@300;400;500;700&display=swap');

:root {
    /* Color Palette - Midnight Cosmic */
    --bg-space: #030108; /* Deepest Midnight */
    --bg-surface: #0C061A; /* Elevated Surface */
    --bg-glass: rgba(18, 9, 36, 0.5); /* Frosted Glass */
    
    --primary: #FF2A6D; /* Cosmic Pink */
    --primary-glow: rgba(255, 42, 109, 0.4);
    --secondary: #05D5FA; /* Holographic Cyan */
    --secondary-glow: rgba(5, 213, 250, 0.4);
    
    /* Typography */
    --text-pure: #FFFFFF;
    --text-main: #E0DDE6;
    --text-muted: #8F87A6;
    
    /* Spatial Structural Elements */
    --border-glass: rgba(255, 255, 255, 0.08);
    --border-highlight: rgba(255, 255, 255, 0.15);
    
    /* Tactile Shadows */
    --shadow-inset: inset 0 2px 4px rgba(255, 255, 255, 0.05);
    --shadow-drop: 0 20px 40px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 40px var(--primary-glow);
    
    /* Fonts */
    --font-heading: 'Cabinet Grotesk', sans-serif;
    --font-body: 'Satoshi', sans-serif;
    
    /* Layout & Animation */
    --max-width: 1400px;
    --nav-height: 90px;
    --radius-lg: 32px;
    --radius-md: 16px;
    --section-gap: 160px;
    --transition-spatial: 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* ==========================================================================
   Reset & Base Styles
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-body);
    color: var(--text-main);
    background-color: var(--bg-space);
    background-image: 
        radial-gradient(circle at 0% 0%, rgba(255, 42, 109, 0.05) 0%, transparent 40%),
        radial-gradient(circle at 100% 100%, rgba(5, 213, 250, 0.05) 0%, transparent 40%);
    background-attachment: fixed;
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--text-pure);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition-spatial);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul { list-style: none; }

.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 5%;
}

/* Custom Selection & Scrollbar */
::selection { background: var(--secondary); color: var(--bg-space); }
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg-space); }
::-webkit-scrollbar-thumb { background: var(--bg-surface); border: 1px solid var(--border-glass); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* ==========================================================================
   Typography & Spatial Components
   ========================================================================== */
.text-gradient {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.title-massive {
    font-size: clamp(3.5rem, 7vw, 6.5rem);
    line-height: 1.05;
    margin-bottom: 1.5rem;
}

.title-section {
    font-size: clamp(2.5rem, 5vw, 4rem);
    margin-bottom: 1rem;
    text-align: center;
}

.subtitle {
    font-size: 1.25rem;
    color: var(--text-muted);
    text-align: center;
    max-width: 700px;
    margin: 0 auto 4rem;
}

.pill-spatial {
    display: inline-flex;
    align-items: center;
    padding: 8px 20px;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: 100px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: var(--shadow-inset);
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-pure);
    margin-bottom: 2rem;
}

.btn-spatial {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 16px 36px;
    background: linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255,255,255,0.0));
    background-color: var(--primary);
    color: var(--text-pure);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1rem;
    border-radius: 100px;
    border: 1px solid rgba(255,255,255,0.2);
    box-shadow: var(--shadow-inset), 0 10px 20px var(--primary-glow);
    cursor: pointer;
    transition: var(--transition-spatial);
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.btn-spatial:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: var(--shadow-inset), 0 15px 30px var(--primary-glow);
}

.btn-spatial:active {
    transform: translateY(2px) scale(0.98);
    box-shadow: 0 5px 10px var(--primary-glow);
}

/* ==========================================================================
   Master Header (Deepest Midnight)
   ========================================================================== */
.site-header {
    position: fixed;
    top: 0; left: 0; width: 100%;
    height: var(--nav-height);
    background: rgba(3, 1, 8, 0.7);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid var(--border-glass);
    z-index: 9999;
    display: flex;
    align-items: center;
    transition: var(--transition-spatial);
}

.site-header.scrolled {
    height: 75px;
    background: rgba(3, 1, 8, 0.9);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo img {
    height: 60px;
    object-fit: contain;
    filter: invert(1);
}

.nav-cluster {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--bg-glass);
    padding: 6px;
    border-radius: 100px;
    border: 1px solid var(--border-glass);
    box-shadow: var(--shadow-inset);
}

.nav-link {
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--text-main);
    padding: 10px 24px;
    border-radius: 100px;
    transition: var(--transition-spatial);
}

.nav-link:hover, .nav-link.active {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-pure);
}

.hamburger {
    display: none;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
    z-index: 10000;
}

.hamburger span {
    display: block;
    width: 32px; height: 2px;
    background: var(--text-pure);
    border-radius: 2px;
    transition: var(--transition-spatial);
}

/* ==========================================================================
   Hero Section (Spatial Environment)
   ========================================================================== */
.hero {
    padding-top: calc(var(--nav-height) + 60px);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* Glowing Orb Background */
.hero::before {
    content: '';
    position: absolute;
    top: 30%; left: 50%;
    transform: translate(-50%, -50%);
    width: 800px; height: 800px;
    background: radial-gradient(circle, var(--primary-glow) 0%, transparent 60%);
    filter: blur(80px);
    z-index: -1;
    animation: orbPulse 8s ease-in-out infinite alternate;
}

.hero-content {
    max-width: 900px;
    position: relative;
    z-index: 2;
}

.hero-desc {
    font-size: 1.3rem;
    color: var(--text-muted);
    margin: 0 auto 3rem;
    max-width: 650px;
    line-height: 1.8;
}

/* Spatial Floating Panels */
.spatial-float {
    position: absolute;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow-drop), var(--shadow-inset);
    display: flex;
    align-items: center;
    gap: 15px;
    pointer-events: none;
    z-index: 1;
}

.sf-1 { top: 20%; left: 5%; animation: floatY 6s ease-in-out infinite; }
.sf-2 { bottom: 25%; right: 5%; animation: floatY 8s ease-in-out infinite reverse; }

.sf-icon {
    width: 40px; height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: bold;
}

/* ==========================================================================
   Marquee Glass Track
   ========================================================================== */
.client-track {
    padding: 2.5rem 0;
    background: var(--bg-glass);
    border-top: 1px solid var(--border-glass);
    border-bottom: 1px solid var(--border-glass);
    backdrop-filter: blur(10px);
    overflow: hidden;
}

.marquee-container {
    display: flex;
    width: max-content;
    animation: scrollMarquee 35s linear infinite;
}

.mq-logo {
    font-family: var(--font-heading);
    font-size: 2rem;
    color: var(--text-muted);
    margin: 0 4rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    transition: var(--transition-spatial);
}

.mq-logo:hover {
    color: var(--text-pure);
    text-shadow: 0 0 15px rgba(255,255,255,0.5);
}

/* ==========================================================================
   Spotlight Card Component (Crucial Spatial Detail)
   ========================================================================== */
.spotlight-card {
    position: relative;
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-glass);
    overflow: hidden;
    isolation: isolate;
    transition: transform var(--transition-spatial);
}

/* The actual spotlight effect utilizing JS mouse coordinates */
.spotlight-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(
        800px circle at var(--mouse-x, 0) var(--mouse-y, 0), 
        rgba(255, 255, 255, 0.06),
        transparent 40%
    );
    z-index: 1;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.spotlight-card:hover::before { opacity: 1; }
.spotlight-card:hover { transform: translateY(-5px); border-color: var(--border-highlight); }

/* Content wrapper above the spotlight */
.sc-content {
    position: relative;
    z-index: 2;
    padding: 3rem;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* ==========================================================================
   About / Scale Metrics
   ========================================================================== */
.metrics { padding: var(--section-gap) 0; }

.metric-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.metric-box {
    text-align: center;
    padding: 4rem 2rem;
}

.metric-val {
    font-family: var(--font-heading);
    font-size: 5rem;
    line-height: 1;
    margin-bottom: 1rem;
    background: linear-gradient(to bottom, var(--text-pure), var(--text-muted));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.metric-lbl {
    font-size: 1.1rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* ==========================================================================
   Services Spatial Grid
   ========================================================================== */
.services { padding: var(--section-gap) 0; }

.srv-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.srv-icon {
    width: 64px; height: 64px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    box-shadow: var(--shadow-inset);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.8rem;
    margin-bottom: 2rem;
    color: var(--secondary);
}

.sc-content h3 { font-size: 1.75rem; margin-bottom: 1rem; }
.sc-content p { color: var(--text-muted); font-size: 1.05rem; }

/* ==========================================================================
   Analytics Dashboard (Pure CSS Conic Donut Chart)
   ========================================================================== */
.analytics { padding: var(--section-gap) 0; }

.analytics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5rem;
    align-items: center;
}

.dash-panel {
    background: var(--bg-surface);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 4rem;
    box-shadow: var(--shadow-drop), var(--shadow-inset);
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.dash-panel::before {
    content: '';
    position: absolute;
    top: 0; left: 10%; width: 80%; height: 1px;
    background: linear-gradient(90deg, transparent, var(--secondary), transparent);
}

/* The CSS Donut Chart */
.css-donut {
    width: 250px; height: 250px;
    border-radius: 50%;
    /* Baseline conic gradient, animation handled by JS/CSS vars or pure CSS rotation */
    background: conic-gradient(var(--primary) 0deg, var(--secondary) 280deg, var(--bg-space) 280deg);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 0 0 30px rgba(5, 213, 250, 0.2);
    margin-bottom: 2rem;
}

/* Inner cutout for donut effect */
.css-donut::before {
    content: '';
    position: absolute;
    width: 200px; height: 200px;
    background: var(--bg-surface);
    border-radius: 50%;
    box-shadow: inset 0 5px 15px rgba(0,0,0,0.5);
}

.donut-label {
    position: relative;
    z-index: 2;
    text-align: center;
}

.donut-label span { display: block; font-family: var(--font-heading); font-size: 3rem; color: var(--text-pure); line-height: 1; }
.donut-label small { font-size: 0.85rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.1em; }

/* ==========================================================================
   Tactile Calculator (Neumorphic Spatial Sliders)
   ========================================================================== */
.calculator { padding: var(--section-gap) 0; }

.calc-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
}

.calc-sliders {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.slider-group {
    background: var(--bg-surface);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 2rem;
    box-shadow: var(--shadow-inset);
}

.slider-head {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.slider-head label { font-weight: 700; color: var(--text-main); }
.slider-head span { color: var(--primary); font-family: var(--font-heading); font-size: 1.5rem; }

/* Spatial Range Input */
input[type=range] {
    -webkit-appearance: none;
    width: 100%;
    background: transparent;
}

input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 8px;
    background: var(--bg-space);
    border: 1px solid var(--border-glass);
    border-radius: 4px;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.8);
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 28px; width: 28px;
    background: var(--text-pure);
    border: 4px solid var(--primary);
    border-radius: 50%;
    margin-top: -11px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5), 0 0 15px var(--primary-glow);
    transition: transform var(--transition-spatial);
}

input[type=range]::-webkit-slider-thumb:active { transform: scale(0.9); }

.calc-output {
    background: linear-gradient(135deg, var(--bg-surface), var(--bg-space));
    border: 1px solid var(--border-highlight);
    border-radius: var(--radius-lg);
    padding: 4rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-shadow: var(--shadow-drop), inset 0 0 40px rgba(5, 213, 250, 0.05);
}

.calc-output h4 { font-size: 4rem; color: var(--secondary); margin-bottom: 1rem; line-height: 1; }
.calc-output p { font-size: 1.1rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.1em; }

/* ==========================================================================
   Industry Floating Pills
   ========================================================================== */
.industries { padding: var(--section-gap) 0; text-align: center; }

.pill-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 4rem;
}

.industry-pill {
    padding: 1.25rem 2.5rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-glass);
    border-radius: 100px;
    font-family: var(--font-heading);
    font-size: 1.25rem;
    color: var(--text-main);
    box-shadow: var(--shadow-inset);
    transition: var(--transition-spatial);
    cursor: default;
}

.industry-pill:hover {
    background: var(--text-pure);
    color: var(--bg-space);
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(255,255,255,0.1);
}

/* ==========================================================================
   Testimonials
   ========================================================================== */
.testimonials { padding: var(--section-gap) 0; }

.test-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
}

.t-quote {
    font-size: 1.5rem;
    line-height: 1.6;
    color: var(--text-pure);
    margin-bottom: 2rem;
}

.t-author { display: flex; align-items: center; gap: 1rem; }
.t-avatar { width: 56px; height: 56px; border-radius: 50%; background: var(--bg-space); border: 1px solid var(--border-glass); }

/* ==========================================================================
   Contact / Glass Pane
   ========================================================================== */
.contact-section { padding: var(--section-gap) 0; position: relative; }

.glass-pane {
    background: var(--bg-glass);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid var(--border-highlight);
    border-radius: var(--radius-lg);
    padding: 5rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5rem;
    box-shadow: var(--shadow-drop), var(--shadow-inset);
    position: relative;
    overflow: hidden;
}

/* Moving gradient behind glass */
.glass-pane::before {
    content: '';
    position: absolute;
    top: -50%; left: -50%; width: 200%; height: 200%;
    background: conic-gradient(from 0deg, transparent, rgba(255, 42, 109, 0.1), transparent, rgba(5, 213, 250, 0.1), transparent);
    animation: spinRotate 20s linear infinite;
    z-index: -1;
}

.form-field { margin-bottom: 2rem; }

.spatial-input {
    width: 100%;
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    color: var(--text-pure);
    font-family: var(--font-body);
    font-size: 1rem;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.5);
    transition: var(--transition-spatial);
}

.spatial-input:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.5), 0 0 15px var(--secondary-glow);
}

textarea.spatial-input { height: 140px; resize: none; }

/* ==========================================================================
   Legal Pages Spatial Formatting
   ========================================================================== */
.legal-main {
    padding: calc(var(--nav-height) + 120px) 5% 120px;
    max-width: 900px;
    margin: 0 auto;
}

.legal-box {
    background: var(--bg-surface);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 5rem;
    box-shadow: var(--shadow-inset), var(--shadow-drop);
}

.legal-box h1 { font-size: 3.5rem; margin-bottom: 2rem; border-bottom: 1px solid var(--border-glass); padding-bottom: 1rem; }
.legal-box h2 { font-size: 1.75rem; color: var(--primary); margin: 3rem 0 1rem; }
.legal-box p { font-size: 1.1rem; color: var(--text-muted); margin-bottom: 1.5rem; line-height: 1.8; }

/* ==========================================================================
   Master Footer (Midnight Cosmic)
   ========================================================================== */
.site-footer {
    background: var(--bg-space);
    border-top: 1px solid var(--border-glass);
    padding: 100px 5% 40px;
    position: relative;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 4rem;
    max-width: var(--max-width);
    margin: 0 auto 4rem;
}

.footer-brand img { height: 40px; margin-bottom: 1.5rem; filter: drop-shadow(0 0 10px rgba(255,255,255,0.2)); }
.footer-brand p { color: var(--text-muted); max-width: 320px; font-size: 1rem; }

.footer-col h4 {
    font-size: 1.25rem;
    color: var(--text-pure);
    margin-bottom: 1.5rem;
}

.footer-col ul { display: flex; flex-direction: column; gap: 1rem; }
.footer-col a, .footer-col li { color: var(--text-muted); font-size: 1rem; transition: var(--transition-spatial); }
.footer-col a:hover { color: var(--secondary); text-shadow: 0 0 10px var(--secondary-glow); }

.footer-bottom {
    max-width: var(--max-width);
    margin: 0 auto;
    padding-top: 2rem;
    border-top: 1px solid var(--border-glass);
    display: flex;
    justify-content: space-between;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ==========================================================================
   Animations & Responsive
   ========================================================================== */
@keyframes orbPulse { 0% { transform: translate(-50%, -50%) scale(1); opacity: 0.8; } 100% { transform: translate(-50%, -50%) scale(1.1); opacity: 1; } }
@keyframes floatY { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-20px); } }
@keyframes scrollMarquee { 100% { transform: translateX(-50%); } }
@keyframes spinRotate { 100% { transform: rotate(360deg); } }

.reveal-up {
    opacity: 0;
    transform: translateY(50px) scale(0.95);
    transition: opacity 0.8s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.reveal-up.active {
    opacity: 1;
    transform: translateY(0) scale(1);
}

@media (max-width: 1024px) {
    .metric-grid { grid-template-columns: 1fr; }
    .analytics-grid, .calc-layout, .glass-pane { grid-template-columns: 1fr; }
    .glass-pane { padding: 3rem; }
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 3rem; }
}

@media (max-width: 768px) {
    .hamburger { display: flex; }
    .nav-cluster {
        position: fixed;
        top: var(--nav-height); left: 0; width: 100%; height: calc(100vh - var(--nav-height));
        background: var(--bg-space);
        flex-direction: column; justify-content: center;
        border-radius: 0; border: none; padding: 2rem;
        transform: translateX(100%); transition: var(--transition-spatial);
    }
    .nav-cluster.active { transform: translateX(0); }
    .hamburger.active span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
    .hamburger.active span:nth-child(2) { opacity: 0; }
    .hamburger.active span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

    .test-grid, .footer-grid { grid-template-columns: 1fr; }
    .footer-bottom { flex-direction: column; gap: 1rem; text-align: center; }
    .legal-box { padding: 2rem; }
    .spatial-float { display: none; }
}