/* ================================================================
   JH REFORMAS — style.css
   Fondo oscuro · Tipografía Veneer / Montserrat · Acento naranja
   ================================================================ */

/* --- FUENTES ---------------------------------------------------- */
@font-face {
    font-family: 'Veneer';
    src: url('fonts/Veneer Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
    /* Excluir @(U+0040), tildes, ñ — Veneer no tiene esos glifos en iOS/Safari */
    unicode-range: U+0020-003F, U+0041-007E;
}
@font-face {
    font-family: 'Montserrat';
    src: url('fonts/Montserrat-VariableFont_wght.woff2') format('woff2');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
    /* El archivo local es un subset — solo ASCII básico. Los glifos con Ñ/tildes/— los sirve Google Fonts */
    unicode-range: U+0020-007E;
}

/* --- RESET / BASE ----------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background-color: #09090b;
    color: #d4d4d8;
    font-family: 'Montserrat', 'Segoe UI', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    /* Bloquea pan lateral en toda la página en móvil */
    touch-action: pan-y;
}

/* --- FONDO 3D CANVAS -------------------------------------------- */
.polvo-bg-wrapper {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}
#rocas-canvas {
    display: block;
    width: 100%;
    height: 100%;
    touch-action: auto;
}
.content-layer { position: relative; z-index: 1; }

/* --- GRADIENTE TEXTO -------------------------------------------- */
.gradient-text {
    background: linear-gradient(90deg, #ff6a00, #ff9a3c);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* === NAVEGACIÓN ================================================= */
.lg-nav {
    background: rgba(9, 9, 11, 0.85);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.lg-nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    max-width: 80rem;
    margin: 0 auto;
    padding: 0.75rem 1.5rem;
}
.lg-logo-pill {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}
.lg-logo-pill img {
    height: 2.5rem;
    width: auto;
    object-fit: contain;
}
@media (min-width: 768px) {
    .lg-logo-pill img { height: 3.5rem; }
}
.lg-nav-pill {
    display: inline-block;
    padding: 0.45rem 1.1rem;
    border-radius: 99px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.04);
    color: #d4d4d8;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-decoration: none;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
    white-space: nowrap;
}
.lg-nav-pill:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.2);
    color: #ffffff;
}
.lg-nav-pill--orange {
    background: #ff6a00;
    border-color: #ff6a00;
    color: #ffffff;
}
.lg-nav-pill--orange:hover {
    background: #ff8c38;
    border-color: #ff8c38;
}

/* === HERO ======================================================= */
.hero-fullscreen {
    min-height: 100svh;
    display: flex;
    align-items: center;
}
.hero-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 2rem;
    padding: 3rem 1.5rem 4rem;
    width: 100%;
    max-width: 64rem;
    margin: 0 auto;
}

/* --- BLOQUE 1: HERO TITLE --------------------------------------- */
.hero-title {
    font-family: 'Veneer', 'Montserrat', sans-serif;
    text-transform: uppercase;
    font-size: clamp(2.4rem, 9vw, 6rem);
    line-height: 1.15;
    letter-spacing: 0.01em;
    font-weight: 400;
    color: #ffffff;
    text-shadow: 0 6px 16px rgba(0,0,0,0.8);
    margin: 0;
    overflow: visible;
    padding-top: 0.1em;
}
.hero-title .gradient-text {
    -webkit-text-fill-color: transparent;
}

/* --- BLOQUE 2: HERO GLASS GRID --------------------------------- */
.hero-glass-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    width: 100%;
    max-width: 800px;
}
@media (min-width: 768px) {
    .hero-glass-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
    }
}

/* --- BLOQUE 3: HERO GLASS CARD --------------------------------- */
.hero-glass-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.7rem;
    /* padding-top extra compensa ascendentes de Ñ que Veneer tiene muy altos (yMax=1864/2048em) */
    padding: 1.6rem 0.75rem 1.4rem;
    background: rgba(18, 18, 22, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.6);
    font-family: 'Montserrat', sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    line-height: 1.5;
    color: #ffffff;
    text-transform: uppercase;
    text-align: center;
    overflow: visible;
    transition: transform 0.3s ease, background 0.3s ease, border-color 0.3s ease;
    cursor: default;
}
.hero-glass-card:hover {
    background: rgba(25, 25, 30, 0.9);
    border-color: rgba(255, 106, 0, 0.3);
    transform: translateY(-3px) scale(1.02);
}
.hero-glass-card .card-icon {
    font-size: 1.9rem;
    color: #ff6a00;
    line-height: 1;
}
@media (max-width: 480px) {
    .hero-glass-card {
        padding: 1rem 0.5rem;
        font-size: 0.88rem;
        gap: 0.5rem;
    }
    .hero-glass-card .card-icon { font-size: 1.5rem; }
}

