:root {
    --black: #030303;
    --soft-black: #080808;
    --white: #f5f5f5;
    --muted: rgba(255, 255, 255, 0.58);
    --edge-space: clamp(24px, 3.5vw, 68px);
}

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

html,
body {
    width: 100%;
    min-height: 100%;
    background: var(--black);
}

body {
    overflow: hidden;
    font-family: "Montserrat", Arial, sans-serif;
    color: var(--white);
}

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

.landing {
    position: relative;
    isolation: isolate;
    width: 100vw;
    height: 100vh;
    height: 100svh;
    min-height: 540px;
    overflow: hidden;
    background: var(--black);
}

/* =========================================================
   1. MAPA OSCURO DE FONDO
   ========================================================= */
.map-layer {
    position: absolute;
    inset: -7%;
    z-index: -6;
    pointer-events: none;
    background: #101010;
    transform: translate3d(var(--map-x, 0px), var(--map-y, 0px), 0) scale(1.04);
    transition: transform 180ms linear;
}

.map-layer iframe {
    width: 100%;
    height: 100%;
    border: 0;
    pointer-events: none;
    opacity: 0.84;
    filter:
        grayscale(1)
        invert(0.92)
        hue-rotate(180deg)
        saturate(0.15)
        brightness(0.52)
        contrast(1.26);
}

/* El mapa queda visible; el negro se concentra detrás del texto y en los bordes. */
.map-treatment {
    position: absolute;
    inset: 0;
    z-index: -5;
    pointer-events: none;
    background:
        linear-gradient(90deg,
            rgba(2, 2, 2, 0.76) 0%,
            rgba(2, 2, 2, 0.43) 24%,
            rgba(2, 2, 2, 0.12) 51%,
            rgba(2, 2, 2, 0.16) 72%,
            rgba(2, 2, 2, 0.64) 100%),
        linear-gradient(180deg,
            rgba(2, 2, 2, 0.72) 0%,
            rgba(2, 2, 2, 0.05) 22%,
            rgba(2, 2, 2, 0.06) 68%,
            rgba(2, 2, 2, 0.80) 100%),
        radial-gradient(ellipse at 50% 48%, transparent 30%, rgba(0, 0, 0, 0.48) 100%);
}

/* =========================================================
   2. VEHÍCULO: GRANDE, ABAJO A LA DERECHA Y SIN RECTÁNGULO
   ========================================================= */
.car-layer {
    position: absolute;
    right: -5vw;
    bottom: -17vh;
    z-index: -3;
    width: min(86vw, 1650px);
    pointer-events: none;
    transform: translate3d(var(--car-x, 0px), var(--car-y, 0px), 0);
    transform-origin: 72% 70%;
    transition: transform 180ms linear;
}

.car-layer img {
    display: block;
    width: 100%;
    height: auto;
    filter: brightness(0.92) contrast(1.12) saturate(0.80);

    /* Una sola máscara radial funciona mejor que dos máscaras cruzadas
       y evita el corte rectangular visible en Chrome. */
    -webkit-mask-image: radial-gradient(
        ellipse 71% 70% at 72% 57%,
        #000 0%,
        #000 49%,
        rgba(0, 0, 0, 0.96) 60%,
        rgba(0, 0, 0, 0.55) 73%,
        transparent 91%
    );
    mask-image: radial-gradient(
        ellipse 71% 70% at 72% 57%,
        #000 0%,
        #000 49%,
        rgba(0, 0, 0, 0.96) 60%,
        rgba(0, 0, 0, 0.55) 73%,
        transparent 91%
    );
}

/* Fusión luminosa tenue para que el humo del vehículo y el mapa parezcan una sola escena. */
.car-layer::after {
    content: "";
    position: absolute;
    inset: 10% 5% 7% 22%;
    z-index: -1;
    background: radial-gradient(ellipse at 58% 60%, rgba(130, 130, 130, 0.16), transparent 65%);
    filter: blur(34px);
}

.atmosphere {
    position: absolute;
    inset: 0;
    z-index: -2;
    pointer-events: none;
    background:
        radial-gradient(ellipse 46% 25% at 72% 79%, rgba(255, 255, 255, 0.055), transparent 72%),
        linear-gradient(90deg, transparent 0 76%, rgba(0, 0, 0, 0.26) 100%);
    box-shadow: inset 0 0 130px rgba(0, 0, 0, 0.64);
}

