@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600&family=Syncopate:wght@400;700&display=swap');

:root {
    --bg-primary: #050505;
    --bg-secondary: #0f0f0f;
    --bg-glass: rgba(15, 15, 15, 0.7);
    
    --text-primary: #ffffff;
    --text-secondary: #a1a1a6;
    --text-tertiary: #86868b;
    
    --accent-primary: #0071e3;
    --accent-secondary: #9d56ff;
    --accent-glow: rgba(0, 113, 227, 0.3);
    
    --border-soft: rgba(255, 255, 255, 0.1);
    --particle-color: rgba(255, 255, 255, 0.2);
    
    --max-width: 1300px;
    --section-gap: clamp(60px, 10vw, 160px);
    --section-padding: clamp(60px, 8vh, 120px) clamp(20px, 5vw, 40px);
    --border-radius-lg: clamp(24px, 4vw, 40px);
    
    --transition-smooth: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="light"] {
    --bg-primary: #edeff2; /* Premium greyish off-white */
    --bg-secondary: #ffffff;
    --bg-glass: rgba(255, 255, 255, 0.4);
    
    --text-primary: #1d1d1f;
    --text-secondary: #424245;
    --text-tertiary: #86868b;
    
    --accent-primary: #0071e3;
    --accent-secondary: #8e2de2;
    --accent-glow: rgba(0, 113, 227, 0.15);
    
    --border-soft: rgba(0, 0, 0, 0.08);
    --particle-color: rgba(0, 0, 0, 0.25); /* Darker background structures */
}

[data-theme="light"] .product-card,
[data-theme="light"] .home-product-card,
[data-theme="light"] .glass-card,
[data-theme="light"] .form-card,
[data-theme="light"] .philosophy-item,
[data-theme="light"] .cap-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.1)) !important;
    backdrop-filter: blur(60px) saturate(200%) !important;
    -webkit-backdrop-filter: blur(60px) saturate(200%) !important;
    border: 1px solid rgba(255, 255, 255, 0.8) !important;
    border-top: 2px solid rgba(255, 255, 255, 1) !important;
    border-left: 2px solid rgba(255, 255, 255, 0.9) !important;
    box-shadow: 
        10px 10px 30px rgba(0, 0, 0, 0.05),
        inset 0 10px 20px rgba(255, 255, 255, 0.6) !important;
    border-radius: 32px !important;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

/* "Coloury" Hovering Effects */
[data-theme="light"] .product-card:hover,
[data-theme="light"] .home-product-card:hover,
[data-theme="light"] .glass-card:hover,
[data-theme="light"] .form-card:hover,
[data-theme="light"] .philosophy-item:hover,
[data-theme="light"] .cap-card:hover {
    border-color: rgba(255, 255, 255, 1) !important;
    box-shadow: 
        0 40px 80px rgba(0, 0, 0, 0.1),
        0 0 30px rgba(0, 113, 227, 0.4),
        0 0 60px rgba(157, 86, 255, 0.3) !important;
    /* Transform removed to allow JS 3D tilt */
}

/* Water Glass Inputs */
[data-theme="light"] input,
[data-theme="light"] textarea {
    background: rgba(255, 255, 255, 0.15) !important;
    backdrop-filter: blur(20px) !important;
    border: 1.5px solid rgba(255, 255, 255, 0.6) !important;
    border-top: 2px solid rgba(255, 255, 255, 0.8) !important;
    border-radius: 12px !important;
    color: var(--text-primary) !important;
}

[data-theme="light"] input::placeholder,
[data-theme="light"] textarea::placeholder {
    color: var(--text-tertiary) !important;
    opacity: 0.7;
}


* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

#particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}


html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    font-family: 'Space Grotesk', -apple-system, sans-serif;
    font-weight: 300;
    background-color: var(--bg-primary);
    background-image: radial-gradient(circle at 50% 0%, #111 0%, var(--bg-primary) 70%);
    background-attachment: fixed;
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    cursor: none; /* Hide default cursor for custom one */
}

