/*
   Tech Doable - Premium Design System
   Theme: Cinematic Tech (Gold, Grid, 3D Depth)
*/

:root {
    /* Color Palette - Electric Blue & Data Dark */
    --color-bg-primary: #0a0a0f;
    --color-bg-secondary: #0f1016;

    /* Electric Blue Accents */
    --color-blue-light: #a5f3fc;
    /* Cyan 200 */
    --color-blue-mid: #06b6d4;
    /* Cyan 500 */
    --color-blue-electric: #00f3ff;
    /* High Voltage Cyan */
    --color-blue-dark: #0891b2;
    /* Cyan 600 */

    /* Functional Colors mapped to Blue */
    --color-accent: var(--color-blue-electric);
    --color-accent-hover: var(--color-blue-light);

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, var(--color-blue-dark) 0%, var(--color-blue-mid) 50%, var(--color-blue-electric) 100%);
    --gradient-text: linear-gradient(to right, #22d3ee, #67e8f9, #06b6d4, #a5f3fc, #0891b2);

    /* Text */
    --color-text-primary: #ffffff;
    --color-text-secondary: #cbd5e1;

    /* Glass & Borders */
    --color-surface-glass: rgba(15, 23, 42, 0.6);
    --color-surface-glass-hover: rgba(15, 23, 42, 0.8);
    --color-border: rgba(6, 182, 212, 0.3);
    /* Cyan border */

    /* Component Backgrounds */
    --navbar-bg: rgba(10, 10, 15, 0.7);
    --hero-bg: rgba(10, 10, 15, 0.4);
    --card-bg: rgba(6, 182, 212, 0.03);
    /* Subtle blue tint */
    --form-bg: rgba(255, 255, 255, 0.03);

    /* Typography */
    --font-primary: 'Outfit', sans-serif;
    --font-secondary: 'Inter', sans-serif;

    /* Spacing & Layout */
    --container-width: 1200px;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 5rem;
    --border-radius: 20px;

    /* Effects */
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 20px 40px -5px rgba(0, 0, 0, 0.6), 0 0 20px rgba(6, 182, 212, 0.2);
    --transition-fast: 0.3s ease;
    --transition-normal: 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

:root[data-theme="light"] {
    /* Light Theme Overrides */
    --color-bg-primary: #f0f9ff;
    /* Very light blue tint */
    --color-bg-secondary: #ffffff;

    --color-text-primary: #0f172a;
    /* Slate 900 */
    --color-text-secondary: #334155;
    /* Slate 700 */

    /* Darker Blue for Light Mode Contrast */
    --color-blue-light: #0ea5e9;
    /* Sky 500 */
    --color-blue-mid: #0284c7;
    /* Sky 600 */
    --color-blue-electric: #0369a1;
    /* Sky 700 */
    --color-blue-dark: #0c4a6e;
    /* Sky 900 */

    /* Adjust gradients for visibility on white */
    --gradient-primary: linear-gradient(135deg, var(--color-blue-dark) 0%, var(--color-blue-mid) 50%, var(--color-blue-light) 100%);
    --gradient-text: linear-gradient(to right, #0369a1, #0284c7, #0c4a6e, #0369a1, #075985);

    --color-surface-glass: rgba(255, 255, 255, 0.7);
    --color-surface-glass-hover: rgba(255, 255, 255, 0.9);
    --color-border: rgba(2, 132, 199, 0.3);
    /* Stronger blue border */

    --navbar-bg: rgba(255, 255, 255, 0.95);
    --hero-bg: rgba(255, 255, 255, 0.7);
    --card-bg: rgba(255, 255, 255, 0.9);
    --form-bg: rgba(255, 255, 255, 0.8);

    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 20px 40px -5px rgba(0, 0, 0, 0.1), 0 0 20px rgba(2, 132, 199, 0.15);
}

/* Force Contrast in Light Mode for specific elements */
[data-theme="light"] .card h3,
[data-theme="light"] .card p,
[data-theme="light"] .hero-text,
[data-theme="light"] .contact-link {
    color: var(--color-text-primary);
}

[data-theme="light"] .card p {
    color: var(--color-text-secondary);
}

/* Reset & Base */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--color-bg-primary);
    /* Cinematic Grid Overlay */
    background-image:
        radial-gradient(circle at 15% 50%, rgba(139, 92, 246, 0.15), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(6, 182, 212, 0.15), transparent 25%),
        url('../assets/bg-grid.png');
    background-repeat: repeat;
    background-size: auto, auto, 100px 100px;
    /* Grid size */
    background-blend-mode: screen;

    color: var(--color-text-primary);
    font-family: var(--font-secondary);
    line-height: 1.7;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    perspective: 1000px;
    /* Enable 3D space */
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-primary);
    font-weight: 700;
    line-height: 1.2;
    color: var(--color-text-primary);
    margin-bottom: 1rem;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition-fast);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

