@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
}

html {
    scroll-behavior: smooth;
    /* Offset para anclajes refinado */
    scroll-padding-top: 72px; /* 73 -> 72 (-1px) */
}

/* Efecto de encendido gradual para el typewriter */
#typewriter-text {
    opacity: 0;
    filter: brightness(0.3) blur(2px);
    transition: all 2s ease-out;
}

#typewriter-text.power-on {
    opacity: 1;
    filter: brightness(1) blur(0px);
}

@keyframes powerOn {
    0% {
        opacity: 0;
        filter: brightness(0.1) blur(4px) contrast(0.5);
        text-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
    }
    20% {
        opacity: 0.3;
        filter: brightness(0.4) blur(3px) contrast(0.7);
        text-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
    }
    50% {
        opacity: 0.6;
        filter: brightness(0.7) blur(1px) contrast(0.9);
        text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
    }
    80% {
        opacity: 0.9;
        filter: brightness(0.95) blur(0.5px) contrast(1);
        text-shadow: 0 0 25px rgba(255, 255, 255, 0.7);
    }
    100% {
        opacity: 1;
        filter: brightness(1) blur(0px) contrast(1);
        text-shadow: 0 0 30px rgba(255, 255, 255, 0.8), 0 0 40px rgba(254, 91, 44, 0.3);
    }
}

body { 
    font-family: 'Inter', sans-serif; 
    overflow-x: hidden;
}

/* Hero Background */
.hero-bg {
    background: linear-gradient(
        135deg,
        rgba(19, 40, 46, 0.95) 0%,
        rgba(24, 51, 59, 0.85) 50%,
        rgba(19, 40, 46, 0.95) 100%
    ),
    url('../images/background.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    min-height: 100vh;
    position: relative;
}

.hero-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse at center, transparent 0%, rgba(19, 40, 46, 0.3) 100%);
    pointer-events: none;
}

/* Animaciones */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(50px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.glass-effect {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.text-glow {
    text-shadow: 0 0 20px rgba(254, 91, 44, 0.5);
}

.card-hover {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-hover:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
}

/* Scroll indicator */
.scroll-indicator {
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #fe5b2c, #18333b);
    border-radius: 4px;
}

.navbar-blur {
    backdrop-filter: blur(20px);
    background: rgba(255, 255, 255, 0.95);
    /* Eliminado borde para evitar corte brusco */
    border-bottom: none;
    box-shadow: 0 2px 4px -2px rgba(0,0,0,0.05), 0 4px 12px -2px rgba(0,0,0,0.06);
}

.section-padding {
    padding: 120px 0;
}

/* Eliminado scroll-margin-top en section: ahora se usa scroll-padding-top en html para compensar el navbar fijo */

/* Clase opcional para ajustar aún más un ancla concreta si hiciera falta */
.anchor-fine-tune { scroll-margin-top: 90px; }

/* Botón flotante para subir al inicio */
.scroll-to-top-btn {
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.scroll-to-top-btn.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-to-top-btn:hover {
    box-shadow: 0 10px 30px rgba(254, 91, 44, 0.4);
}

/* Efecto de máquina de escribir */
#typewriter-cursor {
    color: #fe5b2c;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

#typewriter-text {
    min-height: 1.2em;
    display: inline-block;
    word-break: break-word;
    hyphens: auto;
}

/* Responsive font sizes para el typewriter */
@media (max-width: 640px) {
    #typewriter-text {
        font-size: 0.9em;
        line-height: 1.1;
    }
}

@media (min-width: 641px) and (max-width: 768px) {
    #typewriter-text {
        font-size: 1em;
        line-height: 1.2;
    }
}

@media (min-width: 769px) {
    #typewriter-text {
        font-size: 1em;
        line-height: 1.1;
    }
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Animación simple del dado */
.dice-bounce {
    animation: diceBounce 0.6s ease-out;
}

@keyframes diceBounce {
    0% { 
        transform: translateY(0px) scale(1); 
    }
    40% { 
        transform: translateY(-15px) scale(1.1); 
    }
    60% { 
        transform: translateY(-8px) scale(1.05); 
    }
    80% { 
        transform: translateY(-3px) scale(1.02); 
    }
    100% { 
        transform: translateY(0px) scale(1); 
    }
}

