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

/* CSS Variables & Theme (Adapted for Capix Web) */
:root {
    --obsidian-black: #030303;
    --slate-gray: #111113;
    --card-bg: rgba(20, 20, 22, 0.4);
    --crimson-red: #d90429;
    --vibrant-red: #ff2a2a;
    --metallic-gray: #8d99ae;
    --pure-white: #ffffff;
    --web-accent: #ffffff; /* Capix Web main accent */
    
    --gradient-text: linear-gradient(135deg, var(--pure-white) 0%, #a0aabf 100%);
    --gradient-web: linear-gradient(135deg, #2b2b36 0%, #030303 100%);
    
    --font-primary: 'Inter', sans-serif;
    --font-display: 'Space Grotesk', sans-serif;
    
    --container-width: 1280px;
    --section-padding-y: clamp(80px, 10vw, 150px);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--font-primary);
    background-color: var(--obsidian-black);
    color: var(--pure-white);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

@media (hover: hover) and (pointer: fine) { * { cursor: none !important; } }
body.loading { overflow: hidden; }

/* Global Noise Overlay - Optimized */
.noise {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    pointer-events: none; z-index: 9998; opacity: 0.02;
    background-image: repeating-linear-gradient(45deg, #000 25%, transparent 25%, transparent 75%, #000 75%, #000), repeating-linear-gradient(45deg, #000 25%, var(--obsidian-black) 25%, var(--obsidian-black) 75%, #000 75%, #000);
    background-position: 0 0, 2px 2px; background-size: 4px 4px;
    will-change: transform;
}

/* Custom Cursor */
.cursor-dot, .cursor-outline {
    position: fixed; top: 0; left: 0; transform: translate(-50%, -50%);
    border-radius: 50%; z-index: 9999; pointer-events: none; will-change: transform;
}
@media (hover: none) and (pointer: coarse) { .cursor-dot, .cursor-outline { display: none !important; } }
.cursor-dot { width: 6px; height: 6px; background-color: var(--pure-white); }
.cursor-outline {
    width: 36px; height: 36px; border: 1px solid rgba(255, 255, 255, 0.4);
    transition: width 0.3s ease, height 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
}
.cursor-outline.hovering {
    width: 60px; height: 60px; background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5); backdrop-filter: blur(2px);
}

/* Preloader */
#preloader {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-color: var(--obsidian-black); z-index: 10000; display: flex; justify-content: center; align-items: center;
}
.preloader-content { display: flex; flex-direction: column; align-items: center; gap: 2rem; }
.logo-reveal { font-family: var(--font-display); font-size: clamp(1.5rem, 4vw, 3rem); font-weight: 700; letter-spacing: 0.1em; display: flex; gap: 10px; overflow: hidden; }
.reveal-text { display: inline-block; transform: translateY(100%); }
.text-white { color: var(--pure-white); }
.loading-bar { width: clamp(150px, 30vw, 300px); height: 2px; background: rgba(255,255,255,0.1); border-radius: 4px; overflow: hidden; }
.loading-progress { width: 0%; height: 100%; background: var(--pure-white); }

/* Layout Classes */
.container { max-width: var(--container-width); margin: 0 auto; padding: 0 clamp(1.5rem, 4vw, 3rem); }
.section-padding { padding: var(--section-padding-y) 0; }
.center { text-align: center; }

/* Navbar */
.navbar {
    position: fixed; top: 0; width: 100%; padding: clamp(1rem, 2vw, 1.5rem) 0;
    background: rgba(3, 3, 3, 0.6); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    z-index: 100; border-bottom: 1px solid rgba(255,255,255,0.03); transition: transform 0.4s ease, background-color 0.3s ease;
}
.navbar.hidden { transform: translateY(-100%); }
.nav-container { max-width: var(--container-width); margin: 0 auto; padding: 0 clamp(1.5rem, 4vw, 3rem); display: flex; justify-content: space-between; align-items: center; }
.logo { font-family: var(--font-display); font-size: clamp(1.2rem, 2vw, 1.5rem); font-weight: 700; letter-spacing: 0.05em; text-decoration: none; }
.logo-capix { color: var(--pure-white); }
.logo-studios { color: rgba(255,255,255,0.5); font-weight: 400; }

.nav-links { display: flex; gap: clamp(1.5rem, 3vw, 2.5rem); }
.magnetic-link {
    color: var(--pure-white); text-decoration: none; font-size: 0.9rem; font-weight: 500;
    opacity: 0.6; transition: opacity 0.3s ease, color 0.3s ease; display: inline-block;
}
.magnetic-link:hover { opacity: 1; color: var(--pure-white); }

/* Mobile Hamburger Menu (Reactbits Inspired) */
.mobile-menu-btn {
    display: none; background: none; border: none;
    width: 44px; height: 44px; align-items: center; justify-content: center;
    position: relative; z-index: 101; cursor: pointer !important; border-radius: 50%; transition: background 0.3s ease;
}
.mobile-menu-btn:hover { background: rgba(255,255,255,0.05); }
.hamburger-lines { width: 24px; height: 16px; position: relative; display: flex; flex-direction: column; justify-content: space-between; }
.hamburger-lines .line {
    display: block; height: 2px; width: 100%; border-radius: 2px; background: var(--pure-white);
    transition: transform 0.4s cubic-bezier(0.68, -0.6, 0.32, 1.6), opacity 0.3s ease, width 0.4s ease;
}
.hamburger-lines .line-1 { transform-origin: top left; }
.hamburger-lines .line-2 { width: 70%; transition-delay: 0.05s; }
.hamburger-lines .line-3 { width: 50%; transform-origin: bottom left; transition-delay: 0.1s; }
.menu-open .hamburger-lines .line-1 { transform: rotate(45deg) translate(-1px, -2px); width: 26px; }
.menu-open .hamburger-lines .line-2 { opacity: 0; transform: translateX(10px); }
.menu-open .hamburger-lines .line-3 { transform: rotate(-45deg) translate(-1px, 2px); width: 26px; }

/* Hero Section */
.hero { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; padding-top: 80px; }
.hero-background { position: absolute; top: 0; left: 0; right: 0; bottom: 0; z-index: 0; }
.mesh-orb { position: absolute; border-radius: 50%; opacity: 0.8; will-change: transform; pointer-events: none; }
.orb-1 { width: 45vw; height: 45vw; min-width: 300px; min-height: 300px; background: radial-gradient(circle, rgba(255,42,42,0.15) 0%, transparent 70%); top: -15%; left: -10%; }
.orb-2 { width: 40vw; height: 40vw; min-width: 250px; min-height: 250px; background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%); bottom: -10%; right: -10%; }
.orb-3 { width: 30vw; height: 30vw; min-width: 200px; min-height: 200px; background: radial-gradient(circle, rgba(217,4,41,0.1) 0%, transparent 70%); top: 40%; left: 40%; }