/* Utilities */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.text-gradient {
    background: var(--gradient-text);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 1rem 3rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1.05rem;
    cursor: pointer;
    transition: var(--transition-normal);
    border: none;
    position: relative;
    overflow: hidden;
    z-index: 1;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: var(--color-blue-mid);
    color: #000;
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.4);
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient-primary);
    z-index: -1;
    transition: opacity 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 35px rgba(6, 182, 212, 0.6);
}

.btn-outline {
    background: transparent;
    color: var(--color-blue-light);
    border: 1px solid var(--color-blue-mid);
}

.btn-outline:hover {
    background: rgba(6, 182, 212, 0.1);
    transform: translateY(-3px);
    border-color: var(--color-blue-light);
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.2);
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: var(--navbar-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-bottom: 1px solid rgba(6, 182, 212, 0.15);
    padding: 1.2rem 0;
    pointer-events: auto;
    /* Ensure clickable */
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-primary);
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.nav-links {
    display: flex;
    gap: 2.5rem;
}

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

.nav-links a:hover,
.nav-links a.active {
    color: var(--color-blue-light);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: var(--gradient-primary);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

/* Theme Toggle */
.theme-toggle {
    margin-left: 1.5rem;
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--color-text-secondary);
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    position: relative;
    /* For Tooltip */
}

.theme-toggle:hover {
    color: var(--color-blue-mid);
    background: rgba(6, 182, 212, 0.1);
    transform: rotate(15deg);
}

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

/* Theme Tooltip */
.theme-tooltip {
    position: absolute;
    top: 150%;
    right: 0;
    background: var(--color-surface-glass);
    backdrop-filter: blur(12px);
    border: 1px solid var(--color-border);
    padding: 1rem;
    border-radius: 12px;
    width: 220px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 100;
    box-shadow: var(--shadow-lg);
    pointer-events: none;
    text-align: left;
    cursor: default;
}

.theme-tooltip span {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    font-weight: 500;
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 0.25rem;
}

.theme-toggle:hover .theme-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.color-swatch {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    font-size: 0.75rem;
    color: var(--color-text-primary);
    font-family: var(--font-secondary);
}

.color-dot {
    width: 14px;
    height: 14px;
    border-radius: 4px;
    display: inline-block;
}

/* Mobile Toggle */
.mobile-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--color-text-primary);
}

/* Hero Section */
.hero {
    padding-top: 12rem;
    padding-bottom: 8rem;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

#bg-animation {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.anime-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(40px, 1fr));
    grid-template-rows: repeat(auto-fit, minmax(40px, 1fr));
    z-index: 0;
    opacity: 0.3;
    pointer-events: none;
}

.anime-grid-item {
    width: 100%;
    height: 100%;
    border: 1px solid rgba(6, 182, 212, 0.05);
    transform-origin: center;
}

