/* Iberica Visual - styles.css */

:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #1a0a2e;
    --accent-cyan: #00E5FF;
    --accent-magenta: #FF00E5;
    --accent-yellow: #FFE600;
    --text-light: #ffffff;
    --text-fade: rgba(255, 255, 255, 0.7);
    --transition-time: 0.3s;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-primary);
    background: var(--bg-primary);
    color: var(--text-light);
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: var(--accent-cyan);
}

a:hover {
    text-decoration: underline;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background-color: transparent;
    transition: background-color var(--transition-time);
    z-index: 999;
}

.navbar.scrolled {
    background-color: var(--bg-secondary);
}

.navbar-brand, .nav-link {
    color: var(--text-light);
    padding: 1rem;
    display: inline-block;
}

.nav-link:hover {
    color: var(--accent-cyan);
}

/* Hero Section */
.hero {
    position: relative;
    height: 100vh;
    background: radial-gradient(circle, var(--bg-secondary), var(--bg-primary));
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--text-light);
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40"><circle cx="20" cy="20" r="5" fill="var(--accent-cyan)" opacity="0.7"/></svg>');
    background-size: 20px 20px;
    animation: blink 1.5s step-end infinite;
}

@keyframes blink {
    to { background-position: -40px; }
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.2rem;
    max-width: 600px;
    line-height: 1.5;
}

/* Buttons */
.btn {
    padding: 1rem 2rem;
    color: var(--text-light);
    background-color: transparent;
    border: 2px solid var(--accent-cyan);
    transition: all var(--transition-time);
    cursor: pointer;
    position: relative;
}

.btn::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border: 1px solid var(--accent-cyan);
    box-shadow: 0 0 10px 5px var(--accent-cyan), 0 0 20px 10px rgba(0, 229, 255, 0.3);
    transition: all var(--transition-time);
    opacity: 0;
}

.btn:hover {
    background-color: linear-gradient(to right, var(--accent-cyan), var(--accent-magenta));
    color: var(--bg-primary);
}

.btn:hover::after {
    opacity: 1;
}

/* Cards */
.card {
    border: none;
    background-color: var(--bg-secondary);
    box-shadow: 0 4px 8px rgba(0, 255, 255, 0.3);
    transition: all var(--transition-time);
    position: relative;
    overflow: hidden;
}

.card img {
    width: 100%;
    height: auto;
    display: block;
}

.card-content {
    padding: 1rem;
}

.card::before {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    border: 2px solid var(--accent-cyan);
    box-shadow: inset 0 0 30px rgba(0, 255, 255, 0.7), 0 0 20px 10px rgba(0, 229, 255, 0.3);
    opacity: 0;
    transition: all var(--transition-time);
}

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

/* Sections */
.section {
    padding: 4rem 0;
    background-color: var(--bg-primary);
}

.section:nth-child(even) {
    background-color: linear-gradient(to right, var(--bg-secondary), var(--bg-primary));
}

.section h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    text-align: center;
}

/* Portfolio */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    padding: 2rem 0;
}

.portfolio-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(255, 255, 0, 0.3);
}

.portfolio-item img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform var(--transition-time);
}

.portfolio-item:hover img {
    transform: scale(1.1);
}

.portfolio-item::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, transparent, rgba(0, 255, 255, 0.7));
    opacity: 0;
    transition: opacity var(--transition-time);
}

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

/* Stats */
.stats-container {
    text-align: center;
    padding: 4rem 0;
}

.stat {
    display: inline-block;
    margin: 2rem;
    color: var(--text-light);
}

.stat-number {
    font-size: 3rem;
    margin-bottom: 1rem;
    transition: transform var(--transition-time);
}

.stat:hover .stat-number {
    transform: scale(1.1);
}

/* Form */
.form-container {
    padding: 4rem 0;
    text-align: center;
}

.form-group {
    margin-bottom: 1.5rem;
    position: relative;
}

.input-field {
    width: 80%;
    max-width: 600px;
    padding: 1rem;
    border: none;
    border-bottom: 2px solid var(--accent-cyan);
    background-color: transparent;
    color: var(--text-light);
    font-size: 1.1rem;
    outline: none;
}

.input-field:focus {
    border-bottom: 2px solid var(--accent-magenta);
    box-shadow: 0 0 10px rgba(255, 0, 255, 0.5);
}

.submit-btn {
    padding: 1rem 3rem;
    color: var(--text-light);
    background-color: transparent;
    border: 2px solid var(--accent-cyan);
    transition: all var(--transition-time);
    cursor: pointer;
}

.submit-btn:hover {
    background-color: linear-gradient(to right, var(--accent-cyan), var(--accent-magenta));
    color: var(--bg-primary);
}

