/* ============================================
   NEXUS AI AGENCY — HYPER-REALISTIC ENHANCED
   International Design System + Glassmorphism
   ============================================ */

:root {
    /* ─── Core Palette ─── */
    --black: #000000;
    --void: #030308;
    --deep: #08081a;
    --surface: #0c0c20;
    --surface-2: #10102a;
    --surface-3: #161640;
    --border: rgba(255, 255, 255, 0.05);
    --border-hover: rgba(255, 255, 255, 0.12);
    --border-active: rgba(124, 58, 237, 0.4);

    /* ─── Text (International Scale) ─── */
    --text-primary: #f0f0f8;
    --text-secondary: rgba(240, 240, 248, 0.55);
    --text-muted: rgba(240, 240, 248, 0.28);
    --text-accent: #a78bfa;

    /* ─── Accents ─── */
    --accent-primary: #7c3aed;
    --accent-secondary: #a855f7;
    --accent-tertiary: #c084fc;
    --accent-glow: rgba(124, 58, 237, 0.5);
    --accent-cyan: #06b6d4;
    --accent-cyan-glow: rgba(6, 182, 212, 0.4);
    --accent-gold: #f59e0b;
    --accent-rose: #ec4899;
    --accent-emerald: #10b981;

    /* ─── Gradients ─── */
    --gradient-hero: linear-gradient(135deg, #7c3aed 0%, #a855f7 40%, #06b6d4 100%);
    --gradient-warm: linear-gradient(135deg, #f59e0b 0%, #ec4899 100%);
    --gradient-cool: linear-gradient(135deg, #06b6d4 0%, #7c3aed 100%);
    --gradient-surface: linear-gradient(180deg, rgba(124, 58, 237, 0.08) 0%, transparent 100%);

    /* ─── Glass (Hyper-Realistic) ─── */
    --glass-bg: rgba(12, 12, 32, 0.55);
    --glass-bg-hover: rgba(16, 16, 42, 0.7);
    --glass-border: rgba(255, 255, 255, 0.06);
    --glass-border-hover: rgba(255, 255, 255, 0.12);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255,255,255,0.04);
    --glass-shadow-hover: 0 24px 80px rgba(0, 0, 0, 0.6), 0 0 60px rgba(124, 58, 237, 0.08), inset 0 1px 0 rgba(255,255,255,0.06);
    --glass-blur: blur(24px) saturate(1.2);
    --glass-blur-heavy: blur(40px) saturate(1.4);

    /* ─── Typography ─── */
    --font-primary: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-display: 'Unbounded', 'Outfit', sans-serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', monospace;

    /* ─── Modular Scale (1.250 - Major Third) ─── */
    --text-xs: 0.6rem;
    --text-sm: 0.7rem;
    --text-base: 0.8rem;
    --text-md: 0.9rem;
    --text-lg: 1rem;
    --text-xl: 1.2rem;
    --text-2xl: 1.45rem;
    --text-3xl: 1.8rem;
    --text-4xl: 2.2rem;
    --text-5xl: 2.6rem;
    --text-hero: clamp(2rem, 4vw, 3.2rem);

    /* ─── Spacing (8px base) ─── */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;
    --space-20: 5rem;
    --space-24: 6rem;
    --space-32: 8rem;

    /* ─── Layout ─── */
    --section-height: 100vh;
    --nav-height: 72px;
    --max-width: 1280px;
    --content-max: 800px;

    /* ─── Transitions ─── */
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
    --ease-out-back: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);

    /* ─── Z-Index Scale ─── */
    --z-canvas: 0;
    --z-content: 10;
    --z-overlay: 20;
    --z-nav: 1000;
    --z-progress: 999;
    --z-cursor: 9999;
    --z-loader: 10000;
}

/* ============================================
   RESET & BASE
   ============================================ */

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

html {
    scroll-behavior: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(124, 58, 237, 0.4) var(--void);
    font-size: 16px;
}

html::-webkit-scrollbar {
    width: 5px;
}

html::-webkit-scrollbar-track {
    background: var(--void);
}

html::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--accent-primary), var(--accent-cyan));
    border-radius: 10px;
}

body {
    font-family: var(--font-primary);
    background: var(--void);
    color: var(--text-primary);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.6;
}

::selection {
    background: rgba(124, 58, 237, 0.4);
    color: white;
}

/* ============================================
   NOISE OVERLAY (Film Grain)
   ============================================ */

#noise-overlay {
    position: fixed;
    inset: 0;
    z-index: var(--z-overlay);
    pointer-events: none;
    opacity: 0.035;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    mix-blend-mode: overlay;
}

/* ============================================
   CURSOR
   ============================================ */

#cursor-glow {
    position: fixed;
    width: 800px;
    height: 800px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 1;
    background: radial-gradient(circle,
        rgba(124, 58, 237, 0.12) 0%,
        rgba(6, 182, 212, 0.05) 30%,
        transparent 70%
    );
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.8s ease;
    mix-blend-mode: screen;
}

#cursor-trail {
    position: fixed;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1px solid rgba(124, 58, 237, 0.5);
    pointer-events: none;
    z-index: var(--z-cursor);
    transform: translate(-50%, -50%);
    transition: width 0.3s var(--ease-out-expo),
                height 0.3s var(--ease-out-expo),
                border-color 0.3s ease;
    mix-blend-mode: difference;
}

#cursor-trail.hover {
    width: 48px;
    height: 48px;
    border-color: var(--accent-cyan);
}

body:hover #cursor-glow {
    opacity: 1;
}

/* ============================================
   LOADER
   ============================================ */

#loader {
    position: fixed;
    inset: 0;
    z-index: var(--z-loader);
    background: #030306;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

#loader.loaded {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 1.2s var(--ease-out-expo), visibility 1.2s;
}

#loader-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.loader-light-rays {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 600px;
    height: 600px;
    transform: translate(-50%, -50%);
    background:
        conic-gradient(from 0deg, transparent 0deg, rgba(0, 229, 195, 0.03) 10deg, transparent 20deg),
        conic-gradient(from 120deg, transparent 0deg, rgba(139, 92, 246, 0.03) 10deg, transparent 20deg),
        conic-gradient(from 240deg, transparent 0deg, rgba(0, 240, 255, 0.03) 10deg, transparent 20deg);
    animation: raysSpin 12s linear infinite;
    z-index: 0;
    opacity: 0;
    animation: raysSpin 12s linear infinite, brandReveal 1.2s ease-out 0.3s both;
}

@keyframes raysSpin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

.loader-inner {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    perspective: 800px;
}

/* ── LOADER GEM ── */
.loader-gem-wrap {
    width: 120px;
    height: 120px;
    position: relative;
    margin-bottom: 36px;
    animation: gemReveal 1s ease-out 0.2s both;
}

.loader-gem-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    animation: gemFloat 4s ease-in-out infinite;
    filter: drop-shadow(0 0 20px rgba(201, 168, 76, 0.5));
}

.loader-gem-pulse {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 80px;
    height: 80px;
    margin: -40px 0 0 -40px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(201, 168, 76, 0.3), transparent 70%);
    animation: gemPulse 2s ease-in-out infinite;
}

.gem-facet {
    opacity: 0;
    animation: facetReveal 0.4s ease-out forwards;
}
.gem-facet.gf-1 { animation-delay: 0.1s; }
.gem-facet.gf-2 { animation-delay: 0.15s; }
.gem-facet.gf-3 { animation-delay: 0.2s; }
.gem-facet.gf-4 { animation-delay: 0.25s; }
.gem-facet.gf-5 { animation-delay: 0.3s; }
.gem-facet.gf-6 { animation-delay: 0.35s; }
.gem-facet.gf-7 { animation-delay: 0.4s; }
.gem-facet.gf-8 { animation-delay: 0.45s; }
.gem-facet.gf-9 { animation-delay: 0.5s; }
.gem-facet.gf-10 { animation-delay: 0.55s; }
.gem-facet.gf-11 { animation-delay: 0.6s; }
.gem-facet.gf-12 { animation-delay: 0.65s; }
.gem-facet.gf-13 { animation-delay: 0.7s; }
.gem-facet.gf-14 { animation-delay: 0.75s; }
.gem-facet.gf-15 { animation-delay: 0.8s; }
.gem-facet.gf-16 { animation-delay: 0.85s; }

@keyframes gemReveal {
    from { opacity: 0; transform: scale(0.5) rotate(-20deg); }
    to { opacity: 1; transform: scale(1) rotate(0deg); }
}

