:root {
    --bg-color: #050505;
    --text-color: #ffffff;
    --accent-color: #ffffff;
    --secondary-text: #a0a0a0;
    --font-main: 'Satoshi', sans-serif;
    --spacing-unit: 1rem;
    --transition-speed: 0.3s;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-main);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
    transition: opacity var(--transition-speed);
}

a:hover {
    opacity: 0.7;
}

ul {
    list-style: none;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 1rem;
}

h1 {
    font-size: clamp(3rem, 8vw, 6rem);
    letter-spacing: -0.02em;
}

h2 {
    font-size: clamp(2rem, 5vw, 4rem);
}

p {
    margin-bottom: 1rem;
    color: var(--secondary-text);
}

/* Utility */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.btn {
    display: inline-block;
    padding: 1rem 2rem;
    border: 1px solid var(--accent-color);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.9rem;
    transition: all var(--transition-speed);
    cursor: pointer;
    white-space: nowrap;
    /* Prevent text wrapping in Chrome */
}

.primary-btn {
    background-color: var(--accent-color);
    color: var(--bg-color);
}

.primary-btn:hover {
    background-color: transparent;
    color: var(--accent-color);
}

.secondary-btn {
    background-color: transparent;
    color: var(--accent-color);
    text-transform: none;
    /* Keep email lowercase */
}

.secondary-btn:hover {
    background-color: var(--accent-color);
    color: var(--bg-color);
}

.section {
    padding: 6rem 0;
}

.section-title {
    margin-bottom: 3rem;
    text-transform: uppercase;
    font-size: 1rem;
    letter-spacing: 0.1em;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 1rem;
    display: inline-block;
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 9999;
    /* Highest priority */
    background: rgba(0, 0, 0, 0.01);
    /* Start transparent */
    backdrop-filter: blur(10px) saturate(180%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    /* Subtle edge */
    transition: background-color 0.3s ease, backdrop-filter 0.3s ease, border-bottom 0.3s ease;
}

/* Scroll-triggered Glass Effect */
.header.scrolled {
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px) saturate(180%);
    -webkit-backdrop-filter: blur(10px) saturate(180%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    z-index: 1001;
}

.logo-icon {
    width: 24px;
    height: 24px;
    opacity: 0.9;
}

.logo-text {
    font-family: var(--font-main);
    font-weight: 900;
    /* Black/Bold */
    font-size: 2rem;
    /* Larger: ~32px */
    color: var(--text-color);
    letter-spacing: -0.02em;
    /* No uppercase */
}

.nav-links {
    display: flex;
    gap: 3rem;
}

.nav-links li a {
    font-size: 0.9rem;
    letter-spacing: 0.05em;
    /* text-transform: uppercase; REMOVED */
}

/* Language Toggle */
.lang-toggle {
    background: none;
    border: none;
    color: var(--secondary-text);
    font-size: 0.9rem;
    font-family: var(--font-main);
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0;
    margin-left: 1rem;
    transition: color 0.3s ease;
}

.lang-toggle:hover {
    color: var(--text-color);
}

.lang-toggle span {
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

.lang-toggle span.active {
    opacity: 1;
    color: var(--text-color);
    font-weight: 700;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.hamburger {
    display: block;
    width: 24px;
    height: 2px;
    background: white;
    position: relative;
}

.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    background: white;
    left: 0;
    transition: 0.3s;
}

.hamburger::before {
    top: -6px;
}

.hamburger::after {
    bottom: -6px;
}

/* Hero */
.hero {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    /* Left align */
    text-align: left;
    /* Left align text */
    padding: 0 4rem;
    /* Add side padding for spacing */
    overflow: hidden;
}

/* Ensure canvas covers the background, behind text */
/* Ensure canvas covers the background, behind text */
#webgl-canvas {
    position: absolute;
    /* Changed from fixed to absolute so it stays in hero */
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 0;
    /* Base layer */
    opacity: 1 !important;
    pointer-events: auto;
    /* Allow mouse interaction */
}

/* Ensure Services/Expertise has transparent background to see global black,
   but since Attractor is now in Hero, we don't need to hide it.
   The main body background is black. */
.services {
    position: relative;
    z-index: 1;
    /* Above Hero if needed, but Hero is 100vh */
    background: transparent;
    /* Let body black show through */
}

.hero-content {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 1400px;
    /* Widened to prevent internal wrapping */
    padding: 0 4rem;
}

.hero h1 {
    font-size: clamp(3.5rem, 8vw, 7rem);
    /* Kept requested size */
    line-height: 1.1;
    margin-bottom: 1.5rem;
    font-weight: 900;
    letter-spacing: -0.03em;
    text-transform: none;
    white-space: nowrap;
    /* Force "Chaotic Beauty." to stay on one line */
}

/* On mobile, allow wrap */
@media (max-width: 768px) {
    .hero h1 {
        white-space: normal;
        font-size: 3.5rem;
    }
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    color: var(--secondary-text);
    white-space: nowrap;
    /* Prevent breaking in Chrome */
}

/* Services */
/* Clean Typography Cards with Mini-Attractors */
.expertise-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 3rem;
    /* More generous gap */
    padding: 4rem 0;
}

