/* ==========================================================================
   Impervalia · Hoja de estilos principal
   --------------------------------------------------------------------------
   Índice
     1. Variables de diseño (colores, tipografía, movimiento)
     2. Base y superficies del navegador (selección, foco, scroll)
     3. Utilidades y botones
     4. Cabecera y navegación
     5. Vistas de la SPA y transición entre ellas
     6. Inicio: portada, bloques, servicios, galería
     7. Páginas de contenido: fibra de vidrio y obras nuevas
     8. Contacto y formulario
     9. Pie de página
    10. Adaptación a pantallas pequeñas
    11. Movimiento reducido
   ========================================================================== */

/* 1. Variables de diseño ================================================== */
:root {
    /* Paleta tomada del logotipo: azul noche, oro, plata y azul gota. */
    --navy-900: #081626;
    --navy-800: #0c1d31;   /* fondo del logotipo */
    --navy-700: #12283f;
    --navy-600: #1a3452;
    --gold-400: #e2c47a;
    --gold-500: #c9a254;
    --gold-600: #a8863f;
    --sky-400:  #6cbbe8;   /* azul de la gota */
    --silver:   #d9dee6;

    --text:        #eef2f7;
    --text-soft:   #b7c1cf;  /* ≈ 9:1 sobre --navy-800 */
    --text-muted:  #8f9cb0;  /* ≈ 5.6:1 sobre --navy-800 */
    --line:        rgba(217, 222, 230, 0.12);
    --danger:      #f08a7c;
    --success:     #7fdca4;

    --font-display: 'Cormorant Garamond', 'Times New Roman', serif;
    --font-body:    'Figtree', system-ui, -apple-system, 'Segoe UI', sans-serif;

    --radius-sm: 10px;
    --radius:    18px;
    --radius-lg: 28px;

    /* Curvas de movimiento: salida rápida para respuesta inmediata. */
    --ease-out:    cubic-bezier(0.23, 1, 0.32, 1);
    --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);

    --header-h: 76px;
}

/* 2. Base y superficies del navegador ===================================== */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html {
    -webkit-text-size-adjust: 100%;
    scroll-padding-top: calc(var(--header-h) + 16px);
    color-scheme: dark;
    scrollbar-color: var(--navy-600) var(--navy-900);
}

body {
    font-family: var(--font-body);
    font-size: 1.0625rem;
    line-height: 1.65;
    color: var(--text);
    background: var(--navy-800);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    caret-color: var(--gold-400);
}

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

h1, h2, h3 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: -0.01em;
    text-wrap: balance;
    color: var(--text);
}

p { text-wrap: pretty; }

a { color: var(--gold-400); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }

::selection { background: var(--gold-500); color: var(--navy-900); }

:focus-visible {
    outline: 2px solid var(--gold-400);
    outline-offset: 3px;
    border-radius: 4px;
}

/* Elemento principal enfocable para lectores de pantalla, sin anillo visible. */
main:focus, h1:focus { outline: none; }

::-webkit-scrollbar { width: 12px; }
::-webkit-scrollbar-track { background: var(--navy-900); }
::-webkit-scrollbar-thumb { background: var(--navy-600); border-radius: 8px; border: 3px solid var(--navy-900); }

main { flex: 1; }

/* 3. Utilidades y botones ================================================= */
.container {
    width: 100%;
    max-width: 1180px;
    margin-inline: auto;
    padding-inline: clamp(1rem, 4vw, 2rem);
}

.visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.skip-link {
    position: absolute;
    left: 1rem; top: -100px;
    z-index: 100;
    background: var(--gold-500);
    color: var(--navy-900);
    padding: 0.6rem 1rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
}
.skip-link:focus { top: 1rem; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    min-height: 48px;
    padding: 0.75rem 1.6rem;
    border-radius: 999px;
    border: 1px solid transparent;
    font: 600 1rem/1.2 var(--font-body);
    text-decoration: none;
    cursor: pointer;
    transition: transform 160ms var(--ease-out), background-color 200ms ease, border-color 200ms ease, box-shadow 200ms ease;
}
/* Respuesta táctil: el botón "cede" un poco al pulsarlo. */
.btn:active { transform: scale(0.97); }

