@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;800&family=Space+Grotesk:wght@300;500;700&display=swap');

:root {
    --primary-color: #00f2fe;
    /* Security Cyan */
    --secondary-color: #4facfe;
    /* Data Blue */
    --accent-color: #71ebd2;
    /* Infrastructure Teal */
    --bg-deep: #05070a;
    /* Deep Space */
    --bg-surface: #0a0e14;
    /* Surface Level */
    --bg-card: rgba(22, 27, 34, 0.4);
    --text-main: #ffffff;
    --text-muted: #b1bac4;
    /* Brightened for better readability */
    --text-secondary: #9aa4ae;
    --glass-border: rgba(255, 255, 255, 0.12);
    --glass-shadow: rgba(0, 0, 0, 0.4);
    --transition-smooth: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    --container-width: 1200px;
}

/* Light Mode Variables */
body.light-mode {
    --bg-deep: #ffffff;
    --bg-surface: #f7fafc;
    --bg-card: rgba(255, 255, 255, 0.9);
    --text-main: #1a202c;
    --text-muted: #4a5568;
    --text-secondary: #718096;
    --glass-border: rgba(0, 0, 0, 0.08);
    --glass-shadow: rgba(0, 0, 0, 0.05);
    --primary-color: #3182ce; /* Professional Blue */
    --secondary-color: #2c5282;
}

/* Light Mode Variables - Removal of horizontal logo override to maintain favicon consistent */
body.light-mode .navbar-brand img {
    /* Favicon typically works on both modes if correctly designed */
    filter: none; 
}

body.light-mode {
    background-image: 
        radial-gradient(circle at 2px 2px, rgba(0, 0, 0, 0.03) 1px, transparent 0);
}


body.light-mode .navbar {
    background: rgba(255, 255, 255, 0.85);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

body.light-mode .navbar .nav-link {
    color: #2d3748 !important;
}

body.light-mode .navbar .nav-link:hover {
    color: var(--primary-color) !important;
}

body.light-mode .navbar .fas.fa-bars {
    color: #2d3748 !important;
}

body.light-mode .navbar.scrolled {
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

body.light-mode .hero-tagline {
    color: var(--secondary-color);
    font-weight: 600;
}

body.light-mode .hero-title {
    color: #1a202c;
    text-shadow: none;
}

body.light-mode .text-muted {
    color: #4a5568 !important;
}

body.light-mode .glass-card {
    background: white;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.04);
    border: 1px solid #edf2f7;
}

body.light-mode .glass-card:hover {
    box-shadow: 0 20px 40px rgba(0,0,0,0.08);
    border-color: var(--primary-color);
}

body.light-mode .skill-tag {
    background: #f7fafc;
    border-color: #e2e8f0;
    color: #2d3748;
}

body.light-mode .skill-tag:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

body.light-mode .btn-premium-outline {
    color: #2d3748;
    border-color: #cbd5e0;
}

body.light-mode .btn-premium-outline:hover {
    background: #f7fafc;
    border-color: var(--primary-color);
    color: var(--primary-color);
}

body.light-mode .btn-premium {
    color: white;
    box-shadow: 0 4px 14px rgba(49, 130, 206, 0.3);
}

body.light-mode .timeline-entry::after {
    background: white;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px #edf2f7;
}

body.light-mode .tech-date {
    background: #ebf8ff;
    color: #2b6cb0 !important;
    border-left-color: #2b6cb0;
}

body.light-mode .terminal-loader {
    background: #1a202c;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

body.light-mode .root-id-card {
    background: #f7fafc;
    border-color: #e2e8f0;
}

body.light-mode .id-label {
    color: #718096;
}

body.light-mode .id-value {
    color: #2d3748;
}

body.light-mode footer {
    background: #f7fafc;
    border-top: 1px solid #edf2f7;
}

body.light-mode .stat-box {
    border-color: #edf2f7;
}

body.light-mode .stat-box h4 {
    background: linear-gradient(135deg, #3182ce, #2c5282);
    -webkit-background-clip: text;
    background-clip: text;
}

body.light-mode .scroll-top-btn::after {
    background: white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

body.light-mode .scroll-top-btn i {
    color: #2d3748;
}

body.light-mode .scroll-top-btn:hover::after {
    background: var(--primary-color);
}

body.light-mode .scroll-top-btn:hover i {
    color: white;
}

body.light-mode .tech-hud {
    background: white;
    border-color: #e2e8f0;
    color: #2d3748;
}

body.light-mode .hud-value {
    color: var(--primary-color);
}


.text-muted {
    color: var(--text-muted) !important;
}

.lead {
    color: var(--text-main) !important;
    opacity: 0.9;
}

strong,
b {
    color: var(--text-main);
    font-weight: 600;
}

.text-primary strong,
.text-primary b {
    color: var(--primary-color);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    height: 100%;
}

body {
    background-color: var(--bg-deep);
    color: var(--text-main);
    font-family: 'Outfit', sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
    /* Animated Grid Background */
    background-image:
        radial-gradient(circle at 2px 2px, rgba(128, 128, 128, 0.05) 1px, transparent 0);
    background-size: 40px 40px;
    
    /* Sticky Footer Setup */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: background-color 0.5s ease, color 0.5s ease;
}

/* Typography Overrides */
h1,
h2,
h3,
h4,
.navbar-brand {
    font-family: 'Space Grotesk', sans-serif;
}

.grayscale {
    filter: grayscale(100%);
}

.hover-brighten:hover {
    filter: grayscale(0%) brightness(1.2);
    opacity: 1 !important;
    transform: scale(1.1);
}

.transition {
    transition: var(--transition-smooth);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-deep);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(var(--bg-deep), var(--primary-color), var(--bg-deep));
    border-radius: 10px;
}

/* Premium Navbar */
.navbar {
    background: rgba(5, 7, 10, 0.6);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    padding: 20px 0;
    transition: var(--transition-smooth);
}

.navbar .nav-link {
    text-decoration: none !important;
}

.navbar.scrolled {
    padding: 12px 0;
    background: rgba(5, 7, 10, 0.9);
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.85rem;
    display: flex;
    align-items: center;
    text-decoration: none !important;
    transition: var(--transition-smooth);
}

.brand-text {
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -1px;
    font-family: 'Space Grotesk', sans-serif;
}

.navbar-brand:hover {
    transform: scale(1.02);
}

.navbar-brand:hover .brand-text {
    text-shadow: 0 0 15px rgba(0, 242, 254, 0.4);
}

.navbar-brand img {
    height: 65px; /* Base height matches index.php */
    width: auto;
    transition: height 0.3s ease;
}

.navbar.scrolled .navbar-brand img {
    height: 50px; /* Slight scale down on scroll */
}



/* Hero Section: The "Control Room" Feel */
.hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    padding: 160px 0 100px;
    overflow: hidden;
}

/* Data Rain Canvas - Matrix effect background */
.data-rain-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1; /* Above background/glow */
    opacity: 0.35; /* Increased for better visibility */
    -webkit-mask-image: radial-gradient(circle at 50% 50%, black 60%, transparent 100%);
    mask-image: radial-gradient(circle at 50% 50%, black 60%, transparent 100%);
    display: block !important;
}

@media (max-width: 768px) {
    .data-rain-canvas {
        -webkit-mask-image: none;
        mask-image: none;
        opacity: 0.2;
    }
}

/* Ensure hero content is above canvas */
.hero-section .container {
    position: relative;
    z-index: 10;
}


/* Dynamic background glow */
.hero-section::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(0, 242, 254, 0.05) 0%, transparent 70%);
    top: -100px;
    right: -100px;
    filter: blur(80px);
    z-index: -1;
}