/* Wrapper de texto en cards — overflow visible evita que Safari recorte
   ascendentes de Ñ/tildes al hacer text-transform:uppercase con Veneer */
.hero-glass-card .card-label {
    display: block;
    overflow: visible;
    line-height: 1.5;
    padding-top: 0.1em;
}

/* --- HERO BOTONES ----------------------------------------------- */
.hero-btn {
    display: inline-block;
    padding: 0.85rem 2rem;
    border-radius: 8px;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
}
.hero-btn--primary {
    background: #ff6a00;
    color: #ffffff;
    border: 2px solid #ff6a00;
}
.hero-btn--primary:hover {
    background: #ff8c38;
    border-color: #ff8c38;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(255,106,0,0.35);
}
.hero-btn--glass {
    background: transparent;
    color: #ffffff;
    border: 2px solid rgba(255,255,255,0.25);
}
.hero-btn--glass:hover {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.5);
    transform: translateY(-2px);
}

/* === SECCIÓN SERVICIOS ========================================== */
.services-section { background: transparent; }

/* --- Service Card ----------------------------------------------- */
.service-card-wrapper {
    background: rgba(18, 18, 22, 0.8);
    border: none;
    border-radius: 16px;
    overflow: visible;
    transition: transform 0.35s ease, box-shadow 0.35s ease;
    position: relative;
    /* isolation crea un stacking context propio — evita que los pseudo z-index
       negativos en iOS Safari tapen el contenido de texto del flex child */
    isolation: isolate;
}

/* Borde de cinta de obra: faja de 8px con patrón amarillo/negro */
.service-card-wrapper::before {
    content: '';
    position: absolute;
    inset: -8px;
    border-radius: 22px;
    background: repeating-linear-gradient(
        -45deg,
        #f5c400 0px,
        #f5c400 10px,
        #111113 10px,
        #111113 22px
    );
    z-index: -2;
    pointer-events: none;
}

/* Capa intermedia que reproduce el fondo de la tarjeta tapando el interior de la cinta */
.service-card-wrapper::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 16px;
    background: rgba(18, 18, 22, 0.97);
    z-index: -1;
    pointer-events: none;
}

.service-card-wrapper:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 48px rgba(0,0,0,0.6);
}

/* El área de texto debe estar sobre el ::after (fondo oscuro) */
.service-card-wrapper .gear-icon-outer,
.service-card-wrapper .gear-divider,
.service-card-wrapper .flex-1 {
    position: relative;
    z-index: 1;
}

.service-card-a { }
.service-card-b { }

.service-card-wrapper h3 {
    font-family: 'Montserrat', -apple-system, sans-serif;
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    color: #ffffff;
    text-transform: uppercase;
    margin: 0 0 0.75rem 0;
    overflow: visible;
    line-height: 1.3;
}
.service-card-wrapper ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
.service-card-wrapper li {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    color: #a1a1aa;
    font-size: 0.9rem;
    line-height: 1.55;
    margin-bottom: 0.5rem;
}
.service-card-wrapper li strong { color: #d4d4d8; }

/* --- Gear icon area -------------------------------------------- */
.gear-icon-outer {
    position: relative;
    flex-shrink: 0;
    width: 130px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 0.75rem;
    background: #ffffff;
}

/* Todas las variantes tienen fondo blanco */
[data-gear-variant="orange"],
[data-gear-variant="dark"] {
    background: #ffffff;
}

/* El wrapper que contiene el canvas del engranaje tiene fondo blanco
   para que el engranaje quede sobre blanco (efecto PNG) */
.gear-icon-wrapper {
    position: relative;
    width: 130px;
    height: 130px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border-radius: 50%;
}
@media (max-width: 640px) {
    .gear-icon-wrapper { width: 90px; height: 90px; }
    .gear-icon-wrapper .gear-canvas-scroll { width: 90px !important; height: 90px !important; }
    .gear-icon-wrapper .gear-object-slot,
    .gear-icon-wrapper .gear-object-canvas { width: 60px !important; height: 60px !important; }
}
.gear-canvas-scroll {
    display: block;
    position: absolute;
    top: 0; left: 0;
    width: 130px;
    height: 130px;
}
.gear-object-slot {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 84px;
    height: 84px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Blanco igual al fondo del engranaje para efecto PNG */
    background: #ffffff;
}
.gear-object-canvas {
    display: block;
    width: 84px;
    height: 84px;
    border-radius: 50%;
    background: #ffffff;
}
.gear-divider {
    width: 1px;
    align-self: stretch;
    background: rgba(255,255,255,0.06);
    flex-shrink: 0;
}

/* === SECCIÓN PROYECTOS ========================================== */

/* --- Liquid Carousel ------------------------------------------- */
.lq-carousel-wrap {
    position: relative;
    display: flex;
    flex-direction: column;
}

/* --- Título del carrusel --------------------------------------- */
.lq-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    color: #ffffff;
    text-transform: uppercase;
    margin-bottom: 0.6rem;
    padding-left: 0.1rem;
}