.btn-primary {
    background: var(--gold-500);
    color: var(--navy-900);
    box-shadow: 0 6px 18px -6px rgba(201, 162, 84, 0.55);
}
.btn-ghost {
    color: var(--text);
    border-color: rgba(217, 222, 230, 0.35);
    background: rgba(8, 22, 38, 0.35);
}

/* Los efectos hover solo en dispositivos con puntero real (no en táctil). */
@media (hover: hover) and (pointer: fine) {
    .btn-primary:hover { background: var(--gold-400); box-shadow: 0 10px 24px -8px rgba(201, 162, 84, 0.6); }
    .btn-ghost:hover { border-color: var(--silver); background: rgba(8, 22, 38, 0.55); }
}

.link-arrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    text-decoration: none;
}
.link-arrow::after {
    content: '';
    width: 1.1em; height: 1.1em;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat;
            mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat;
    transition: transform 200ms var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
    .link-arrow:hover { text-decoration: underline; }
    .link-arrow:hover::after { transform: translateX(4px); }
}

.icon {
    width: 28px; height: 28px;
    fill: none;
    stroke: var(--sky-400);
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.section-title {
    font-size: clamp(1.9rem, 3.5vw, 2.6rem);
    margin: 5rem 0 2rem;
}

/* 4. Cabecera y navegación ================================================ */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(12, 29, 49, 0.88);
    -webkit-backdrop-filter: saturate(140%) blur(12px);
            backdrop-filter: saturate(140%) blur(12px);
    border-bottom: 1px solid var(--line);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: var(--header-h);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    text-decoration: none;
}
.brand-mark { width: 58px; height: 42px; }

/* Wordmark en tipografía clásica, como en el logotipo: IMPER en plata, VALIA en oro. */
.brand-word {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--silver);
    line-height: 1;
}
.brand-word span { color: var(--gold-500); }

.site-nav {
    display: flex;
    align-items: center;
    gap: 2rem;
}
.site-nav a {
    color: var(--text-soft);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.97rem;
    padding-block: 0.4rem;
    border-bottom: 1px solid transparent;
    transition: color 200ms ease, border-color 200ms ease;
}
.site-nav a[aria-current="page"] { color: var(--text); border-bottom-color: var(--gold-500); }
.site-nav .nav-cta {
    color: var(--navy-900);
    background: var(--gold-500);
    padding: 0.55rem 1.2rem;
    border-radius: 999px;
    border: 0;
    font-weight: 600;
    transition: transform 160ms var(--ease-out), background-color 200ms ease;
}
.site-nav .nav-cta:active { transform: scale(0.97); }
.site-nav .nav-cta[aria-current="page"] { background: var(--gold-400); color: var(--navy-900); }

@media (hover: hover) and (pointer: fine) {
    .site-nav a:hover { color: var(--text); }
    .site-nav .nav-cta:hover { background: var(--gold-400); color: var(--navy-900); }
}