@keyframes gemFloat {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-8px) rotate(3deg); }
}

@keyframes gemSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes gemPulse {
    0%, 100% { transform: scale(1); opacity: 0.4; }
    50% { transform: scale(1.3); opacity: 0.7; }
}

@keyframes facetReveal {
    from { opacity: 0; }
    to { opacity: 1; }
}

.loader-brand-text {
    animation: brandReveal 0.8s ease-out 0.6s both;
    overflow: hidden;
}

.loader-text-main {
    display: inline-flex;
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: 0.35em;
}

.loader-letter {
    display: inline-block;
    color: var(--text-secondary);
    animation: letterReveal3D 0.6s ease-out calc(var(--i) * 0.06s + 0.5s) both;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.05);
}

.loader-letter.loader-accent {
    background: linear-gradient(135deg, #00e5c3, #00f0ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 8px rgba(0, 229, 195, 0.3));
}

@keyframes letterReveal3D {
    from {
        opacity: 0;
        transform: translateY(30px) rotateX(-80deg) rotateY(15deg) scale(0.7);
        filter: blur(8px);
    }
    60% {
        opacity: 1;
        transform: translateY(-4px) rotateX(5deg) rotateY(-3deg) scale(1.02);
        filter: blur(0);
    }
    to {
        opacity: 1;
        transform: translateY(0) rotateX(0) rotateY(0) scale(1);
        filter: blur(0);
    }
}

.loader-subtitle {
    font-family: var(--font-mono);
    font-size: 9px;
    letter-spacing: 0.4em;
    color: rgba(255, 255, 255, 0.15);
    margin-top: 12px;
    animation: brandReveal 0.8s ease-out 1.1s both;
}

@keyframes brandReveal {
    from { opacity: 0; transform: translateY(16px) scale(0.95); filter: blur(6px); }
    to { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}

.loader-bar-wrap {
    width: 180px;
    height: 1px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 1px;
    overflow: hidden;
    margin-top: 32px;
    animation: brandReveal 0.8s ease-out 1.0s both;
}

.loader-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #00e5c3, #00f0ff);
    border-radius: 1px;
    animation: loaderFill 2.2s ease-in-out forwards;
}

@keyframes loaderFill {
    0% { width: 0%; }
    20% { width: 25%; }
    50% { width: 55%; }
    80% { width: 85%; }
    100% { width: 100%; }
}

/* ============================================
   NAVIGATION
   ============================================ */

#nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    z-index: var(--z-nav);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 clamp(24px, 4vw, 64px);
    background: rgba(3, 3, 8, 0.6);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--border);
    transform: translateY(-100%);
    transition: transform 0.8s var(--ease-out-expo);
}

#nav.visible {
    transform: translateY(0);
}

.nav-left {
    flex: 0 0 auto;
}

.nav-logo {
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-display);
    position: relative;
}

.logo-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
}

.logo-icon-img {
    border-radius: 50%;
    overflow: hidden;
}

.logo-icon-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.logo-icon svg {
    width: 100%;
    height: 100%;
    animation: logoPulse 4s ease-in-out infinite;
}

@keyframes logoPulse {
    0%, 100% { filter: drop-shadow(0 0 4px rgba(201, 168, 76, 0.2)); }
    50% { filter: drop-shadow(0 0 10px rgba(201, 168, 76, 0.4)) drop-shadow(0 0 20px rgba(139, 92, 246, 0.2)); }
}

.logo-name {
    display: inline-flex;
    align-items: baseline;
    gap: 0;
}

.logo-text-gradient {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    background: linear-gradient(135deg, #C9A84C 0%, #d4b84a 25%, #fff 50%, #8b5cf6 75%, #C9A84C 100%);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: logoShimmer 6s ease-in-out infinite;
    filter: drop-shadow(0 0 6px rgba(201, 168, 76, 0.3));
    line-height: 1;
}

@keyframes logoShimmer {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.logo-w {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 900;
    background: linear-gradient(135deg, #C9A84C, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    filter: drop-shadow(0 0 8px rgba(201, 168, 76, 0.3));
}

.logo-eb {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.12em;
    line-height: 1;
}

.logo-accent {
    font-family: var(--font-mono);
    font-size: 0.55rem;
    font-weight: 500;
    letter-spacing: 0.3em;
    color: rgba(0, 229, 195, 0.5);
    margin-left: 5px;
    position: relative;
    top: -2px;
    border-bottom: 1px solid rgba(0, 229, 195, 0.2);
    padding-bottom: 1px;
}


@keyframes dotPulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 8px var(--accent-cyan-glow); }
    50% { opacity: 0.4; box-shadow: 0 0 20px var(--accent-cyan-glow); }
}

.nav-center {
    display: flex;
    gap: clamp(20px, 3vw, 40px);
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.nav-center a {
    text-decoration: none;
    color: var(--text-muted);
    font-size: var(--text-xs);
    font-weight: 500;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    transition: color 0.4s ease;
    position: relative;
    padding: 4px 0;
}

.nav-center a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--gradient-hero);
    transition: width 0.4s var(--ease-out-expo);
}

.nav-center a:hover,
.nav-center a.active {
    color: var(--text-primary);
}

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

.nav-right {
    flex: 0 0 auto;
}

.nav-cta {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
    font-size: var(--text-xs);
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 10px 24px;
    border: 1px solid rgba(124, 58, 237, 0.4);
    border-radius: 100px;
    transition: all 0.5s var(--ease-out-expo);
    position: relative;
    overflow: hidden;
}

.nav-cta::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient-hero);
    opacity: 0;
    transition: opacity 0.5s ease;
    border-radius: inherit;
}

.nav-cta:hover::before {
    opacity: 1;
}

.nav-cta span,
.nav-cta svg {
    position: relative;
    z-index: 1;
}

.nav-cta svg {
    width: 14px;
    height: 14px;
    transition: transform 0.4s var(--ease-out-expo);
}

.nav-cta:hover svg {
    transform: translate(2px, -2px);
}

/* ============================================
   SCROLL PROGRESS
   ============================================ */

#scroll-progress {
    position: fixed;
    right: clamp(20px, 3vw, 40px);
    top: 50%;
    transform: translateY(-50%);
    z-index: var(--z-progress);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-6);
}

.progress-track {
    width: 2px;
    height: 180px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 1px;
    position: relative;
    overflow: hidden;
}

.progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 0%;
    background: var(--gradient-hero);
    border-radius: 1px;
    transition: height 0.15s ease;
    box-shadow: 0 0 8px var(--accent-glow);
}

.progress-chapters {
    display: flex;
    flex-direction: column;
    gap: 14px;
    position: absolute;
    top: 0;
    height: 180px;
    justify-content: space-between;
}

.chapter-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: transparent;
    transition: all 0.5s var(--ease-out-expo);
    cursor: pointer;
}

.chapter-dot.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    box-shadow: 0 0 12px var(--accent-glow);
    transform: scale(1.6);
}

.chapter-dot:hover {
    border-color: var(--accent-secondary);
    transform: scale(1.3);
}

.progress-label {
    font-family: var(--font-mono);
    font-size: 0.5rem;
    letter-spacing: 0.3em;
    color: var(--text-muted);
    writing-mode: vertical-lr;
    text-orientation: mixed;
    transform: rotate(180deg);
}

/* ============================================
   THREE.JS CANVAS
   ============================================ */

#webgl-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: var(--z-canvas);
}

/* ============================================
   STORY SCROLL
   ============================================ */

#story-scroll {
    position: relative;
    z-index: var(--z-content);
}

.chapter {
    min-height: var(--section-height);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: clamp(80px, 10vh, 140px) clamp(24px, 6vw, 100px);
    overflow: hidden;
}

.chapter:first-child {
    text-align: center;
    position: relative;
}

.chapter:first-child .chapter-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 2;
    background: radial-gradient(ellipse at center, rgba(3,3,8,0.4) 0%, transparent 65%);
    padding: 40px;
    border-radius: 20px;
}

.chapter:first-child .chapter-meta {
    justify-content: center;
    margin-bottom: var(--space-5);
}

.chapter:first-child .chapter-subtitle,
.chapter:first-child .chapter-body {
    text-align: center;
}

.chapter:first-child .chapter-body {
    margin-bottom: var(--space-6);
}


.chapter:first-child .scroll-indicator {
    left: 50%;
    transform: translateX(-50%);
    align-items: center;
    text-align: center;
}

.chapter-bg-glow {
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.15;
    pointer-events: none;
    z-index: -1;
}

