/**
 * E.E.D.A / LiebeBlack Ultra-Hub 2026 (SCALE -20% EXPANDED+)
 * 20% Reducción Global de Escala (13px Root) | Infinite Dark Gradient
 */

:root {
    --bg-base: #030305;
    --bg-subtle: #08080c;
    --bg-card: rgba(15, 15, 20, 0.6);

    --text-pure: #ffffff;
    --text-primary: #f8fafc;
    --text-muted: #94a3b8;

    --accent-cyan: #00f0ff;
    --accent-blue: #3b82f6;
    --accent-purple: #8b5cf6;
    --accent-magenta: #d946ef;
    --accent-green: #10b981;
    --accent-gold: #fbbf24;

    /* Color variables for light theme */
    --light-bg-primary: #ffffff;
    --light-bg-secondary: #f1f5f9;
    --light-bg-tertiary: #e2e8f0;
    --light-text-primary: #0f172a;
    --light-text-secondary: #1e293b;
    --light-text-muted: #475569;
    --light-text-tertiary: #334155;
    --light-border: #cbd5e1;
    --light-accent-cyan: #0284c7;
    --light-accent-blue: #2563eb;
    --light-accent-purple: #7c3aed;
    --light-accent-green: #059669;
    --light-accent-yellow: #d97706;

    --grad-primary: linear-gradient(135deg, var(--accent-blue), var(--accent-cyan));
    --grad-royal: linear-gradient(135deg, var(--accent-purple), var(--accent-magenta));
    --grad-aurora: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple), var(--accent-magenta), var(--accent-gold));
    --grad-matrix: linear-gradient(135deg, #064e3b, var(--accent-green));
    --grad-text: linear-gradient(to right, #ffffff, #a5b4fc, #e2e8f0);
    --grad-vivid: linear-gradient(90deg, #00f2fe 0%, #4facfe 100%);
    --grad-mesh: radial-gradient(at 20% 40%, rgba(139, 92, 246, 0.15) 0px, transparent 50%),
                 radial-gradient(at 80% 20%, rgba(6, 182, 212, 0.15) 0px, transparent 50%),
                 radial-gradient(at 10% 80%, rgba(217, 70, 239, 0.15) 0px, transparent 50%);

    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-highlight: rgba(255, 255, 255, 0.12);
    
    --shadow-base: 0 10px 30px -10px rgba(0,0,0,0.5);
    --shadow-premium: 0 20px 40px -10px rgba(0,0,0,0.7);
    --shadow-glow: 0 0 20px rgba(0, 240, 255, 0.2);

    --font-sans: 'Outfit', -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    --max-w: 1250px;
    --section-pad: 80px;
    --ease-elastic: 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    --ease-super-smooth: 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    --ease-fast: 0.15s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

body.light-theme {
    --bg-base: var(--light-bg-primary);
    --bg-subtle: var(--light-bg-secondary);
    --bg-card: rgba(255, 255, 255, 0.8);

    --text-pure: var(--light-text-primary);
    --text-primary: var(--light-text-secondary);
    --text-muted: var(--light-text-muted);

    --accent-cyan: var(--light-accent-cyan);
    --accent-blue: var(--light-accent-blue);
    --accent-purple: var(--light-accent-purple);
    --accent-magenta: #c026d3;
    --accent-green: var(--light-accent-green);
    --accent-gold: var(--light-accent-yellow);

    --glass-border: rgba(0, 0, 0, 0.1);
    --glass-highlight: rgba(0, 0, 0, 0.05);
    
    --shadow-base: 0 10px 30px -10px rgba(0,0,0,0.1);
    --shadow-premium: 0 20px 40px -10px rgba(0,0,0,0.15);
    --shadow-glow: 0 0 20px rgba(2, 132, 199, 0.15);
    
    --grad-text: linear-gradient(to right, var(--light-text-primary), #4338ca, #334155);
    background-color: var(--bg-base);
}

body.light-theme .deep-cosmos-bg {
    background: #eef2f6;
    background-image: 
        radial-gradient(at 0% 0%, rgba(240, 249, 255, 1) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(238, 242, 255, 1) 0px, transparent 50%);
}

body.light-theme .digital-grid {
    background-image:
        linear-gradient(rgba(0, 0, 0, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 0, 0, 0.04) 1px, transparent 1px);
    mask-image: linear-gradient(to bottom, white 5%, transparent 90%);
    -webkit-mask-image: linear-gradient(to bottom, white 5%, transparent 90%);
}

body.light-theme .orb {
    mix-blend-mode: multiply;
    opacity: 0.7;
    filter: blur(140px);
}

body.light-theme .nav-center {
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
}

body.light-theme .nav-center.scrolled {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.05);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

body.light-theme .section-glass-backing {
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: none;
    border: none;
}

body.light-theme .card-premium, 
body.light-theme .extreme-stats-bar, 
body.light-theme .mega-project-card,
body.light-theme .contact-glass {
    background: #ffffff;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.06);
}

body.light-theme .arch-node {
    background: #ffffff;
    border-color: rgba(2, 132, 199, 0.2);
    color: #1e293b;
    box-shadow: 0 10px 20px rgba(0,0,0,0.02);
}

body.light-theme .mega-project-card:hover {
    background: #f8fafc;
    border-color: rgba(2, 132, 199, 0.4);
    box-shadow: 0 15px 30px rgba(0,0,0,0.04);
}

body.light-theme .form-input,
body.light-theme .form-textarea,
body.light-theme input,
body.light-theme textarea,
body.light-theme select {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: #1e293b;
}

body.light-theme .form-input:focus,
body.light-theme .form-textarea:focus,
body.light-theme input:focus,
body.light-theme textarea:focus,
body.light-theme select:focus {
    border-color: #0284c7;
    background: #ffffff;
    box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.1);
}

body.light-theme .form-input::placeholder,
body.light-theme .form-textarea::placeholder,
body.light-theme input::placeholder,
body.light-theme textarea::placeholder {
    color: #94a3b8;
}

body.light-theme .card-premium h4,
body.light-theme .p-title {
    color: var(--text-pure);
    text-shadow: none;
}

body.light-theme .card-icon {
    background: linear-gradient(135deg, rgba(2, 132, 199, 0.1), rgba(2, 132, 199, 0.02));
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.8), 0 10px 20px rgba(2, 132, 199, 0.05);
}

body.light-theme .card-premium:hover {
    box-shadow: 0 40px 80px -20px rgba(0,0,0,0.1), 0 0 40px rgba(2, 132, 199, 0.05);
}

body.light-theme .btn-void {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(2, 132, 199, 0.3);
    color: #1e293b;
}

body.light-theme .btn-void:hover {
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    color: #0284c7;
    border-color: rgba(2, 132, 199, 0.6);
}

body.light-theme .btn-cyber {
    background: rgba(2, 132, 199, 0.05);
    color: #0284c7;
    border-color: rgba(2, 132, 199, 0.3);
    box-shadow: inset 0 0 15px rgba(2, 132, 199, 0.05);
}

body.light-theme .btn-cyber:hover {
    background: rgba(2, 132, 199, 0.15);
    color: #0f172a;
    border-color: #0284c7;
    box-shadow: 0 0 25px rgba(2, 132, 199, 0.2), inset 0 0 10px rgba(2, 132, 199, 0.1);
}

body.light-theme .terminal-window {
    background: #f1f5f9;
    border-color: #cbd5e1;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

body.light-theme .term-header {
    background: #e2e8f0;
    border-bottom-color: #cbd5e1;
}

body.light-theme .term-body {
    color: #334155;
}

body.light-theme .term-success { color: #059669; }
body.light-theme .term-info { color: #0284c7; }
body.light-theme .term-warn { color: #d97706; }
body.light-theme .term-path { color: #7c3aed; }

body.light-theme .stack-pill {
    background: rgba(255, 255, 255, 0.6);
}

body.light-theme .stack-pill:hover {
    background: rgba(2, 132, 199, 0.05);
}

body.light-theme .preloader-overlay {
    background: #f8fafc;
}

body.light-theme .loader-percentage {
    color: #0f172a !important;
    text-shadow: 0 0 25px rgba(2, 132, 199, 0.3);
}

body.light-theme .mega-project-card p {
    color: #475569;
    text-shadow: none;
}

body.light-theme .loader-logs {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(2, 132, 199, 0.4);
    box-shadow: inset 0 0 20px rgba(0,0,0,0.05), 0 0 15px rgba(2, 132, 199, 0.1);
    color: #334155;
}

/* FIX TÍTULOS BLANCOS / INVISIBLES EN MODO CLARO */
body.light-theme h1,
body.light-theme h2,
body.light-theme h3,
body.light-theme h4,
body.light-theme h5,
body.light-theme h6,
body.light-theme .mega-title-extreme,
body.light-theme .s-title,
body.light-theme .time-title,
body.light-theme .a-title,
body.light-theme .f-logo,
body.light-theme .loader-logo,
body.light-theme .p-title {
    color: var(--text-pure);
    text-shadow: none !important;
}

body.light-theme .gradient-text-anim {
    background: linear-gradient(270deg, var(--text-pure), var(--accent-blue), var(--accent-cyan), var(--text-pure));
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: none !important;
}

body.light-theme .s-subtitle,
body.light-theme .a-sub,
body.light-theme .f-moto {
    color: var(--accent-blue);
    text-shadow: none;
}

body.light-theme .term-path {
    color: var(--accent-purple);
}

body.light-theme .log-line.info { color: #1e293b; }
body.light-theme .log-line.success { color: #059669; text-shadow: none; }
body.light-theme .log-line.warn { color: #d97706; text-shadow: none; }

body.light-theme .loader-scan {
    background: linear-gradient(to bottom, transparent, rgba(2, 132, 199, 0.2), transparent);
}

body.light-theme .loader-logo {
    color: #0f172a;
    text-shadow: 0 0 20px rgba(2, 132, 199, 0.3);
}

body.light-theme .loader-status {
    color: #0284c7;
}

body.light-theme .loader-bar-wrap {
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(2, 132, 199, 0.2);
}

body.light-theme .loader-terminal-detailed {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(2, 132, 199, 0.4);
    color: #1e293b !important;
}

body.light-theme .loader-status-min {
    color: #0284c7 !important;
}

body.light-theme .loader-ring.r1 {
    border-top-color: #0284c7;
}

body.light-theme .loader-ring.r2 {
    border-right-color: #2563eb;
}

body.light-theme .mobile-tab-bar {
    background: rgba(255, 255, 255, 0.95);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 -5px 30px rgba(0, 0, 0, 0.05);
}

body.light-theme .mobile-tab-item {
    color: rgba(15, 23, 42, 0.5);
}

body.light-theme .mobile-tab-item.tab-active {
    color: #0284c7;
}

body.light-theme .nav-links {
    background: rgba(255, 255, 255, 0.98);
}

body.light-theme .nav-toggle {
    color: var(--text-pure);
}

.theme-toggle-btn {
    background: transparent;
    border: none;
    color: var(--text-pure);
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    transition: var(--ease-fast);
}

.theme-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

body.light-theme .theme-toggle-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    cursor: default;
    user-select: none !important; /* Disable text selection */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
}

[data-aos] {
    opacity: 1 !important;
    transform: none !important;
    visibility: visible !important;
    transition: none !important;
}

.hardware-accel {
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
    perspective: 1000px;
}

/* REDUCCIÓN DE ESCALA GLOBAL '640P' PERFORMANCE */
html {
    font-size: 14.5px; /* Reducción del 10% aproximada para mayor densidad */
    scroll-behavior: smooth;
    background-color: var(--bg-deep);
    color: var(--text-primary);
    overflow-x: hidden;
}

@media (max-width: 1024px) {
    html { font-size: 13.5px; }
}

@media (max-width: 768px) {
    html { font-size: 12.5px; }
}

body.ultra-dark {
    font-family: var(--font-sans);
    color: var(--text-primary);
    line-height: 1.8;
    position: relative;
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

/* =========================================================
   BACKGROUNDS (VIVID COSMOS)
   ========================================================= */
.deep-cosmos-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -10;
    background: var(--bg-base);
    background-image: var(--grad-mesh);
    overflow: hidden;
}

.noise-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -9;
    opacity: 0.02;
    pointer-events: none;
    background: transparent;
    mix-blend-mode: overlay;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.5;
    mix-blend-mode: screen;
    will-change: transform;
    pointer-events: none;
}

.orb-1 {
    width: 55vw;
    height: 55vw;
    min-width: 600px;
    min-height: 600px;
    background: radial-gradient(circle at center, var(--accent-blue) 0%, transparent 65%);
    top: -15%;
    left: -10%;
    animation: floatUltraSmooth 25s ease-in-out infinite alternate;
}

.orb-2 {
    width: 45vw;
    height: 45vw;
    min-width: 500px;
    min-height: 500px;
    background: radial-gradient(circle at center, var(--accent-purple) 0%, transparent 65%);
    bottom: -10%;
    right: -10%;
    animation: floatUltraSmooth 28s ease-in-out infinite alternate-reverse;
}

.orb-3 {
    width: 40vw;
    height: 40vw;
    min-width: 400px;
    min-height: 400px;
    background: radial-gradient(circle at center, var(--accent-magenta) 0%, transparent 65%);
    top: 30%;
    left: 20%;
    animation: floatUltraSmooth 32s ease-in-out infinite alternate;
}

.orb-4 {
    width: 35vw;
    height: 35vw;
    min-width: 300px;
    min-height: 300px;
    background: radial-gradient(circle at center, var(--accent-cyan) 0%, transparent 65%);
    top: 50%;
    right: 15%;
    animation: floatUltraSmooth 22s ease-in-out infinite alternate-reverse;
}

@keyframes floatUltraSmooth {
    0% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(6vw, 6vh) scale(1.08); }
    66% { transform: translate(-4vw, 8vh) scale(0.92); }
    100% { transform: translate(0, 0) scale(1); }
}

.digital-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -8;
    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: 50px 50px;
    opacity: 1;
    pointer-events: none;
    mask-image: linear-gradient(to bottom, black 10%, transparent 80%);
    -webkit-mask-image: linear-gradient(to bottom, black 10%, transparent 80%);
}

/* =========================================================
   BASE UTILITIES
   ========================================================= */
.container {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 5%;
    content-visibility: auto;
    contain-intrinsic-size: 1px 1000px;
}

.text-center {
    text-align: center;
}

.mt-small {
    margin-top: 1.5rem;
}

.mt-medium {
    margin-top: 3rem;
}

.mt-large {
    margin-top: 6rem;
}

.mb-12 {
    margin-bottom: 12rem;
}

/* Form Styles */
.form-input,
.form-textarea {
    width: 100%;
    margin-bottom: 25px;
    padding: 18px 25px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #fff;
    font-family: var(--font-sans);
    outline: none;
    transition: 0.4s ease;
    text-align: left !important;
}

.form-input:focus,
.form-textarea:focus {
    border-color: var(--accent-cyan);
    background: rgba(0, 255, 242, 0.05);
    transform: translateY(-3px);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

/* Missing utility classes from pages */
.flex-center {
    display: flex;
    justify-content: center;
    align-items: center;
}

.flex-col {
    flex-direction: column;
}

.gap-2 {
    gap: 0.5rem;
}

.transition-colors {
    transition: color 0.3s ease;
}

.hover\:text-cyan:hover {
    color: var(--accent-cyan);
}

.hover\:text-purple:hover {
    color: var(--accent-purple);
}

.opacity-50 {
    opacity: 0.5;
}

.cursor-not-allowed {
    cursor: not-allowed !important;
}

.text-xs {
    font-size: 0.75rem;
}

.font-mono {
    font-family: var(--font-mono);
}

.uppercase {
    text-transform: uppercase;
}

.tracking-widest {
    letter-spacing: 0.25em;
}

/* Removed Redundant Base Utilities */

h1,
h2,
h3,
h4,
h5,
p,
span,
a,
li {
    text-align: center !important;
}

p {
    font-size: 1.25rem;
    color: var(--text-muted);
    line-height: 1.9;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

strong {
    color: var(--accent-cyan);
    font-weight: 700;
}

.section-glass-backing {
    background: linear-gradient(180deg, rgba(15, 15, 20, 0.4) 0%, rgba(5, 5, 10, 0.6) 100%);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 40px 100px -20px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255,255,255,0.05);
    padding: 3.5rem 3rem;
    border-radius: 32px;
}

.gradient-text-anim {
    background: linear-gradient(270deg, var(--text-pure), var(--accent-cyan), var(--accent-purple), var(--text-pure));
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: textGradientPan 8s linear infinite;
}

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

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

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

/* =========================================================
   NAVIGATION
   ========================================================= */
.nav-center {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 96%;
    max-width: 950px;
    z-index: 1000;
    background: rgba(10, 10, 15, 0.3);
    border-radius: 100px;
    border: 1px solid transparent;
    padding: 12px 25px;
    transition: all var(--ease-super-smooth);
}

.nav-center.scrolled {
    padding: 10px 25px;
    background: rgba(10, 10, 15, 0.65);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-color: var(--glass-highlight);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255,255,255,0.05);
    width: 98%;
    max-width: 1000px;
}

.nav-wrap {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo-text {
    font-size: 1.6rem;
    letter-spacing: 0.15em;
    font-weight: 900;
    text-decoration: none;
    z-index: 10001;
    position: relative;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav-links a {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-muted);
    transition: color 0.3s ease;
    position: relative;
    padding-bottom: 4px;
    text-decoration: none;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 100%;
    height: 2px;
    background: var(--accent-cyan);
    transition: transform 0.3s ease;
}

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

.nav-links a:hover::after,
.nav-links a.active::after {
    transform: translateX(-50%) scaleX(1);
}

/* Hamburger Menu */
.nav-toggle {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-pure);
    cursor: pointer;
    z-index: 10001;
    position: relative;
    padding: 10px;
}

/* Mobile nav styles moved to responsive section below */

/* =========================================================
   BUTTONS
   ========================================================= */
.action-cluster {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-extreme {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px 42px;
    border-radius: 100px;
    font-weight: 700;
    font-size: 0.95rem;
    position: relative;
    overflow: hidden;
    transition: all var(--ease-super-smooth);
    cursor: pointer;
    border: 1px solid transparent;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    z-index: 1;
}

.btn-cyber {
    background: rgba(0, 240, 255, 0.05);
    color: var(--accent-cyan);
    border: 1px solid rgba(0,240,255,0.3);
    box-shadow: inset 0 0 20px rgba(0,240,255,0.05);
}

.btn-cyber:hover {
    background: rgba(0, 240, 255, 0.15);
    color: #fff;
    border-color: var(--accent-cyan);
    box-shadow: 0 0 30px rgba(0, 240, 255, 0.4), inset 0 0 20px rgba(0, 240, 255, 0.2);
    transform: translateY(-3px) scale(1.02);
}

.btn-royal {
    background: var(--grad-royal);
    color: var(--text-pure);
    box-shadow: 0 10px 25px rgba(180, 0, 251, 0.3), inset 0 1px 0 rgba(255,255,255,0.2);
}

.btn-royal:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 20px 40px rgba(180, 0, 251, 0.5), inset 0 1px 0 rgba(255,255,255,0.4);
    filter: brightness(1.1);
}

.btn-void {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--glass-highlight);
    backdrop-filter: blur(10px);
}

.btn-void:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-pure);
    border-color: rgba(255,255,255,0.3);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

/* =========================================================
   PRELOADER & INTERFACE
   ========================================================= */
/* PRELOADER STYLES (Ultra-Vivid Modern Engine 5.0 - Void Architecture) */
/* Preloader Moved to End for Priority */

@keyframes coreEntrance { from { transform: scale(0.7); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes rotateCW { to { transform: rotate(360deg); } }
@keyframes rotateCCW { to { transform: rotate(-360deg); } }

.loader-bar { 
    width: 0%; height: 100%; border-radius: 20px;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-cyan), var(--accent-purple));
    background-size: 200% 100%;
    box-shadow: 0 0 30px var(--accent-cyan); 
    transition: width 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    animation: gradientFlow 2s linear infinite; 
}

.loader-logs { 
    font-family: var(--font-mono); font-size: 0.8rem; text-align: left; 
    height: 190px; overflow-y: auto; overflow-x: hidden;
    display: flex; flex-direction: column; gap: 4px; color: rgba(255, 255, 255, 0.85); 
    background: rgba(0, 5, 12, 0.95); padding: 20px; border-radius: 12px;
    border: 1px solid rgba(0, 255, 242, 0.4);
    position: relative; box-shadow: inset 0 0 30px #000, 0 0 15px rgba(0, 255, 242, 0.1);
    scrollbar-width: thin; scrollbar-color: var(--accent-cyan) transparent;
    animation: terminalPulse 4s infinite alternate;
}

@keyframes terminalPulse {
    0% { border-color: rgba(0, 255, 242, 0.3); box-shadow: 0 0 10px rgba(0, 255, 242, 0.1); }
    100% { border-color: rgba(0, 255, 242, 0.6); box-shadow: 0 0 25px rgba(0, 255, 242, 0.2); }
}

.loader-logs::-webkit-scrollbar { width: 4px; }
.loader-logs::-webkit-scrollbar-thumb { background: var(--accent-cyan); border-radius: 10px; }

/* Internal Scanlines for Terminal */
.loader-logs::before {
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(rgba(0,0,0,0) 50%, rgba(0,255,242,0.02) 50%);
    background-size: 100% 4px; z-index: 10; pointer-events: none;
}

.loader-logs::after {
    content: "TERMINAL OPERATIVA v4.1 | CORE ENGINE"; position: absolute; top: 8px; right: 12px;
    font-size: 0.6rem; color: var(--accent-cyan); opacity: 0.3; letter-spacing: 1px;
}

.log-line { 
    display: flex; align-items: flex-start; gap: 12px;
    opacity: 0; transform: translateY(10px);
    animation: logAppear 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    white-space: pre-wrap; word-break: break-all;
    font-weight: 700; border-left: 4px solid transparent; padding-left: 15px;
    margin-bottom: 6px; line-height: 1.5; font-size: 0.85rem;
    position: relative; z-index: 50; /* Ensure it's above everything */
}

.log-line.info { color: #fff; border-left-color: var(--accent-cyan); }
.log-line.success { color: #00ffa2; border-left-color: #00ffa2; text-shadow: 0 0 20px rgba(0, 255, 162, 0.5); }
.log-line.warn { color: #ffeb3b; border-left-color: #ffeb3b; text-shadow: 0 0 10px rgba(255, 235, 59, 0.4); }

@keyframes dataRain { 0% { transform: translateY(-50%); } 100% { transform: translateY(0); } }
@keyframes logAppear { to { transform: translateY(0); opacity: 1; } }

/* SECONDARY PRELOADER ENGINE (Subpages) */
.loader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 500px;
    z-index: 100;
}

.loader-scan {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 20%;
    background: linear-gradient(to bottom, transparent, rgba(0, 255, 242, 0.2), transparent);
    animation: sweepScan 3s linear infinite;
    pointer-events: none;
    z-index: 50;
}

@keyframes sweepScan {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(500%); }
}

.loader-logo {
    font-size: 2.5rem;
    font-weight: 900;
    letter-spacing: 0.3em;
    color: #fff;
    margin-bottom: 20px;
    text-shadow: 0 0 30px rgba(0, 255, 242, 0.6);
}

.loader-status-wrap {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    width: 100%;
    margin-bottom: 10px;
}

.loader-status {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--accent-cyan);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.loader-bar-wrap {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(0, 255, 242, 0.3);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 30px;
}
@keyframes contentInitial { from { transform: scale(0.9) rotateX(20deg); opacity: 0; } to { transform: scale(1) rotateX(10deg); opacity: 1; } }
@keyframes glitchLogo { 0% { opacity: 0.8; transform: translate(2px, -1px); } 50% { opacity: 0.5; transform: translate(-2px, 1px); } 100% { opacity: 0.8; transform: translate(1px, 2px); } }

@keyframes gradientFlow { 0% { background-position: 0% 50%; } 100% { background-position: 100% 50%; } }
@keyframes logSlideIn { from { transform: translateX(-20px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

@keyframes glitchStatic {
    0% { clip: rect(44px, 9999px, 56px, 0); transform: skew(0.5deg); opacity: 1; }
    5% { clip: rect(12px, 9999px, 90px, 0); transform: skew(0.3deg); color: var(--accent-magenta); }
    10% { clip: rect(70px, 9999px, 12px, 0); transform: skew(0.8deg); opacity: 0.8; }
    15% { clip: rect(0, 0, 0, 0); }
    80% { clip: rect(0, 0, 0, 0); }
    85% { transform: scale(1.05); color: var(--accent-blue); opacity: 0.5; }
    100% { clip: rect(0, 0, 0, 0); }
}

.section-center {
    padding: var(--section-pad) 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.mega-hero {
    min-height: 100vh;
    padding-top: 200px;
}

.hero-badge-glowing {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 10px 24px;
    background: linear-gradient(90deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
    border: 1px solid var(--glass-border);
    border-radius: 100px;
    font-family: var(--font-mono);
    font-size: 0.95rem;
    color: var(--text-pure);
    margin-bottom: 3rem;
    box-shadow: 0 0 25px rgba(255, 255, 255, 0.05), inset 0 1px 0 rgba(255,255,255,0.1);
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-8px); }
    100% { transform: translateY(0px); }
}

.mega-title-extreme {
    font-size: clamp(3.2rem, 7vw, 5.8rem);
    font-weight: 900;
    line-height: 1.05;
    letter-spacing: -0.04em;
    margin-bottom: 2rem;
    text-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.mega-subtitle-extreme {
    font-size: 1.35rem;
    color: var(--text-muted);
    max-width: 750px;
    margin: 0 auto 3.5rem;
    line-height: 1.8;
    text-align: center;
    font-weight: 400;
}

.v-icon {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 2rem;
    background: var(--bg-card);
    border: 1px solid var(--glass-highlight);
    position: relative;
    overflow: hidden;
}

.v-icon i {
    width: 30px;
    height: 30px;
    position: relative;
    z-index: 2;
}

.v-icon::before {
    content: '';
    position: absolute;
    width: 150%;
    height: 150%;
    background: var(--grad-primary);
    animation: rotateGrad 4s linear infinite;
    opacity: 0.2;
    z-index: 0;
}

.v-icon.purple i {
    color: var(--accent-purple);
}

.v-icon.purple::before {
    background: var(--grad-royal);
}

.v-icon.green i {
    color: var(--accent-green);
}

.v-icon.green::before {
    background: var(--grad-matrix);
}

.v-icon.blue i {
    color: var(--accent-blue);
}

.v-icon.blue::before {
    background: var(--grad-primary);
}

.v-icon.cyan i {
    color: var(--accent-cyan);
}

.v-icon.cyan::before {
    background: var(--grad-vivid);
}

.v-icon.gold i {
    color: var(--accent-gold);
}

.v-icon.gold::before {
    background: var(--accent-gold);
}

.s-title {
    font-size: clamp(2.8rem, 5vw, 4rem);
    margin-bottom: 1rem;
    letter-spacing: -0.03em;
}

.s-subtitle {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    color: var(--accent-cyan);
    text-transform: uppercase;
    letter-spacing: 0.25em;
    margin-bottom: 3rem;
}

.s-paragraph {
    max-width: 950px;
    margin: 0 auto;
    text-align: center;
    font-size: 1.35rem;
    color: var(--text-primary);
    line-height: 1.9;
}

/* =========================================================
   GRIDS & MODULES
   ========================================================= */
.extreme-stats-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 60px;
    margin-top: 5rem;
    width: 100%;
    padding: 40px 30px;
    background: linear-gradient(135deg, rgba(20,20,30,0.5), rgba(5,5,10,0.8));
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    box-shadow: var(--shadow-base), inset 0 1px 0 rgba(255,255,255,0.05);
}

.e-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.e-number {
    font-size: 3.5rem;
    font-weight: 900;
    font-family: var(--font-mono);
    color: var(--text-pure);
    background: var(--grad-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.e-label {
    font-size: 1rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-top: 5px;
}

.grid-immense {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(380px, 100%), 1fr));
    gap: 40px;
    width: 100%;
    margin: 4rem auto 0;
    align-items: stretch;
}

@media (max-width: 768px) {
    .grid-immense {
        grid-template-columns: 1fr;
    }
}

.card-premium {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 2.5rem;
    transition: var(--ease-super-smooth);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.card-premium::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top right, rgba(0, 255, 242, 0.1), transparent 70%);
    z-index: -1;
    pointer-events: none;
    opacity: 0;
    transition: opacity var(--ease-super-smooth);
}

.card-premium:hover::before {
    opacity: 1;
}

.card-premium:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 40px 80px -20px rgba(0,0,0,0.8), 0 0 40px rgba(0, 240, 255, 0.1);
}

.card-icon {
    width: 65px;
    height: 65px;
    margin: 0 auto 30px;
    color: var(--text-pure);
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, rgba(0, 255, 242, 0.2), rgba(0, 255, 242, 0.05));
    border: 1px solid rgba(0, 255, 242, 0.3);
    border-radius: 18px;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.2), 0 10px 20px rgba(0, 255, 242, 0.15);
}

.card-icon i {
    width: 32px;
    height: 32px;
    filter: drop-shadow(0 0 10px rgba(0, 255, 242, 0.8));
}

.card-premium h4 {
    font-size: 1.7rem;
    margin-bottom: 20px;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.card-premium p {
    font-size: 1.15rem;
    color: var(--text-muted);
    line-height: 1.8;
    margin-bottom: 0;
    text-align: justify;
    text-align-last: center;
}

/* Terminal Mockup */
.terminal-window {
    width: 100%;
    max-width: 950px;
    margin: 4rem auto 0;
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 10px;
    overflow: hidden;
    text-align: left;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8);
}

.term-header {
    background: #161b22;
    padding: 12px 18px;
    border-bottom: 1px solid #30363d;
    display: flex;
    gap: 8px;
}

.term-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.term-dot.r {
    background: #ff5f56;
}

.term-dot.y {
    background: #ffbd2e;
}

.term-dot.g {
    background: #27c93f;
}

.term-body {
    padding: 30px;
    font-family: var(--font-mono);
    font-size: 1.05rem;
    color: #c9d1d9;
    line-height: 1.6;
    overflow-x: auto;
}

.term-success {
    color: #56d364;
}

.term-info {
    color: #58a6ff;
}

.term-warn {
    color: #e3b341;
}

.term-path {
    color: #d2a8ff;
}

/* Diagram Box (CSS Architecture) */
.arch-diagram {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 25px;
    margin: 4rem auto 0;
    width: 100%;
    max-width: 950px;
    padding: 40px;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
}

.arch-nodes {
    display: flex;
    justify-content: space-between;
    width: 100%;
    gap: 20px;
    position: relative;
}

.arch-node {
    flex: 1;
    padding: 25px;
    background: #000;
    border: 1px solid var(--accent-cyan);
    border-radius: 14px;
    text-align: center;
    font-weight: 600;
    font-size: 1.1rem;
}

.arch-node i {
    display: block;
    margin: 0 auto 10px;
    color: var(--accent-cyan);
    width: 28px;
    height: 28px;
}

.arch-nodes::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 10%;
    width: 80%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-cyan), transparent);
    z-index: -1;
    transform: translateY(-50%);
    opacity: 0.5;
}

/* Timeline CSS */
.timeline-container {
    width: 100%;
    max-width: 800px;
    margin: 5rem auto 0;
    position: relative;
    border-left: 2px solid var(--glass-highlight);
    padding-left: 40px;
}

.time-node {
    position: relative;
    margin-bottom: 50px;
    text-align: left;
}

.time-node::before {
    content: '';
    position: absolute;
    left: -46px;
    top: 0;
    width: 12px;
    height: 12px;
    background: var(--accent-cyan);
    border-radius: 50%;
    box-shadow: 0 0 15px var(--accent-cyan);
}

.time-date {
    font-family: var(--font-mono);
    font-size: 1rem;
    color: var(--accent-purple);
    margin-bottom: 10px;
    display: block;
}

.time-title {
    font-size: 1.6rem;
    margin-bottom: 10px;
}

.time-desc {
    font-size: 1.15rem;
    color: var(--text-muted);
    line-height: 1.7;
}

/* Project Hub Matrix */
.project-immense-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(350px, 100%), 1fr));
    gap: 40px;
    width: 100%;
    margin-top: 6rem;
    align-items: stretch;
}