/* Botón hamburguesa: solo visible en móvil (ver sección 10). */
.nav-toggle {
    display: none;
    width: 48px; height: 48px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: transparent;
    cursor: pointer;
    position: relative;
}
.nav-toggle-bars,
.nav-toggle-bars::before,
.nav-toggle-bars::after {
    position: absolute;
    left: 50%;
    width: 20px; height: 2px;
    margin-left: -10px;
    background: var(--text);
    border-radius: 2px;
    transition: transform 240ms var(--ease-out), opacity 160ms ease;
}
.nav-toggle-bars { top: 50%; margin-top: -1px; }
.nav-toggle-bars::before, .nav-toggle-bars::after { content: ''; }
.nav-toggle-bars::before { transform: translateY(-6px); }
.nav-toggle-bars::after  { transform: translateY(6px); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::before { transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::after  { transform: rotate(-45deg); }

/* 5. Vistas de la SPA ===================================================== */
.view { padding-bottom: 5rem; }
.view[hidden] { display: none; }

/* Entrada de vista: aparece desde un leve desenfoque y desplazamiento.
   Solo se aplica cuando el enrutador cambia de vista (clase .is-entering). */
.view.is-entering {
    animation: view-in 320ms var(--ease-out) both;
}
@keyframes view-in {
    from { opacity: 0; transform: translateY(10px); filter: blur(4px); }
    to   { opacity: 1; transform: none; filter: none; }
}

/* 6. Inicio =============================================================== */
.hero {
    position: relative;
    isolation: isolate;
    min-height: min(78vh, 720px);
    display: flex;
    align-items: flex-end;
    overflow: hidden;
}
.hero-media {
    position: absolute;
    inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    object-position: 60% 70%;
    z-index: -2;
}
/* Velo para garantizar contraste del texto sobre la fotografía. */
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        linear-gradient(90deg, rgba(8, 22, 38, 0.94) 0%, rgba(8, 22, 38, 0.78) 45%, rgba(8, 22, 38, 0.25) 100%),
        linear-gradient(0deg, var(--navy-800) 0%, rgba(12, 29, 49, 0) 35%);
}
.hero-inner { padding-block: 7rem 4.5rem; }
.hero-title {
    font-size: clamp(2.4rem, 7vw, 5.4rem);
    font-weight: 600;
    line-height: 1;
    max-width: 12ch;
    margin-bottom: 1.5rem;
}
.hero-title em { font-style: italic; color: var(--gold-400); font-weight: 500; }
.hero-lead {
    max-width: 52ch;
    font-size: 1.15rem;
    color: var(--text-soft);
    margin-bottom: 2.2rem;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.9rem; }

/* Bloques imagen + texto alternos. */
.split {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    align-items: center;
    gap: clamp(2rem, 5vw, 4.5rem);
    margin-top: 5.5rem;
}
.split-reverse .split-media { order: 2; }
.split-media {
    border-radius: var(--radius-lg);
    overflow: hidden;
    aspect-ratio: 4 / 3;
    background: var(--navy-700);
}
.split-media img { width: 100%; height: 100%; object-fit: cover; }
.split-copy h2 { font-size: clamp(1.9rem, 3.4vw, 2.7rem); margin-bottom: 1rem; }
.split-copy p { color: var(--text-soft); max-width: 46ch; margin-bottom: 1.4rem; }

/* Servicios: columnas separadas por líneas finas, sin tarjetas. */
.services {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    border-top: 1px solid var(--line);
}
.services li {
    padding: 1.8rem 1.6rem 0.5rem 0;
}
.services li + li { padding-left: 1.6rem; border-left: 1px solid var(--line); }
.services h3 { font-size: 1.6rem; margin: 1rem 0 0.4rem; }
.services p { color: var(--text-muted); font-size: 0.97rem; }

/* Galería: cinta en movimiento continuo; se pausa al pasar el ratón o enfocar. */
.gallery-viewport {
    overflow: hidden;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
            mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}
.gallery-track {
    list-style: none;
    padding: 0;
    display: flex;
    gap: 1rem;
    width: max-content;
    animation: gallery-scroll 40s linear infinite;
}
.gallery-viewport:hover .gallery-track,
.gallery-viewport:focus-within .gallery-track { animation-play-state: paused; }
.gallery-track li {
    flex-shrink: 0;
    width: clamp(260px, 30vw, 380px);
    aspect-ratio: 3 / 2;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--navy-700);
}
.gallery-track img { width: 100%; height: 100%; object-fit: cover; }
@keyframes gallery-scroll {
    to { transform: translateX(calc(-50% - 0.5rem)); }
}

.cta-band {
    margin-top: 5.5rem;
    padding: clamp(2rem, 5vw, 3.5rem);
    border-radius: var(--radius-lg);
    background: var(--navy-700);
    border: 1px solid var(--line);
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas: "title action" "text action";
    align-items: center;
    column-gap: 2rem;
}
.cta-band h2,
.prose-page .cta-band h2 { grid-area: title; font-size: clamp(1.8rem, 3.2vw, 2.4rem); margin: 0; max-width: none; }
.cta-band p  { grid-area: text; color: var(--text-soft); margin-top: 0.4rem; }
.cta-band .btn { grid-area: action; }

/* 7. Páginas de contenido ================================================= */
.prose-page h2 {
    font-size: clamp(1.9rem, 3.4vw, 2.6rem);
    margin: 4.5rem 0 1.2rem;
    max-width: 24ch;
}
.prose-page > p,
.prose p { color: var(--text-soft); max-width: 68ch; }
.prose p + p { margin-top: 1rem; }
.prose-page > p.prose { margin-top: 1.6rem; }
.lead { font-size: 1.2rem; color: var(--text) !important; }

.page-head { padding-top: 3.5rem; }
.page-crumb { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 1rem; }
.page-crumb a { color: var(--text-muted); }
.page-head h1 {
    font-size: clamp(2.5rem, 5.5vw, 4.4rem);
    max-width: 18ch;
}

