/* ======================================================
   VARIABLES
====================================================== */
:root {
    --bg-dark: #0e0e0e;
    --bg-secondary: #161616;
    --bg-light: #fafafa;

    --text-main: #ffffff;
    --text-muted: #cfcfcf;
    --text-dark: #1e1e1e;

    --border-soft: #e5e5e5;
}

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

html {
    scroll-behavior: smooth;
}

/* ======================================================
   BASE
====================================================== */
body {
    font-family: 'Montserrat', sans-serif;
    background: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.7;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: auto;
}

/* ======================================================
   HEADER / NAV
====================================================== */
.header {
    position: fixed;
    top: 0;
    width: 100%;
    height: 82px;
    background: rgba(14, 14, 14, 0.95);
    z-index: 1000;
}

.header-content {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;

    /* Ancla el desplegable del menú móvil */
    position: relative;
}

/* BRAND (LOGO ARRIBA + NOMBRE ABAJO) */
.brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
}

.brand img {
    height: 36px;
    margin-bottom: 6px;
    display: block;
}

.brand span {
    color: var(--text-main);
    font-size: 0.7rem;
    letter-spacing: 1.6px;
    text-transform: uppercase;
    white-space: nowrap;
}

/* NAV */
.nav a {
    color: var(--text-main);
    margin-left: 26px;
    font-size: 0.75rem;
    text-decoration: none;
    letter-spacing: 1px;
    text-transform: uppercase;
    position: relative;
}

.nav a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -6px;
    width: 0;
    height: 1px;
    background: var(--text-main);
    transition: width 0.3s ease;
}

.nav a:hover::after,
.nav a.active::after {
    width: 100%;
}

/* ======================================================
   HERO HOME
====================================================== */
.hero {
    min-height: 100vh;
    padding-top: 82px;
    display: flex;
    align-items: center;
    background:
        linear-gradient(rgba(14,14,14,0.88), rgba(14,14,14,0.88)),
        url("../img/hero/fondo_portada.png") center / cover no-repeat;
}

.hero-content {
    max-width: 720px;
    padding-left: 6%;
}

.hero h1 {
    font-size: 3.2rem;
    font-weight: 300;
    color: var(--text-main);
    margin-bottom: 22px;
    line-height: 1.25;
}

.hero p {
    color: rgba(255,255,255,0.75);
    max-width: 520px;
    margin-bottom: 42px;
    font-size: 0.95rem;
}

.btn-primary {
    display: inline-block;
    border: 1px solid var(--text-main);
    padding: 14px 36px;
    color: var(--text-main);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.75rem;
    transition: background 0.35s ease, color 0.35s ease;
}

.btn-primary:hover {
    background: var(--text-main);
    color: var(--bg-dark);
}

/* ======================================================
   PAGE HERO – PÁGINAS INTERNAS
====================================================== */
.page-hero {
    min-height: 55vh;
    padding-top: 82px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    background:
        linear-gradient(rgba(14,14,14,0.9), rgba(14,14,14,0.9)),
        url("../img/hero/fondo_portada.png") center / cover no-repeat;
}

.page-hero h1 {
    font-size: 3rem;
    font-weight: 300;
    color: var(--text-main);
    margin-bottom: 14px;
}

.page-hero p {
    font-size: 0.95rem;
    color: rgba(255,255,255,0.75);
    max-width: 560px;
}

/* ======================================================
   SECCIONES
====================================================== */
.section {
    padding: 110px 0;
}

/* ======================================================
   SERVICIOS
====================================================== */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px,1fr));
    gap: 40px;
}

.service-card {
    background: #fff;
    border: 1px solid var(--border-soft);
    padding: 46px 38px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.service-card h3 {
    font-size: 0.9rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 14px;
}

.service-card p {
    font-size: 0.9rem;
    color: #555;
}

.service-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.08);
}

/* ======================================================
   PROYECTOS
====================================================== */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px,1fr));
    gap: 50px;
    justify-items: center;
}

.project-card {
    text-decoration: none;
    color: #111;
    text-align: center;
    max-width: 320px;
}