/* =========================================================
   3. ENCABEZADO
   ========================================================= */
.site-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: clamp(28px, 4.2vh, 52px) var(--edge-space);
    opacity: 0;
    transform: translateY(-16px);
    transition: opacity 900ms ease, transform 900ms cubic-bezier(.2, .8, .2, 1);
}

.brand {
    display: inline-flex;
    width: clamp(54px, 4.3vw, 82px);
    height: clamp(54px, 4.3vw, 82px);
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.brand img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 0 18px rgba(255, 255, 255, 0.12));
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 19px;
}

.icon-button {
    width: 34px;
    height: 34px;
    border: 0;
    background: transparent;
    color: #fff;
    cursor: pointer;
    opacity: 0.92;
    transition: opacity 180ms ease, transform 180ms ease;
}

.icon-button:hover {
    opacity: 1;
    transform: scale(1.08);
}

.search-button svg {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
}

.menu-button {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
}

.menu-button span {
    display: block;
    width: 27px;
    height: 2px;
    margin-left: auto;
    background: currentColor;
    transition: transform 250ms ease, width 250ms ease, opacity 250ms ease;
}

.menu-button span:nth-child(2) {
    width: 19px;
}

body.menu-open .menu-button span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

body.menu-open .menu-button span:nth-child(2) {
    width: 0;
    opacity: 0;
}

body.menu-open .menu-button span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* =========================================================
   4. CONTENIDO PRINCIPAL
   ========================================================= */
.hero-content {
    position: absolute;
    top: 51%;
    left: var(--edge-space);
    z-index: 12;
    width: min(46vw, 850px);
    transform: translateY(-50%);
}

.eyebrow {
    margin: 0 0 12px 5px;
    color: rgba(255, 255, 255, 0.42);
    font-size: clamp(0.56rem, 0.60vw, 0.78rem);
    font-weight: 700;
    letter-spacing: 0.68em;
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 700ms 120ms ease, transform 900ms 120ms cubic-bezier(.2, .8, .2, 1);
}

.hero-title {
    margin: 0 0 clamp(27px, 4vh, 44px);
    color: #fff;
    font-size: clamp(5.2rem, 8.4vw, 10.8rem);
    font-weight: 900;
    line-height: 0.82;
    letter-spacing: -0.055em;
    text-shadow: 0 12px 45px rgba(0, 0, 0, 0.72);
    opacity: 0;
    transform: translateX(-45px);
    transition: opacity 900ms 180ms ease, transform 1100ms 180ms cubic-bezier(.17, .84, .28, 1);
}

.mail-button {
    position: relative;
    display: inline-flex;
    width: clamp(162px, 10.8vw, 210px);
    height: clamp(50px, 5.4vh, 62px);
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.45);
    color: #fff;
    background: rgba(0, 0, 0, 0.16);
    text-decoration: none;
    backdrop-filter: blur(2px);
    opacity: 0;
    transform: translateY(20px);
    transition:
        opacity 800ms 320ms ease,
        transform 950ms 320ms cubic-bezier(.2, .8, .2, 1),
        border-color 260ms ease,
        color 260ms ease,
        box-shadow 260ms ease;
}

.mail-button::before {
    content: "";
    position: absolute;
    inset: 0;
    background: #fff;
    transform: translateX(-102%);
    transition: transform 300ms cubic-bezier(.5, 0, .2, 1);
}

.mail-button span {
    position: relative;
    z-index: 1;
    font-size: clamp(0.67rem, 0.72vw, 0.88rem);
    font-weight: 900;
    letter-spacing: 0.42em;
    transform: translateX(0.21em);
}

.mail-button:hover,
.mail-button:focus-visible {
    color: #070707;
    border-color: #fff;
    box-shadow: 0 0 28px rgba(255, 255, 255, 0.18);
}

.mail-button:hover::before,
.mail-button:focus-visible::before {
    transform: translateX(0);
}

/* =========================================================
   5. ELEMENTOS LATERALES
   ========================================================= */
.social-rail {
    position: absolute;
    right: clamp(22px, 2.1vw, 42px);
    top: 50%;
    z-index: 15;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    transform: translateY(-12%);
    opacity: 0;
    transition: opacity 900ms 520ms ease;
}