[data-theme="light"] body {
    background-image: radial-gradient(circle at 50% 0%, #ffffff 0%, #d1d5db 100%);
    background-attachment: fixed;
}

/* Custom Cursor */
.custom-cursor {
    position: fixed;
    top: -20px;
    left: -20px;
    width: 40px;
    height: 40px;
    border: 1px solid var(--accent-primary);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transition: width 0.3s, height 0.3s, top 0.3s, left 0.3s, background-color 0.3s;
    mix-blend-mode: difference;
}

.custom-cursor-dot {
    position: fixed;
    top: -4px;
    left: -4px;
    width: 8px;
    height: 8px;
    background: var(--text-primary);
    border-radius: 50%;
    pointer-events: none;
    z-index: 10000;
}

.custom-cursor.active {
    width: 80px;
    height: 80px;
    top: -40px;
    left: -40px;
    background-color: rgba(255, 255, 255, 0.1);
    border-color: transparent;
}

/* Ensure links override default cursor */
a, button, .btn {
    cursor: none;
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 40px;
}

section {
    padding: var(--section-padding);
}

section + section {
    margin-top: var(--section-gap);
}

/* Navigation */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 clamp(20px, 5vw, 60px);
    background: var(--bg-glass);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid var(--border-soft);
    z-index: 1000;
}

.logo {
    font-size: clamp(1.2rem, 4vw, 1.5rem);
    font-weight: 700;
    text-decoration: none;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    z-index: 1001;
}

.logo-img {
    height: 60px;
    width: auto;
    transition: height 0.3s ease, filter 0.3s ease;
    display: block;
}

[data-theme="light"] .logo-img {
    filter: invert(1);
}

@media (max-width: 768px) {
    .logo-img {
        height: 45px;
    }
}

.logo span {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Theme Toggle Button */
.theme-btn {
    background: transparent;
    border: 1px solid var(--border-soft);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-primary);
    transition: var(--transition-smooth);
    padding: 0;
    margin-right: 10px;
}

.theme-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--accent-primary);
    transform: scale(1.1);
}

[data-theme="light"] .theme-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

.theme-btn svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
    transition: transform 0.5s ease;
}

.theme-btn .sun-icon { display: none; }
[data-theme="light"] .theme-btn .sun-icon { display: block; }
[data-theme="light"] .theme-btn .moon-icon { display: none; }

[data-theme="light"] .nav-links a.active::after {
    background: var(--accent-primary);
    box-shadow: 0 0 10px rgba(0, 113, 227, 0.3);
}

.nav-links {
    display: flex;
    gap: 40px;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    position: relative;
}

.nav-links a:hover {
    color: var(--text-primary);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.nav-links a.active {
    color: var(--text-primary);
    font-weight: 600;
}

.nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--accent-primary);
    box-shadow: 0 0 10px var(--accent-primary);
    border-radius: 2px;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from { width: 0; opacity: 0; }
    to { width: 100%; opacity: 1; }
}

/* Dropdown */
.dropdown {
    position: relative;
    display: inline-block;
    padding-bottom: 20px;
    margin-bottom: -20px;
}

.dropdown > a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.dropdown > a::after {
    content: "⌄";
    font-size: 1.2em;
    position: relative;
    top: -2px;
    display: inline-block;
    transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

.dropdown:hover > a::after,
.dropdown:focus-within > a::after {
    transform: translateY(3px);
    color: var(--text-primary);
}

.dropdown-content {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    top: calc(100% + 20px);
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    background: var(--bg-secondary);
    border: 1px solid var(--border-soft);
    border-radius: 16px;
    padding: 8px;
    min-width: 200px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    transition: var(--transition-smooth);
    z-index: 1000;
    pointer-events: none; /* Crucial for hover unblocking */
}

/* Important: Allow hovering area between link and dropdown */
.dropdown {
    position: relative;
    display: inline-block;
    padding-bottom: 20px;
    margin-bottom: -20px;
}

.dropdown:hover .dropdown-content,
.dropdown:focus-within .dropdown-content {
    visibility: visible;
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto; /* Re-enable interaction when shown */
}

.dropdown-content a {
    display: block;
    padding: 12px 16px;
    border-radius: 10px;
}

.dropdown-content a:hover {
    background: rgba(255, 255, 255, 0.05);
}


/* Hero Section */
.hero {
    min-height: 100vh; /* Occupy full viewport on load */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
    padding-top: 100px;
    padding-bottom: 0;
}

.hero::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--accent-glow), transparent 70%);
    filter: blur(80px);
    z-index: -1;
    animation: pulse 8s infinite alternate;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 0.5; }
    100% { transform: scale(1.2); opacity: 0.8; }
}