.hero-title {
    font-size: clamp(2.5rem, 7vw, 5rem);
    font-weight: 800;
    line-height: 1;
    margin-bottom: 1.5rem;
    letter-spacing: -2px;
    position: relative;
    color: var(--text-main);
}


@keyframes hero-glitch {
    0% { transform: translate(0); text-shadow: none; }
    94% { transform: translate(0); text-shadow: none; }
    95% { transform: translate(-3px, 1px); text-shadow: 3px 0 var(--primary-color), -3px 0 var(--secondary-color); }
    96% { transform: translate(3px, -1px); text-shadow: -3px 0 var(--primary-color), 3px 0 var(--secondary-color); }
    97% { transform: translate(0); text-shadow: none; }
    100% { transform: translate(0); text-shadow: none; }
}

.hero-title span {
    color: var(--primary-color);
}


.hero-tagline {
    font-family: 'Space Grotesk', sans-serif;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 4px;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    display: block;
}

/* Premium Glass Cards */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 40px;
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
    transform: translateX(-100%);
    transition: 0.5s;
}

.glass-card:hover {
    transform: translateY(-10px);
    border-color: rgba(0, 242, 254, 0.3);
    box-shadow: 0 20px 40px var(--glass-shadow);
}

.glass-card:hover::before {
    transform: translateX(100%);
}

/* Section Titles */
.section-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 4rem;
    position: relative;
    transition: var(--transition-smooth);
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color), transparent);
    border-radius: 3px;
    margin-top: 12px;
    transition: width 0.5s ease;
}

.section-title:hover::after {
    width: 140px;
}

.section-title:hover {
    animation: titleGlitch 0.3s cubic-bezier(.25, .46, .45, .94) both;
}

@keyframes titleGlitch {
    0% { transform: translate(0); text-shadow: none; }
    20% { transform: translate(-2px, 2px); text-shadow: 2px 0 var(--primary-color), -2px 0 var(--secondary-color); }
    40% { transform: translate(-2px, -2px); text-shadow: -2px 0 var(--primary-color), 2px 0 var(--secondary-color); }
    60% { transform: translate(2px, 2px); text-shadow: 2px 0 var(--primary-color), -2px 0 var(--secondary-color); }
    80% { transform: translate(2px, -2px); text-shadow: -2px 0 var(--primary-color), 2px 0 var(--secondary-color); }
    100% { transform: translate(0); text-shadow: none; }
}

.section-title span {
    color: var(--primary-color);
}

/* Skill Nodes */
.skill-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
    gap: 24px;
}

.skill-category-title {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-muted);
    margin-bottom: 20px;
    display: block;
}

.skill-tag {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    padding: 8px 16px;
    border-radius: 12px;
    font-size: 0.9rem;
    margin: 5px;
    display: inline-block;
    transition: 0.3s;
}

.skill-tag:hover {
    background: rgba(0, 242, 254, 0.1);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* Timeline: High-End Security Audit Feel */
.timeline-modern {
    position: relative;
    padding-left: 30px;
}

.timeline-modern::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 1px;
    background: linear-gradient(transparent, var(--glass-border), var(--primary-color), var(--glass-border), transparent);
}

.timeline-entry {
    position: relative;
    margin-bottom: 60px;
}

.timeline-entry::after {
    content: '';
    position: absolute;
    left: -35px;
    top: 10px;
    width: 10px;
    height: 10px;
    background: var(--bg-deep);
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--primary-color);
}