/* Hero Tech Grid */
.web-grid-bg {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 0;
    background-image: 
        linear-gradient(to right, rgba(255,255,255,0.03) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    mask-image: radial-gradient(ellipse at center, rgba(0,0,0,1) 0%, rgba(0,0,0,0) 70%);
    -webkit-mask-image: radial-gradient(ellipse at center, rgba(0,0,0,1) 0%, rgba(0,0,0,0) 70%);
}

/* Floating Tech Elements */
.floating-elements { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; }
.float-badge {
    position: absolute; padding: 0.5rem 1rem; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px; backdrop-filter: blur(10px); font-family: var(--font-display); font-size: 0.8rem;
    display: flex; align-items: center; gap: 6px; color: var(--pure-white);
    animation: float-yoyo 6s ease-in-out infinite alternate;
}
@keyframes float-yoyo { 0% { transform: translateY(0px) rotate(0deg); } 100% { transform: translateY(-20px) rotate(2deg); } }
.fb-1 { top: 20%; left: 15%; animation-delay: 0s; font-family: monospace; color: var(--vibrant-red); }
.fb-2 { top: 30%; right: 15%; animation-delay: -2s; }
.fb-3 { bottom: 30%; left: 20%; animation-delay: -4s; border-color: rgba(255,42,42,0.3); }
.fb-4 { bottom: 25%; right: 25%; animation-delay: -1s; }

.hero-content { position: relative; z-index: 1; text-align: center; max-width: clamp(600px, 80vw, 1000px); padding: 0 1rem; display: flex; flex-direction: column; align-items: center; }
.hero-badge {
    display: inline-flex; align-items: center; gap: 8px; padding: 0.5rem 1.2rem;
    border: 1px solid rgba(255,255,255,0.2); border-radius: 30px; font-size: clamp(0.7rem, 1.5vw, 0.8rem); letter-spacing: 0.1em;
    margin-bottom: 2rem; background: rgba(255,255,255,0.05); backdrop-filter: blur(10px); color: var(--pure-white);
}
.pulse-dot { width: 8px; height: 8px; background: var(--pure-white); border-radius: 50%; animation: pulse-dot 2s infinite; }
@keyframes pulse-dot { 0% { box-shadow: 0 0 0 0 rgba(255,255,255,0.4); } 70% { box-shadow: 0 0 0 6px rgba(255,255,255,0); } 100% { box-shadow: 0 0 0 0 rgba(255,255,255,0); } }

.hero-title { font-family: var(--font-display); font-size: clamp(3rem, 8vw, 7rem); font-weight: 800; line-height: 1.05; letter-spacing: -0.04em; margin-bottom: 1.5rem; display: flex; flex-direction: column; align-items: center; }
.title-line { overflow: hidden; display: block; }
.title-word { display: inline-block; transform: translateY(110%); }
.glowing-text {
    background: var(--gradient-text); -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    text-shadow: 0 0 40px rgba(255,255,255,0.3);
}
.hero-subtitle { font-size: clamp(1.1rem, 2vw, 1.5rem); color: var(--metallic-gray); margin-bottom: 3rem; font-weight: 400; max-width: 700px; opacity: 0; }

.magnetic-btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: clamp(1rem, 2vw, 1.2rem) clamp(1.5rem, 3vw, 2.5rem); background: var(--pure-white); color: var(--obsidian-black);
    text-decoration: none; font-weight: 600; font-size: clamp(0.9rem, 1.5vw, 1rem); border-radius: 50px; position: relative; overflow: hidden;
}
.btn-text, .btn-icon { position: relative; z-index: 2; transition: transform 0.3s ease; }
.btn-icon { width: 20px; height: 20px; margin-left: 10px; }
.magnetic-btn:hover .btn-icon { transform: translateX(5px); }