.page-intro {
    display: grid;
    grid-template-columns: 1.25fr 1fr;
    gap: clamp(2rem, 5vw, 4rem);
    align-items: start;
    margin-top: 2.5rem;
}
.page-figure {
    border-radius: var(--radius-lg);
    overflow: hidden;
    aspect-ratio: 4 / 3;
    background: var(--navy-700);
}
.page-figure img { width: 100%; height: 100%; object-fit: cover; }

/* Lista con marcas de verificación dibujadas en SVG. */
.checklist {
    list-style: none;
    padding: 0;
    margin-top: 1.4rem;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem 2.5rem;
    max-width: 900px;
}
.checklist li {
    position: relative;
    padding: 0.2rem 0 0.9rem 2.2rem;
    border-bottom: 1px solid var(--line);
}
.checklist li::before {
    content: '';
    position: absolute;
    left: 0; top: 0.35rem;
    width: 1.35rem; height: 1.35rem;
    background: var(--sky-400);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='m8 12 3 3 5-6'/%3E%3C/svg%3E") center / contain no-repeat;
            mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='m8 12 3 3 5-6'/%3E%3C/svg%3E") center / contain no-repeat;
}
.checklist-compact { grid-template-columns: 1fr; gap: 0.6rem; }
.checklist-compact li { border-bottom: 0; padding-bottom: 0; }

.tags {
    list-style: none;
    padding: 0;
    margin: 1.6rem 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}
.tags li {
    padding: 0.45rem 1rem;
    border-radius: 999px;
    border: 1px solid rgba(201, 162, 84, 0.45);
    color: var(--gold-400);
    font-weight: 500;
    font-size: 0.95rem;
}

/* Comparativa: juntas frente a capa continua. */
.compare {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.2rem;
    margin-top: 2.2rem;
}
.compare-item {
    padding: 1.8rem;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: var(--navy-900);
}
.compare-item-good { border-color: rgba(108, 187, 232, 0.4); }
.compare-art { width: 100%; height: auto; margin-bottom: 1.2rem; }
.compare-art rect { fill: var(--navy-600); stroke: var(--silver); stroke-opacity: 0.5; }
.compare-art .layer { fill: var(--sky-400); stroke: none; }
.compare-art .base { stroke: var(--text-muted); stroke-width: 2; stroke-dasharray: 4 5; }
.compare-art .leak { fill: var(--danger); }
.compare-item figcaption { color: var(--text-soft); font-size: 0.98rem; }
.compare-item figcaption strong {
    display: block;
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--text);
    margin-bottom: 0.3rem;
}

/* Animación: las juntas "laten" en rojo; la capa continua se extiende de izquierda a derecha. */
.js .compare[data-reveal] .compare-art-continuous .layer { clip-path: inset(0 100% 0 0); }
.js .compare[data-reveal] .leak { opacity: 0; }
.js .compare.is-visible .compare-art-continuous .layer {
    clip-path: inset(0 0 0 0);
    transition: clip-path 900ms var(--ease-in-out) 200ms;
}
.js .compare.is-visible .leak { animation: leak-pulse 1.6s ease-in-out 400ms 2 both; }
@keyframes leak-pulse {
    0%   { opacity: 0; transform: scale(0.6); }
    40%  { opacity: 1; transform: scale(1.15); }
    100% { opacity: 1; transform: scale(1); }
}
.compare-art .leak { transform-box: fill-box; transform-origin: center; }

