/* ============================================
   CYBERTEC - Estilos Base
   Brand Colors Schema
   ============================================ */

/* @font-face - Polymath (Display / Headings) */
@font-face {
    font-family: 'Polymath';
    src: url('fonts/Polymath/PolymathDispDemo-Regular.otf') format('opentype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Polymath';
    src: url('fonts/Polymath/PolymathDispDemo-Medium.otf') format('opentype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Polymath';
    src: url('fonts/Polymath/PolymathDispDemo-Semibold.otf') format('opentype');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Polymath';
    src: url('fonts/Polymath/PolymathDispDemo-Bold.otf') format('opentype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Polymath';
    src: url('fonts/Polymath/PolymathDispDemo-Black.otf') format('opentype');
    font-weight: 900;
    font-style: normal;
    font-display: swap;
}

/* @font-face - Bahnschrift (Body / UI) */
@font-face {
    font-family: 'Bahnschrift';
    src: url('fonts/Bahnschrift/BAHNSCHRIFT%201.TTF') format('truetype');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Bahnschrift';
    src: url('fonts/Bahnschrift/BAHNSCHRIFT.TTF') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Bahnschrift';
    src: url('fonts/Bahnschrift/BAHNSCHRIFT%204.TTF') format('truetype');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Bahnschrift';
    src: url('fonts/Bahnschrift/BAHNSCHRIFT%205.TTF') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* CSS Variables - Brand Palette */
:root {
    --cybertec-radar: #1B92D0;      /* Radar Blue (Primary) */
    --cybertec-navy: #181D5E;       /* Command Navy (Institutional) */
    --cybertec-graphite: #202020;   /* Grafito Táctico (Secondary) */
    --cybertec-base: #020617;       /* Dark Base */
    --cybertec-surface: #0f172a;    /* Surface */
    --cybertec-highlight: #1e293b;  /* Highlight */
}

/* Base Dark Rules */
body {
    background-color: #020617;
    color: #f8fafc;
}

/* Grid Background Animation */
.cyber-grid {
    background-size: 50px 50px;
    background-image: linear-gradient(to right, rgba(30, 41, 59, 0.5) 1px, transparent 1px),
                      linear-gradient(to bottom, rgba(30, 41, 59, 0.5) 1px, transparent 1px);
    mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 40%, rgba(0,0,0,0) 100%);
    perspective: 1000px;
    transform-style: preserve-3d;
}

/* Hero Laser Load Scan */
@keyframes heroLaserSweep {
    0% {
        left: -60%;
        opacity: 0;
    }
    5% {
        opacity: 1;
    }
    95% {
        opacity: 1;
    }
    100% {
        left: 110%;
        opacity: 0;
    }
}

@keyframes heroLaserReveal {
    0% {
        opacity: 0;
        transform: scaleX(0);
    }
    60% {
        opacity: 1;
        transform: scaleX(1);
    }
    85% {
        opacity: 0.6;
    }
    100% {
        opacity: 0;
        transform: scaleX(1);
    }
}

.hero-laser-sweep {
    position: absolute;
    top: 0;
    left: -60%;
    width: 55%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(27, 146, 208, 0.04) 20%,
        rgba(27, 146, 208, 0.18) 48%,
        rgba(255, 255, 255, 0.25) 50%,
        rgba(27, 146, 208, 0.18) 52%,
        rgba(27, 146, 208, 0.04) 80%,
        transparent 100%
    );
    animation: heroLaserSweep 1.6s cubic-bezier(0.4, 0, 0.2, 1) 0.3s 1 forwards;
    pointer-events: none;
    z-index: 10;
}

.hero-laser-sweep::after {
    content: '';
    position: absolute;
    top: 0;
    left: 40%;
    width: 2px;
    height: 100%;
    background: linear-gradient(
        180deg,
        transparent 0%,
        rgba(56, 189, 248, 0.8) 20%,
        rgba(255, 255, 255, 0.95) 50%,
        rgba(56, 189, 248, 0.8) 80%,
        transparent 100%
    );
    filter: blur(0.5px);
    box-shadow: 0 0 12px rgba(27, 146, 208, 0.9), 0 0 24px rgba(27, 146, 208, 0.5);
}

.hero-laser-underline {
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(27,146,208,0.6), rgba(56,189,248,1), rgba(255,255,255,0.8), rgba(56,189,248,1), rgba(27,146,208,0.6), transparent);
    transform-origin: left center;
    transform: scaleX(0);
    animation: heroLaserReveal 1.4s cubic-bezier(0.4, 0, 0.2, 1) 0.5s 1 forwards;
    box-shadow: 0 0 10px rgba(27, 146, 208, 0.7), 0 0 20px rgba(27, 146, 208, 0.4);
}

/* Glassmorphism */
.glass-panel {
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

.glass-card-hover {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.glass-card-hover:hover {
    transform: translateY(-5px) scale(1.01);
    border-color: rgba(27, 146, 208, 0.3);
    box-shadow: 0 10px 40px -10px rgba(27, 146, 208, 0.2);
}

/* Text Gradients */
.text-neon {
    background: linear-gradient(135deg, #1B92D0 0%, #38bdf8 100%);
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #0f172a;
}

::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

/* Service Image Overlay */
.service-img-overlay {
    background: linear-gradient(to top, #020617 10%, transparent 100%);
}

/* Keyframe Animations */
@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

@keyframes gridMove {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(50px);
    }
}

@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 0 15px rgba(27, 146, 208, 0.2);
    }
    50% {
        box-shadow: 0 0 30px rgba(27, 146, 208, 0.5);
    }
}

/* Laser Scan Line Animation */
@keyframes laserScan {
    0% {
        transform: translateX(-100%);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateX(100%);
        opacity: 0;
    }
}

@keyframes laserPulse {
    0%, 100% {
        opacity: 0.4;
        box-shadow: 0 0 6px rgba(27, 146, 208, 0.6);
    }
    50% {
        opacity: 1;
        box-shadow: 0 0 16px rgba(27, 146, 208, 1), 0 0 30px rgba(27, 146, 208, 0.4);
    }
}

@keyframes navLinkScan {
    0% { width: 0; left: 0; }
    50% { width: 100%; left: 0; }
    51% { width: 100%; left: 0; }
    100% { width: 0; left: 100%; }
}

/* Navbar Laser Line */
.nav-laser-line {
    position: relative;
    height: 2px;
    width: 100%;
    background: linear-gradient(90deg, transparent 0%, rgba(27,146,208,0.15) 20%, rgba(27,146,208,0.6) 50%, rgba(27,146,208,0.15) 80%, transparent 100%);
    animation: laserPulse 3s ease-in-out infinite;
    overflow: hidden;
}

.nav-laser-line::after {
    content: '';
    position: absolute;
    top: -1px;
    left: 0;
    width: 40%;
    height: 4px;
    background: linear-gradient(90deg, transparent, rgba(56, 189, 248, 0.9), rgba(255,255,255,0.8), rgba(56, 189, 248, 0.9), transparent);
    filter: blur(1px);
    animation: laserScan 3.5s ease-in-out infinite;
    border-radius: 2px;
}

/* Nav Link Hover Underline */
.nav-link {
    position: relative;
    padding-bottom: 2px;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: linear-gradient(90deg, rgba(27,146,208,0.8), rgba(56,189,248,0.8));
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 6px rgba(27,146,208,0.5);
}

.nav-link:hover::after {
    width: 100%;
}

/* Utility Classes */
.animate-gradient-slow {
    animation: gradient 8s ease infinite;
}

.opacity-10 {
    opacity: 0.1;
}

.opacity-20 {
    opacity: 0.2;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .cyber-grid {
        background-size: 40px 40px;
    }
}

/* Small mobile (360px) */
@media (max-width: 400px) {
    .cyber-grid {
        background-size: 30px 30px;
    }

    /* Prevent horizontal overflow */
    body {
        overflow-x: hidden;
    }

    /* Hero laser adjustments */
    .hero-laser-sweep {
        width: 70%;
    }

    /* Reduce glass card hover lift on touch */
    .glass-card-hover:hover {
        transform: translateY(-3px) scale(1.005);
    }

    /* Compact nav laser line */
    .nav-laser-line {
        height: 1px;
    }
    .nav-laser-line::after {
        height: 2px;
    }
}

/* Ensure touch targets are accessible */
@media (max-width: 640px) {
    a, button {
        min-height: 44px;
    }

    /* Prevent large absolute elements from causing overflow */
    .absolute {
        max-width: 100vw;
    }
}
