/* --- CSS VARIABLES --- */
:root {
    /* These will act as fallbacks. Javascript updates them live */
    --bg-base: #0a0a0f; 
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent-glow: #c8ff47;
    
    /* Glassmorphism Variables */
    --glass-bg: rgba(10, 10, 15, 0.16); 
    --glass-bg-hover: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(200, 255, 71, 0.18);
    --glass-border-light: rgba(255, 255, 255, 0.15);
    --glass-blur: blur(14px) saturate(130%);
    --glass-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    
    /* Typography */
    --font-sans: 'Inter', sans-serif;
    --font-serif: 'Playfair Display', serif;
    
    /* Spacing & Transitions */
    --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 8px;
}

/* --- RESET & BASE --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html.smooth-scroll {
    scroll-behavior: smooth;
}

body {
    background-color: transparent;
    color: var(--text-main);
    font-family: var(--font-sans);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    transition: color 0.1s linear;
}

/* --- WEBGL BACKGROUND --- */
#webgl_canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    z-index: -5;
    pointer-events: none;
}

.noise-overlay {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    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.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.05'/%3E%3C/svg%3E");
    z-index: -4;
    pointer-events: none;
    opacity: 0.4; 
}

/* --- TYPOGRAPHY --- */
h1, h2, h3 { font-weight: 700; line-height: 1.1; letter-spacing: -0.02em; color: var(--text-main); }
.hero-title { font-size: clamp(3rem, 8vw, 6rem); margin-bottom: 0.5rem; }
.section-title { font-size: clamp(2.5rem, 5vw, 4rem); margin-bottom: 3rem; }
.section-title span { color: var(--text-muted); }
.subtitle { font-size: clamp(0.9rem, 2vw, 1.1rem); color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 1rem; }
.tagline { font-size: clamp(1.2rem, 3vw, 1.8rem); font-weight: 300; color: var(--text-muted); margin-bottom: 2.5rem; }

/* --- GLASSMORPHISM SYSTEM --- */
.glass-panel, .glass-card, .glass-nav, .glass-btn, .glass-footer {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
}

/* Glass Reflections */
.glass-card {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-lg);
    transition: var(--transition-smooth);
}
.glass-reflection {
    position: absolute;
    top: 0; left: -150%; width: 150%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.05), transparent);
    transform: skewX(-20deg);
    transition: all 0.6s ease;
    z-index: 1;
    pointer-events: none;
}
.glass-card:hover .glass-reflection { left: 150%; }
.glass-card:hover {
    background: var(--glass-bg-hover);
    border-color: var(--glass-border-light);
    transform: translateY(-5px);
}

/* --- BUTTONS --- */
.glass-btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 1rem 2rem; border-radius: 100px;
    color: var(--text-main); text-decoration: none; font-weight: 500;
    cursor: pointer; transition: var(--transition-smooth);
    position: relative; overflow: hidden;
}
.primary-btn { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.2); }
.primary-btn:hover { background: rgba(255, 255, 255, 0.15); border-color: rgba(255, 255, 255, 0.4); transform: scale(1.02); }
.secondary-btn:hover { background: rgba(255, 255, 255, 0.05); }
.small-btn { padding: 0.6rem 1.2rem; font-size: 0.9rem; }
.text-btn { background: transparent; border: none; box-shadow: none; padding: 0.6rem; }
.text-btn:hover { transform: translateX(5px); color: var(--text-main); }
.icon-btn { width: 50px; height: 50px; padding: 0; border-radius: 50%; }

/* --- COMPONENTS --- */
/* Scroll Progress */
.scroll-progress {
    position: fixed; top: 0; left: 0; height: 3px; background: var(--accent-glow);
    width: 0%; z-index: 1000; box-shadow: 0 0 10px var(--accent-glow); transition: width 0.1s ease;
}

/* Navbar */
.glass-nav {
    position: fixed; top: 1rem; left: 50%; transform: translateX(-50%);
    width: 90%; max-width: 90%; border-radius: 100px; z-index: 100;
    padding: 0.8rem 2rem; transition: var(--transition-smooth);
}
.glass-nav.scrolled { 
    top: 0; width: 100%; max-width: 100%; border-radius: 0; 
    padding: 1rem 2rem; background: var(--glass-bg); 
    border-left: none; border-right: none; border-top: none;
}
.nav-container { display: flex; justify-content: space-between; align-items: center; }
.brand { font-size: 1.5rem; font-weight: 700; color: var(--text-main); text-decoration: none; }
.brand span { color: var(--text-muted); }
.nav-links { display: flex; gap: 2rem; list-style: none; }
.nav-links a { color: var(--text-muted); text-decoration: none; font-size: 0.9rem; transition: var(--transition-smooth); position: relative; }
.nav-links a:hover, .nav-links a.active { color: var(--text-main); }
.nav-links a.active::after { content: ''; position: absolute; bottom: -5px; left: 0; width: 100%; height: 2px; background: var(--text-main); border-radius: 2px; }
.mobile-menu-toggle { display: none; background: none; border: none; color: var(--text-main); font-size: 1.5rem; cursor: pointer; }