.section-glass-backing {
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: none;
    box-shadow: none;
    width: 100%;
}

.mega-project-card {
    display: flex;
    flex-direction: column;
    text-align: left;
    padding: 25px;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    transition: var(--ease-elastic);
    cursor: pointer;
    transition: var(--ease-elastic);
}

.contact-glass {
    background: var(--bg-card);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-radius: 30px;
    border: 1px solid var(--glass-border);
    padding: 50px;
    max-width: 900px;
    margin: 0 auto;
}

.mega-project-card:hover {
    background: #000;
    border-color: var(--accent-cyan);
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 240, 255, 0.1);
}

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

.p-title {
    font-size: 1.6rem;
    font-weight: 900;
    color: #fff;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.p-icon {
    width: 50px;
    height: 50px;
    background: rgba(0, 240, 255, 0.15);
    color: var(--accent-cyan);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mega-project-card p {
    font-size: 1.15rem;
    color: #cbd5e1;
    text-align: left !important;
    line-height: 1.7;
    text-shadow: 0 1px 5px rgba(0, 0, 0, 0.8);
}

.p-tags {
    display: flex;
    gap: 12px;
    margin-top: 25px;
    flex-wrap: wrap;
}

.p-tag {
    padding: 6px 16px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--accent-cyan);
    background: rgba(0, 255, 242, 0.08);
    border-radius: 20px;
    border: 1px solid rgba(0, 255, 242, 0.2);
}