/* Buttons */
.btn-premium {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--bg-deep);
    padding: 16px 36px;
    border-radius: 14px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    transition: var(--transition-smooth);
    border: 1px solid transparent;
    position: relative;
    overflow: hidden;
}

.btn-premium::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.15), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.btn-premium:hover {
    background: transparent;
    border-color: var(--primary-color);
    color: var(--primary-color);
    box-shadow: 0 0 25px rgba(0, 242, 254, 0.35), 0 8px 32px rgba(0, 0, 0, 0.3);
    transform: translateY(-2px);
}

.btn-premium:hover::after {
    opacity: 1;
}

.btn-premium-outline {
    background: transparent;
    color: var(--text-main);
    padding: 16px 36px;
    border-radius: 14px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    border: 1px solid var(--glass-border);
    transition: var(--transition-smooth);
}

.btn-premium-outline:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    box-shadow: 0 0 15px rgba(0, 242, 254, 0.15);
    transform: translateY(-2px);
}

/* Stats/Badges */
.stat-box {
    text-align: center;
    border-right: 1px solid var(--glass-border);
    padding: 16px 0;
}

.stat-box h4 {
    font-size: 2.8rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -1px;
}

/* Responsive Design Base Classes */
@media (min-width: 992px) {
    .w-lg-75 {
        width: 75% !important;
    }
}

/* Tablet (max-width: 991px) */
@media (max-width: 991px) {
    .hero-section {
        padding: 140px 0 60px;
        min-height: auto;
    }

    .hero-title {
        font-size: clamp(2.2rem, 8vw, 3.8rem);
        line-height: 1.2;
        letter-spacing: -1px;
    }

    .hero-title::after {
        display: none !important;
    }

    .hero-tagline {
        letter-spacing: 2px !important;
        font-size: 0.8rem !important;
    }

    .tech-hud, 
    .header-hud {
        display: none !important;
    }

    .section-title {
        font-size: 2.4rem;
        margin-bottom: 2.5rem;
    }

    .section-title::after {
        width: 50px;
    }

    .navbar-toggler {
        border: 1px solid var(--primary-color);
        background: rgba(0, 242, 254, 0.08);
        padding: 10px 14px;
        min-width: 44px;
        min-height: 44px;
    }

    .navbar-toggler i {
        color: var(--primary-color) !important;
        font-size: 1.3rem;
    }

    .system-log-sidebar,
    #custom-cursor,
    .precision-cursor {
        display: none !important;
    }

    .navbar-collapse {
        background: rgba(10, 14, 20, 0.97);
        backdrop-filter: blur(20px);
        padding: 1.5rem;
        border-radius: 16px;
        margin-top: 1rem;
        border: 1px solid var(--glass-border);
        box-shadow: 0 20px 40px rgba(0,0,0,0.6);
        animation: navSlideDown 0.3s ease;
    }

    @keyframes navSlideDown {
        from { opacity: 0; transform: translateY(-10px); }
        to   { opacity: 1; transform: translateY(0); }
    }

    .navbar-nav .nav-link {
        padding: 12px 8px !important;
        min-height: 44px;
        display: flex;
        align-items: center;
        border-bottom: 1px solid rgba(255,255,255,0.05);
    }

    .navbar-nav .nav-item:last-child .nav-link {
        border-bottom: none;
    }

    /* Button full-width on tablet/mobile pero con max-width para no verse estirado */
    .btn-premium, .btn-premium-outline {
        width: 100%;
        max-width: 320px;
        margin-left: auto;
        margin-right: auto;
        text-align: center;
        justify-content: center;
    }

    .d-grid .btn-premium,
    .d-grid .btn-premium-outline,
    .d-sm-flex .btn-premium,
    .d-sm-flex .btn-premium-outline {
        width: auto;
    }
}

/* Mobile (max-width: 768px) */
@media (max-width: 768px) {
    .stat-box {
        border-right: none;
        border-bottom: 1px solid var(--glass-border) !important;
        padding: 24px 0;
    }

    .stat-box:last-child {
        border-bottom: none !important;
    }

    .stat-box h4 {
        font-size: 2.2rem;
    }

    .hero-title {
        font-size: clamp(1.9rem, 9vw, 2.8rem);
        line-height: 1.1;
    }

    .section-title {
        font-size: 1.9rem;
        margin-bottom: 2rem;
    }

    .glass-card {
        padding: 20px;
        border-radius: 18px;
    }

    .timeline-modern {
        padding-left: 20px;
    }

    .timeline-modern::before {
        left: 5px;
    }

    .timeline-entry::after {
        left: -20px;
    }

    .hero-section {
        /* Reducido padding top/bottom en mobile para menos espacio muerto */
        padding: 100px 0 30px;
    }

    .skill-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    /* Ensure tap targets are large enough */
    .nav-link, .btn-cookie-accept, .btn-cookie-deny {
        min-height: 44px;
    }
}

/* Very small screens (< 400px) */
@media (max-width: 400px) {
    .hero-title {
        font-size: clamp(1.6rem, 9vw, 2.2rem);
        letter-spacing: -0.5px;
    }

    .hero-tagline {
        font-size: 0.72rem !important;
        letter-spacing: 1.5px !important;
    }

    .glass-card {
        padding: 16px;
        border-radius: 14px;
    }

    .section-title {
        font-size: 1.6rem;
    }

    .navbar-brand {
        font-size: 1.2rem;
    }

    .navbar-brand img {
        height: 35px;
        margin-right: 8px !important;
    }
}