/* --- MOUSE-FOLLOWING BORDER GLOW & BANDING FIX --- */
.glass-card {
    position: relative;
    /* Soft Internal Glow + Glass Tint */
    background: radial-gradient(800px circle at var(--mouse-x) var(--mouse-y),
            rgba(255, 255, 255, 0.04),
            transparent 40%), rgba(255, 255, 255, 0.01);

    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 2rem;
    overflow: hidden;
    transition: box-shadow 0.3s ease;
    backdrop-filter: blur(5px);
}

/* Noise overlay to fix banding */
/* Noise overlay to fix banding */
.glass-card::after {
    position: absolute;
    inset: 0;
    z-index: 0;
    /* Behind text */
    opacity: 0.05;
    /* Very subtle */
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    content: "";
    mix-blend-mode: overlay;
}

.glass-card:hover {
    box-shadow: inset 0 0 40px rgba(255, 255, 255, 0.03);
}

/* The Spotlight Border */
.glass-card::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    /* On top of border/noise */
    border-radius: 12px;
    padding: 1.5px;

    background: radial-gradient(600px circle at var(--mouse-x) var(--mouse-y),
            rgba(255, 255, 255, 0.7),
            transparent 40%);

    -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;

    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.glass-card:hover::before {
    opacity: 1;
}

/* Typography Fixes */
.glass-card h3 {
    position: relative;
    z-index: 3;
    font-family: var(--font-main);
    font-weight: 700;
    font-size: 1.5rem;
    line-height: 1.1;
    margin-bottom: 0.5rem;
    color: var(--secondary-text);
    transition: color 0.3s ease;
    white-space: pre-wrap;
    overflow-wrap: break-word;
    hyphens: auto;
}

.glass-card:hover h3 {
    color: #ffffff;
}

.glass-card .subtitle {
    position: relative;
    z-index: 1;
    font-family: 'Courier New', 'Fira Code', monospace;
    font-size: 0.9rem;
    color: #666;
    line-height: 1.4;
}

.glass-card .subtitle {
    font-family: 'Courier New', 'Fira Code', monospace;
    font-size: 0.9rem;
    color: #666;
    /* Lighter grey */
    line-height: 1.4;
}

/* Mobile Responsive */
@media (max-width: 1024px) {
    .expertise-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
}

@media (max-width: 768px) {
    .expertise-grid {
        grid-template-columns: 1fr;
    }

    .glass-card {
        padding: 1rem;
    }
}

/* About */
.about-content {
    max-width: 800px;
    font-size: 1.2rem;
}

.disclaimer {
    margin-top: 2rem;
    font-size: 1rem;
    border-left: 2px solid var(--accent-color);
    padding-left: 1rem;
}

/* Contact */
.contact {
    text-align: center;
    padding: 8rem 0;
}

.contact h2 {
    font-size: clamp(3rem, 6vw, 5rem);
    margin-bottom: 2rem;
    border: none;
}

/* Footer */
.footer {
    padding: 2rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-left: 6vw !important;
    padding-right: 6vw !important;
    /* Force spacing */
    box-sizing: border-box;
    width: 100%;
}

.footer-logo {
    font-weight: 900;
}

.footer p {
    margin: 0;
    font-size: 0.8rem;
}

/* Mobile */
@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .menu-toggle {
        display: block;
    }

    .hero {
        padding: 60px 1.5rem 2rem 1.5rem;
        align-items: center;
        /* Vertically centered */
        text-align: left;
    }

    .hero-content {
        padding: 0;
        text-align: left;
        align-items: flex-start;
        /* Left align content items */
    }

    .hero h1 {
        font-size: 2.5rem;
        white-space: normal;
        text-align: left;
    }

    .hero p {
        font-size: 1rem;
        white-space: normal;
    }

    .btn {
        padding: 0.8rem 1.5rem;
        font-size: 0.8rem;
    }

    .section-title {
        font-size: 0.85rem;
    }

    .glass-card h3 {
        font-size: 1.1rem;
    }

    .glass-card .subtitle {
        font-size: 0.8rem;
    }

    .about-content {
        font-size: 1rem;
    }

    .footer-content {
        flex-direction: column;
        gap: 1rem;
    }
}