h1 {
    font-family: 'Syncopate', sans-serif;
    font-size: clamp(1.8rem, 8vw, 4rem);
    font-weight: 400;
    line-height: 1.1;
    letter-spacing: clamp(0.1em, 2vw, 0.25em);
    text-transform: uppercase;
    margin-bottom: clamp(20px, 4vw, 32px);
    background: linear-gradient(135deg, var(--text-primary) 40%, var(--text-secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 15px var(--accent-glow);
    width: 100%;
    padding: 0 20px;
    color: var(--text-primary); /* Fallback */
}

[data-theme="light"] h1 {
    background: linear-gradient(135deg, var(--text-primary), var(--accent-primary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: none;
}

h2 {
    font-family: 'Syncopate', sans-serif;
    font-size: clamp(1.4rem, 5vw, 2.2rem);
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 32px;
}

h2 span {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* h1 span removed as text is now single line uppercase */

.hero p {
    font-size: clamp(1.15rem, 3vw, 1.4rem);
    color: var(--text-secondary);
    max-width: 700px;
    margin-bottom: 40px;
    letter-spacing: -0.01em;
    line-height: 1.5;
}

.btn {
    padding: 16px 32px;
    border-radius: 980px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.4s, color 0.4s, box-shadow 0.4s, transform 0.1s; /* Faster transform for magnetic effect */
    display: inline-block;
    position: relative;
    overflow: hidden;
    will-change: transform; /* Hint for performance */
}

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

.btn-primary:hover {
    background: var(--text-primary); /* Maintain original color */
    transform: scale(1.05); /* Added scale as requested */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .btn-primary:hover {
    background: var(--text-primary) !important;
    color: var(--bg-primary) !important;
    transform: scale(1.05) !important;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1) !important;
}

/* Products Section */
/* Products Section (Main Products Page) */
#products {
    margin-top: calc(var(--section-gap) * 1.5);
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(clamp(280px, 100%, 400px), 1fr));
    gap: clamp(20px, 4vw, 40px);
    margin-top: clamp(40px, 8vw, 80px);
}

.product-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.01) 100%);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 40px;
    padding: 60px;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transform-style: preserve-3d;
    will-change: transform;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.3);
}

/* Rim Light Effect */
.product-card::after {
    content: "";
    position: absolute;
    top: -50%; right: -50%;
    width: 100%; height: 100%;
    background: radial-gradient(circle at center, rgba(0, 113, 227, 0.15) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.product-card::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    border-radius: inherit;
    background: radial-gradient(
        800px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
        rgba(255, 255, 255, 0.08),
        transparent 40%
    );
    z-index: 1;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.product-card:hover::before {
    opacity: 1;
}

.product-card > * {
    position: relative;
    z-index: 2;
    transform: translateZ(30px);
    transition: transform 0.2s ease;
}

.product-card:hover {
    border-color: rgba(0, 113, 227, 0.4);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6), 0 0 50px rgba(0, 113, 227, 0.15);
}

.product-card h3 {
    font-size: 2.8rem;
    margin-bottom: 24px;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.product-card p {
    color: var(--text-secondary);
    font-size: 1.15rem;
    line-height: 1.6;
    margin-bottom: 40px;
}

.badge {
    background: rgba(0, 113, 227, 0.1);
    color: var(--accent-primary);
    padding: 10px 22px;
    border-radius: 100px;
    font-size: 0.9rem;
    font-weight: 600;
    display: inline-block;
    margin-bottom: 24px;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid rgba(0, 113, 227, 0.4);
    letter-spacing: 0.02em;
}

.product-card:hover .badge, 
.home-product-card:hover .badge {
    background: rgba(0, 113, 227, 0.2);
    border-color: rgba(0, 113, 227, 0.6);
    box-shadow: 0 0 20px rgba(0, 113, 227, 0.2);
}

/* Home-Specific Products Section (Decoupled) */
.home-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(clamp(280px, 100%, 400px), 1fr));
    gap: clamp(20px, 4vw, 40px);
    margin-top: clamp(40px, 8vw, 80px);
}

.home-product-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.01) 100%);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 40px;
    padding: 60px;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transform-style: preserve-3d;
    will-change: transform;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.3);
}