/* Disable hover lift and 3D tilt on touch devices */
@media (hover: none) {
    .glass-card:hover {
        transform: none !important;
        box-shadow: none;
    }

    .hover-lift:hover {
        transform: none !important;
        box-shadow: none;
    }

    .btn-premium:hover,
    .btn-premium-outline:hover {
        transform: none !important;
    }

    .section-title:hover {
        animation: none !important;
    }
}

/* Scroll to Top Button */
.scroll-top-btn {
    position: fixed;
    bottom: -80px;
    left: 30px;
    width: 50px;
    height: 50px;
    background: transparent;
    border: none;
    border-radius: 50%;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 1000;
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 15px rgba(0, 242, 254, 0.15);
    overflow: hidden;
}

/* Inner card handling the glassmorphism */
.scroll-top-btn::after {
    content: "";
    position: absolute;
    inset: 2px;
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border-radius: 50%;
    z-index: 0;
    transition: var(--transition-smooth);
}

/* The sweeping lightning effect */
.scroll-top-btn::before {
    content: "";
    position: absolute;
    width: 200%;
    height: 200%;
    background: conic-gradient(transparent 70%, var(--primary-color) 95%, #fff 100%);
    top: -50%;
    left: -50%;
    z-index: -1;
    animation: lightningSweep 5s linear infinite;
}

.scroll-top-btn i {
    z-index: 1;
    position: relative;
    transition: var(--transition-smooth);
}

@keyframes lightningSweep {
    0% {
        transform: rotate(0deg);
        opacity: 0;
    }

    5% {
        opacity: 1;
    }

    20% {
        transform: rotate(360deg);
        opacity: 0;
    }

    100% {
        transform: rotate(360deg);
        opacity: 0;
    }
}

.scroll-top-btn.visible {
    bottom: 30px;
    opacity: 1;
}

/* Hover effect */
.scroll-top-btn:hover {
    box-shadow: 0 0 25px rgba(0, 242, 254, 0.6);
    transform: translateY(-5px);
}

.scroll-top-btn:hover::after {
    background: var(--primary-color);
}

.scroll-top-btn:hover i {
    color: var(--bg-deep);
}

.scroll-top-btn:hover::before {
    display: none;
}

@media (max-width: 768px) {
    .scroll-top-btn {
        /* Movido a la derecha para no tapar el footer ni el cookie banner */
        left: auto;
        right: 20px;
        width: 45px;
        height: 45px;
    }

    .scroll-top-btn.visible {
        bottom: 20px;
    }
}

/* Modern Hover Effects */
.hover-lift {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: 0 30px 60px rgba(0, 242, 254, 0.15);
}

/* Premium Link Styling */
.premium-link {
    color: var(--primary-color);
    text-decoration: none;
    position: relative;
    font-weight: 600;
    transition: var(--transition-smooth);
    display: inline-block;
}

.premium-link::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 1px;
    bottom: -2px;
    left: 0;
    background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
    transform: scaleX(0.3);
    opacity: 0;
    transition: var(--transition-smooth);
}

.premium-link:hover {
    color: #fff;
    text-shadow: 0 0 15px rgba(0, 242, 254, 0.8);
}

.premium-link:hover::after {
    transform: scaleX(1);
    opacity: 1;
}

@keyframes fiberPulse {
    0% {
        top: -20%;
        opacity: 0;
    }

    20% {
        opacity: 1;
    }

    80% {
        opacity: 1;
    }

    100% {
        top: 120%;
        opacity: 0;
    }
}

.timeline-modern::after {
    content: '';
    position: absolute;
    left: 0;
    width: 2px;
    height: 150px;
    background: linear-gradient(to bottom, transparent, var(--primary-color), transparent);
    animation: fiberPulse 6s infinite linear;
    z-index: 1;
}

/* Console Style Dates */
.tech-date {
    font-family: 'Space Grotesk', monospace;
    font-size: 0.75rem;
    letter-spacing: 2px;
    background: rgba(0, 242, 254, 0.1);
    padding: 4px 12px;
    border-radius: 4px;
    color: var(--primary-color) !important;
    border-left: 2px solid var(--primary-color);
}

/* Micro-grid Card Texture */
.glass-card.tech-card {
    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: 15px 15px;
}

/* Scanline Effect */
.scanline {
    position: absolute;
    top: -100%;
    left: 0;
    width: 100%;
    height: 40px;
    background: linear-gradient(to bottom,
            transparent,
            rgba(0, 242, 254, 0.05) 50%,
            transparent);
    pointer-events: none;
    z-index: 2;
}

.tech-card:hover .scanline {
    animation: techScan 2s linear infinite;
}

@keyframes techScan {
    0% {
        top: -20%;
    }

    100% {
        top: 120%;
    }
}

/* Status Badges */
.status-tag {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 0.6rem;
    text-transform: uppercase;
    color: var(--text-muted);
    border: 1px solid var(--glass-border);
    padding: 2px 8px;
    border-radius: 4px;
    letter-spacing: 1px;
}

.status-tag span {
    display: inline-block;
    width: 6px;
    height: 6px;
    background: #00ff00;
    border-radius: 50%;
    margin-right: 5px;
    box-shadow: 0 0 5px #00ff00;
}

/* Hero Terminal Styling */
.terminal-loader {
    background: #010101;
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.6);
    overflow: hidden;
    position: relative;
    max-width: 500px;
    margin: 0 auto;
}

.terminal-header {
    background: #1a1a1b;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    position: relative;
}

.terminal-buttons {
    display: flex;
    gap: 8px;
}

.btn-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.btn-dot.red {
    background: #ff5f56;
}

.btn-dot.yellow {
    background: #ffbd2e;
}

.btn-dot.green {
    background: #27c93f;
}