.ch1-glow { background: var(--accent-primary); top: 20%; left: -10%; }
.ch2-glow { background: var(--accent-cyan); top: 30%; right: -10%; }
.ch3-glow { background: var(--accent-gold); bottom: 10%; left: 20%; }
.ch4-glow { background: var(--accent-rose); top: 10%; left: 50%; }
.ch5-glow { background: var(--accent-emerald); bottom: 20%; right: 10%; }
.ch6-glow { background: var(--accent-primary); top: 40%; left: 30%; }

#hero-neural-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.chapter-overlay {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, transparent 0%, var(--void) 65%);
    pointer-events: none;
    z-index: -1;
}

/* Darker overlay for later chapters */
.chapter-ecosystem .chapter-overlay,
.chapter-contact-page .chapter-overlay {
    background: radial-gradient(ellipse at center, rgba(3, 3, 8, 0.3) 0%, var(--void) 60%);
}

.chapter-content {
    max-width: var(--max-width);
    width: 100%;
}

.chapter-meta {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    margin-bottom: var(--space-8);
    opacity: 0;
    transform: translateY(20px);
}

.chapter-label {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    font-weight: 500;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--accent-primary);
}

.chapter-divider {
    width: 40px;
    height: 1px;
    background: var(--gradient-hero);
}

.chapter-year {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--text-muted);
    letter-spacing: 0.1em;
}

.chapter-title {
    font-family: var(--font-display);
    font-size: var(--text-hero);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.03em;
    margin-bottom: var(--space-5);
    opacity: 0;
    transform: translateY(60px);
}

.chapter:first-child .chapter-title {
    font-size: clamp(2.2rem, 4.5vw, 3.5rem);
}

.chapter:first-child .chapter-subtitle {
    font-size: var(--text-base);
    max-width: 480px;
}

.chapter:first-child .chapter-body p {
    font-size: var(--text-sm);
    max-width: 440px;
}

.chapter-subtitle {
    font-size: clamp(var(--text-sm), 1.2vw, var(--text-lg));
    font-weight: 300;
    color: var(--text-secondary);
    max-width: 500px;
    line-height: 1.7;
    margin-bottom: var(--space-8);
    opacity: 0;
    transform: translateY(40px);
}

.chapter-body {
    max-width: var(--content-max);
    opacity: 0;
    transform: translateY(40px);
}

.chapter-body p {
    font-size: var(--text-sm);
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: var(--space-4);
}

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

/* Glitch Effect */
.glitch-text {
    position: relative;
}

.glitch-text::before,
.glitch-text::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
}

.glitch-text:hover::before {
    animation: glitch1 0.4s linear;
    color: var(--accent-cyan);
    opacity: 0.7;
}

.glitch-text:hover::after {
    animation: glitch2 0.4s linear;
    color: var(--accent-rose);
    opacity: 0.7;
}

@keyframes glitch1 {
    0% { clip-path: inset(15% 0 65% 0); transform: translate(-4px, 2px); }
    20% { clip-path: inset(65% 0 10% 0); transform: translate(4px, -2px); }
    40% { clip-path: inset(35% 0 45% 0); transform: translate(-3px, 4px); }
    60% { clip-path: inset(80% 0 5% 0); transform: translate(3px, -4px); }
    80% { clip-path: inset(10% 0 70% 0); transform: translate(-4px, 2px); }
    100% { clip-path: inset(50% 0 25% 0); transform: translate(4px, -2px); }
}

@keyframes glitch2 {
    0% { clip-path: inset(65% 0 15% 0); transform: translate(4px, -2px); }
    20% { clip-path: inset(10% 0 65% 0); transform: translate(-4px, 2px); }
    40% { clip-path: inset(45% 0 35% 0); transform: translate(3px, -4px); }
    60% { clip-path: inset(15% 0 55% 0); transform: translate(-3px, 4px); }
    80% { clip-path: inset(70% 0 10% 0); transform: translate(4px, -2px); }
    100% { clip-path: inset(25% 0 50% 0); transform: translate(-4px, 2px); }
}

/* ============================================
   HERO BADGE
   ============================================ */

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 22px;
    border: 1px solid rgba(139, 92, 246, 0.5);
    border-radius: 100px;
    font-family: var(--font-mono);
    font-size: 13px;
    letter-spacing: 0.2em;
    color: var(--text-secondary);
    background: rgba(139, 92, 246, 0.08);
    backdrop-filter: blur(12px);
    margin-bottom: 36px;
    animation: borderGlow 3s ease-in-out infinite;
    text-shadow: 0 0 20px rgba(0,0,0,0.8);
}

.hero-badge-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-purple);
    box-shadow: 0 0 12px var(--accent-purple);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes borderGlow {
    0%, 100% { border-color: rgba(139, 92, 246, 0.5); box-shadow: 0 0 20px rgba(139, 92, 246, 0.1); }
    50% { border-color: rgba(139, 92, 246, 0.8); box-shadow: 0 0 30px rgba(139, 92, 246, 0.25); }
}

/* ============================================
   HERO TITLE — GRADIENT TEXT
   ============================================ */

.hero-title {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 28px;
}

.hero-title-line1 {
    font-family: var(--font-display);
    font-size: clamp(52px, 7vw, 100px);
    font-weight: 800;
    line-height: 1.05;
    color: #fff;
    letter-spacing: -0.02em;
    text-shadow: 0 0 60px rgba(0,0,0,0.8), 0 0 120px rgba(0,0,0,0.6), 0 4px 20px rgba(0,0,0,0.9);
}

.hero-title-line2 {
    font-family: var(--font-display);
    font-size: clamp(52px, 7vw, 100px);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #a78bfa 0%, #818cf8 20%, #6366f1 35%, #8b5cf6 50%, #a78bfa 65%, #c4b5fd 80%, #818cf8 100%);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: heroGradientShift 6s ease-in-out infinite;
    filter: drop-shadow(0 0 40px rgba(139, 92, 246, 0.5)) drop-shadow(0 4px 20px rgba(0,0,0,0.9));
}

@keyframes heroGradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ============================================
   HERO SUBTITLE
   ============================================ */

.hero-subtitle {
    max-width: 560px;
    font-size: 17px;
    line-height: 1.75;
    color: var(--text-muted);
    margin-bottom: 40px;
    text-shadow: 0 0 40px rgba(0,0,0,0.9), 0 2px 10px rgba(0,0,0,0.8);
}

/* ============================================
   HERO BUTTONS
   ============================================ */

.hero-buttons {
    display: flex;
    gap: 18px;
    margin-bottom: 60px;
}

.hero-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    padding: 16px 34px;
    border-radius: 12px;
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    overflow: hidden;
}

.hero-btn-primary {
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-cyan));
    color: #fff;
    border: none;
    box-shadow: 0 4px 30px rgba(139, 92, 246, 0.35), inset 0 1px 0 rgba(255,255,255,0.15);
}

.hero-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 40px rgba(139, 92, 246, 0.55), inset 0 1px 0 rgba(255,255,255,0.2);
}

.hero-btn-glow {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(255,255,255,0.2), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

.hero-btn-primary:hover .hero-btn-glow {
    opacity: 1;
}

.hero-btn-outline {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.hero-btn-outline:hover {
    border-color: var(--accent-purple);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.2);
}

/* ============================================
   GLASS CARD (Hyper-Realistic)
   ============================================ */

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    position: relative;
    overflow: hidden;
    transition: all 0.6s var(--ease-out-expo);
}

.glass-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg,
        rgba(255,255,255,0.04) 0%,
        transparent 40%,
        rgba(124,58,237,0.03) 100%
    );
    pointer-events: none;
    border-radius: inherit;
}

.glass-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg,
        transparent,
        rgba(255,255,255,0.08),
        transparent
    );
    pointer-events: none;
}

.glass-card:hover {
    border-color: var(--glass-border-hover);
    transform: translateY(-6px);
    box-shadow: var(--glass-shadow-hover);
}

/* ============================================
   STATS GRID
   ============================================ */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-5);
    margin-top: var(--space-12);
    opacity: 0;
    transform: translateY(50px);
}

.stat-card {
    padding: var(--space-8) var(--space-6);
    text-align: center;
}

.stat-icon {
    width: 36px;
    height: 36px;
    margin: 0 auto var(--space-5);
    color: var(--accent-primary);
    opacity: 0.6;
}

.stat-icon svg {
    width: 100%;
    height: 100%;
}

.stat-number {
    font-family: var(--font-display);
    font-size: var(--text-3xl);
    font-weight: 800;
    background: var(--gradient-hero);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    margin-bottom: var(--space-2);
}

