/* Sistema de diseño — Departamento de Matemáticas y Estadística (Unimagdalena).
   Utilidades propias que no genera Tailwind. Los colores viven en el tailwind.config
   inline de base.html; aquí se repiten en crudo porque el CSS no ve esos tokens. */

html {
    scroll-behavior: smooth;
    scroll-padding-top: 6.5rem; /* compensa el navbar sticky de h-20 */
}

body {
    font-family: "Plus Jakarta Sans", system-ui, sans-serif;
    background: #f6f8fb;
    color: #12233a;
}

.font-display {
    font-family: "Fraunces", Georgia, serif;
}

/* Textura de ruido: se aplica a todas las secciones grandes, claras y oscuras.
   Al ser un pseudo-elemento absoluto, el contenido interno debe ir en un .relative. */
.grain {
    position: relative;
}

.grain::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.035;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Fondo azul profundo con halo vino arriba-derecha y terracota abajo-izquierda. */
.gradient-dark {
    background:
        radial-gradient(60rem 35rem at 90% -10%, rgba(122, 3, 44, 0.5), transparent 60%),
        radial-gradient(45rem 30rem at -10% 110%, rgba(196, 96, 65, 0.3), transparent 55%),
        linear-gradient(155deg, #00243f 0%, #00356a 55%, #143a6b 100%);
}

/* Etiqueta de sección. Sobre fondo oscuro se sobreescribe con !text-dorado. */
.kicker {
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: #c46041;
}

/* Entrada escalonada, solo para contenido above the fold. */
@keyframes riseIn {
    from { opacity: 0; transform: translateY(28px); }
    to   { opacity: 1; transform: none; }
}

.rise   { opacity: 0; animation: riseIn 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) forwards; }
.rise-1 { animation-delay: 0.05s; }
.rise-2 { animation-delay: 0.15s; }
.rise-3 { animation-delay: 0.25s; }
.rise-4 { animation-delay: 0.36s; }
.rise-5 { animation-delay: 0.52s; }

/* Aparición al entrar en viewport. La activa el IntersectionObserver de main.js. */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s cubic-bezier(0.2, 0.7, 0.2, 1),
                transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.reveal.in {
    opacity: 1;
    transform: none;
}

/* Scroll sutil sobre fondo oscuro. */
.cal-scroll {
    scrollbar-width: thin;
    scrollbar-color: rgb(255 255 255 / 0.25) transparent;
}

.cal-scroll::-webkit-scrollbar { width: 6px; }

.cal-scroll::-webkit-scrollbar-thumb {
    border-radius: 9999px;
    background: rgb(255 255 255 / 0.25);
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .reveal { opacity: 1; transform: none; transition: none; }
    .rise   { opacity: 1; animation: none; }
}