/* Layout Utilities */
.section { padding: 8rem 2rem; min-height: 100vh; display: flex; flex-direction: column; justify-content: center; }
.container { max-width: 90%; margin: 0 auto; width: 100%; }
.py-small { min-height: auto; padding: 4rem 2rem; }
.split-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: center; }
.flex-center { display: flex; flex-direction: column; align-items: center; justify-content: center; }
.text-center { text-align: center; }
.btn-group { display: flex; gap: 1rem; flex-wrap: wrap; }
.center-btns { justify-content: center; margin-top: 2rem; }

/* Profile & Grids */
.profile-card { padding: 3rem; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 1.5rem; transform-style: preserve-3d; }
.avatar-placeholder { width: 150px; height: 150px; border-radius: 50%; background: rgba(255,255,255,0.05); display: flex; justify-content: center; align-items: center; box-shadow: inset 0 0 20px rgba(0,0,0,0.5); transform: translateZ(30px); }
.chips { display: flex; gap: 0.5rem; flex-wrap: wrap; justify-content: center; transform: translateZ(20px); }
.glass-chip { padding: 0.4rem 0.8rem; font-size: 0.8rem; border-radius: 100px; background: rgba(255,255,255,0.05); border: 1px solid var(--glass-border); }
.divider { width: 50px; height: 1px; background: var(--glass-border-light); transform: translateZ(10px); }
.profile-line { color: var(--text-muted); font-size: 0.9rem; transform: translateZ(15px); }

.trust-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1.5rem; }
.mini-card { padding: 1.5rem; border-radius: var(--radius-md); display: flex; align-items: center; gap: 1rem; font-size: 0.9rem; font-weight: 500; }
.mini-card .icon { 
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    color: var(--accent-glow); /* This links the icon to the dynamic WebGL theme */
    transition: color 0.1s linear;
}

.mini-card .icon svg {
    width: 100%;
    height: 100%;
}

.work-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 2rem; }
.project-card { display: flex; flex-direction: column; }
.project-image-placeholder { height: 250px; background: rgba(0,0,0,0.3); border-bottom: 1px solid var(--glass-border); display: flex; align-items: center; justify-content: center; color: var(--text-muted); font-size: 0.9rem; }
.project-content { padding: 2rem; display: flex; flex-direction: column; gap: 1rem; flex-grow: 1; }

.services-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1.5rem; }
.service-card { padding: 2.5rem 2rem; }

.quote-block { padding: 4rem; border-radius: var(--radius-lg); position: relative; overflow: hidden; text-align: center; max-width: 800px; }
.quote-block blockquote { font-family: var(--font-serif); font-size: clamp(1.5rem, 4vw, 2.5rem); line-height: 1.4; color: var(--text-muted); }
.quote-block strong { color: var(--text-main); font-family: var(--font-sans); }

/* Footer */
.glass-footer { margin-top: 4rem; border-radius: var(--radius-lg) var(--radius-lg) 0 0; padding: 4rem 2rem 2rem; border-bottom: none; }
.footer-content { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 3rem; margin-bottom: 3rem; }
.footer-links { display: flex; flex-direction: column; gap: 0.8rem; }
.footer-links a { color: var(--text-muted); text-decoration: none; transition: color 0.3s; }
.footer-social { display: flex; gap: 1rem; }
.footer-bottom { text-align: center; color: var(--text-muted); font-size: 0.8rem; border-top: 1px solid var(--glass-border); padding-top: 2rem; }

#back-to-top { position: fixed; bottom: 2rem; right: 2rem; z-index: 99; opacity: 0; pointer-events: none; transform: translateY(20px); }
#back-to-top.visible { opacity: 1; pointer-events: auto; transform: translateY(0); }

/* --- ANIMATIONS & OBSERVERS --- */
.reveal-item {
    opacity: 0; filter: blur(10px); transform: translateY(30px);
    transition: opacity 0.8s ease, filter 0.8s ease, transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal-item.revealed { opacity: 1; filter: blur(0); transform: translateY(0); }
.scroll-indicator { position: absolute; bottom: 2rem; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 0.5rem; opacity: 1; transition: opacity 0.3s; }
.scroll-indicator.hidden { opacity: 0; pointer-events: none; }
.mouse { width: 24px; height: 36px; border: 2px solid var(--text-muted); border-radius: 12px; position: relative; }
.mouse::before { content: ''; position: absolute; top: 6px; left: 50%; transform: translateX(-50%); width: 4px; height: 4px; background: var(--text-main); border-radius: 50%; animation: scroll 1.5s infinite; }
@keyframes scroll { 0% { top: 6px; opacity: 1; } 100% { top: 20px; opacity: 0; } }

/* --- RESPONSIVE / MEDIA QUERIES --- */
@media (max-width: 992px) {
    .split-layout { grid-template-columns: 1fr; text-align: center; }
    .hero-content { display: flex; flex-direction: column; align-items: center; }
    .footer-content { grid-template-columns: 1fr; text-align: center; }
    .footer-social { justify-content: center; }
}
@media (max-width: 768px) {
    .nav-links, .nav-cta { display: none; }
    .mobile-menu-toggle { display: block; }
    .section { padding: 6rem 1.5rem; }
}
@media (prefers-reduced-motion: reduce) {
    *, ::before, ::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
    .reveal-item { opacity: 1; filter: none; transform: none; transition: none; }
}