@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700;800&family=Space+Mono:wght@400;700&display=swap');

/* ========================================= */
/* 0. RESET & BASE (mobile-first, base = 360px) */
/* ========================================= */
html {
    scroll-behavior: smooth;
    overflow-x: hidden;
    width: 100%;
}

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Montserrat', 'Segoe UI', system-ui, sans-serif;
    background-color: var(--color-bg);
    background-image: var(--pattern-bg);
    background-repeat: repeat;
    background-size: 40px 40px;
    color: var(--color-text);
    font-size: 0.92rem;
    line-height: 1.6;
    overflow-x: hidden;
    width: 100%;
    position: relative;
    isolation: isolate;
    overflow-wrap: break-word;
    word-break: normal;
}

/* Cuadraditos del fondo que "arman" una diagonal tipo andamio al pasar el mouse.
   Cada cuadrito visitado se queda marcado (no sigue al cursor ni se apaga). */
.andamio-brace {
    position: absolute;
    width: 40px;
    height: 40px;
    pointer-events: none;
    opacity: 0;
    z-index: -1;
    transition: opacity 0.35s ease;
}

.andamio-brace.in {
    opacity: 1;
}

/* Mismo efecto pero adentro del navbar (PC), líneas oscuras sobre la reticula roja. */
.navbar-brace-layer {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.navbar-brace {
    position: absolute;
    width: 48px;
    height: 48px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.35s ease;
}

.navbar-brace.in {
    opacity: 1;
}

.navbar-brace svg {
    width: 100%;
    height: 100%;
    display: block;
}

.andamio-brace svg {
    width: 100%;
    height: 100%;
    display: block;
    filter: drop-shadow(0 0 4px var(--color-accent));
}

body.nav-open {
    position: fixed;
    width: 100%;
    overflow: hidden;
}

h1, h2, h3, h4 {
    font-family: 'Copperplate', 'Copperplate Gothic Light', 'Copperplate Gothic Bold', serif;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

a, button {
    -webkit-tap-highlight-color: transparent;
}

img, svg, video {
    max-width: 100%;
    display: block;
}

ul, ol {
    list-style: none;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: 'Space Mono', 'Courier New', monospace;
    font-size: 0.82rem;
    letter-spacing: 0.05em;
    color: var(--color-accent);
    margin-bottom: 14px;
}

.text-gradient {
    color: var(--color-accent-text);
}

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

@media (min-width: 480px) {
    .container { padding: 0 32px; }
}

@media (min-width: 768px) {
    .container { padding: 0 5%; }
}

/* ========================================= */
/* 1. BOTONES                                */
/* ========================================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
    border: 1px solid transparent;
    width: 100%;
}

.btn-primary {
    background: var(--color-accent);
    color: var(--color-on-accent);
    box-shadow: 0 8px 24px var(--shadow-color);
}

.btn-primary:hover {
    transform: translateY(-3px);
    background: var(--color-accent-hover);
    box-shadow: 0 12px 28px var(--shadow-color);
}

.btn-primary:active {
    background: var(--color-accent-active);
}

.btn-secondary,
.btn-outline {
    border-color: var(--color-border-soft);
    color: var(--color-text);
    background: var(--color-surface);
}

.btn-secondary:hover,
.btn-outline:hover {
    border-color: var(--color-accent);
    color: var(--color-accent);
}

.btn-small {
    padding: 9px 18px;
    font-size: 0.72rem;
    border-radius: 8px;
}

@media (min-width: 480px) {
    .btn {
        width: auto;
    }
}

/* ========================================= */
/* 3. HERO (HOME)                            */
/* ========================================= */
.hero {
    padding: 110px 0 60px;
}

.hero-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 8px 18px;
    border: 1px solid var(--color-border-soft);
    background: var(--color-surface);
    border-radius: 30px;
    font-family: 'Space Mono', 'Courier New', monospace;
    font-size: 0.72rem;
    color: var(--color-text-muted);
    margin-bottom: 22px;
}

.badge .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-accent);
    box-shadow: 0 0 8px var(--color-accent);
    flex-shrink: 0;
}

.hero h1 {
    font-size: 1.9rem;
    max-width: 780px;
    margin-bottom: 20px;
}

.hero > .hero-inner > p {
    font-size: 1.02rem;
    color: var(--color-text-muted);
    max-width: 560px;
    margin-bottom: 30px;
}

.hero-actions {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
    max-width: 340px;
    justify-content: center;
    margin-bottom: 50px;
}

.hero-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 28px 36px;
    justify-content: center;
}

.hero-stats .stat {
    text-align: center;
    min-width: 90px;
}

.hero-stats .num {
    font-family: 'Space Mono', 'Courier New', monospace;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--color-accent-text);
}

.hero-stats .label {
    font-size: 0.72rem;
    color: var(--color-text-muted);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-top: 6px;
}

@media (min-width: 480px) {
    .hero-actions {
        flex-direction: row;
        flex-wrap: wrap;
        max-width: none;
    }
}

@media (min-width: 768px) {
    .hero { padding-top: 140px; }
    .hero-stats { gap: 60px; }
}

@media (min-width: 1024px) {
    .hero { padding: 170px 0 90px; }
}

/* Modulos principales (home) */
.container.modules-section {
    padding-top: 20px;
    padding-bottom: 20px;
}

.home-preview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    padding-bottom: 50px;
}

.glass-card {
    min-width: 0;
    background: var(--color-surface);
    border: 1px solid var(--color-border-soft);
    border-radius: 16px;
    padding: 26px;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.glass-card:hover {
    transform: translateY(-6px);
    border-color: var(--color-accent);
}

.preview-card .icon {
    font-size: 1.35rem;
    display: block;
    margin-bottom: 16px;
}

.preview-card h3 {
    margin-bottom: 10px;
    font-size: 1.15rem;
}

.preview-card p {
    color: var(--color-text-muted);
    font-size: 0.82rem;
}

@media (min-width: 768px) {
    .home-preview { gap: 24px; padding-bottom: 60px; }
    .glass-card { padding: 30px; }
}

/* ========================================= */
/* 4. SECCIONES GENERALES                    */
/* ========================================= */
section {
    padding: 70px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.page-header {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 40px;
    padding-top: 10px;
}

.page-header h2 {
    font-size: 1.6rem;
    margin-bottom: 14px;
}

.page-header p {
    color: var(--color-text-muted);
    font-size: 1.02rem;
}

section > h2:not(.page-header h2) {
    font-size: 1.6rem;
    margin-bottom: 32px;
    text-align: center;
}

@media (min-width: 480px) {
    section { padding: 90px 32px; }
}

@media (min-width: 768px) {
    section { padding: 100px 5%; }
    .page-header { margin-bottom: 60px; padding-top: 40px; }
    section > h2:not(.page-header h2) { margin-bottom: 40px; }
}

/* ========================================= */
/* ANIMACIONES DE SCROLL                     */
/* ========================================= */
.reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s ease-out;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* ========================================= */
/* ACCESIBILIDAD: MOVIMIENTO REDUCIDO        */
/* ========================================= */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }

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

/* ========================================= */
/* FOCUS VISIBLE                             */
/* ========================================= */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
.hamburger:focus-visible {
    outline: 2px solid var(--color-focus);
    outline-offset: 3px;
}

/* ========================================= */
/* 9. AJUSTES FINOS POR BREAKPOINT           */
/* ========================================= */
@media (min-width: 1280px) {
    .hero > .hero-inner > p {
        font-size: 1.1rem;
    }
}