.hero-content {
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
    animation: fadeInUp 1s ease;
    position: relative;
    z-index: 1;

    /* Frosted Glass Box */
    background: var(--hero-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 4rem;
    border-radius: 24px;
    position: relative;
}

/* Fluid Border Animation Removed */
.hero-content::after {
    display: none;
}

.hero h1 {
    font-size: 5.5rem;
    /* Massive Cinematic Size */
    margin-bottom: 2rem;
    letter-spacing: -2px;
    background: var(--gradient-text);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.1;
    text-transform: uppercase;
    /* Editorial Style */
}

/* Character Split Styles */
.hero h1 .char {
    display: inline-block;
    opacity: 0;
    /* Hidden initially for anime.js */
    transform-origin: bottom center;
}

.hero p {
    font-size: 1.35rem;
    color: #e2e8f0;
    margin-bottom: 3rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.hero-actions {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
}

/* Sections */
.section {
    padding: 6rem 0;
}

.section-header {
    text-align: center;
    margin-bottom: 5rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.section-header h2 {
    font-size: 3rem;
    margin-bottom: 1rem;
    background: var(--gradient-text);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.section-header p {
    color: var(--color-text-secondary);
    font-size: 1.2rem;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem;
    align-items: start;
}

/* Card Styling - Cinematic 3D */
.card {
    background: var(--card-bg);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border-radius: 24px;
    padding: 3rem;
    transition: var(--transition-normal);
    position: relative;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;

    /* 3D Capabilities */
    transform-style: preserve-3d;
    will-change: transform;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.card::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 24px;
    padding: 1px;
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.2), rgba(6, 182, 212, 0.05));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    transition: background 0.5s ease;
    transform: translateZ(0);
}

.card:hover::after {
    background: var(--gradient-primary);
    padding: 2px;
}

.card:hover {
    transform: translateY(-10px);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 30px 60px -10px rgba(0, 0, 0, 0.7);
}

.img-box {
    margin-bottom: 2rem;
    display: flex;
    justify-content: center;
    transform: translateZ(30px);
    /* 3D Depth */
}

.img-box img {
    filter: drop-shadow(0 0 10px rgba(6, 182, 212, 0.2));
    transition: transform 0.5s ease;
}

.card:hover .img-box img {
    transform: scale(1.15) rotate(5deg) translateZ(30px);
}

.card h3 {
    font-size: 1.6rem;
    margin-bottom: 1rem;
    text-align: center;
    transform: translateZ(20px);
    /* 3D Depth */
}

.card p {
    color: var(--color-text-secondary);
    line-height: 1.7;
    text-align: center;
    font-size: 1.05rem;
    transform: translateZ(20px);
    /* 3D Depth */
}

/* Footer (Gold Line Top) */
.contact-icon {
    color: var(--color-accent);
    width: 24px;
}

.contact-link {
    margin-left: 0.5rem;
    color: var(--color-text-primary);
    transition: color 0.3s ease;
}

.contact-link:hover {
    color: var(--color-accent);
}

.footer {
    background: var(--color-bg-secondary);
    padding: 5rem 0 2rem;
    border-top: 1px solid rgba(6, 182, 212, 0.15);
    margin-top: 6rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 4rem;
    margin-bottom: 4rem;
}

.footer-col h4 {
    margin-bottom: 1.5rem;
    color: var(--color-blue-light);
}

.footer-links li {
    margin-bottom: 1rem;
}

.footer-links a:hover {
    color: var(--color-blue-mid);
    padding-left: 5px;
}

.footer-bottom {
    text-align: center;
    color: #666;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Mobile */
@media (max-width: 1024px) {
    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--color-bg-secondary);
        flex-direction: column;
        padding: 2rem;
        text-align: center;
        border-bottom: 1px solid var(--color-blue-dark);
        border-top: 1px solid rgba(255, 255, 255, 0.05);
    }

    .nav-links.active {
        display: flex;
    }

    .mobile-toggle {
        display: block;
    }

    .hero {
        padding-top: 8rem;
        /* Less top padding on mobile */
        padding-bottom: 4rem;
        min-height: auto;
        /* Allow auto height */
    }

    .hero h1 {
        font-size: 2.8rem;
        /* Smaller to fit screen */
        letter-spacing: -1px;
    }

    .grid-3 {
        grid-template-columns: 1fr;
        /* Force single column */
        gap: 1.5rem;
    }

    .hero-content {
        padding: 2rem 1.5rem;
        /* Reduced padding */
    }

    /* Ensure cards don't have huge padding on mobile */
    .card {
        padding: 2rem;
    }

    .section {
        padding: 4rem 0;
        /* Reduced vertical spacing */
    }
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.page-header {
    padding-top: 10rem;
    padding-bottom: 5rem;
    text-align: center;
    background: radial-gradient(circle at center, rgba(6, 182, 212, 0.05), transparent 70%);
}

/* Form Styling */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--color-text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
}

.form-control {
    width: 100%;
    display: block;
    background: var(--form-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--color-text-primary);
    border-radius: 12px;
    padding: 1rem;
    font-family: var(--font-secondary);
    font-size: 1rem;
    transition: var(--transition-fast);
}

.form-control:focus {
    border-color: var(--color-blue-mid);
    box-shadow: 0 0 0 2px rgba(6, 182, 212, 0.2);
    outline: none;
    background: var(--form-bg);
}

textarea.form-control {
    min-height: 150px;
    resize: vertical;
}