.social-rail a {
    min-width: 24px;
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.82rem;
    font-weight: 800;
    text-align: center;
    text-decoration: none;
    transition: color 180ms ease, transform 180ms ease;
}

.social-rail a:hover {
    color: #fff;
    transform: scale(1.15);
}

.social-separator {
    width: 1px;
    height: 42px;
    background: linear-gradient(transparent, rgba(255, 255, 255, 0.35), transparent);
}

.decorative-diamond {
    width: 28px;
    height: 28px;
    border: 1px solid rgba(255, 255, 255, 0.24);
    transform: rotate(45deg);
}

.page-index {
    position: absolute;
    left: 50%;
    bottom: clamp(24px, 4vh, 48px);
    z-index: 12;
    display: flex;
    align-items: center;
    gap: 12px;
    color: rgba(255, 255, 255, 0.28);
    font-size: 0.60rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 900ms 650ms ease;
}

.page-index i {
    width: 54px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.30), transparent);
}

.quick-menu {
    position: absolute;
    top: clamp(86px, 11vh, 126px);
    right: var(--edge-space);
    z-index: 25;
    display: grid;
    min-width: 210px;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(5, 5, 5, 0.88);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(16px);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-12px);
    transition: opacity 220ms ease, visibility 220ms ease, transform 220ms ease;
}

.quick-menu a {
    padding: 15px 14px;
    color: rgba(255, 255, 255, 0.80);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-decoration: none;
    text-transform: uppercase;
    transition: color 160ms ease, background 160ms ease;
}

.quick-menu a:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
}

body.menu-open .quick-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Estado de entrada activado desde JS. */
body.is-ready .site-header,
body.is-ready .eyebrow,
body.is-ready .hero-title,
body.is-ready .mail-button {
    opacity: 1;
    transform: none;
}

body.is-ready .social-rail {
    opacity: 1;
    transform: translateY(-12%);
}

body.is-ready .page-index {
    opacity: 1;
    transform: translateX(-50%);
}

/* =========================================================
   6. RESPONSIVE
   ========================================================= */
@media (max-width: 1100px) {
    .car-layer {
        right: -15vw;
        bottom: -10vh;
        width: 105vw;
    }

    .hero-content {
        width: 54vw;
    }

    .hero-title {
        font-size: clamp(4.8rem, 9.2vw, 8.4rem);
    }
}

@media (max-width: 760px) {
    .landing {
        min-height: 620px;
    }

    .map-treatment {
        background:
            linear-gradient(180deg,
                rgba(2, 2, 2, 0.76) 0%,
                rgba(2, 2, 2, 0.25) 27%,
                rgba(2, 2, 2, 0.22) 57%,
                rgba(2, 2, 2, 0.87) 100%),
            linear-gradient(90deg, rgba(2, 2, 2, 0.50), rgba(2, 2, 2, 0.16));
    }

    .site-header {
        padding: 24px;
    }

    .brand {
        width: 58px;
        height: 58px;
    }

    .hero-content {
        top: 32%;
        left: 24px;
        width: calc(100vw - 48px);
    }

    .eyebrow {
        font-size: 0.54rem;
        letter-spacing: 0.48em;
    }

    .hero-title {
        font-size: clamp(4.2rem, 20vw, 7.4rem);
        margin-bottom: 25px;
    }

    .car-layer {
        right: -42vw;
        bottom: -1vh;
        width: 170vw;
    }

    .car-layer img {
        -webkit-mask-image: radial-gradient(ellipse 72% 63% at 72% 61%, #000 0 46%, rgba(0, 0, 0, .90) 61%, transparent 90%);
        mask-image: radial-gradient(ellipse 72% 63% at 72% 61%, #000 0 46%, rgba(0, 0, 0, .90) 61%, transparent 90%);
    }

    .social-rail,
    .page-index {
        display: none;
    }

    .quick-menu {
        top: 90px;
        right: 24px;
    }
}

@media (max-height: 650px) and (min-width: 761px) {
    .hero-content {
        top: 54%;
    }

    .hero-title {
        font-size: clamp(4.5rem, 8vw, 8rem);
        margin-bottom: 24px;
    }

    .car-layer {
        bottom: -25vh;
    }
}

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

    .map-layer,
    .car-layer {
        transform: none !important;
    }
}