.stat-label {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: var(--space-4);
}

.stat-bar {
    width: 100%;
    height: 2px;
    background: rgba(255,255,255,0.04);
    border-radius: 1px;
    overflow: hidden;
}

.stat-bar-fill {
    width: 0%;
    height: 100%;
    background: var(--gradient-hero);
    border-radius: 1px;
    transition: width 2s var(--ease-out-expo);
}

.stat-card.animated .stat-bar-fill {
    width: var(--fill);
}

/* ============================================
   FORGE PIPELINE
   ============================================ */

.forge-pipeline {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-6);
    margin-top: var(--space-12);
    position: relative;
}

.pipeline-connector {
    position: absolute;
    top: 50%;
    left: 10%;
    right: 10%;
    height: 1px;
    background: linear-gradient(90deg,
        transparent,
        var(--accent-primary),
        var(--accent-cyan),
        transparent
    );
    opacity: 0.2;
    z-index: 0;
}

.pipeline-step {
    padding: var(--space-8) var(--space-6);
    opacity: 0;
    transform: translateY(80px) scale(0.92);
    position: relative;
    z-index: 1;
    transform-style: preserve-3d;
    will-change: transform;
}

.pipeline-step::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 16px;
    background: radial-gradient(circle at var(--glare-x, 50%) var(--glare-y, 50%), rgba(255,255,255,0.08) 0%, transparent 55%);
    z-index: 10;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.pipeline-step:hover::before {
    opacity: 1;
}

.step-glow {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 40px;
    background: var(--accent-primary);
    filter: blur(30px);
    opacity: 0;
    transition: opacity 0.6s ease;
    border-radius: 50%;
}

.pipeline-step:hover .step-glow {
    opacity: 0.15;
}

.pipeline-step::after {
    content: attr(data-step);
    position: absolute;
    top: var(--space-4);
    right: var(--space-5);
    font-family: var(--font-mono);
    font-size: 0.6rem;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.1em;
}

.step-icon {
    width: 40px;
    height: 40px;
    margin-bottom: var(--space-5);
    color: var(--accent-primary);
    transition: transform 0.5s var(--ease-out-expo);
}

.pipeline-step:hover .step-icon {
    transform: scale(1.1) rotate(-5deg);
}

.step-icon svg {
    width: 100%;
    height: 100%;
}

.pipeline-step h3 {
    font-family: var(--font-display);
    font-size: var(--text-sm);
    font-weight: 700;
    letter-spacing: 0.18em;
    margin-bottom: var(--space-3);
    color: var(--text-primary);
}

.pipeline-step p {
    font-size: var(--text-sm);
    line-height: 1.7;
    color: var(--text-secondary);
}

.step-line {
    position: absolute;
    bottom: 0;
    left: var(--space-8);
    right: var(--space-8);
    height: 1px;
    background: linear-gradient(90deg, var(--accent-primary), transparent);
    opacity: 0.3;
}

/* ============================================
   PORTFOLIO — 2x2 Grid
   ============================================ */

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-7);
    max-width: var(--max-width);
    width: 100%;
    margin: var(--space-12) auto 0;
    padding: 0 clamp(24px, 6vw, 100px);
}

.portfolio-item {
    opacity: 0;
    transform: translateY(100px) rotateX(8deg);
    cursor: pointer;
    perspective: 800px;
    transform-style: preserve-3d;
    position: relative;
}

.portfolio-item::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 20px;
    background: radial-gradient(circle at var(--glare-x, 50%) var(--glare-y, 50%), rgba(255,255,255,0.1) 0%, transparent 55%);
    z-index: 5;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.portfolio-item:hover::before {
    opacity: 1;
}

.portfolio-image {
    width: 100%;
    height: 320px;
    overflow: hidden;
    border-radius: 20px 20px 0 0;
    position: relative;
}

.portfolio-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 1;
    transition: opacity 0.6s ease;
    z-index: 0;
}

.portfolio-item:first-child .portfolio-placeholder,
.portfolio-item:nth-child(2) .portfolio-placeholder,
.portfolio-item:nth-child(3) .portfolio-placeholder,
.portfolio-item:nth-child(4) .portfolio-placeholder {
    opacity: 0;
}

.portfolio-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--surface-2), var(--surface-3));
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    transition: opacity 0.5s ease;
    z-index: 1;
}

.portfolio-placeholder::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 30% 40%, var(--accent) 0%, transparent 55%);
    opacity: 0.2;
}

.portfolio-placeholder::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 70% 60%, var(--accent) 0%, transparent 45%);
    opacity: 0.1;
}

.portfolio-grid-pattern {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
    background-size: 40px 40px;
    opacity: 0.5;
}

.portfolio-icon {
    font-size: 3.5rem;
    color: var(--accent);
    opacity: 0.3;
    transition: all 0.6s var(--ease-out-expo);
    position: relative;
    z-index: 1;
}

.portfolio-item:hover .portfolio-icon {
    opacity: 0.7;
    transform: scale(1.15) rotate(10deg);
}

.portfolio-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.5s ease;
    z-index: 3;
}

.portfolio-item:hover .portfolio-overlay {
    opacity: 1;
}

.view-project {
    font-family: var(--font-display);
    font-size: var(--text-sm);
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: white;
    padding: 12px 28px;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 100px;
    transition: all 0.4s var(--ease-out-expo);
}

.view-project:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.5);
}

.portfolio-info {
    padding: var(--space-7);
}

.portfolio-category {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--accent-primary);
    margin-bottom: var(--space-2);
    display: block;
}

.portfolio-info h3 {
    font-family: var(--font-display);
    font-size: var(--text-lg);
    font-weight: 700;
    margin-bottom: var(--space-2);
}

.portfolio-info p {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ============================================
   RIPPLE EFFECT — Captivating Redesign
   ============================================ */

.testimonials {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    margin-top: var(--space-10);
    opacity: 0;
    transform: translateY(80px);
    max-width: 900px;
}

.testimonial {
    padding: var(--space-6) var(--space-8);
    display: flex;
    align-items: center;
    gap: var(--space-8);
    position: relative;
    border-radius: 16px;
    transition: all 0.5s var(--ease-out-expo);
}

.testimonial::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background: var(--gradient-hero);
    border-radius: 2px;
    transition: height 0.5s var(--ease-out-expo);
}

.testimonial:hover::before {
    height: 60%;
}

.testimonial-glow {
    display: none;
}

.testimonial-quote {
    font-family: var(--font-display);
    font-size: 4rem;
    line-height: 1;
    background: var(--gradient-hero);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    opacity: 0.3;
    flex-shrink: 0;
    transition: opacity 0.4s ease;
}

.testimonial:hover .testimonial-quote {
    opacity: 0.6;
}

.testimonial-content {
    flex: 1;
}

.testimonial p {
    font-size: var(--text-base);
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: var(--space-4);
    font-style: normal;
}

.testimonial-author {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.author-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-cyan));
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 0.5rem;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.testimonial-author strong {
    display: block;
    font-size: var(--text-sm);
    font-weight: 600;
}

.testimonial-author span {
    font-size: var(--text-xs);
    color: var(--text-muted);
}

/* Featured testimonial — first one larger */
.testimonial:first-child {
    padding: var(--space-8) var(--space-10);
    background: rgba(124, 58, 237, 0.03);
    border: 1px solid rgba(124, 58, 237, 0.08);
}

.testimonial:first-child .testimonial-quote {
    font-size: 5rem;
}

.testimonial:first-child p {
    font-size: var(--text-md);
}

/* Stats ribbon between title and testimonials */
.testimonial-stats {
    display: flex;
    align-items: center;
    gap: var(--space-10);
    margin-top: var(--space-8);
    margin-bottom: var(--space-6);
    padding: var(--space-5) var(--space-8);
    background: rgba(124, 58, 237, 0.04);
    border: 1px solid rgba(124, 58, 237, 0.08);
    border-radius: 100px;
    width: fit-content;
}