/* --- Frame principal ------------------------------------------- */
.lq-glass-frame {
    position: relative;
    width: 100%;
    border-radius: 16px;
    overflow: hidden;
    background: #18181b;
    border: 1px solid rgba(255,255,255,0.07);
    box-shadow: 0 8px 32px rgba(0,0,0,0.6), 0 2px 8px rgba(0,0,0,0.4);
    cursor: grab;
    user-select: none;
    aspect-ratio: 4 / 3;
    outline: none;
    /* Permite gestos en todas direcciones dentro del carrusel */
    touch-action: pan-x pan-y;
}
.lq-glass-frame:focus-visible {
    box-shadow: 0 0 0 2px #ff6a00, 0 8px 32px rgba(0,0,0,0.6);
}
.lq-glass-frame.is-dragging { cursor: grabbing; }

/* --- Track y slides -------------------------------------------- */
.lq-track {
    display: flex;
    height: 100%;
    will-change: transform;
}
.lq-track.is-animating {
    transition: transform 0.56s cubic-bezier(0.25, 1, 0.5, 1);
}
.lq-slide {
    flex: 0 0 100%;
    height: 100%;
    overflow: hidden;
}
.lq-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
    draggable: false;
    transition: transform 0.6s ease;
}
.lq-slide.is-active img { transform: scale(1.02); }

/* --- Overlays decorativos -------------------------------------- */
.lq-lens-left,
.lq-lens-right {
    position: absolute;
    top: 0;
    width: 80px;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}
.lq-lens-left {
    left: 0;
    background: linear-gradient(to right, rgba(9,9,11,0.35), transparent);
}
.lq-lens-right {
    right: 0;
    background: linear-gradient(to left, rgba(9,9,11,0.35), transparent);
}
.lq-vignette {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 2;
    background: radial-gradient(ellipse at center, transparent 60%, rgba(0,0,0,0.45) 100%);
}
.lq-refraction-ring {
    position: absolute;
    inset: 0;
    border-radius: 16px;
    pointer-events: none;
    z-index: 3;
    border: 1px solid rgba(255,255,255,0.06);
}

/* --- Progress bar ---------------------------------------------- */
.lq-progress {
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: rgba(255,255,255,0.08);
    z-index: 10;
}
.lq-progress-bar {
    height: 100%;
    background: #ff6a00;
    width: 0%;
    transform-origin: left;
}
.lq-progress-bar.is-running {
    animation: lq-prog 4.2s linear forwards;
}
.lq-progress-bar.is-paused { animation-play-state: paused; }
@keyframes lq-prog {
    from { width: 0%; }
    to   { width: 100%; }
}

/* --- Botones prev/next ----------------------------------------- */
.lq-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 2.6rem;
    height: 2.6rem;
    border-radius: 50%;
    background: rgba(9, 9, 11, 0.7);
    border: 1px solid rgba(255,255,255,0.12);
    color: #ffffff;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, transform 0.2s;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    overflow: hidden;
}
.lq-btn:hover {
    background: rgba(255,106,0,0.85);
    border-color: #ff6a00;
    transform: translateY(-50%) scale(1.08);
}
.btn-prev { left: 0.75rem; }
.btn-next { right: 0.75rem; }

/* --- Ripple efecto agua ---------------------------------------- */
.water-ripple {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.55) 0%, transparent 70%);
    animation: water-in 0.55s ease-out forwards;
    pointer-events: none;
}
.water-wave {
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 1.5px solid rgba(255,255,255,0.35);
    animation: water-ring 0.7s ease-out forwards;
    pointer-events: none;
}
@keyframes water-in {
    from { opacity: 0.9; transform: scale(0); }
    to   { opacity: 0;   transform: scale(2.2); }
}
@keyframes water-ring {
    from { opacity: 0.7; transform: scale(0.5); }
    to   { opacity: 0;   transform: scale(2.4); }
}