/* Section Titles */
.section-header { position: relative; margin-bottom: clamp(3rem, 6vw, 5rem); }
.section-title { font-family: var(--font-display); font-size: clamp(2.5rem, 6vw, 4rem); letter-spacing: -0.02em; }
.text-stroke { color: transparent; -webkit-text-stroke: 1px rgba(255,255,255,0.1); position: absolute; top: -2rem; left: 0; font-size: clamp(3.5rem, 10vw, 6rem); z-index: 0; white-space: nowrap; }
.center .text-stroke { left: 50%; transform: translateX(-50%); }
.overlay-title { position: relative; z-index: 1; }

/* Feature Cards */
.services-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 2rem; }
.glass-card {
    background: var(--card-bg); backdrop-filter: blur(20px); border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 0 20px rgba(255,255,255,0.02), 0 20px 40px rgba(0,0,0,0.4); border-radius: 24px; padding: 2.5rem; position: relative; overflow: hidden;
}
.card-icon { width: 50px; height: 50px; background: rgba(255,255,255,0.1); border-radius: 14px; display: flex; align-items: center; justify-content: center; margin-bottom: 1.5rem; color: var(--pure-white); }
.glass-card h3 { font-family: var(--font-display); font-size: 1.5rem; margin-bottom: 1rem; }
.glass-card p { color: var(--metallic-gray); font-size: 0.95rem; line-height: 1.6; }