.terminal-title {
    position: absolute;
    width: 100%;
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: monospace;
    left: 0;
    pointer-events: none;
}

.terminal-body {
    padding: 20px;
    min-height: 250px;
    font-family: 'Space Grotesk', monospace;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
}

.term-prompt {
    color: var(--primary-color);
    font-weight: 600;
    margin-right: 10px;
}

.cursor {
    display: inline-block;
    background: var(--primary-color);
    width: 8px;
    height: 16px;
    margin-left: 5px;
    animation: blink 1s step-end infinite;
    vertical-align: middle;
}

@keyframes blink {
    50% {
        opacity: 0;
    }
}

.term-log {
    display: block;
    margin-top: 5px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.term-log.success {
    color: #27c93f;
    font-weight: 500;
}

/* Master Diagnostic Switch */
.diagnostic-switch-wrapper {
    display: flex;
    align-items: center;
}

.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    transition: .4s;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--glass-border);
}

.theme-switch .sun-icon {
    color: #ffd700;
    opacity: 0;
    transition: .4s;
    position: absolute;
    left: 6px;
}

.theme-switch .moon-icon {
    color: #4facfe;
    opacity: 1;
    transition: .4s;
    position: absolute;
    right: 8px;
}

input:checked + .slider .sun-icon {
    opacity: 1;
}

input:checked + .slider .moon-icon {
    opacity: 0;
}


.slider i {
    font-size: 0.7rem;
    color: var(--text-muted);
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 3px;
    background-color: var(--text-muted);
    transition: .4s;
}

input:checked+.slider {
    background-color: rgba(0, 242, 254, 0.2);
    border-color: var(--primary-color);
}

input:checked+.slider i {
    color: var(--primary-color);
    text-shadow: 0 0 5px var(--primary-color);
}

input:checked+.slider:before {
    transform: translateX(20px);
    background-color: var(--primary-color);
    box-shadow: 0 0 10px var(--primary-color);
}

.slider.round {
    border-radius: 24px;
}

.slider.round:before {
    border-radius: 50%;
}

/* Diagnostic Mode Global Overrides */
body.phosphor-mode {
    --primary-color: #33ff33;
    /* Classic Phosphor Green */
    --text-main: #b3ffb3;
    --text-muted: #4d994d;
    background-color: #000c00;
}

body.phosphor-mode .glass-card {
    border-color: #004d00;
    background: rgba(0, 20, 0, 0.9);
}

body.phosphor-mode .section-title span {
    color: var(--primary-color);
}

body.phosphor-mode *:not(i) {
    font-family: 'Space Grotesk', monospace !important;
}

/* HUD / Monitoring Panel */
.tech-hud {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 260px;
    background: rgba(0, 20, 0, 0.95);
    border: 1px solid var(--primary-color);
    padding: 15px;
    z-index: 2000;
    box-shadow: 0 0 30px rgba(51, 255, 51, 0.2);
    font-family: monospace;
    backdrop-filter: blur(10px);
}

.hud-item {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    margin-bottom: 10px;
    border-bottom: 1px solid rgba(51, 255, 51, 0.1);
    padding-bottom: 4px;
}

.hud-label {
    color: var(--text-muted);
}

.hud-value {
    color: var(--primary-color);
    font-weight: bold;
}

.hud-value.status-online {
    animation: ledPulse 2s infinite;
}

@keyframes ledPulse {
    0% {
        opacity: 0.5;
    }

    50% {
        opacity: 1;
        text-shadow: 0 0 10px var(--primary-color);
    }

    100% {
        opacity: 0.5;
    }
}

.hud-canvas-container {
    height: 50px;
    margin-top: 15px;
}

/* CRT Overlay Effect */
.crt-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.1) 50%),
        linear-gradient(90deg, rgba(255, 0, 0, 0.04), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.04));
    z-index: 9999;
    background-size: 100% 4px, 4px 100%;
    pointer-events: none;
    opacity: 0.4;
}

/* 1. Glitch Effect */
.glitch-flash {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
    z-index: 10000;
    pointer-events: none;
    display: none;
}

.glitch-flash.active {
    display: block;
    animation: glitchAnim 0.4s ease-out forwards;
}

@keyframes glitchAnim {
    0% {
        transform: translate(0);
        opacity: 0.8;
        clip-path: inset(10% 0 30% 0);
    }

    50% {
        transform: translate(-10px, 5px);
        clip-path: inset(40% 0 10% 0);
    }

    100% {
        transform: translate(0);
        opacity: 0;
    }
}

/* 2. System Log Sidebar */
.system-log-sidebar {
    position: fixed;
    left: 10px;
    bottom: 80px;
    width: 220px;
    height: 220px;
    background: rgba(0, 0, 0, 0.6);
    border-left: 2px solid var(--primary-color);
    padding: 10px 12px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    color: var(--primary-color);
    z-index: 1000;
    overflow: hidden;
    user-select: none;
    display: none;
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(8px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.system-log-sidebar.minimized {
    height: 32px;
    width: 160px;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.82);
}

.log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    border-bottom: 1px solid rgba(0, 242, 254, 0.2);
    padding-bottom: 5px;
    font-weight: 800;
    letter-spacing: 1px;
}

.log-toggle {
    cursor: pointer;
    font-size: 0.8rem;
    transition: transform 0.3s;
}

.system-log-sidebar.minimized .log-toggle {
    transform: rotate(180deg);
}

.log-entry {
    margin-bottom: 5px;
    opacity: 0;
    animation: logIn 0.3s forwards;
}

@keyframes logIn {
    to {
        opacity: 1;
    }
}