/* Responsive */
@media (max-width: 992px) {
    .hero h1 {
        font-size: 2.5rem;
    }

    .hero p {
        font-size: 1rem;
    }

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

@media (max-width: 768px) {
    .navbar-brand, .nav-link {
        padding: 0.5rem;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .portfolio-grid {
        grid-template-columns: 1fr;
    }
}
/* === ANIMACIÓN 1: HERO PARTICLES CON CONEXIONES === */
#hero { position: relative; overflow: hidden; }
#hero-canvas {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 0;
    pointer-events: none;
}
.hero-content { position: relative; z-index: 2; }

/* === ANIMACIÓN 2: LOGO GLITCH RGB LED === */
.logo-glitch {
    position: relative;
    display: inline-block;
    color: var(--accent-cyan);
    font-weight: 700;
    text-shadow: 0 0 12px rgba(0, 229, 255, 0.6);
    letter-spacing: 3px;
}
.logo-glitch::before,
.logo-glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    overflow: hidden;
}
.logo-glitch::before {
    color: var(--accent-magenta);
    z-index: -1;
    animation: glitch-rgb-1 2.5s infinite linear;
    clip-path: polygon(0 0, 100% 0, 100% 35%, 0 35%);
}
.logo-glitch::after {
    color: var(--accent-yellow);
    z-index: -2;
    animation: glitch-rgb-2 2.5s infinite linear;
    clip-path: polygon(0 65%, 100% 65%, 100% 100%, 0 100%);
}
@keyframes glitch-rgb-1 {
    0%, 90%, 100% { transform: translate(0); }
    92% { transform: translate(-3px, 1px); }
    94% { transform: translate(3px, -1px); }
    96% { transform: translate(-1px, 0); }
    98% { transform: translate(1px, 0); }
}
@keyframes glitch-rgb-2 {
    0%, 88%, 100% { transform: translate(0); }
    90% { transform: translate(2px, -1px); }
    93% { transform: translate(-2px, 1px); }
    96% { transform: translate(1px, 0); }
}
.logo-glitch.reveal {
    animation: logo-reveal 1.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes logo-reveal {
    0%   { opacity: 0; transform: scale(0.7) skewX(25deg); filter: blur(25px); }
    40%  { opacity: 1; transform: scale(1.08) skewX(-5deg); filter: blur(0); }
    60%  { transform: scale(0.97) skewX(2deg); }
    100% { transform: scale(1) skewX(0); }
}

/* === ANIMACIÓN 3: SCROLL REVEAL === */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out, box-shadow 0.8s ease-out, border-color 0.5s ease;
}
.reveal-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}
.card.reveal-on-scroll {
    border: 1px solid transparent;
}
.card.reveal-on-scroll:hover {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 30px var(--accent-cyan) !important;
}
.card.reveal-on-scroll:nth-child(1).is-visible { box-shadow: 0 0 25px rgba(0, 229, 255, 0.5); }
.card.reveal-on-scroll:nth-child(2).is-visible { box-shadow: 0 0 25px rgba(255, 0, 229, 0.5); }
.card.reveal-on-scroll:nth-child(3).is-visible { box-shadow: 0 0 25px rgba(255, 230, 0, 0.5); }
.card.reveal-on-scroll:nth-child(4).is-visible { box-shadow: 0 0 25px rgba(0, 229, 255, 0.5); }

/* ====================================================================== */
/* === WEB-10 ANIMATIONS PROFESIONALES === */
/* ====================================================================== */