/* Stack Matrix */
.stack-matrix {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-top: 4rem;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.stack-pill {
    padding: 15px 25px;
    border: 1px solid var(--glass-highlight);
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.02);
    font-size: 1.15rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: var(--ease-fast);
}

.stack-pill:hover {
    border-color: var(--accent-cyan);
    background: rgba(0, 240, 255, 0.05);
    transform: translateY(-5px);
    color: var(--text-pure);
}

.stack-pill i {
    color: var(--accent-purple);
}

/* Author Box */
.author-void {
    padding: 70px 40px;
    margin-top: 4rem;
    text-align: center;
    border: 1px solid var(--glass-highlight);
    border-radius: 25px;
    position: relative;
    overflow: hidden;
}

.author-void::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 8px;
    background: var(--grad-royal);
}

.a-avatar {
    width: 90px;
    height: 90px;
    margin: 0 auto 25px;
    background: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 40px rgba(255, 255, 255, 0.5);
}

.a-avatar i {
    width: 40px;
    height: 40px;
    color: #000;
}

.a-title {
    font-size: 3.5rem;
    letter-spacing: -0.05em;
    margin-bottom: 10px;
}

.a-sub {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    color: var(--accent-purple);
    text-transform: uppercase;
    margin-bottom: 25px;
    letter-spacing: 0.1em;
}