/* 3. Root Identity Card */
.root-id-card {
    background: rgba(0, 0, 0, 0.9);
    border: 1px solid var(--primary-color);
    border-radius: 6px;
    overflow: hidden;
    margin-top: 20px;
    max-width: 450px;
    display: none;
}

.root-id-header {
    background: var(--primary-color);
    color: #000;
    padding: 4px 12px;
    font-weight: bold;
    font-size: 0.7rem;
    text-transform: uppercase;
    display: flex;
    justify-content: space-between;
}

.root-id-body {
    padding: 20px;
    font-family: monospace;
}

.id-field {
    display: flex;
    margin-bottom: 8px;
    font-size: 0.8rem;
}

.id-label {
    color: var(--text-muted);
    width: 130px;
}

.id-value {
    color: var(--primary-color);
    font-weight: bold;
}

/* 4. Precision Cursor */
.precision-cursor {
    position: fixed;
    width: 50px;
    height: 50px;
    border: 1px solid var(--primary-color);
    border-radius: 50%;
    pointer-events: none;
    z-index: 10001;
    display: none;
    transform: translate(-50%, -50%);
}

.precision-cursor::before {
    content: '';
    position: absolute;
    background: var(--primary-color);
    top: 50%;
    left: 0;
    width: 100%;
    height: 1px;
}

.precision-cursor::after {
    content: '';
    position: absolute;
    background: var(--primary-color);
    left: 50%;
    top: 0;
    width: 1px;
    height: 100%;
}

.cursor-coords {
    position: absolute;
    top: 55px;
    left: 10px;
    font-size: 0.6rem;
    color: var(--primary-color);
    white-space: nowrap;
    background: rgba(0, 0, 0, 0.5);
    padding: 2px 5px;
}

body.phosphor-mode {
    cursor: none !important;
}

body.phosphor-mode #custom-cursor,
body.phosphor-mode .system-log-sidebar,
body.phosphor-mode .root-id-card {
    display: block;
}

body.phosphor-mode .hero-desc-standard {
    display: none;
}

/* Tech Metadata on Skills */
.skill-tag-container {
    position: relative;
    margin: 5px;
    display: flex;
    flex-direction: column;
}

.tech-cmd {
    font-size: 0.65rem;
    color: var(--primary-color);
    background: rgba(0, 0, 0, 0.7);
    padding: 3px 8px;
    border-radius: 4px;
    display: none;
    /* Hidden by default */
    margin-top: 5px;
    border: 1px solid rgba(51, 255, 51, 0.3);
    white-space: nowrap;
}

body.phosphor-mode .tech-cmd {
    display: block;
}

/* View Switcher */
.view-switcher {
    display: flex;
    background: rgba(255, 255, 255, 0.05);
    padding: 5px;
    border-radius: 50px;
    border: 1px solid var(--glass-border);
}

.view-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 8px 20px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    transition: var(--transition-smooth);
    letter-spacing: 1px;
}

.view-btn.active {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 15px rgba(0, 242, 254, 0.3);
}

/* Topology Container */
.topology-container {
    width: 100%;
    height: 600px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    position: relative;
    overflow: hidden;
    cursor: grab;
}

.topology-container:active {
    cursor: grabbing;
}

#topologyCanvas {
    width: 100%;
    height: 100%;
}

.topology-tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.9);
    border: 1px solid var(--primary-color);
    padding: 10px;
    border-radius: 8px;
    color: white;
    font-size: 0.8rem;
    pointer-events: none;
    display: none;
    z-index: 100;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

body.phosphor-mode .topology-container {
    background: #000c00;
    border-color: #004d00;
}

/* Cookie Protocol Banner */
.cookie-banner-wrapper {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(150%);
    width: 95%;
    max-width: 900px;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(20px);
    border: 1px solid var(--primary-color);
    border-radius: 12px;
    padding: 15px 25px;
    z-index: 10005;
    transition: transform 0.8s cubic-bezier(0.19, 1, 0.22, 1);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.9), 0 0 30px rgba(0, 242, 254, 0.1);
}

.cookie-banner-wrapper.active {
    transform: translateX(-50%) translateY(0);
}

@media (max-width: 991px) {
    .cookie-banner-wrapper {
        width: 100% !important;
        bottom: 0 !important;
        left: 0 !important;
        transform: translateY(150%);
        border-radius: 12px 12px 0 0 !important;
        border-bottom: none !important;
        padding: 20px !important;
        /* FINAL BUMP (+20px as per user request): Aggressively increase padding to ensure full clearance */
        padding-bottom: calc(105px + env(safe-area-inset-bottom, 50px)) !important;
    }

    .cookie-banner-wrapper.active {
        transform: translateY(0) !important;
        left: 0 !important;
    }
}

.cookie-banner-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 30px;
}

.cookie-text {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-family: inherit;
    line-height: 1.4;
}

.cookie-link {
    color: var(--primary-color);
    text-decoration: underline;
    margin-left: 10px;
    font-weight: bold;
    cursor: pointer;
}

.cookie-actions {
    display: flex;
    gap: 12px;
}

.btn-cookie-accept,
.btn-cookie-deny {
    background: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    font-size: 0.75rem;
    padding: 8px 18px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 800;
    transition: all 0.3s ease;
    text-transform: uppercase;
    white-space: nowrap;
}

.btn-cookie-accept {
    background: var(--primary-color);
    color: #000;
}

.btn-cookie-accept:hover {
    box-shadow: 0 0 20px var(--primary-color);
    filter: brightness(1.2);
}

.btn-cookie-deny:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-color: #fff;
}