/* Estilos para los personajes y bocadillos de conversación */
.pixel-art {
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    font-size: 2rem;
    text-shadow: 2px 2px 0px rgba(0,0,0,0.3);
}

.character-float {
    animation: characterFloat 4s ease-in-out infinite;
}

@keyframes characterFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-6px); }
}

.character-talk {
    animation: characterTalk 0.4s ease-in-out;
}

@keyframes characterTalk {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Bocadillos de diálogo para 6 personajes */
.speech-bubble {
    position: absolute;
    border-radius: 16px;
    padding: 14px 18px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
    min-width: 200px;
    max-width: 280px;
    transition: all 0.3s ease;
    z-index: 10;
    font-size: 13px;
    line-height: 1.45;
    background: linear-gradient(135deg,#ffffff,#f8fafc);
    border:2px solid #e2e8f0;
}

/* Paleta por personaje */
/* Paleta ajustada para coincidir exactamente con avatar + etiqueta */
.bubble-cto { background:linear-gradient(135deg,#eff6ff,#dbeafe); border-color:#3b82f6; }
.bubble-designer { background:linear-gradient(135deg,#fdf2f8,#fce7f3); border-color:#ec4899; }
.bubble-hr { background:linear-gradient(135deg,#e0e7ff,#eef2ff); border-color:#6366f1; }
.bubble-programmer { background:linear-gradient(135deg,#ecfdf5,#d1fae5); border-color:#059669; }
.bubble-reviewer { background:linear-gradient(135deg,#f3e8ff,#ede9fe); border-color:#8b5cf6; }
.bubble-tester { background:linear-gradient(135deg,#fef9c3,#fef3c7); border-color:#ca8a04; }

.bubble-cto .speech-content { color:#1d4ed8; }
.bubble-designer .speech-content { color:#9d174d; }
.bubble-hr .speech-content { color:#4338ca; }
.bubble-programmer .speech-content { color:#065f46; }
.bubble-reviewer .speech-content { color:#6d28d9; }
.bubble-tester .speech-content { color:#854d0e; }

/* Eliminar todas las reglas de flechas - ya no son necesarias */

/* Colores de flecha responsive (arriba) ya están definidos arriba */

.bubble-cto a, .bubble-designer a, .bubble-hr a, .bubble-programmer a, .bubble-reviewer a, .bubble-tester a { text-decoration:underline; }

/* Adaptación para el grid del equipo - bocadillos popup flotantes */
.team-grid .character-wrapper { 
    position: relative; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    text-align: center;
    overflow: visible;
}

/* Asegurar que el contenedor del equipo tenga suficiente padding */
#equipo .container {
    padding-left: 2rem;
    padding-right: 2rem;
}

@media (min-width: 1024px) {
    #equipo .container {
        padding-left: 3rem;
        padding-right: 3rem;
    }
}

.team-grid .team-bubble { 
    position: absolute;
    top: calc(50% - 30px);
    left: calc(100% - 100px);
    transform: translateY(-50%);
    min-width: 180px;
    max-width: 220px;
    font-size: 11px;
    z-index: 10;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-50%) translateX(-5px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    padding: 8px 12px;
    border-radius: 12px;
}

/* Eliminar flechas - sin pseudo-elemento */

/* Estados de visibilidad - ajustados para nueva posición */
.team-grid .speech-bubble.hide { 
    opacity: 0;
    visibility: hidden;
    transform: translateY(calc(-50% - 30px)) translateX(-5px) scale(0.95);
}

.team-grid .speech-bubble.show { 
    opacity: 1;
    visibility: visible;
    transform: translateY(calc(-50% - 30px)) translateX(0) scale(1);
}

/* Adaptación responsive - también más arriba en móvil */
@media (max-width: 768px) {
    .team-grid .team-bubble {
        left: 50%;
        top: calc(-100px - 30px);
        transform: translate(-50%, 0);
        min-width: 160px;
        max-width: 200px;
        font-size: 10px;
        padding: 6px 10px;
    }
    
    .team-grid .speech-bubble.hide {
        transform: translate(-50%, -10px) scale(0.95);
    }
    
    .team-grid .speech-bubble.show {
        transform: translate(-50%, 0) scale(1);
    }
}

/* Reglas de flechas móviles eliminadas */

@media (min-width: 640px) {
    .team-grid .team-bubble { font-size: 13px; }
}

@media (min-width: 1024px) {
    .team-grid .team-bubble { font-size: 14px; }
}

/* Bocadillos superiores */
.speech-bubble-left {
    bottom: 100%;
    left: 100%;
    margin-left: 10px;
    margin-bottom: 15px;
}

.speech-bubble-left::after {
    content: '';
    position: absolute;
    left: -8px;
    top: 50%;
    transform: translateY(-50%);
    border: 8px solid transparent;
    border-right-color: #6366f1;
}

.speech-bubble-left::before {
    content: '';
    position: absolute;
    left: -6px;
    top: 50%;
    transform: translateY(-50%);
    border: 6px solid transparent;
    border-right-color: white;
}

.speech-bubble-center {
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 15px;
}

.speech-bubble-center::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    border: 8px solid transparent;
    border-top-color: #6366f1;
}

.speech-bubble-center::before {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: white;
}

.speech-bubble-right {
    bottom: 100%;
    right: 100%;
    margin-right: 10px;
    margin-bottom: 15px;
}

.speech-bubble-right::after {
    content: '';
    position: absolute;
    right: -8px;
    top: 50%;
    transform: translateY(-50%);
    border: 8px solid transparent;
    border-left-color: #6366f1;
}

.speech-bubble-right::before {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    border: 6px solid transparent;
    border-left-color: white;
}

/* Bocadillos inferiores */
.speech-bubble-left-bottom {
    top: 100%;
    left: 100%;
    margin-left: 10px;
    margin-top: 15px;
}

.speech-bubble-left-bottom::after {
    content: '';
    position: absolute;
    left: -8px;
    top: 50%;
    transform: translateY(-50%);
    border: 8px solid transparent;
    border-right-color: #6366f1;
}

.speech-bubble-left-bottom::before {
    content: '';
    position: absolute;
    left: -6px;
    top: 50%;
    transform: translateY(-50%);
    border: 6px solid transparent;
    border-right-color: white;
}

.speech-bubble-center-bottom {
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 15px;
}

.speech-bubble-center-bottom::after {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    border: 8px solid transparent;
    border-bottom-color: #6366f1;
}

.speech-bubble-center-bottom::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-bottom-color: white;
}

.speech-bubble-right-bottom {
    top: 100%;
    right: 100%;
    margin-right: 10px;
    margin-top: 15px;
}

.speech-bubble-right-bottom::after {
    content: '';
    position: absolute;
    right: -8px;
    top: 50%;
    transform: translateY(-50%);
    border: 8px solid transparent;
    border-left-color: #6366f1;
}

.speech-bubble-right-bottom::before {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    border: 6px solid transparent;
    border-left-color: white;
}

.speech-bubble.show {
    opacity: 1 !important;
    transform: translateY(0px) scale(1);
}

.speech-bubble.hide {
    opacity: 0 !important;
    transform: translateY(10px) scale(0.8);
}

/* Partículas flotantes */
.floating-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(255,255,255,0.3);
    border-radius: 50%;
    animation: floatParticle 8s ease-in-out infinite;
}

@keyframes floatParticle {
    0%, 100% { 
        transform: translateY(0px) scale(1);
        opacity: 0.3;
    }
    50% { 
        transform: translateY(-30px) scale(1.5);
        opacity: 0.8;
    }
}

/* Gradiente de texto */
.text-gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Chips estadísticas */
.stat-chip {
    background: linear-gradient(145deg,#ffffff,#f3f4f6);
    border:1px solid #e5e7eb;
    padding:8px 14px;
    border-radius: 9999px;
    display:flex;
    align-items:center;
    gap:6px;
    box-shadow:0 2px 4px -1px rgba(0,0,0,0.06),0 1px 2px -1px rgba(0,0,0,0.04);
    font-weight:500;
    color:#374151;
}
.stat-chip:hover { box-shadow:0 4px 10px -2px rgba(0,0,0,0.08); }