.home-product-card::after {
    content: "";
    position: absolute;
    top: -50%; right: -50%;
    width: 100%; height: 100%;
    background: radial-gradient(circle at center, rgba(0, 113, 227, 0.15) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

/* Spotlight Effect */
.home-product-card::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    border-radius: inherit;
    background: radial-gradient(
        800px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
        rgba(255, 255, 255, 0.08),
        transparent 40%
    );
    z-index: 1;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.home-product-card:hover::before {
    opacity: 1;
}

.home-product-card > * {
    position: relative;
    z-index: 2;
    transform: translateZ(30px);
    transition: transform 0.2s ease;
}

.home-product-card:hover {
    border-color: rgba(0, 113, 227, 0.4);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6), 0 0 50px rgba(0, 113, 227, 0.15);
}

.home-product-card h3 {
    font-size: 2.8rem;
    margin-bottom: 24px;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.home-product-card p {
    color: var(--text-secondary);
    font-size: clamp(1rem, 2vw, 1.15rem);
    line-height: 1.6;
    margin-bottom: clamp(24px, 5vw, 40px);
}

/* Specific reveal behavior decoupled */
.home-product-card.reveal.active {
    transform: none;
}

/* Contact Section */
#contact {
    text-align: center;
    margin-top: calc(var(--section-gap) * 1.5); /* Specific override for more breathing room */
    padding-bottom: 160px; /* Extra breathing room before footer */
}

/* Responsive */
/* Responsive */
@media (max-width: 768px) {
    body {
        cursor: default; /* Disable custom cursor on touch */
    }
    .custom-cursor, .custom-cursor-dot {
        display: none;
    }

    nav {
        height: 70px;
        min-height: auto;
        padding: 0 20px;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 0;
    }

    /* Move menu toggle back to right */
    nav > div:last-child {
        width: auto;
        display: flex;
        justify-content: flex-end;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 100%;
        height: 100vh;
        background: var(--bg-primary);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 30px;
        transition: 0.5s cubic-bezier(0.16, 1, 0.3, 1);
        z-index: 1000;
        display: flex; /* Ensure display is consistent for transition */
    }

    .nav-links.active {
        right: 0;
    }

    .nav-links a {
        font-size: 1.5rem;
    }

    /* Hide Connect btn on mobile header to prevent overcrowding */
    nav .btn-primary {
        display: none;
    }

    /* Hamburger Menu Icon */
    .menu-toggle {
        display: block;
        width: 30px;
        height: 20px;
        position: relative;
        cursor: pointer;
        z-index: 1001;
    }

    .menu-toggle span {
        display: block;
        width: 100%;
        height: 2px;
        background: var(--text-primary);
        position: absolute;
        transition: 0.3s;
    }

    .menu-toggle span:nth-child(1) { top: 0; }
    .menu-toggle span:nth-child(2) { top: 9px; }
    .menu-toggle span:nth-child(3) { top: 18px; }

    .menu-toggle.active span:nth-child(1) { transform: rotate(45deg); top: 9px; }
    .menu-toggle.active span:nth-child(2) { opacity: 0; }
    .menu-toggle.active span:nth-child(3) { transform: rotate(-45deg); top: 9px; }

    .product-card, .home-product-card {
        padding: clamp(30px, 8vw, 60px);
        border-radius: 32px;
    }

    .product-card h3, .home-product-card h3 {
        font-size: clamp(1.8rem, 6vw, 2.4rem);
    }
}

@media (max-width: 480px) {
    :root {
        --section-gap: 60px;
    }
    
    .logo {
        font-size: 1.1rem;
    }
    
    h1 {
        font-size: clamp(1.4rem, 8vw, 2.2rem);
        letter-spacing: 0.15em;
        line-height: 1.2;
    }

    .hero p {
        font-size: 1rem;
    }
}

.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 1s cubic-bezier(0.16, 1, 0.3, 1), transform 1s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Ensure product cards don't have their transform reset by reveal when actively being tilted by JS */
.product-card.reveal.active {
    transform: none; /* Let JS handle the transform */
}

/* Core Capabilities */
.capabilities-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.capabilities-grid .cap-card {
    padding: 40px 30px;
    background: rgba(255, 255, 255, 0.02);
    box-shadow: none; /* Reset shadow for smaller cards until hover */
}

.philosophy-item {
    padding: 30px;
    border-left: 2px solid rgba(255, 255, 255, 0.05);
    background: linear-gradient(90deg, rgba(255,255,255,0.02) 0%, transparent 100%);
    transition: all 0.4s ease;
}

.philosophy-item:hover {
    border-color: var(--accent-primary);
    background: linear-gradient(90deg, rgba(0,113,227,0.05) 0%, transparent 100%);
    transform: translateX(10px);
}