/* Tech Modal Overlay */
.tech-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 10010;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 20px;
    overflow-y: auto; /* Ensure scroll if content is too tall */
}

@media (max-width: 768px) {
    .tech-modal-overlay {
        align-items: flex-start; /* Better for tall content on small screens */
        padding: 10px;
    }
}

.tech-modal-overlay.active {
    display: flex;
}

.tech-modal-container {
    width: 100%;
    max-width: 650px;
    border: 1px solid var(--primary-color);
    box-shadow: 0 0 50px rgba(0, 242, 254, 0.2);
}

.tech-modal-header {
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title-text {
    color: var(--primary-color);
    font-weight: 900;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.modal-close-btn {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
}

.tech-modal-body {
    padding: 30px;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-muted);
}

@media (max-width: 768px) {
    .tech-modal-body {
        padding: 20px !important;
        font-size: 0.85rem !important;
    }
    
    .legal-section p {
        margin-bottom: 15px !important;
    }
}

@media (max-width: 991px) {
    .cookie-banner-content {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }

    .cookie-actions {
        display: flex; /* Re-affirm flex for column */
        flex-direction: column !important;
        width: 100%;
        gap: 12px;
    }

    .btn-cookie-accept, .btn-cookie-deny {
        width: 100% !important;
        padding: 12px !important; /* Slightly more compact for mobile */
        font-size: 0.85rem !important;
    }
}

/* Premium UI Effects Base */
/* NOTE: perspective intentionally NOT on body – it would break position:fixed elements */
/* (cookie banner, scroll-to-top btn). Perspective is applied per-card instead. */

.glass-card {
    perspective: 1500px;
    transform-style: preserve-3d;
    transition: transform 0.1s ease-out, box-shadow 0.3s ease;
    will-change: transform;
}

.btn-premium, .btn-premium-outline {
    transition: transform 0.2s cubic-bezier(0.23, 1, 0.32, 1), box-shadow 0.3s ease;
    will-change: transform;
}

/* --- CYBER HUD ENHANCEMENTS --- */
/* 1. Boot Sequence Loader */
#boot-loader {
    position: fixed;
    inset: 0;
    background: #05070a;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 10%;
    font-family: 'Space Grotesk', monospace;
    color: var(--primary-color);
}

.boot-line {
    font-size: 14px;
    margin-bottom: 5px;
    opacity: 0;
    transform: translateX(-10px);
}

.boot-line.active {
    opacity: 1;
    transform: translateX(0);
    transition: all 0.1s ease;
}

.boot-cursor {
    display: inline-block;
    width: 8px;
    height: 15px;
    background: var(--primary-color);
    animation: blink 0.5s infinite;
    vertical-align: middle;
}

@keyframes blink { 50% { opacity: 0; } }

/* 2. Data Leaks (Floating Code) */
.data-leak {
    position: absolute;
    font-family: 'Space Grotesk', monospace;
    font-size: 10px;
    color: var(--primary-color);
    opacity: 0.08;
    white-space: nowrap;
    pointer-events: none;
    user-select: none;
    z-index: -1;
    animation: float-leak 25s linear infinite;
}

@keyframes float-leak {
    from { transform: translateY(100vh); }
    to { transform: translateY(-100px); }
}

/* 3. System Notifications */
#system-notifications {
    position: fixed;
    bottom: 25px;
    left: 25px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.hud-notif {
    background: rgba(0, 242, 254, 0.05);
    border-left: 3px solid var(--primary-color);
    backdrop-filter: blur(8px);
    padding: 12px 18px;
    color: #fff;
    font-family: 'Space Grotesk', monospace;
    font-size: 11px;
    text-transform: uppercase;
    animation: notif-slide 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 15px rgba(0,0,0,0.6);
    letter-spacing: 1px;
    border-radius: 0 4px 4px 0;
    max-width: 260px;
}

@media (max-width: 768px) {
    #system-notifications {
        display: none !important;
    }
}