.testimonial-stat {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.testimonial-stat-value {
    font-family: var(--font-display);
    font-size: var(--text-xl);
    font-weight: 700;
    background: var(--gradient-hero);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.testimonial-stat-label {
    font-family: var(--font-mono);
    font-size: 0.55rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.testimonial-stat-divider {
    width: 1px;
    height: 24px;
    background: var(--border);
}

/* ============================================
   NEURAL ARCHITECTURE — Interactive Network
   ============================================ */

.chapter-neural {
    position: relative;
    overflow: hidden;
}

#neural-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.neural-content {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    min-height: 100vh;
}

.neural-text {
    max-width: 520px;
}

.neural-title {
    font-size: clamp(2rem, 4vw, 3rem) !important;
    line-height: 1.05 !important;
}

.neural-sub {
    font-size: var(--text-sm) !important;
    line-height: 1.8 !important;
    color: var(--text-secondary) !important;
}

.ripple-orb-container {
    position: absolute;
    top: 5%;
    right: 2%;
    width: 48%;
    height: 90%;
    z-index: 5;
    pointer-events: auto;
    border: none;
    background: transparent;
    overflow: visible;
    cursor: crosshair;
}

.ripple-orb-container::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 350px;
    height: 350px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 229, 195, 0.12) 0%, rgba(0, 240, 255, 0.06) 40%, transparent 70%);
    filter: blur(35px);
    pointer-events: none;
    z-index: -1;
}

#ripple-orb {
    width: 100%;
    height: 100%;
    cursor: none;
    background: transparent;
}

#ripple-orb canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
    background: transparent !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

.orb-prompt {
    position: absolute;
    bottom: 12%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 12px;
    opacity: 0.4;
    animation: orbPromptPulse 3s ease-in-out infinite, brandReveal 0.8s ease-out 1.5s both;
    pointer-events: none;
}

.orb-prompt-text {
    font-family: var(--font-mono);
    font-size: 9px;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.5);
    white-space: nowrap;
}

.orb-prompt-line {
    width: 30px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0, 229, 195, 0.4), transparent);
}

@keyframes orbPromptPulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.7; }
}

/* ============================================
   GLASSMORPHIC CARD — Base Tilt Style
   ============================================ */

.glassmorphic-card {
    transform-style: preserve-3d;
    will-change: transform;
    transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.5s ease;
}

.glassmorphic-card:hover {
    box-shadow: 0 0 40px rgba(139, 92, 246, 0.12), 0 20px 60px rgba(0, 0, 0, 0.3);
}

/* ============================================
   GLASS PORTFOLIO GALLERY — 3D WebGL
   ============================================ */

/* ============================================
   IRIDESCENT 3D SPHERE — Hero Center
   ============================================ */

#sphere-canvas {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 600px;
    z-index: 1;
    display: block;
    pointer-events: auto;
    cursor: pointer;
}

.sphere-eye {
    position: absolute;
    width: 20px;
    height: 50px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 10px;
    z-index: 3;
    pointer-events: none;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 6px rgba(0,0,0,0.6);
    transition: opacity 0.3s ease;
}

.chapter-sphere {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
}

.ch5a-glow {
    background: linear-gradient(135deg, #06b6d4, #8b5cf6);
    top: 30%;
    right: -10%;
}

.sphere-layout {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    min-height: 100vh;
    padding: 0 clamp(24px, 6vw, 100px);
    pointer-events: none;
}

.sphere-text {
    max-width: 420px;
    pointer-events: auto;
}

.sphere-text .chapter-title {
    font-size: clamp(2rem, 4vw, 3.2rem);
    margin-bottom: 20px;
}

.sphere-text .chapter-subtitle {
    color: var(--text-secondary);
    margin-bottom: 36px;
    line-height: 1.7;
}

.chapter-gallery {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
}

.gallery-bg-noise {
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 0;
}

.gallery-content {
    position: relative;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding-top: 10vh;
    pointer-events: none;
}

.gallery-badge {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--accent-cyan);
    padding: 8px 24px;
    border: 1px solid rgba(6, 182, 212, 0.25);
    border-radius: 100px;
    background: rgba(6, 182, 212, 0.04);
    margin-bottom: var(--space-6);
    animation: badgeGlow 3s ease-in-out infinite;
}

@keyframes badgeGlow {
    0%, 100% { box-shadow: 0 0 12px rgba(6, 182, 212, 0.1); }
    50% { box-shadow: 0 0 24px rgba(6, 182, 212, 0.2); }
}

.gallery-title {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    line-height: 1.05;
    margin-bottom: var(--space-4);
}

.gallery-subtitle {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    max-width: 500px;
    line-height: 1.7;
}

#gallery-webgl {
    position: absolute;
    inset: 0;
    z-index: 1;
}

#gallery-webgl canvas {
    width: 100% !important;
    height: 100% !important;
}

/* ============================================
   GALLERY TILES — Floating Glassmorphic Panels
   ============================================ */

.gallery-panels-wrap {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
}

.gallery-tile {
    position: absolute;
    width: 240px;
    height: 300px;
    pointer-events: auto;
    cursor: pointer;
    transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.5s, filter 0.5s;
    transform-style: preserve-3d;
}

.gallery-tile:hover {
    z-index: 10;
    filter: brightness(1.15);
}

.gallery-tile:hover .tile-inner {
    border-color: var(--tile-border);
    box-shadow:
        0 0 2px var(--tile-border),
        0 0 40px rgba(0,0,0,0.4),
        0 0 80px color-mix(in srgb, var(--tile-border) 30%, transparent),
        inset 0 1px 0 rgba(255,255,255,0.08);
}

.gallery-tile:hover .tile-glow {
    opacity: 0.25 !important;
    transform: scale(1.3);
}

.gallery-tile:hover .tile-tag {
    color: rgba(255,255,255,0.6);
}

.gallery-tile-1 { left: 5%; top: 25%; transform: rotate(-8deg) translateZ(-20px); }
.gallery-tile-2 { left: 28%; top: 10%; transform: rotate(2deg) translateZ(30px); }
.gallery-tile-3 { left: 50%; top: 15%; transform: rotate(5deg) translateZ(10px); }
.gallery-tile-4 { right: 12%; top: 22%; transform: rotate(-3deg) translateZ(20px); }
.gallery-tile-5 { right: -2%; top: 35%; transform: rotate(7deg) translateZ(-15px); filter: brightness(0.65); }
.gallery-tile-5:hover { filter: brightness(1.1); }

.tile-inner {
    position: relative;
    width: 100%;
    height: 100%;
    background: rgba(8, 8, 20, 0.65);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--tile-border, rgba(255,255,255,0.1));
    border-radius: 16px;
    padding: 18px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow:
        0 0 1px var(--tile-border),
        0 0 30px rgba(0,0,0,0.5),
        inset 0 1px 0 rgba(255,255,255,0.05);
}

.tile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.tile-dots {
    display: flex;
    gap: 5px;
}

.tile-dots span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.15);
}

.tile-tag {
    font-family: var(--font-mono);
    font-size: 8px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.35);
}

.tile-visual {
    position: absolute;
    inset: 0;
    border-radius: 16px;
    overflow: hidden;
    z-index: 0;
}

.tile-visual-bg {
    width: 100%;
    height: 100%;
    opacity: 0.7;
    transition: opacity 0.5s ease, transform 0.6s ease;
}

.gallery-tile:hover .tile-visual-bg {
    opacity: 1;
    transform: scale(1.05);
}

.tile-visual-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 40%, rgba(0,0,0,0.6) 100%);
    pointer-events: none;
}