/* --- Counter y dots -------------------------------------------- */
.lq-counter {
    position: absolute;
    bottom: 0.7rem;
    right: 0.9rem;
    z-index: 10;
    background: rgba(0,0,0,0.55);
    color: #ffffff;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    padding: 0.2rem 0.6rem;
    border-radius: 99px;
    border: 1px solid rgba(255,255,255,0.1);
    backdrop-filter: blur(4px);
}
.lq-counter-cur { display: inline-block; }
.lq-counter-cur.flip {
    animation: flip-num 0.38s ease;
}
@keyframes flip-num {
    0%   { transform: rotateX(0deg);  opacity: 1; }
    45%  { transform: rotateX(90deg); opacity: 0; }
    55%  { transform: rotateX(90deg); opacity: 0; }
    100% { transform: rotateX(0deg);  opacity: 1; }
}
.lq-dots {
    position: absolute;
    bottom: 0.75rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    gap: 0.4rem;
}
.lq-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    border: none;
    padding: 0;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}
.lq-dot.is-active {
    background: #ff6a00;
    transform: scale(1.4);
}

/* === SECCIÓN CONTACTO ========================================== */
.contact-icon {
    border-radius: 10px;
    flex-shrink: 0;
}
.contact-selectable {
    user-select: text;
    -webkit-user-select: text;
}

/* --- btn-primary (formulario) ---------------------------------- */
.btn-primary {
    background: linear-gradient(135deg, #ff6a00 0%, #ff8c38 100%);
    color: #ffffff;
    border: none;
    cursor: pointer;
    font-family: 'Montserrat', sans-serif;
    transition: opacity 0.25s, transform 0.25s, box-shadow 0.25s;
}
.btn-primary:not(:disabled):hover {
    opacity: 0.9;
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(255,106,0,0.4);
}
.btn-primary:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* --- scan-tag -------------------------------------------------- */
.scan-tag { display: inline-block; }

/* === REVEAL ANIMATIONS ========================================= */
.reveal,
.reveal-left,
.reveal-right,
.reveal-scale {
    opacity: 0;
    transition: opacity 0.7s ease, transform 0.7s ease;
    will-change: opacity, transform;
    overflow: visible;
    -webkit-overflow-scrolling: auto;
}
.reveal       { transform: translateY(16px); }
.reveal-left  { transform: translateX(-28px); }
.reveal-right { transform: translateX(28px); }
.reveal-scale { transform: scale(0.96); }

.reveal.active,
.reveal-left.active,
.reveal-right.active,
.reveal-scale.active {
    opacity: 1;
    transform: none;
}
.reveal.exit-up,
.reveal-left.exit-up,
.reveal-right.exit-up,
.reveal-scale.exit-up {
    opacity: 0;
    transform: translateY(-18px);
}
.reveal.exit-down,
.reveal-left.exit-down,
.reveal-right.exit-down,
.reveal-scale.exit-down {
    opacity: 0;
}

/* === MOBILE REFINEMENTS ======================================== */
@media (max-width: 767px) {
    .hero-inner {
        padding: 2rem 1rem 3rem;
        gap: 1.5rem;
    }
    .hero-btn {
        padding: 0.8rem 1.5rem;
        font-size: 0.75rem;
        width: 100%;
        text-align: center;
    }
    /* Engranaje arriba, texto abajo en móvil */
    .service-card-wrapper {
        flex-direction: column;
    }
    .gear-icon-outer {
        width: 100%;
        padding: 1.25rem 0;
        justify-content: center;
        border-radius: 16px 16px 0 0;
    }
    .gear-divider {
        width: 100%;
        height: 1px;
        align-self: auto;
    }
    .service-card-wrapper h3 { font-size: 1.1rem; }
    .service-card-wrapper li { font-size: 0.83rem; }
    /* Padding del bloque de texto en columna */
    .service-card-wrapper > div:last-child {
        padding: 1.25rem 1.25rem 1.5rem;
    }
    .lq-glass-frame { border-radius: 12px; }
    .lq-btn {
        width: 2.1rem;
        height: 2.1rem;
        font-size: 0.75rem;
    }
    .btn-prev { left: 0.5rem; }
    .btn-next { right: 0.5rem; }
}

@media (max-width: 380px) {
    .hero-title { font-size: 2rem; }
    .hero-glass-grid { gap: 0.5rem; }
    .hero-glass-card { padding: 0.85rem 0.4rem; font-size: 0.8rem; }
}