/* === 1. HERO TIPOGRAFÍA CINEMATOGRÁFICA === */
.title-letters {
    display: inline-block;
    perspective: 800px;
    font-weight: 800;
    letter-spacing: 4px;
}
.title-letters span {
    display: inline-block;
    color: var(--accent-cyan);
    text-shadow: 0 0 14px rgba(0, 229, 255, 0.7);
    opacity: 0;
    transform: translateY(-60px) rotateX(90deg);
    filter: blur(12px);
    animation: letter-drop 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.title-letters span:nth-child(1)  { animation-delay: 0.05s; }
.title-letters span:nth-child(2)  { animation-delay: 0.10s; }
.title-letters span:nth-child(3)  { animation-delay: 0.15s; }
.title-letters span:nth-child(4)  { animation-delay: 0.20s; }
.title-letters span:nth-child(5)  { animation-delay: 0.25s; }
.title-letters span:nth-child(6)  { animation-delay: 0.30s; }
.title-letters span:nth-child(7)  { animation-delay: 0.35s; }
.title-letters span:nth-child(8)  { animation-delay: 0.40s; }
.title-letters span:nth-child(9)  { animation-delay: 0.45s; }
.title-letters span:nth-child(10) { animation-delay: 0.50s; }
.title-letters span:nth-child(11) { animation-delay: 0.55s; }
.title-letters span:nth-child(12) { animation-delay: 0.60s; }
.title-letters span:nth-child(13) { animation-delay: 0.65s; }
.title-letters span:nth-child(14) { animation-delay: 0.70s; }
@keyframes letter-drop {
    0%   { opacity: 0; transform: translateY(-60px) rotateX(90deg); filter: blur(12px); }
    60%  { opacity: 1; transform: translateY(8px) rotateX(-10deg); filter: blur(0); }
    100% { opacity: 1; transform: translateY(0) rotateX(0); filter: blur(0); }
}
/* Subtitle fade-in tras el reveal */
.hero-subtitle { opacity: 0; animation: fade-up 0.8s 1.0s ease forwards; }
.hero-content .btn-cyan { opacity: 0; animation: fade-up 0.8s 1.3s ease forwards; }
@keyframes fade-up {
    0% { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* === 2. PANTALLA LED INTERACTIVA 5x3 === */
.led-panel {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    max-width: 600px;
    margin: 0 auto;
    padding: 16px;
    background: #0a0a0f;
    border: 2px solid rgba(0, 229, 255, 0.3);
    border-radius: 8px;
    box-shadow:
        0 0 40px rgba(0, 229, 255, 0.2),
        inset 0 0 30px rgba(0, 0, 0, 0.5);
}
.led-pixel {
    aspect-ratio: 1;
    background: #0a0a0f;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    transition: background 0.1s, box-shadow 0.15s, transform 0.1s;
    cursor: pointer;
}
.led-pixel.lit {
    background: var(--c, var(--accent-cyan));
    box-shadow:
        0 0 12px var(--c, var(--accent-cyan)),
        0 0 24px var(--c, var(--accent-cyan)),
        inset 0 0 8px rgba(255, 255, 255, 0.4);
    transform: scale(1.05);
}
.led-pixel.frozen {
    background: var(--c, #ffffff);
    box-shadow:
        0 0 20px #ffffff,
        0 0 40px var(--c, var(--accent-cyan));
}

/* === 3. SCAN-LINE LED === */
.scan-line {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-cyan), transparent);
    box-shadow: 0 0 20px var(--accent-cyan), 0 0 40px var(--accent-cyan);
    pointer-events: none;
    z-index: 9999;
    opacity: 0;
    transform: translateY(0);
}
.scan-line.active { opacity: 0.8; }

/* === 4. PARALLAX SECTIONS === */
.parallax-section { will-change: transform; transition: transform 0.1s linear; }

/* === 5. MORPH TITLE (letras se intercambian) === */
.morph-title {
    display: inline-block;
    position: relative;
}
.morph-title.is-morphing { color: var(--accent-magenta); transition: color 0.3s; }

/* === 6. CARDS EXPLOSION === */
.cards-explode .reveal-on-scroll {
    transform: scale(0) rotate(180deg);
}
.cards-explode .reveal-on-scroll.is-visible {
    transform: scale(1) rotate(0deg);
    transition: opacity 0.7s ease-out, transform 0.7s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.7s ease;
}
.cards-explode .col-md-3:nth-child(1) .reveal-on-scroll.is-visible { transition-delay: 0.0s; }
.cards-explode .col-md-3:nth-child(2) .reveal-on-scroll.is-visible { transition-delay: 0.1s; }
.cards-explode .col-md-3:nth-child(3) .reveal-on-scroll.is-visible { transition-delay: 0.2s; }
.cards-explode .col-md-3:nth-child(4) .reveal-on-scroll.is-visible { transition-delay: 0.3s; }

/* === 7. BOTÓN MICROINTERACCIONES === */
.btn-ripple {
    position: relative;
    overflow: hidden;
    isolation: isolate;
}
.btn-ripple .btn-shine {
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
    transition: left 0.6s ease;
    pointer-events: none;
    z-index: 1;
}
.btn-ripple:hover .btn-shine { left: 100%; }
.btn-ripple .btn-text { position: relative; z-index: 2; }
.btn-ripple:focus-visible {
    outline: 2px solid var(--accent-cyan);
    outline-offset: 4px;
    box-shadow: 0 0 20px var(--accent-cyan);
}

/* === 8. CURSOR CUSTOM + TRAIL === */
/* Solo ocultar cursor nativo si el JS confirma que cursor-dot existe (clase .custom-cursor en body) */
body.custom-cursor,
body.custom-cursor * { cursor: none !important; }
.cursor-dot {
    position: fixed;
    top: 0; left: 0;
    width: 12px; height: 12px;
    border-radius: 50%;
    background: var(--accent-cyan);
    box-shadow: 0 0 16px var(--accent-cyan);
    pointer-events: none;
    z-index: 10000;
    transform: translate(-50%, -50%);
    transition: width 0.2s, height 0.2s, background 0.2s, transform 0.05s;
}
.cursor-dot.is-hover {
    width: 28px; height: 28px;
    background: var(--accent-magenta);
    box-shadow: 0 0 24px var(--accent-magenta);
    transform: translate(-50%, -50%) scale(1.2);
}
.cursor-trail {
    position: fixed;
    top: 0; left: 0;
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--accent-yellow);
    box-shadow: 0 0 12px var(--accent-yellow);
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    opacity: 0.7;
    transition: width 0.3s, height 0.3s;
}

/* === 9. ACCESSIBILITY - reduce motion === */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .title-letters span { opacity: 1; transform: none; filter: none; }
    .hero-subtitle, .hero-content .btn-cyan { opacity: 1; }
    .reveal-on-scroll { opacity: 1; transform: none; }
    .cards-explode .reveal-on-scroll { transform: none; }
}
