@tailwind base;
@tailwind components;
@tailwind utilities;

/* Añadimos estilos personalizados usando @layer para que Tailwind los optimice */
@layer components {
    /* La clase blob para las formas borrosas de fondo */
    .blob {
        position: absolute;
        filter: blur(80px);
        opacity: 0.4;
        z-index: -1;
    }
}

@layer utilities {
    /* El cursor parpadeante para el efecto de escritura JS */
    .cursor-blink {
        animation: blink 1s step-end infinite;
    }
    
    /* Clases personalizadas para porcentajes de barras de progreso (para evitar estilos inline) */
    .w-90 { width: 90%; }
    .w-95 { width: 95%; }
    .w-80 { width: 80%; }
    .w-85 { width: 85%; } 
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* RESET SIMPLE */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* TIPOGRAFÍA FLUIDA */
html {
    font-size: 16px;
}
@media (max-width: 480px) {
    html { font-size: 14px; }
}

body {
    font-family: 'Fredoka', sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
}

/* IMÁGENES RESPONSIVE */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* CONTENEDORES GENERALES */
.section,
.container,
.wrapper {
    width: 100%;
    max-width: 1200px;
    margin: auto;
    padding: 1.2rem;
}

/* TITULOS */
h1 { font-size: clamp(1.8rem, 4vw, 3rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2.4rem); }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.8rem); }

/* BOTONES */
button, .btn {
    padding: .7rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    width: fit-content;
}

/* GRID GENERAL */
.grid {
    display: grid;
    gap: 1.5rem;
}
.grid-2 {
    grid-template-columns: 1fr 1fr;
}
.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

/* GRID RESPONSIVE */
@media (max-width: 768px) {
    .grid-2,
    .grid-3 {
        grid-template-columns: 1fr;
    }
}

/* NAV RESPONSIVE */
nav ul {
    display: flex;
    gap: 1.5rem;
}
@media (max-width: 768px) {
    nav ul {
        flex-direction: column;
    }
}

/* SECCIONES CON FONDO (como tenías en tus proyectos) */
.section-bg {
    padding: 2.2rem 1rem;
    background-color: rgba(0,0,0,0.04); /* muy suave como pediste */
    border-radius: 16px;
    margin-bottom: 2rem;
}