/* Aetheris — Flowing cosmetic gradient with light refraction */
.tile-visual-1 {
    background:
        radial-gradient(ellipse at 30% 20%, rgba(96, 165, 250, 0.6) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 80%, rgba(37, 99, 235, 0.5) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(147, 197, 253, 0.3) 0%, transparent 60%),
        linear-gradient(135deg, #0c1929 0%, #1e3a5f 40%, #0f172a 100%);
    animation: visualShift1 8s ease-in-out infinite;
}

/* Vortex — Swirling cloud data streams */
.tile-visual-2 {
    background:
        conic-gradient(from 45deg at 60% 40%, transparent 0deg, rgba(6, 182, 212, 0.4) 60deg, transparent 120deg, rgba(34, 211, 238, 0.3) 180deg, transparent 240deg, rgba(8, 145, 178, 0.4) 300deg, transparent 360deg),
        radial-gradient(circle at 40% 60%, rgba(6, 182, 212, 0.3) 0%, transparent 50%),
        linear-gradient(160deg, #0a1628 0%, #0e2a3a 50%, #091520 100%);
    animation: visualShift2 10s ease-in-out infinite;
}

/* Lumina — Soft living light with organic glow */
.tile-visual-3 {
    background:
        radial-gradient(ellipse at 25% 75%, rgba(52, 211, 153, 0.5) 0%, transparent 45%),
        radial-gradient(ellipse at 75% 25%, rgba(16, 185, 129, 0.4) 0%, transparent 45%),
        radial-gradient(circle at 50% 50%, rgba(110, 231, 183, 0.2) 0%, transparent 50%),
        linear-gradient(145deg, #071a14 0%, #0d2e22 45%, #061210 100%);
    animation: visualShift3 9s ease-in-out infinite;
}

/* Archon — Deep purple neural architecture */
.tile-visual-4 {
    background:
        radial-gradient(ellipse at 60% 30%, rgba(167, 139, 250, 0.5) 0%, transparent 45%),
        radial-gradient(ellipse at 30% 70%, rgba(124, 58, 237, 0.4) 0%, transparent 45%),
        conic-gradient(from 200deg at 50% 50%, transparent 0deg, rgba(139, 92, 246, 0.2) 90deg, transparent 180deg, rgba(167, 139, 250, 0.15) 270deg, transparent 360deg),
        linear-gradient(155deg, #110a24 0%, #1a103c 50%, #0d0820 100%);
    animation: visualShift4 11s ease-in-out infinite;
}

/* Synapse — Electric neural pulse */
.tile-visual-5 {
    background:
        radial-gradient(ellipse at 40% 40%, rgba(129, 140, 248, 0.5) 0%, transparent 40%),
        radial-gradient(ellipse at 70% 70%, rgba(99, 102, 241, 0.4) 0%, transparent 40%),
        linear-gradient(45deg, transparent 40%, rgba(129, 140, 248, 0.1) 50%, transparent 60%),
        linear-gradient(135deg, #0a0e2a 0%, #151b3d 50%, #080c22 100%);
    animation: visualShift5 7s ease-in-out infinite;
}

@keyframes visualShift1 {
    0%, 100% { filter: hue-rotate(0deg) brightness(1); }
    50% { filter: hue-rotate(15deg) brightness(1.1); }
}

@keyframes visualShift2 {
    0%, 100% { filter: hue-rotate(0deg) brightness(1); transform: rotate(0deg); }
    50% { filter: hue-rotate(10deg) brightness(1.15); transform: rotate(2deg); }
}

@keyframes visualShift3 {
    0%, 100% { filter: hue-rotate(0deg) brightness(1); }
    50% { filter: hue-rotate(-10deg) brightness(1.1); }
}

@keyframes visualShift4 {
    0%, 100% { filter: hue-rotate(0deg) brightness(1); }
    50% { filter: hue-rotate(20deg) brightness(1.12); }
}

@keyframes visualShift5 {
    0%, 100% { filter: hue-rotate(0deg) brightness(1); }
    50% { filter: hue-rotate(-15deg) brightness(1.1); }
}

.gallery-tile:hover .tile-video {
    opacity: 1;
}

.tile-header {
    position: relative;
    z-index: 1;
}

.tile-body {
    position: relative;
    z-index: 1;
    flex: 1;
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    padding-bottom: 8px;
}

.tile-title {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 700;
    line-height: 1.15;
    color: #fff;
    text-shadow: 0 2px 12px rgba(0,0,0,0.8), 0 1px 3px rgba(0,0,0,0.9);
}

.tile-inner::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 16px;
    background: linear-gradient(to top, rgba(8,8,20,0.85) 0%, rgba(8,8,20,0.3) 40%, transparent 70%);
    z-index: 0;
    pointer-events: none;
}

.tile-inner::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 16px;
    background: radial-gradient(circle at var(--glare-x, 50%) var(--glare-y, 50%), rgba(255,255,255,0.12) 0%, transparent 60%);
    z-index: 2;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-tile:hover .tile-inner::before {
    opacity: 1;
}

.tile-glow {
    position: absolute;
    bottom: -30px;
    right: -30px;
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, var(--glow-color, #8b5cf6) 0%, transparent 70%);
    opacity: 0.12;
    filter: blur(30px);
    pointer-events: none;
    transition: opacity 0.5s;
}

.gallery-tile:hover .tile-glow {
    opacity: 0.3;
}

.tile-orb {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--orb-color, #8b5cf6) 0%, transparent 70%);
    opacity: 0.5;
    filter: blur(8px);
    pointer-events: none;
    z-index: 1;
    animation: orbPulse 3s ease-in-out infinite;
}

.gallery-tile:hover .tile-orb {
    opacity: 0.9;
    filter: blur(4px);
    transform: translateX(-50%) scale(1.3);
    transition: all 0.4s ease;
}

@keyframes orbPulse {
    0%, 100% { opacity: 0.4; transform: translateX(-50%) scale(1); }
    50% { opacity: 0.7; transform: translateX(-50%) scale(1.15); }
}

.gallery-tile-1 { animation: tileFloat1 6s ease-in-out infinite; }
.gallery-tile-2 { animation: tileFloat2 7s ease-in-out infinite; }
.gallery-tile-3 { animation: tileFloat3 8s ease-in-out infinite; }
.gallery-tile-4 { animation: tileFloat4 7.5s ease-in-out infinite; }
.gallery-tile-5 { animation: tileFloat5 6.5s ease-in-out infinite; }

@keyframes tileFloat1 {
    0%, 100% { transform: rotate(-8deg) translateZ(-20px) translateY(0); }
    50% { transform: rotate(-6deg) translateZ(-15px) translateY(-12px); }
}
@keyframes tileFloat2 {
    0%, 100% { transform: rotate(2deg) translateZ(30px) translateY(0); }
    50% { transform: rotate(4deg) translateZ(35px) translateY(-14px); }
}
@keyframes tileFloat3 {
    0%, 100% { transform: rotate(5deg) translateZ(10px) translateY(0); }
    50% { transform: rotate(3deg) translateZ(15px) translateY(-10px); }
}
@keyframes tileFloat4 {
    0%, 100% { transform: rotate(-3deg) translateZ(20px) translateY(0); }
    50% { transform: rotate(-5deg) translateZ(25px) translateY(-11px); }
}
@keyframes tileFloat5 {
    0%, 100% { transform: rotate(7deg) translateZ(-15px) translateY(0); }
    50% { transform: rotate(5deg) translateZ(-10px) translateY(-9px); }
}

.gallery-detail-panel {
    position: absolute;
    bottom: 8%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 4;
    width: 90%;
    max-width: 780px;
}

.gallery-detail-inner {
    display: flex;
    align-items: center;
    gap: 48px;
    background: linear-gradient(135deg, rgba(8, 8, 12, 0.8), rgba(5, 5, 10, 0.9));
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    padding: 36px 44px;
    box-shadow:
        0 0 1px rgba(255, 255, 255, 0.06),
        0 12px 40px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.03);
    transition: border-color 0.5s ease;
}

.gallery-detail-left {
    min-width: 220px;
}

.gallery-detail-category {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--accent-cyan);
    display: block;
    margin-bottom: 12px;
    transition: color 0.5s ease;
}

.gallery-detail-dot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--accent-cyan);
    opacity: 0.7;
    margin-bottom: 16px;
    animation: dotPulse 2s ease-in-out infinite;
    transition: background 0.5s ease;
}

.gallery-detail-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
    margin: 0;
}

.gallery-detail-right p {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    line-height: 1.7;
    margin: 0 0 20px 0;
    max-width: 300px;
}

.gallery-detail-cta {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-primary);
    text-decoration: none;
    padding: 12px 24px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.4s var(--ease-out-expo);
}

.gallery-detail-cta:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.3);
}

/* ============================================
   CONTACT PAGE SHAPES
   ============================================ */

.chapter-contact-page {
    position: relative;
}