/* Portfolio Grid */
.portfolio-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 2rem; }
.portfolio-card { background: var(--card-bg); border: 1px solid rgba(255,255,255,0.05); border-radius: 16px; overflow: hidden; transition: transform 0.3s ease, box-shadow 0.3s ease; }
.portfolio-card:hover { transform: translateY(-10px); box-shadow: 0 20px 40px rgba(0,0,0,0.5); border-color: rgba(255,255,255,0.15); }
.portfolio-img { width: 100%; height: 200px; overflow: hidden; }
.pf-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-weight: 700; font-size: 1.5rem; color: rgba(255,255,255,0.3); transition: transform 0.5s ease; text-align: center; }
.portfolio-card:hover .pf-placeholder { transform: scale(1.05); color: rgba(255,255,255,0.8); }
.portfolio-info { padding: 1.5rem; }
.portfolio-info h4 { font-family: var(--font-display); font-size: 1.2rem; margin-bottom: 0.5rem; }
.portfolio-info p { color: var(--metallic-gray); font-size: 0.9rem; margin-bottom: 1rem; }
.pf-tags { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.pf-tags span { font-size: 0.75rem; padding: 0.2rem 0.6rem; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); border-radius: 20px; color: var(--pure-white); }

/* Showcase specific */
.language-pill { display: inline-block; padding: 0.4rem 1rem; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); border-radius: 30px; font-size: 0.8rem; margin: 0.2rem; }

/* Responsive */
@media (max-width: 768px) {
    .mobile-menu-btn { display: flex; }
    .nav-links {
        position: fixed; top: 0; right: 0; width: 100vw; height: 100vh; background: rgba(3, 3, 3, 0.98); backdrop-filter: blur(30px);
        flex-direction: column; align-items: center; justify-content: center; gap: 3rem; z-index: 100;
        clip-path: circle(0px at calc(100% - 40px) 40px); transition: clip-path 0.8s cubic-bezier(0.77, 0, 0.175, 1); pointer-events: none;
    }
    .nav-links.active { clip-path: circle(150% at calc(100% - 40px) 40px); pointer-events: all; }
    .nav-links .magnetic-link { font-size: 2.5rem; font-family: var(--font-display); font-weight: 700; text-transform: uppercase; opacity: 0; transform: translateY(30px); transition: opacity 0.4s ease, transform 0.4s ease; }
    .nav-links.active .magnetic-link:nth-child(1) { transition-delay: 0.3s; opacity: 1; transform: translateY(0); }
    .nav-links.active .magnetic-link:nth-child(2) { transition-delay: 0.4s; opacity: 1; transform: translateY(0); }
    .nav-links.active .magnetic-link:nth-child(3) { transition-delay: 0.5s; opacity: 1; transform: translateY(0); }
}

/* Footer */
.footer { border-top: 1px solid rgba(255,255,255,0.05); padding: 4rem 0 2rem; background: rgba(0,0,0,0.5); }
.footer-content { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 2rem; }
.footer-brand .logo { text-decoration: none; display: block; }
.footer-brand p { color: var(--metallic-gray); font-size: 0.9rem; margin-top: 0.5rem; }
.footer-links { display: flex; gap: 2rem; justify-content: center; }
.footer-legal { text-align: right; }
.footer-legal p { color: var(--metallic-gray); font-size: 0.8rem; }
@media (max-width: 992px) { .footer-content { grid-template-columns: 1fr; text-align: center; } .footer-legal { text-align: center; } }