.project-image-box {
    width: 100%;
    height: 320px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.project-image-box img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.project-card h3 {
    margin-top: 18px;
    font-size: 0.9rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.project-note {
    font-size: 0.75rem;
    color: #777;
    margin-top: 6px;
}

/* ======================================================
   NOSOTROS
====================================================== */
.about-text {
    max-width: 820px;
    margin: auto;
    text-align: center;
}

/* MISIÓN / VISIÓN */
.mission-vision-section {
    background: #f6f6f6;
}

.mission-vision-modern {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
}

.mv-block {
    background: #fff;
    border: 1px solid var(--border-soft);
    padding: 48px;

    will-change: transform, opacity;
}

.mv-label {
    font-size: 0.7rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #777;
    margin-bottom: 12px;
    display: block;
}

.mv-block h2 {
    font-weight: 400;
    margin-bottom: 16px;
}

.mv-block p {
    font-size: 0.9rem;
    color: #555;
}

/* VALORES */
.section-title {
    text-align: center;
    margin-bottom: 60px;
    font-weight: 400;
}

.values-grid-modern {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 36px;
}

.value-card-modern {
    background: #fff;
    border: 1px solid var(--border-soft);
    padding: 32px 26px;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;

    will-change: transform, opacity;
}

.value-card-modern:hover {
    transform: translateY(-5px);
    box-shadow: 0 16px 32px rgba(0,0,0,0.08);
}

.value-card-modern img {
    width: 40px;
    margin-bottom: 16px;
}

.value-card-modern h3 {
    font-size: 0.8rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.value-card-modern p {
    font-size: 0.85rem;
    color: #555;
}

/* ======================================================
   FOOTER
====================================================== */
.footer {
    background: var(--bg-secondary);
    padding: 40px 0;
    text-align: center;
}

.footer p {
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* ======================================================
   ADVANCED SCROLL ANIMATIONS
====================================================== */

/* Fade + Slide */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition:
        opacity 0.9s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.9s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Fade Left */
.reveal-left {
    opacity: 0;
    transform: translateX(-40px);
    transition: opacity 0.9s ease, transform 0.9s ease;
}

.reveal-left.active {
    opacity: 1;
    transform: translateX(0);
}

/* Fade Right */
.reveal-right {
    opacity: 0;
    transform: translateX(40px);
    transition: opacity 0.9s ease, transform 0.9s ease;
}

.reveal-right.active {
    opacity: 1;
    transform: translateX(0);
}

/* Scale subtle */
.reveal-scale {
    opacity: 0;
    transform: scale(0.96);
    transition: opacity 0.9s ease, transform 0.9s ease;
}

.reveal-scale.active {
    opacity: 1;
    transform: scale(1);
}

/* Stagger helper (delay automático) */
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* ======================================================
   MENU MOVIL (UNICO BLOQUE) + MOBILE SPACING
   (Mantiene exactamente el comportamiento final que ya tenías)
====================================================== */
.menu-toggle {
    display: none;
    color: var(--text-main);
    font-size: 1.6rem;
    cursor: pointer;
    user-select: none;

    background: none;
    border: none;
    padding: 8px 10px;
    line-height: 1;
}

@media (max-width: 768px) {

    /* Mostrar botón hamburguesa */
    .menu-toggle {
        display: block;
    }

    /* Nav cerrado */
    .nav {
        display: none;
    }

    /* Nav abierto */
    .nav.active {
        display: flex;
        position: absolute;
        top: 82px;
        left: 0;
        width: 100%;
        flex-direction: column;
        background: rgba(14,14,14,0.98);
        padding: 18px 0;
        text-align: center;
        z-index: 1200;
    }

    .nav.active a {
        margin: 12px 0;
    }

    /* Ajustes internos en móvil */
    .hero-content {
        padding: 0 20px;
        text-align: center;
    }

    .hero h1,
    .page-hero h1 {
        font-size: 2.2rem;
    }

    .mission-vision-modern {
        grid-template-columns: 1fr;
    }

    /* Reducir el alto del hero interno en móvil (menos espacio en blanco) */
    .page-hero {
        min-height: 38vh;
        padding-bottom: 24px;
    }

    .page-hero p {
        padding: 0 18px;
    }

    /* Padding final en móvil (era lo que ya te quedaba al final) */
    .section {
        padding: 60px 0;
    }
}

/* ======================================================
   ACCESIBILIDAD (NO CAMBIA VISUAL NORMAL)
====================================================== */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }

    .reveal,
    .reveal-left,
    .reveal-right,
    .reveal-scale {
        transition: none;
        transform: none;
        opacity: 1;
    }
}