.contact-shapes {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.contact-shape {
    position: absolute;
    opacity: 0;
    animation: contactFloat 25s ease-in-out infinite;
}

.cs-1 {
    width: 50px;
    height: 50px;
    border: 1px solid rgba(124, 58, 237, 0.2);
    top: 10%;
    left: 10%;
    transform: rotate(45deg);
    animation-delay: 0s;
}

.cs-2 {
    width: 35px;
    height: 35px;
    border: 1px solid rgba(6, 182, 212, 0.2);
    top: 20%;
    right: 15%;
    border-radius: 50%;
    animation-delay: -4s;
}

.cs-3 {
    width: 0;
    height: 0;
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    border-bottom: 35px solid rgba(245, 158, 11, 0.1);
    border-top: none;
    bottom: 25%;
    left: 8%;
    animation-delay: -8s;
}

.cs-4 {
    width: 40px;
    height: 40px;
    border: 1px solid rgba(236, 72, 153, 0.15);
    bottom: 15%;
    right: 10%;
    transform: rotate(60deg);
    animation-delay: -12s;
}

.cs-5 {
    width: 25px;
    height: 25px;
    border: 1px solid rgba(168, 85, 247, 0.2);
    top: 50%;
    left: 5%;
    animation-delay: -16s;
}

.cs-6 {
    width: 30px;
    height: 30px;
    border: 1px solid rgba(16, 185, 129, 0.15);
    top: 40%;
    right: 8%;
    clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
    animation-delay: -20s;
}

@keyframes contactFloat {
    0%, 100% {
        opacity: 0;
        transform: translateY(15px) rotate(0deg);
    }
    15% {
        opacity: 0.5;
    }
    50% {
        opacity: 0.7;
        transform: translateY(-25px) rotate(120deg);
    }
    85% {
        opacity: 0.5;
    }
}

/* ============================================
   CONTACT FORM
   ============================================ */

.chapter-contact {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.chapter-contact .chapter-subtitle {
    margin-left: auto;
    margin-right: auto;
}

.contact-form-wrapper {
    max-width: 740px;
    width: 100%;
    padding: var(--space-12);
    text-align: left;
    margin-top: var(--space-12);
    opacity: 0;
    transform: translateY(60px);
}

.form-glow {
    position: absolute;
    top: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gradient-hero);
    border-radius: 20px 20px 0 0;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-5);
    margin-bottom: var(--space-5);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.form-group.full {
    margin-bottom: var(--space-8);
}

.form-group label {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.form-group input,
.form-group select,
.form-group textarea {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 18px;
    font-family: var(--font-primary);
    font-size: var(--text-sm);
    color: var(--text-primary);
    transition: all 0.4s var(--ease-out-expo);
    outline: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1), 0 0 20px rgba(124, 58, 237, 0.05);
    background: rgba(255, 255, 255, 0.04);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
}

.form-group select {
    appearance: none;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23555' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
}

.form-group select option {
    background: var(--surface-2);
    color: var(--text-primary);
}

.form-group textarea {
    resize: vertical;
    min-height: 110px;
}

.submit-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
    background: var(--accent-primary);
    color: white;
    border: none;
    border-radius: 100px;
    padding: 16px 40px;
    font-family: var(--font-display);
    font-size: var(--text-sm);
    font-weight: 600;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: all 0.5s var(--ease-out-expo);
    position: relative;
    overflow: hidden;
}

.submit-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--accent-secondary), var(--accent-cyan));
    opacity: 0;
    transition: opacity 0.5s ease;
    border-radius: inherit;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(124, 58, 237, 0.4);
}

.submit-btn:hover::before {
    opacity: 1;
}

.submit-btn span,
.submit-btn svg {
    position: relative;
    z-index: 1;
}

.submit-btn svg {
    width: 16px;
    height: 16px;
    transition: transform 0.4s var(--ease-out-expo);
}

.submit-btn:hover svg {
    transform: translate(3px, -3px);
}

/* ============================================
   SCROLL INDICATOR
   ============================================ */

.scroll-indicator {
    position: absolute;
    bottom: var(--space-12);
    left: clamp(24px, 6vw, 100px);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-4);
    opacity: 0;
}

.scroll-line {
    width: 1px;
    height: 60px;
    background: linear-gradient(180deg, var(--accent-primary), transparent);
    animation: scrollLinePulse 2s ease-in-out infinite;
}

@keyframes scrollLinePulse {
    0%, 100% { opacity: 0.3; height: 60px; }
    50% { opacity: 1; height: 80px; }
}

.scroll-indicator span {
    font-family: var(--font-mono);
    font-size: 0.55rem;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--text-muted);
    text-shadow: 0 0 20px rgba(0,0,0,0.9);
}

/* ============================================
   FOOTER
   ============================================ */

.site-footer {
    margin-top: var(--space-16);
    padding-top: var(--space-10);
    border-top: 1px solid var(--border);
    width: 100%;
    max-width: 740px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: var(--space-10);
    margin-bottom: var(--space-10);
}

.footer-brand {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
}

.footer-brand-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: var(--space-4);
}

.footer-brand .logo-icon-img {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.footer-brand p {
    font-size: var(--text-sm);
    color: var(--text-muted);
    line-height: 1.6;
}

.footer-col h4 {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: var(--space-4);
}

.footer-col a {
    display: block;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: var(--text-sm);
    margin-bottom: var(--space-2);
    transition: color 0.3s ease;
}

.footer-col a:hover {
    color: var(--accent-primary);
}

.footer-bottom {
    padding-top: var(--space-6);
    border-top: 1px solid var(--border);
}

.footer-bottom p {
    font-size: var(--text-xs);
    color: var(--text-muted);
    text-align: center;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .forge-pipeline {
        grid-template-columns: repeat(2, 1fr);
    }

    .ecosystem-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: var(--space-8);
    }

    .gallery-tile {
        width: 200px;
        height: 260px;
    }
}

@media (max-width: 1024px) {
    .chapter {
        padding: clamp(60px, 8vh, 100px) clamp(24px, 5vw, 60px);
    }

    .nav-center {
        display: none;
    }

    .testimonials {
        max-width: 100%;
    }

    .testimonial-stats {
        flex-wrap: wrap;
        gap: var(--space-4);
        justify-content: center;
    }

    .ripple-orb-container {
        position: relative;
        top: auto;
        right: auto;
        width: 55%;
        height: 22vh;
        margin: 20px auto 0;
    }

    .neural-content {
        flex-direction: column;
        justify-content: center;
        text-align: center;
    }

    .neural-text {
        max-width: 100%;
    }

    /* ── SPHERE ── */
    #sphere-canvas {
        width: 450px;
        height: 450px;
    }

    .sphere-eye {
        width: 14px;
        height: 36px;
    }

    /* ── GALLERY ── */
    .gallery-panels-wrap {
        position: relative;
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
        padding: 0 20px;
        inset: auto;
        pointer-events: auto;
    }

    .gallery-tile {
        position: relative;
        width: 100%;
        height: auto;
        left: auto !important;
        top: auto !important;
        right: auto !important;
        transform: none !important;
        animation: none !important;
        margin-bottom: 0;
    }

    .gallery-tile-5 {
        grid-column: auto;
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    :root {
        --nav-height: 56px;
        --section-height: 100svh;
    }

    .chapter {
        padding: clamp(24px, 4vh, 60px) clamp(16px, 4vw, 32px);
        min-height: 100svh;
        min-height: 100dvh;
    }

    .chapter:first-child {
        min-height: 100svh;
        min-height: 100dvh;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .chapter:first-child .chapter-content {
        padding: 16px;
        width: 100%;
        max-width: 100%;
    }

    .chapter-title {
        font-size: clamp(1.8rem, 9vw, 3rem) !important;
    }

    .chapter:first-child .chapter-title {
        font-size: clamp(2rem, 9vw, 3rem) !important;
    }

    .chapter-subtitle {
        font-size: var(--text-sm);
    }

    #nav {
        padding: 0 12px;
    }

    .nav-logo {
        gap: 4px;
    }

    .logo-icon {
        width: 28px;
        height: 28px;
    }

    .logo-w {
        font-size: 1.2rem;
    }

    .logo-eb {
        font-size: 0.85rem;
    }

    .logo-accent {
        font-size: 0.45rem;
        display: none;
    }

    .nav-cta {
        font-size: 0.65rem;
        padding: 6px 14px;
    }

    .hero-title-line1,
    .hero-title-line2 {
        font-size: clamp(2rem, 10vw, 3.5rem);
    }

    .hero-subtitle {
        font-size: var(--text-sm);
        max-width: 100%;
        padding: 0 8px;
    }

    .hero-buttons {
        flex-direction: column;
        gap: 10px;
        width: 100%;
        padding: 0 4px;
    }

    .hero-btn {
        width: 100%;
        justify-content: center;
        padding: 14px 24px;
        font-size: 0.7rem;
    }

    /* ── SPHERE ── */
    #sphere-canvas {
        width: 280px;
        height: 280px;
    }

    .sphere-eye {
        width: 12px;
        height: 32px;
        border-radius: 6px;
    }

    .hero-badge {
        font-size: 10px;
        padding: 8px 16px;
        margin-bottom: 18px;
    }

    .scroll-indicator {
        display: none;
    }

    /* ── GPU ACCELERATION ── */
    .hero-title-line1,
    .hero-title-line2,
    .hero-badge,
    .hero-btn,
    .gallery-tile,
    .tile-visual-bg,
    .tile-inner,
    .pipeline-step,
    .portfolio-item {
        will-change: transform;
        transform: translateZ(0);
    }

    /* ── DISABLE HEAVY ANIMATIONS ── */
    .hero-title-line2 {
        animation: none;
        background-position: 0% 50%;
    }

    .hero-badge {
        animation: none;
        border-color: rgba(139, 92, 246, 0.6);
    }

    .logo-text-gradient {
        animation: none;
        background-position: 0% 50%;
    }

    .tile-visual-bg {
        animation: none;
    }

    .tile-orb {
        animation-duration: 6s !important;
    }

    /* ── PORTFOLIO ── */
    .portfolio-grid {
        grid-template-columns: 1fr;
        gap: var(--space-5);
        padding: 0 clamp(16px, 4vw, 32px);
    }

    .portfolio-image {
        height: 220px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-3);
    }

    .forge-pipeline {
        grid-template-columns: 1fr;
        gap: var(--space-4);
    }

    .pipeline-step {
        padding: var(--space-6) var(--space-5);
    }

    .ecosystem-grid {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    /* ── NEURAL SECTION ── */
    .neural-content {
        flex-direction: column;
        justify-content: center;
        text-align: center;
        gap: 30px;
    }

    .neural-text {
        max-width: 100%;
    }

    .ripple-orb-container {
        width: 50%;
        height: 20vh;
        position: relative;
        top: auto;
        right: auto;
        margin: 0 auto;
    }

    .orb-prompt {
        display: none;
    }

    /* ── GALLERY ── */
    .gallery-panels-wrap {
        position: relative;
        display: grid;
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 0 16px;
        inset: auto;
        pointer-events: auto;
    }

    .gallery-tile {
        position: relative;
        width: 100%;
        height: 280px;
        left: auto !important;
        top: auto !important;
        right: auto !important;
        transform: none !important;
        animation: none !important;
    }

    .tile-inner {
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
    }

    .gallery-tile-5 {
        filter: none;
    }

    .portfolio-overlay {
        opacity: 1 !important;
        background: rgba(0, 0, 0, 0.3) !important;
    }

    .view-project {
        opacity: 0.8 !important;
    }

    .glass-card {
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
    }

    .gallery-badge {
        font-size: 11px;
        letter-spacing: 0.3em;
    }

    .gallery-title {
        font-size: clamp(2rem, 8vw, 3rem);
    }

    .gallery-subtitle {
        font-size: var(--text-sm);
        padding: 0 16px;
    }

    .gallery-content {
        padding: 0 16px;
    }

    /* ── TESTIMONIALS ── */
    .testimonial {
        flex-direction: column;
        text-align: center;
        padding: var(--space-5);
        gap: var(--space-3);
    }

    .testimonial::before {
        left: 50%;
        top: 0;
        transform: translateX(-50%);
        width: 0;
        height: 3px;
    }

    .testimonial:hover::before {
        width: 60%;
    }

    .testimonial-author {
        justify-content: center;
    }

    .testimonial-stats {
        padding: var(--space-3);
        gap: var(--space-3);
    }

    .testimonial-stat-divider {
        display: none;
    }

    /* ── FOOTER ── */
    #scroll-progress {
        right: 8px;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: var(--space-6);
    }

    .pipeline-connector {
        display: none;
    }

    /* ── LOADER ── */
    .loader-gem-wrap {
        width: 80px;
        height: 80px;
    }

    .loader-bar-wrap {
        width: 140px;
    }

    /* ── CURSOR ── */
    #cursor-glow,
    #cursor-trail {
        display: none !important;
    }
}