/* Esquema de capas de obra nueva: se apila de abajo arriba al aparecer. */
.layers {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 1.6rem;
    border-radius: var(--radius-lg);
    background: var(--navy-900);
    border: 1px solid var(--line);
}
.layer {
    padding: 1.1rem 1.3rem;
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}
.layer span { font-weight: 600; }
.layer small { font-size: 0.9rem; }
.layer-finish   { background: #b99a6b; color: #1c1408; }
.layer-membrane { background: var(--sky-400); color: #062033; padding-block: 0.8rem; }
.layer-concrete { background: #8c96a3; color: #10161d; padding-block: 1.8rem; }

.js .layers[data-reveal] .layer { opacity: 0; transform: translateY(-18px); }
.js .layers.is-visible .layer {
    opacity: 1;
    transform: none;
    transition: opacity 420ms var(--ease-out), transform 520ms var(--ease-out);
}
/* El orden de aparición es de abajo (hormigón) hacia arriba (acabado). */
.js .layers.is-visible .layer-concrete { transition-delay: 100ms; }
.js .layers.is-visible .layer-membrane { transition-delay: 380ms; }
.js .layers.is-visible .layer-finish   { transition-delay: 660ms; }

/* 8. Contacto y formulario ================================================ */
.contact {
    display: grid;
    grid-template-columns: 0.8fr 1.2fr;
    gap: clamp(2rem, 5vw, 4.5rem);
    padding-top: 3.5rem;
    align-items: start;
}
.contact-intro h1 { font-size: clamp(2.5rem, 5vw, 3.8rem); margin-bottom: 1rem; }
.contact-intro p { color: var(--text-soft); }
.contact-intro .lead { margin-bottom: 1.6rem; }

.form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.3rem 1.5rem;
    padding: clamp(1.4rem, 4vw, 2.4rem);
    border-radius: var(--radius-lg);
    background: var(--navy-700);
    border: 1px solid var(--line);
}
.field { display: flex; flex-direction: column; gap: 0.45rem; min-width: 0; }
.field-full { grid-column: 1 / -1; }
.field label { font-weight: 500; font-size: 0.95rem; color: var(--text); }
.optional { color: var(--text-muted); font-weight: 400; }

.field input,
.field select,
.field textarea {
    width: 100%;
    min-height: 48px;
    padding: 0.75rem 1rem;
    font: inherit;
    font-size: 1rem;  /* ≥16px evita el zoom automático en iOS */
    color: var(--text);
    background: var(--navy-900);
    border: 1px solid rgba(217, 222, 230, 0.2);
    border-radius: 12px;
    transition: border-color 160ms ease, box-shadow 160ms ease;
}
.field textarea { resize: vertical; min-height: 140px; }
.field select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b7c1cf' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 0.9rem center; background-size: 18px; padding-right: 2.6rem; }
.field ::placeholder { color: var(--text-muted); opacity: 1; }
.field input:focus,
.field select:focus,
.field textarea:focus {
    outline: none;
    border-color: var(--gold-500);
    box-shadow: 0 0 0 3px rgba(201, 162, 84, 0.22);
}
.field [aria-invalid="true"] { border-color: var(--danger); }
.field [aria-invalid="true"]:focus { box-shadow: 0 0 0 3px rgba(240, 138, 124, 0.25); }

.field-error { color: var(--danger); font-size: 0.88rem; min-height: 1.3em; }
.field-foot { display: flex; justify-content: space-between; gap: 1rem; }
.char-count { font-size: 0.85rem; color: var(--text-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.char-count.is-near { color: var(--gold-400); }

.field-check {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 0.75rem;
    align-items: start;
}
.field-check input {
    width: 22px; height: 22px; min-height: 0;
    margin-top: 0.15rem;
    padding: 0;
    accent-color: var(--gold-500);
}
.field-check label { font-weight: 400; color: var(--text-soft); }
.field-check .field-error { grid-column: 2; }

/* Trampa anti-robots fuera de la pantalla (no display:none, que algunos bots detectan). */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; }

/* Botón de envío con estados: normal, enviando (spinner) y enviado. */
.btn-submit { min-width: 210px; position: relative; }
.btn-submit:disabled { cursor: progress; }
.btn-spinner {
    display: none;
    width: 18px; height: 18px;
    border-radius: 50%;
    border: 2px solid rgba(8, 22, 38, 0.3);
    border-top-color: var(--navy-900);
    animation: spin 600ms linear infinite;
}
.btn-submit.is-loading .btn-spinner { display: inline-block; }
.btn-submit.is-loading { opacity: 0.85; }
@keyframes spin { to { transform: rotate(360deg); } }

.form-status { font-size: 0.98rem; flex: 1 1 240px; }
.form-status:empty { display: none; }
.form-status.is-error   { color: var(--danger); }
.form-status.is-success { color: var(--success); }
.form-status.is-visible { animation: status-in 260ms var(--ease-out) both; }
@keyframes status-in { from { opacity: 0; transform: translateY(4px); } }

.not-found { padding-top: 6rem; max-width: 640px; }
.not-found h1 { font-size: clamp(2.4rem, 5vw, 3.6rem); margin-bottom: 1rem; }
.not-found p { color: var(--text-soft); margin-bottom: 2rem; }

/* 9. Pie de página ======================================================== */
.site-footer {
    border-top: 1px solid var(--line);
    background: var(--navy-900);
    padding-block: 2.8rem;
    font-size: 0.95rem;
    color: var(--text-muted);
}
.footer-inner {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 1.6rem 2rem;
    align-items: start;
}
.footer-brand .brand-word { font-size: 1.4rem; }
.footer-brand p { margin-top: 0.5rem; }
.footer-nav { display: flex; flex-direction: column; gap: 0.4rem; }
.footer-nav a { color: var(--text-soft); text-decoration: none; }
@media (hover: hover) and (pointer: fine) { .footer-nav a:hover { color: var(--gold-400); text-decoration: underline; } }
.footer-contact span { white-space: nowrap; }
.footer-copy { grid-column: 1 / -1; font-size: 0.88rem; }

/* Sin JavaScript todas las vistas se muestran apiladas. */
.no-js .view[hidden] { display: block; }

/* 10. Pantallas pequeñas ================================================== */
@media (max-width: 900px) {
    .services { grid-template-columns: repeat(2, 1fr); }
    .services li:nth-child(3) { padding-left: 0; border-left: 0; }
    .page-intro, .contact { grid-template-columns: 1fr; }
    .page-figure { max-width: 560px; }
}

@media (max-width: 760px) {
    :root { --header-h: 64px; }
    body { font-size: 1rem; }

    .brand-mark { width: 46px; height: 34px; }
    .brand-word { font-size: 1.35rem; }

    /* Menú desplegable en móvil. */
    .nav-toggle { display: block; }
    .js .site-nav {
        position: absolute;
        top: 100%; left: 0; right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 0.5rem clamp(1rem, 4vw, 2rem) 1.25rem;
        background: var(--navy-800);
        border-bottom: 1px solid var(--line);
        clip-path: inset(0 0 100% 0);
        visibility: hidden;
        transition: clip-path 260ms var(--ease-out), visibility 0s linear 260ms;
    }
    .js .site-nav.is-open {
        clip-path: inset(0 0 0 0);
        visibility: visible;
        transition: clip-path 260ms var(--ease-out), visibility 0s;
    }
    .site-nav a { padding: 0.9rem 0; border-bottom: 1px solid var(--line); font-size: 1.05rem; }
    .site-nav a[aria-current="page"] { border-bottom-color: var(--line); color: var(--gold-400); }
    .site-nav .nav-cta { margin-top: 1rem; text-align: center; padding: 0.85rem 1rem; }
    .no-js .site-nav { flex-wrap: wrap; gap: 1rem; }
    .no-js .nav-toggle { display: none; }
    .no-js .header-inner { flex-wrap: wrap; padding-block: 0.8rem; }

    .hero { min-height: 0; }
    .hero-inner { padding-block: 6rem 3rem; }
    .hero::before {
        background: linear-gradient(0deg, var(--navy-800) 5%, rgba(8, 22, 38, 0.8) 55%, rgba(8, 22, 38, 0.55) 100%);
    }
    .hero-actions .btn { flex: 1 1 100%; }

    .split { grid-template-columns: 1fr; margin-top: 4rem; }
    .split-reverse .split-media { order: 0; }

    .services { grid-template-columns: 1fr; }
    .services li, .services li + li { padding: 1.4rem 0; border-left: 0; border-bottom: 1px solid var(--line); }

    .checklist, .compare { grid-template-columns: 1fr; }

    .cta-band { grid-template-columns: 1fr; grid-template-areas: "title" "text" "action"; row-gap: 0.4rem; }
    .cta-band .btn { margin-top: 1.2rem; width: 100%; }

    .form { grid-template-columns: 1fr; }
    .btn-submit { width: 100%; }

    .footer-inner { grid-template-columns: 1fr; }
}

/* 11. Movimiento reducido ================================================= */
/* Si el usuario pide menos movimiento: sin cinta animada ni entradas, contenido visible al instante. */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 1ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 1ms !important;
        transition-delay: 0ms !important;
    }
    .gallery-track { animation: none !important; flex-wrap: wrap; width: auto; padding-inline: clamp(1rem, 4vw, 2rem); }
    .gallery-track li[aria-hidden="true"] { display: none; }
    .gallery-viewport { -webkit-mask-image: none; mask-image: none; }
}