@keyframes notif-slide {
    from { transform: translateX(-100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.notif-label { color: var(--primary-color); margin-right: 10px; font-weight: bold; }

/* 1. Interactive Glitch */
.hero-title:hover {
    animation: hero-glitch 0.2s infinite !important;
    cursor: crosshair;
}

/* 2. Scan Beam */
.scan-beam {
    position: absolute;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
    box-shadow: 0 0 15px var(--primary-color);
    z-index: 100;
    pointer-events: none;
    opacity: 0;
}

.scan-active {
    animation: scan-move 1.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes scan-move {
    0% { top: 0; opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { top: 100%; opacity: 0; }
}

/* 3. Header HUD Minimalist */
.header-hud {
    position: fixed;
    top: 70px;
    left: 0;
    width: 100%;
    height: 30px;
    background: rgba(5, 7, 10, 0.8);
    backdrop-filter: blur(5px);
    border-bottom: 1px solid rgba(0, 242, 254, 0.2);
    z-index: 999;
    padding: 0 5%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: 'Space Grotesk', monospace;
    font-size: 10px;
    color: var(--primary-color);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.hud-item span { color: #fff; margin-left: 5px; }

/* 4. Circuit Connectors */
.circuit-container {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: -1;
    opacity: 0.12;
}

.circuit-line {
    position: absolute;
    background: var(--primary-color);
}

.circuit-line.v { width: 1px; height: 120px; }
.circuit-line.h { height: 1px; width: 120px; }

.circuit-dot {
    position: absolute;
    width: 3px;
    height: 3px;
    background: var(--primary-color);
    border-radius: 50%;
    box-shadow: 0 0 5px var(--primary-color);
}
/* --- FIX: STICKY FOOTER --- */
footer {
    margin-top: auto !important;
    border-top: 1px solid rgba(255,255,255,0.06);
    background: linear-gradient(to bottom, transparent, rgba(0, 242, 254, 0.02));
    position: relative;
    /* Ensure bottom content is visible on mobile safe areas (Samsung navigation bars) */
    padding-bottom: calc(50px + env(safe-area-inset-bottom, 30px)) !important;
}

/* Fix email largo en footer en pantallas pequeñas */
@media (max-width: 480px) {
    footer a {
        word-break: break-all;
    }
    footer .d-flex {
        flex-wrap: wrap;
        justify-content: center !important;
        gap: 12px !important;
    }
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
}

footer .fab {
    font-size: 1.3rem;
    transition: color 0.3s ease, transform 0.3s ease;
    cursor: default;
}

footer .fab:hover {
    color: var(--primary-color) !important;
    transform: translateY(-3px);
}

/* ─── SCROLL PROGRESS BAR ────────────────────────────────────────────────── */
#scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 2px;
    width: 0%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    z-index: 99999;
    pointer-events: none;
    box-shadow: 0 0 8px var(--primary-color);
    transition: width 0.1s linear;
}

body.light-mode #scroll-progress {
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    box-shadow: none;
}

/* ─── KONAMI OVERLAY ─────────────────────────────────────────────────────── */
#konami-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.88);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

#konami-overlay.konami-visible {
    opacity: 1;
}

#konami-box {
    font-family: 'JetBrains Mono', 'Space Grotesk', monospace;
    font-size: 1.1rem;
    color: #33ff33;
    border: 1px solid #33ff33;
    padding: 32px 48px;
    background: rgba(0, 10, 0, 0.95);
    box-shadow: 0 0 40px rgba(51, 255, 51, 0.3), inset 0 0 20px rgba(51, 255, 51, 0.05);
    text-align: left;
}

.konami-line {
    margin-bottom: 10px;
    opacity: 0;
    animation: konami-appear 0.3s forwards;
}

.konami-line:nth-child(1) { animation-delay: 0.1s; }
.konami-line:nth-child(2) { animation-delay: 0.5s; }
.konami-line:nth-child(3) { animation-delay: 0.9s; }
.konami-line:nth-child(4) { animation-delay: 1.4s; }

@keyframes konami-appear {
    from { opacity: 0; transform: translateX(-8px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* ─── NEW EFFECTS ─────────────────────────────────────────────────────────── */

/* Periodic glitch on section titles */
@keyframes title-glitch-anim {
    0%   { transform: translate(0) skewX(0); filter: none; }
    20%  { transform: translate(-4px, 1px) skewX(-3deg); filter: hue-rotate(90deg); opacity: 0.85; }
    40%  { transform: translate(4px, -1px) skewX(2deg); filter: hue-rotate(-60deg); }
    60%  { transform: translate(-2px, 0) skewX(0); filter: none; opacity: 1; }
    80%  { transform: translate(1px, 1px); }
    100% { transform: translate(0); }
}

.title-glitch-active {
    animation: title-glitch-anim 0.35s steps(2) forwards;
    color: var(--primary-color) !important;
}


/* --- FIX: PREVENT VERTICAL OVERFLOW BEYOND FOOTER --- */
section, header, footer {
    position: relative;
    overflow: hidden; /* Clips circuit lines and floating elements per section */
}

body {
    max-width: 100vw;
    overflow-x: hidden;
    /* GLOBAL MOBILE FIX: Garantiza espacio al final para la barra de sistema */
}

@media (max-width: 768px) {
    body {
        padding-bottom: 120px !important;
    }
}

/* Ensure data leaks don't expand the page height */
.data-leak {
    pointer-events: none;
    z-index: -1;
}

/* --- X-RAY DIAGNOSTIC MODE (PHOSPHOR) --- */
body.phosphor-mode * {
    outline: 1px solid rgba(51, 255, 51, 0.15) !important;
}

body.phosphor-mode {
    outline: none !important;
}

body.phosphor-mode .navbar,
body.phosphor-mode .glass-card,
body.phosphor-mode section {
    outline: 1px solid rgba(51, 255, 51, 0.4) !important;
    background: rgba(0, 15, 0, 0.8) !important;
}

body.phosphor-mode .text-primary,
body.phosphor-mode h1,
body.phosphor-mode h2,
body.phosphor-mode h3,
body.phosphor-mode h4,
body.phosphor-mode .fas,
body.phosphor-mode .fab {
    color: #33ff33 !important;
    text-shadow: 0 0 10px rgba(51, 255, 51, 0.5);
    background: none !important;
    -webkit-text-fill-color: initial !important;
}

body.phosphor-mode .btn-premium {
    background: transparent !important;
    border: 1px solid #33ff33 !important;
    color: #33ff33 !important;
    box-shadow: 0 0 15px rgba(51, 255, 51, 0.2);
}

body.phosphor-mode .btn-premium-outline {
    border: 1px dashed #33ff33 !important;
    color: #33ff33 !important;
}

body.phosphor-mode .section-title::after {
    background: #33ff33 !important;
}


#admin-logs-trigger:hover {
    background: rgba(0, 242, 254, 0.2) !important;
    box-shadow: 0 0 15px rgba(0, 242, 254, 0.1);
}
#admin-logs-trigger:hover .id-value {
    text-shadow: 0 0 8px var(--primary-color);
}

/* Custom Hover Effects */
.hover-cyan:hover {
    color: var(--primary-color) !important;
    text-shadow: 0 0 8px var(--primary-color);
    transition: all 0.2s ease;
}