@media (max-width: 480px) {
    .chapter-title {
        font-size: clamp(1.5rem, 8vw, 2.2rem) !important;
    }

    .hero-title-line1,
    .hero-title-line2 {
        font-size: clamp(1.7rem, 9vw, 2.6rem);
    }

    .hero-badge {
        font-size: 9px;
        padding: 6px 12px;
        margin-bottom: 14px;
    }

    .hero-subtitle {
        font-size: 12px;
        line-height: 1.5;
    }

    .hero-buttons {
        gap: 8px;
    }

    .hero-btn {
        padding: 12px 20px;
        font-size: 0.65rem;
    }

    /* ── SPHERE ── */
    #sphere-canvas {
        width: 220px;
        height: 220px;
    }

    .sphere-eye {
        width: 9px;
        height: 24px;
        border-radius: 5px;
    }

    /* ── PORTFOLIO ── */
    .portfolio-image {
        height: 180px;
    }

    /* ── GALLERY ── */
    .gallery-tile {
        height: 240px;
    }

    .gallery-title {
        font-size: clamp(1.6rem, 8vw, 2.2rem);
    }

    .tile-title {
        font-size: 16px;
    }

    .tile-tag {
        font-size: 7px;
    }

    .tile-orb {
        width: 30px;
        height: 30px;
    }

    /* ── STATS ── */
    .stats-grid {
        gap: 10px;
    }

    .stat-number {
        font-size: 1.4rem;
    }

    /* ── LOADER ── */
    .loader-gem-wrap {
        width: 56px;
        height: 56px;
    }

    .loader-bar-wrap {
        width: 120px;
    }

    /* ── CONTACT ── */
    .contact-form-wrap {
        padding: 16px;
    }

    /* ── CHAPTER META ── */
    .chapter-meta {
        margin-bottom: 12px;
    }

    .chapter-label {
        font-size: 9px;
    }

    .chapter-year {
        font-size: 9px;
    }
}

@media (hover: none) and (pointer: coarse) {
    [data-tilt],
    [data-tilt-card] {
        transform: none !important;
    }

    [data-tilt]:active,
    [data-tilt-card]:active {
        transform: scale(0.97) !important;
        transition: transform 0.1s ease;
    }

    .portfolio-item::before,
    .pipeline-step::before {
        display: none;
    }

    .portfolio-overlay {
        opacity: 1 !important;
        background: rgba(0, 0, 0, 0.3) !important;
    }

    .view-project {
        opacity: 0.7 !important;
    }

    .tile-orb {
        animation-duration: 4s;
    }

    .gallery-tile:hover .tile-inner {
        border-color: var(--tile-border);
    }

    .gallery-tile:active .tile-inner {
        border-color: var(--tile-border);
        box-shadow:
            0 0 2px var(--tile-border),
            0 0 40px rgba(0,0,0,0.4),
            inset 0 1px 0 rgba(255,255,255,0.08);
    }
}

@media (max-width: 768px) and (orientation: landscape) {
    .chapter-gallery {
        min-height: auto;
    }

    .gallery-content {
        padding-top: 2vh;
    }

    .ripple-orb-container {
        height: 22vh;
    }

    #sphere-canvas {
        width: 240px;
        height: 240px;
    }

    .sphere-eye {
        width: 10px;
        height: 26px;
    }

    .hero-badge {
        margin-bottom: 10px;
    }

    .chapter:first-child {
        padding-top: 60px;
        padding-bottom: 20px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .hero-title-line2 {
        animation: none;
    }

    .logo-text-gradient {
        animation: none;
    }

    .tile-visual-bg {
        animation: none;
    }

    .tile-orb {
        animation: none;
    }
}

@media print {
    #loader,
    #webgl-canvas,
    #neural-canvas,
    .ripple-orb-container,
    .chapter-bg-glow,
    .cursor-glow,
    .cursor-trail,
    #scroll-progress {
        display: none !important;
    }
}

/* ── VIDEO MODAL ── */
.video-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.video-modal.active {
    opacity: 1;
    visibility: visible;
}

.video-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.video-modal-content {
    position: relative;
    width: 90vw;
    max-width: 960px;
    border-radius: 16px;
    overflow: hidden;
    background: rgba(10, 10, 20, 0.95);
    border: 1px solid rgba(124, 58, 237, 0.3);
    box-shadow: 0 0 60px rgba(124, 58, 237, 0.25), 0 25px 80px rgba(0, 0, 0, 0.6);
    transform: scale(0.9) translateY(30px);
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.video-modal.active .video-modal-content {
    transform: scale(1) translateY(0);
}

.video-modal-player {
    display: block;
    width: 100%;
    max-height: 75vh;
    object-fit: contain;
    background: #000;
}

.video-modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    z-index: 10;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: background 0.25s, transform 0.25s;
}

.video-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.video-modal-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 40px 24px 20px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
    pointer-events: none;
}

.video-modal-category {
    display: inline-block;
    font-size: 10px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #a78bfa;
    margin-bottom: 6px;
}

.video-modal-title {
    font-size: 1.2rem;
    color: #fff;
    font-weight: 600;
}