.a-bio {
    font-size: 1.35rem;
    max-width: 900px;
    margin: 0 auto;
    color: var(--text-muted);
    text-align: justify;
    text-align-last: center;
    line-height: 1.8;
}

/* Mega Footer */
.mega-footer {
    padding: 100px 0 50px;
    background: transparent;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    text-align: center;
    position: relative;
    z-index: 10;
}

.f-logo {
    font-size: 2.5rem;
    font-weight: 900;
    letter-spacing: 0.2em;
    margin-bottom: 15px;
}

.f-moto {
    font-family: var(--font-mono);
    font-size: 1rem;
    color: var(--accent-cyan);
    text-transform: uppercase;
    letter-spacing: 0.3em;
    margin-bottom: 50px;
}

.f-links {
    display: flex;
    justify-content: center;
    gap: 25px;
    flex-wrap: wrap;
    margin-bottom: 50px;
}

.f-links a {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: color var(--ease-fast);
}

.f-links a:hover {
    color: var(--accent-cyan);
}

.f-copy {
    font-size: 0.95rem;
    color: #475569;
    max-width: 650px;
    margin: 0 auto;
    line-height: 2;
}

/* Scroll Animaciones Minimalistas */
.reveal-up {
    opacity: 0;
    transform: translateY(60px) scale(0.97);
    transition: all 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-fade {
    opacity: 0;
    filter: blur(8px);
    transition: all 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-left {
    opacity: 0;
    transform: translateX(-60px);
    transition: all 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-right {
    opacity: 0;
    transform: translateX(60px);
    transition: all 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.delay-1 {
    transition-delay: 0.1s;
}

.delay-2 {
    transition-delay: 0.2s;
}

.delay-3 {
    transition-delay: 0.3s;
}

.reveal-up.active,
.reveal-left.active,
.reveal-right.active {
    opacity: 1;
    transform: translate(0, 0) scale(1);
}

.reveal-fade.active {
    opacity: 1;
    filter: blur(0px);
}

/* =========================================================
   RESPONSIVE DESIGN - COMPLETE MOBILE/TABLET FIX
   ========================================================= */

/* --- TABLET (max 1024px) --- */
@media (max-width: 1024px) {

    .grid-immense,
    .project-immense-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }

    .arch-nodes {
        flex-direction: column;
        gap: 15px;
    }

    .arch-nodes::after {
        display: none;
    }

    .extreme-stats-bar {
        flex-direction: column;
        gap: 30px;
        padding: 30px 20px;
    }

    .mega-hero {
        padding-top: 150px;
        min-height: auto;
    }

    .orb-1 { width: 350px; height: 350px; }
    .orb-2 { width: 300px; height: 300px; }
    .orb-3 { width: 200px; height: 200px; }
    .orb-4 { width: 130px; height: 130px; }

    .terminal-window {
        max-width: 100%;
    }

    .term-header span {
        display: none;
    }

    .arch-diagram {
        padding: 25px 15px;
    }

    .author-void {
        padding: 40px 25px;
    }

    .a-title {
        font-size: 2.5rem;
    }

    .stack-matrix {
        gap: 10px;
    }

    .stack-pill {
        padding: 12px 18px;
        font-size: 1rem;
    }
}

/* --- MOBILE (max 768px) --- */
@media (max-width: 768px) {

    /* Force proper viewport behavior */
    html {
        -webkit-text-size-adjust: 100%;
    }

    .container {
        padding: 0 5%;
        max-width: 100%;
    }

    /* FIX: Override page-content inline padding for mobile */
    .page-content {
        padding-top: 140px !important;
        padding-bottom: 80px !important;
    }

    /* NAVIGATION MOBILE FIX */
    .nav-center {
        padding: 12px 0;
    }

    .nav-center.scrolled {
        padding: 10px 0;
    }

    .logo-text {
        font-size: 1.3rem;
    }

    .nav-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        padding: 8px;
        z-index: 10000;
        position: relative;
    }

    body.is-mobile .nav-toggle {
        display: none !important;
    }

    .nav-links {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100vw;
        height: 100vh;
        height: 100dvh;
        background: rgba(0, 0, 0, 0.98);
        backdrop-filter: blur(30px);
        -webkit-backdrop-filter: blur(30px);
        display: none;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 2.5rem;
        z-index: 9999;
        padding: 0;
    }

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

    .nav-links a {
        font-size: 1.3rem;
        letter-spacing: 0.2em;
        padding: 10px 20px;
        display: block;
        width: auto;
    }

    /* HERO SECTION */
    .mega-hero {
        padding-top: 120px;
        min-height: auto;
    }

    .mega-title-extreme {
        font-size: clamp(1.8rem, 7vw, 2.8rem);
        text-align: center;
        line-height: 1.2;
        word-break: break-word;
    }

    .mega-subtitle-extreme {
        font-size: 1rem;
        text-align: center;
        padding: 0;
        line-height: 1.6;
    }

    .hero-badge-glowing {
        font-size: 0.8rem;
        padding: 8px 16px;
        margin-bottom: 2rem;
    }

    /* BUTTONS */
    .action-cluster {
        flex-direction: column;
        width: 100%;
        gap: 12px;
        padding: 0;
    }

    .btn-extreme {
        width: 100%;
        padding: 14px 20px;
        font-size: 0.9rem;
        border-radius: 40px;
    }

    /* SECTION TITLES */
    .s-title {
        font-size: clamp(1.6rem, 5vw, 2.2rem);
        text-align: center;
        word-break: break-word;
    }

    .s-subtitle {
        font-size: 0.9rem;
        letter-spacing: 0.15em;
    }

    .s-paragraph,
    .a-bio {
        font-size: 1rem;
        text-align: left;
        text-align-last: left;
        line-height: 1.7;
        padding: 0 5px;
    }

    /* GRIDS - FIX OVERFLOW */
    .grid-immense {
        grid-template-columns: 1fr !important;
        gap: 20px;
        margin-top: 2rem;
    }

    .project-immense-grid {
        grid-template-columns: 1fr !important;
        gap: 20px;
        margin-top: 3rem;
    }

    /* CARDS */
    .card-premium {
        padding: 22px 18px;
        border-radius: 14px;
    }

    .card-premium h4 {
        font-size: 1.25rem;
    }

    .card-premium p {
        font-size: 0.95rem;
        line-height: 1.7;
    }

    .card-icon {
        width: 55px;
        height: 55px;
        margin-bottom: 20px;
    }

    .card-icon i {
        width: 30px;
        height: 30px;
    }

    /* GLASS BACKING */
    .section-glass-backing {
        padding: 1.2rem;
        border-radius: 16px;
    }

    /* STATS */
    .extreme-stats-bar {
        gap: 25px;
        padding: 25px 15px;
        border-radius: 14px;
    }

    .e-number {
        font-size: 2.5rem;
    }

    .e-label {
        font-size: 0.85rem;
    }

    /* TIMELINE */
    .timeline-container {
        padding-left: 25px;
        margin-top: 3rem;
    }

    .time-node {
        margin-bottom: 35px;
    }

    .time-node::before {
        left: -31px;
        width: 10px;
        height: 10px;
    }

    .time-title {
        font-size: 1.3rem;
    }

    .time-desc {
        font-size: 1rem;
        line-height: 1.6;
    }

    .time-date {
        font-size: 0.85rem;
    }

    /* TERMINAL */
    .terminal-window {
        max-width: 100%;
        border-radius: 8px;
        margin-top: 2rem;
    }

    .term-body {
        padding: 15px;
        font-size: 0.8rem;
        line-height: 1.5;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .term-header {
        padding: 10px 14px;
    }

    .term-header span {
        display: none;
    }

    /* ARCHITECTURE DIAGRAM */
    .arch-diagram {
        padding: 20px 12px;
        border-radius: 12px;
        margin-top: 2rem;
    }

    .arch-node {
        padding: 18px;
        font-size: 0.95rem;
        border-radius: 10px;
    }

    /* PROJECT CARDS */
    .mega-project-card {
        padding: 20px;
        border-radius: 14px;
    }

    .p-title {
        font-size: 1.3rem;
    }

    .p-icon {
        width: 40px;
        height: 40px;
        border-radius: 10px;
    }

    .mega-project-card p {
        font-size: 1rem;
        line-height: 1.6;
    }

    .p-tags {
        gap: 8px;
        margin-top: 18px;
    }

    .p-tag {
        padding: 5px 12px;
        font-size: 0.75rem;
    }

    /* STACK PILLS */
    .stack-matrix {
        gap: 8px;
        margin-top: 2rem;
    }

    .stack-pill {
        padding: 10px 16px;
        font-size: 0.95rem;
        border-radius: 20px;
    }

    /* AUTHOR */
    .author-void {
        padding: 40px 20px;
        border-radius: 16px;
        margin-top: 2rem;
    }

    .a-avatar {
        width: 70px;
        height: 70px;
    }

    .a-title {
        font-size: 2rem;
    }

    .a-sub {
        font-size: 0.9rem;
        margin-bottom: 15px;
    }

    /* V-ICON */
    .v-icon {
        width: 50px;
        height: 50px;
        border-radius: 12px;
        margin-bottom: 1.5rem;
    }

    .v-icon i {
        width: 24px;
        height: 24px;
    }

    /* FOOTER */
    .mega-footer {
        padding: 60px 0 40px;
    }

    .f-logo {
        font-size: 1.8rem;
    }

    .f-moto {
        font-size: 0.8rem;
        letter-spacing: 0.15em;
        margin-bottom: 30px;
    }

    .f-links {
        flex-direction: column;
        gap: 15px;
        margin-bottom: 30px;
    }

    .f-links a {
        font-size: 0.9rem;
    }

    .f-copy {
        font-size: 0.8rem;
        line-height: 1.8;
        padding: 0 10px;
    }

    /* BACKGROUND ORBS - Prevent overflow */
    .orb-1 { width: 250px; height: 250px; opacity: 0.1; }
    .orb-2 { width: 200px; height: 200px; opacity: 0.1; }
    .orb-3 { width: 150px; height: 150px; opacity: 0.08; }
    .orb-4 { width: 100px; height: 100px; opacity: 0.08; }

    .digital-grid {
        background-size: 40px 40px;
    }

    /* CONTACT FORM GLASS */
    .contact-glass {
        padding: 25px 18px !important;
        border-radius: 18px !important;
        max-width: 100% !important;
    }

    .form-input {
        padding: 14px 18px !important;
        font-size: 0.95rem;
        border-radius: 10px !important;
        margin-bottom: 18px !important;
    }

    /* PRELOADER MOBILE */
    .loader-hud-container {
        width: 280px;
    }

    .loader-reactor-wrap {
        width: 140px;
        height: 140px;
    }

    .loader-percentage {
        font-size: 2.4rem !important;
    }

    .loader-terminal-detailed {
        width: 260px;
        height: 120px;
        font-size: 0.6rem;
    }

    .loader-status-min {
        font-size: 0.6rem;
        letter-spacing: 3px;
    }

    /* REVEAL ANIMATIONS - reduce intensity on mobile */
    .reveal-up {
        transform: translateY(30px) scale(0.98);
    }

    .reveal-left {
        transform: translateX(-30px);
    }

    .reveal-right {
        transform: translateX(30px);
    }

    /* PARAGRAPH overrides */
    p {
        font-size: 1rem;
        max-width: 100%;
    }

    /* FIX: Inline styles on main padding */
    main.container {
        padding-top: 140px !important;
    }
}

/* --- SMALL PHONES (max 480px) --- */
@media (max-width: 480px) {
    html {
        font-size: 12px;
    }

    .container {
        padding: 0 4%;
    }

    .mega-title-extreme {
        font-size: clamp(1.5rem, 6.5vw, 2rem);
    }

    .s-title {
        font-size: 1.5rem;
    }

    .card-premium {
        padding: 18px 14px;
    }

    .card-premium h4 {
        font-size: 1.15rem;
    }

    .card-premium p {
        font-size: 0.9rem;
    }

    .nav-links a {
        font-size: 1.1rem;
        gap: 2rem;
    }

    .nav-links {
        gap: 2rem;
    }

    .mega-hero {
        padding-top: 100px;
    }

    .page-content {
        padding-top: 120px !important;
    }

    .a-title {
        font-size: 1.6rem;
    }

    .author-void {
        padding: 30px 15px;
    }

    .contact-glass {
        padding: 20px 14px !important;
    }

    .term-body {
        padding: 12px;
        font-size: 0.7rem;
    }

    .loader-hud-container {
        width: 240px;
    }

    .loader-reactor-wrap {
        width: 110px;
        height: 110px;
    }

    .loader-percentage {
        font-size: 2rem !important;
    }

    .loader-terminal-detailed {
        width: 220px;
        height: 100px;
    }

    .e-number {
        font-size: 2rem;
    }

    .timeline-container {
        padding-left: 20px;
    }

    .time-node::before {
        left: -26px;
        width: 8px;
        height: 8px;
    }

    .f-logo {
        font-size: 1.4rem;
    }
}

/* Animations fixes for mobile */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}

/* =========================================================
   DUAL NAVIGATION SYSTEM (Desktop Top Bar + Mobile Bottom Tabs)
   UA Detection via body.is-mobile / body.is-desktop
   ========================================================= */

/* --- MOBILE BOTTOM TAB BAR --- */
.mobile-tab-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 64px;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-top: 1px solid rgba(0, 255, 242, 0.15);
    box-shadow: 0 -5px 30px rgba(0, 0, 0, 0.8);
    z-index: 99999;
    padding: 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

.mobile-tab-bar-inner {
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: 100%;
    width: 100%;
    max-width: 100%;
    padding: 0 4px;
}

.mobile-tab-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.55rem;
    font-family: var(--font-sans, 'Outfit', sans-serif);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    gap: 3px;
    padding: 6px 2px;
    flex: 1;
    min-width: 0;
    transition: color 0.2s ease, transform 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    cursor: pointer;
    text-align: center !important;
}

.mobile-tab-item i,
.mobile-tab-item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.mobile-tab-item span {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    text-align: center !important;
    font-size: 0.55rem;
}

.mobile-tab-item.tab-active {
    color: #00fff2;
}

.mobile-tab-item.tab-active i,
.mobile-tab-item.tab-active svg {
    filter: drop-shadow(0 0 6px rgba(0, 255, 242, 0.6));
}

.mobile-tab-item:active {
    transform: scale(0.9);
}

/* SHOW/HIDE based on device detection */
body.is-mobile .mobile-tab-bar {
    display: block !important;
}

body.is-mobile .nav-links {
    display: none !important;
}

body.is-mobile .nav-toggle {
    display: none !important;
}

body.is-mobile .nav-center {
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 10px 0;
}

body.is-mobile main,
body.is-mobile .page-content {
    padding-bottom: 100px !important;
}

body.is-mobile .mega-footer {
    padding-bottom: 90px;
}

body.is-mobile .mega-hero {
    padding-top: 100px;
    min-height: auto;
}

/* Desktop: ensure everything stays normal */
body.is-desktop .mobile-tab-bar {
    display: none !important;
}

body.is-desktop .nav-links {
    display: flex !important;
}

body.is-desktop .nav-toggle {
    display: none !important;
}

/* =========================================================
   UNIVERSAL HUD PRELOADER (Force Win)
   ========================================================= */
.preloader-overlay {
    position: fixed; inset: 0; z-index: 2147483647 !important; 
    background: #000; display: flex; align-items: center; justify-content: center;
    transition: opacity 1.2s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden; visibility: visible !important; opacity: 1 !important;
}

.loader-hud-full {
    display: flex; align-items: center; gap: clamp(30px, 8vw, 120px);
    width: 100%; justify-content: center; opacity: 1 !important;
}

.loader-pillar {
    width: 4px; height: 180px; background: rgba(0, 255, 234, 0.1); border-radius: 4px; position: relative;
}

.loader-pillar::after {
    content: ""; position: absolute; bottom: 0; left: 0; width: 100%; height: 40%;
    background: linear-gradient(to top, #00ffea, #fff); animation: pillarPulse 2s infinite alternate;
}

@keyframes pillarPulse { 0% { height: 10%; } 100% { height: 90%; } }

@media (max-width: 900px) { .loader-pillar { display: none !important; } }

.loader-hud-container {
    width: 320px; display: flex; flex-direction: column; align-items: center; opacity: 1 !important;
}

.loader-reactor-wrap {
    position: relative; width: 180px; height: 180px; display: flex; align-items: center; justify-content: center; margin-bottom: 25px;
}

.loader-ring { position: absolute; border: 2px solid transparent; border-radius: 50%; width: 100%; height: 100%; }
.loader-ring.r1 { border-top-color: #00ffea; animation: rotateCW 4s linear infinite; }
.loader-ring.r2 { border-right-color: #0088ff; width: 80%; height: 80%; animation: rotateCCW 3s linear infinite; }

.loader-percentage {
    font-size: 3.2rem !important; font-weight: 900 !important; color: #fff !important;
    text-shadow: 0 0 25px rgba(0, 255, 234, 0.8); font-family: 'Outfit', sans-serif !important;
    position: relative; z-index: 10;
}

.loader-status-min {
    font-family: monospace; font-size: 0.7rem; color: #00ffea !important;
    letter-spacing: 5px; text-transform: uppercase; margin-bottom: 20px;
    font-weight: 700; opacity: 1 !important;
}

.loader-terminal-detailed {
    width: 300px; height: 140px; background: #080a0f; border: 1px solid rgba(0, 255, 234, 0.3);
    border-radius: 4px; padding: 12px; overflow: hidden; display: flex; flex-direction: column;
    font-family: monospace; font-size: 0.7rem; color: #fff !important; text-align: left;
    border-left: 3px solid #00ffea; opacity: 1 !important;
}

.log-entry-detailed { margin-bottom: 4px; display: block; opacity: 1 !important; }

/* =========================================================
   WPO & MOBILE FIRST PERFORMANCE (GAMA BAJA)
   ========================================================= */
body.low-end .orb,
body.low-end .noise-layer,
body.low-end .digital-grid {
    display: none !important; /* Salva repaints infinitos */
}

body.low-end .deep-cosmos-bg {
    background: #020202 !important; /* Evita degradados radiales pesados */
}

body.low-end * {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

body.low-end .gradient-text-anim {
    animation: none !important;
    background: transparent !important;
    -webkit-text-fill-color: var(--accent-cyan) !important;
    color: var(--accent-cyan) !important;
}

body.low-end .card-premium,
body.low-end .section-glass-backing,
body.low-end .extreme-stats-bar,
body.low-end .mega-project-card,
body.low-end .author-void,
body.low-end .contact-glass {
    background: #08080a !important; /* Color sólido sin transparency blurs */
    border: 1px solid #1a1a24 !important;
    box-shadow: none !important;
}

body.low-end .nav-center.scrolled,
body.low-end .mobile-tab-bar {
    background: #000000 !important;
    border-top: 1px solid #111 !important;
    border-bottom: 1px solid #111 !important;
    box-shadow: none !important;
}

body.low-end [data-aos] {
    opacity: 1 !important;
    transform: none !important;
    visibility: visible !important;
    transition: none !important;
    animation: none !important;
}

body.low-end .v-icon::before {
    animation: none !important;
    background: var(--accent-cyan) !important;
    opacity: 0.1 !important;
}

body.low-end .loader-ring {
    animation: none !important;
    border: 2px solid var(--text-muted) !important;
    border-top-color: var(--accent-cyan) !important;
}

body.low-end .loader-pillar::after {
    animation: none !important;
    display: none !important;
}

/* =========================================================
   RESPONSIVE OPTIMIZATIONS - MOBILE & TABLET FIXES
   ========================================================= */

/* Ensure no horizontal scroll on all devices */
html, body {
    overflow-x: hidden;
    max-width: 100vw;
}

/* Fluid typography for non-standard resolutions */
@media (min-width: 320px) and (max-width: 767px) {
    html {
        font-size: clamp(12px, 3.5vw, 16px);
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    html {
        font-size: clamp(14px, 2vw, 16px);
    }
}

/* Enhanced Mobile Navigation - 3 Line Layout */
@media (max-width: 768px) {
    /* Navbar restructured for mobile */
    .nav-center {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        transform: none;
        width: 100%;
        max-width: 100%;
        border-radius: 0;
        padding: 12px 16px;
        background: rgba(10, 10, 15, 0.95);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
    }

    .nav-center.scrolled {
        width: 100%;
        max-width: 100%;
        border-radius: 0;
        padding: 10px 16px;
    }

    .nav-wrap {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        flex-wrap: wrap;
        gap: 12px;
    }

    /* Three line mobile navbar structure */
    .nav-wrap > a.logo-text {
        order: 1;
        flex: 0 0 auto;
    }

    .nav-wrap > div[style*="flex"] {
        order: 2;
        flex: 0 0 auto;
        display: flex;
        gap: 8px;
    }

    /* Ensure mobile nav links are properly sized */
    .nav-links a {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 12px 20px;
        font-size: 1.1rem;
        touch-action: manipulation;
    }

    /* Enhanced touch targets for all interactive elements */
    .nav-toggle,
    .theme-toggle-btn,
    .mobile-tab-item,
    .btn-extreme,
    .btn-void,
    .btn-cyber,
    .btn-royal,
    .f-links a,
    .card-premium,
    .mega-project-card {
        min-height: 44px;
        min-width: 44px;
    }

    .nav-toggle {
        width: 48px;
        height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 12px;
        touch-action: manipulation;
        -webkit-tap-highlight-color: rgba(0, 255, 242, 0.2);
    }

    .theme-toggle-btn {
        width: 44px;
        height: 44px;
        touch-action: manipulation;
    }

    /* Mobile tab bar improvements */
    .mobile-tab-bar {
        height: 70px;
        padding-bottom: max(env(safe-area-inset-bottom, 8px), 8px);
    }

    .mobile-tab-item {
        min-height: 44px;
        padding: 8px 4px;
        gap: 4px;
        touch-action: manipulation;
    }

    .mobile-tab-item i,
    .mobile-tab-item svg {
        width: 24px;
        height: 24px;
    }

    .mobile-tab-item span {
        font-size: 0.6rem;
        max-width: 100%;
    }

    /* Fix button touch targets */
    .btn-extreme,
    .btn-void,
    .btn-cyber,
    .btn-royal {
        padding: 14px 24px;
        min-height: 44px;
        touch-action: manipulation;
    }

    .action-cluster {
        gap: 12px;
    }

    /* Fix overlapping in footer links */
    .f-links {
        gap: 16px;
        padding: 0 10px;
    }

    .f-links a {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 8px 12px;
        touch-action: manipulation;
    }

    /* Prevent element overlap in cards */
    .card-premium {
        padding: 20px 16px;
    }

    .card-icon {
        width: 55px;
        height: 55px;
        margin-bottom: 16px;
    }

    .card-icon i {
        width: 28px;
        height: 28px;
    }

    /* Fix form inputs for mobile */
    .form-input,
    .form-textarea {
        min-height: 44px;
        padding: 12px 16px;
        font-size: 16px; /* Prevents iOS zoom on focus */
    }

    /* Ensure proper spacing in project cards */
    .mega-project-card {
        padding: 20px;
    }

    .p-header {
        margin-bottom: 16px;
    }

    .p-icon {
        width: 44px;
        height: 44px;
    }

    .p-tags {
        gap: 8px;
        margin-top: 16px;
    }

    .p-tag {
        padding: 6px 12px;
        min-height: 32px;
        display: inline-flex;
        align-items: center;
    }
}

/* Small phones specific fixes */
@media (max-width: 380px) {
    .nav-center,
    .nav-center.scrolled {
        padding: 10px 12px;
    }

    .logo-text {
        font-size: 1.1rem;
    }

    .nav-toggle {
        width: 44px;
        height: 44px;
    }

    .mobile-tab-item span {
        font-size: 0.55rem;
    }

    .btn-extreme {
        padding: 12px 20px;
        font-size: 0.85rem;
    }
}

/* Tablet specific improvements */
@media (min-width: 769px) and (max-width: 1024px) {
    .nav-center {
        width: 98%;
        padding: 12px 20px;
    }

    .nav-links a {
        font-size: 0.8rem;
        padding: 8px 12px;
        min-height: 40px;
        display: flex;
        align-items: center;
    }

    .grid-immense {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
    }

    .project-immense-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Larger touch targets for touch-only devices */
    .nav-links a,
    .btn-extreme,
    .btn-void,
    .btn-cyber,
    .btn-royal,
    .card-premium,
    .mega-project-card,
    .f-links a {
        touch-action: manipulation;
        -webkit-tap-highlight-color: rgba(0, 255, 242, 0.15);
    }

    /* Remove hover effects on touch devices */
    .card-premium:hover,
    .mega-project-card:hover,
    .btn-extreme:hover,
    .btn-void:hover,
    .btn-cyber:hover,
    .btn-royal:hover {
        transform: none;
    }

    /* Add active states for touch feedback */
    .card-premium:active,
    .mega-project-card:active,
    .btn-extreme:active,
    .btn-void:active,
    .btn-cyber:active,
    .btn-royal:active {
        transform: scale(0.98);
    }
}

/* Non-standard resolution fixes */
@media (min-width: 320px) and (max-width: 359px) {
    .container {
        padding: 0 4%;
    }

    .mega-title-extreme {
        font-size: clamp(1.4rem, 6vw, 1.8rem);
    }

    .s-title {
        font-size: 1.3rem;
    }
}

/* Ensure content doesn't overflow */
img, video, svg, canvas, iframe {
    max-width: 100%;
    height: auto;
}

/* Word wrapping for text */
p, h1, h2, h3, h4, h5, h6 {
    overflow-wrap: break-word;
    word-wrap: break-word;
    hyphens: auto;
}

/* iOS specific fixes */
@supports (-webkit-touch-callout: none) {
    .mobile-tab-bar {
        padding-bottom: max(env(safe-area-inset-bottom), 20px);
    }

    body.is-mobile main,
    body.is-mobile .page-content {
        padding-bottom: 120px !important;
    }
}

/* Safe area support for notched devices */
@supports (padding-top: env(safe-area-inset-top)) {
    .nav-center {
        padding-top: max(12px, env(safe-area-inset-top));
    }
}

/* ============================================
   TELEMETRÍA / DASHBOARD STYLES
   ============================================ */

#telemetria {
    padding: 4rem 0;
}

.telemetry-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
}

.telemetry-header .s-title {
    margin-bottom: 0;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
}

/* Sistema Online con pulso verde neón */
.system-status {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    background: rgba(15, 15, 15, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    backdrop-filter: blur(10px);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
}

.pulse-indicator {
    width: 10px;
    height: 10px;
    background: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

.status-text {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

/* Grid de métricas - 3 columnas */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.metric-card {
    background: rgba(15, 15, 15, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 1.5rem;
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-align: center;
}

.metric-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px -10px rgba(0, 212, 255, 0.2);
    border-color: rgba(0, 212, 255, 0.3);
}

.metric-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.2), rgba(139, 92, 246, 0.2));
    border-radius: 12px;
    color: #00d4ff;
}

.metric-icon svg {
    width: 24px;
    height: 24px;
}

.metric-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, #00d4ff, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.25rem;
}

.metric-label {
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 500;
}

/* Contenedor del gráfico */
.chart-container {
    background: rgba(15, 15, 15, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 1.5rem;
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.chart-header h3 {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.125rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
}

.last-update {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.05);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
}

.chart-wrapper {
    height: 320px;
    position: relative;
}

.chart-wrapper canvas {
    max-height: 100%;
}

/* Responsive para métricas */
@media (max-width: 768px) {
    .metrics-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .telemetry-header {
        flex-direction: column;
        text-align: center;
    }
    
    .chart-wrapper {
        height: 250px;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ============================================
   ANALYTICS PAGE STYLES
   ============================================ */

.analytics-page {
    background: linear-gradient(180deg, #030305 0%, #0a0a12 100%);
}

/* Hero Section */
.analytics-hero {
    position: relative;
    padding: 140px 0 80px;
    overflow: hidden;
}

.hero-grid-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        linear-gradient(rgba(0, 212, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 212, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
}

.analytics-hero .hero-content {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 50px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
    color: #10b981;
    margin-bottom: 1.5rem;
}

.hero-badge .pulse-indicator {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    animation: pulse-green 2s infinite;
}

.analytics-hero .hero-title {
    font-size: 3.5rem;
    font-weight: 900;
    margin-bottom: 1rem;
    font-family: 'Outfit', sans-serif;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 2rem;
    line-height: 1.7;
}

.hero-meta {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: rgba(255, 255, 255, 0.6);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
}

.meta-item i {
    width: 16px;
    height: 16px;
    color: #00d4ff;
}

/* KPI Section */
.kpi-section {
    padding: 4rem 0;
}

.section-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 2rem;
    color: rgba(255, 255, 255, 0.95);
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

.kpi-card {
    background: rgba(15, 15, 15, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 1.5rem;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.kpi-card:hover {
    transform: translateY(-5px);
    border-color: rgba(0, 212, 255, 0.3);
    box-shadow: 0 20px 40px -10px rgba(0, 212, 255, 0.15);
}

.kpi-card.large {
    grid-column: span 2;
}

.kpi-card.wide {
    grid-column: span 2;
}

.kpi-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.kpi-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.kpi-icon.primary {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.2), rgba(0, 212, 255, 0.1));
    color: #00d4ff;
}

.kpi-icon.success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(16, 185, 129, 0.1));
    color: #10b981;
}

.kpi-icon.warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(245, 158, 11, 0.1));
    color: #f59e0b;
}

.kpi-icon.info {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(59, 130, 246, 0.1));
    color: #3b82f6;
}

.kpi-icon.accent {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(139, 92, 246, 0.1));
    color: #8b5cf6;
}

.kpi-trend {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
    font-weight: 600;
}

.kpi-trend.up {
    color: #10b981;
}

.kpi-trend.down {
    color: #ef4444;
}

.kpi-trend.neutral {
    color: #94a3b8;
}

.kpi-trend i {
    width: 16px;
    height: 16px;
}

.kpi-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #ffffff, #a5b4fc);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

.kpi-label {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.875rem;
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-badge.online {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.system-metrics {
    margin-top: 1rem;
}

.metric-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.metric-row:last-child {
    border-bottom: none;
}

.metric-row span:first-child {
    flex: 1;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.875rem;
}

.metric-bar {
    width: 100px;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.metric-bar .fill {
    height: 100%;
    background: linear-gradient(90deg, #00d4ff, #8b5cf6);
    border-radius: 3px;
    transition: width 0.5s ease;
}

.metric-bar .fill.success {
    background: linear-gradient(90deg, #10b981, #34d399);
}

.metric-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.9);
    min-width: 60px;
    text-align: right;
}

/* Charts Section */
.charts-section {
    padding: 4rem 0;
}

.charts-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 1.5rem;
}

.chart-card {
    background: rgba(15, 15, 15, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 1.5rem;
    backdrop-filter: blur(10px);
}

.chart-card.main {
    grid-row: span 2;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}

.chart-header h3 {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.125rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
}

.chart-subtitle {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.chart-controls {
    display: flex;
    gap: 0.5rem;
}

.btn-chart {
    padding: 0.375rem 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.6);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-chart:hover,
.btn-chart.active {
    background: rgba(0, 212, 255, 0.2);
    border-color: rgba(0, 212, 255, 0.4);
    color: #00d4ff;
}

.chart-container-large {
    height: 350px;
    position: relative;
}

.chart-container-medium {
    height: 200px;
    position: relative;
}

.chart-legend {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.7);
}

.legend-item .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

/* Telemetry Info Section */
.telemetry-info-section {
    padding: 4rem 0;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.info-card {
    background: rgba(15, 15, 15, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 2rem;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.info-card:hover {
    transform: translateY(-5px);
    border-color: rgba(139, 92, 246, 0.4);
    box-shadow: 0 20px 40px -10px rgba(139, 92, 246, 0.2);
}

.info-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(139, 92, 246, 0.1));
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #8b5cf6;
    margin-bottom: 1.5rem;
}

.info-icon i {
    width: 28px;
    height: 28px;
}

.info-card h3 {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.25rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 1rem;
}

.info-card p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.info-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.info-list li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.875rem;
}

.info-list li i {
    width: 18px;
    height: 18px;
    color: #10b981;
}

/* Stats Table Section */
.stats-table-section {
    padding: 4rem 0;
}

.table-card {
    background: rgba(15, 15, 15, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 1.5rem;
    backdrop-filter: blur(10px);
    overflow-x: auto;
}

.stats-table {
    width: 100%;
    border-collapse: collapse;
}

.stats-table th {
    text-align: left;
    padding: 1rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.stats-table td {
    padding: 1rem;
    font-size: 0.95rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.stats-table tr:last-child td {
    border-bottom: none;
}

.table-icon {
    width: 18px;
    height: 18px;
    color: #00d4ff;
    margin-right: 0.5rem;
    vertical-align: middle;
}

.stats-table .value {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}

.stats-table .change {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
    font-weight: 600;
}

.stats-table .change.positive {
    color: #10b981;
}

.stats-table .change.negative {
    color: #ef4444;
}

.stats-table .change.neutral {
    color: #94a3b8;
}

.trend-bar {
    display: inline-block;
    width: 80px;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.trend-bar .fill {
    height: 100%;
    background: linear-gradient(90deg, #00d4ff, #8b5cf6);
    border-radius: 3px;
}

.trend-bar .fill.warning {
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.trend-bar .fill.success {
    background: linear-gradient(90deg, #10b981, #34d399);
}

.status {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status.good {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.status.warning {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

/* CTA Section */
.cta-section {
    padding: 4rem 0 6rem;
}

.cta-card {
    background: linear-gradient(135deg, rgba(15, 15, 20, 0.9), rgba(30, 20, 60, 0.6));
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 24px;
    padding: 3rem;
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 3rem;
    align-items: center;
}

.cta-content h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #ffffff, #c4b5fd);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.cta-content p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    border: none;
    border-radius: 10px;
    color: white;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px -10px rgba(139, 92, 246, 0.5);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

.cta-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    text-align: center;
}

.cta-stat .number {
    display: block;
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.75rem;
    font-weight: 700;
    background: linear-gradient(135deg, #00d4ff, #8b5cf6);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.25rem;
}

.cta-stat .label {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.875rem;
}

@media (max-width: 1024px) {
    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .kpi-card.large,
    .kpi-card.wide {
        grid-column: span 2;
    }
    
    .charts-grid {
        grid-template-columns: 1fr;
    }
    
    .chart-card.main {
        grid-row: span 1;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .cta-card {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .cta-buttons {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .analytics-hero {
        padding: 120px 0 60px;
    }
    
    .analytics-hero .hero-title {
        font-size: 2.5rem;
    }
    
    .kpi-grid {
        grid-template-columns: 1fr;
    }
    
    .kpi-card.large,
    .kpi-card.wide {
        grid-column: span 1;
    }
    
    .cta-stats {
        grid-template-columns: 1fr;
    }
    
    .chart-controls {
        flex-wrap: wrap;
    }
    
    .hero-meta {
        flex-direction: column;
        gap: 1rem;
    }
}