/* ==========================================================================
   luisjuarez.dev — estilos
   CSS nativo moderno: custom properties, scroll-driven animations,
   view transitions, @starting-style y :has(). Sin build step.
   ========================================================================== */

@font-face {
    font-family: "Inter";
    src: url("../fonts/inter-latin-wght-normal.woff2") format("woff2");
    font-weight: 100 900;
    font-display: swap;
}

@font-face {
    font-family: "Space Grotesk";
    src: url("../fonts/space-grotesk-latin-wght-normal.woff2") format("woff2");
    font-weight: 300 700;
    font-display: swap;
}

:root {
    color-scheme: dark;

    --bg: #07090f;
    --surface: #0c111b;
    --surface-2: #111827;
    --border: rgb(148 163 184 / 0.14);
    --border-strong: rgb(148 163 184 / 0.28);
    --text: #e8edf6;
    --muted: #94a3b8;
    --subtle: #64748b;

    --cyan: #22d3ee;
    --violet: #8b5cf6;
    --green: #34d399;
    --red: #f87171;
    --gradient: linear-gradient(100deg, var(--cyan), var(--violet));

    --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font-display: "Space Grotesk", var(--font-body);

    --radius: 16px;
    --radius-sm: 10px;
    --container: 1160px;
    --header-h: 68px;
    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

@view-transition {
    navigation: auto;
}

/* ---------- Base ---------- */

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h) + 16px);
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 1.0625rem;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    overflow-x: clip;
}

h1, h2, h3, h4 {
    font-family: var(--font-display);
    line-height: 1.12;
    letter-spacing: -0.02em;
    margin: 0 0 0.5em;
    text-wrap: balance;
}

p {
    margin: 0 0 1em;
    text-wrap: pretty;
}

a {
    color: var(--cyan);
    text-underline-offset: 3px;
}

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

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

::selection {
    background: rgb(34 211 238 / 0.3);
}

.container {
    width: min(var(--container), 100% - 32px);
    margin-inline: auto;
}

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

.skip-link {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 100;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    background: var(--text);
    color: var(--bg);
    font-weight: 600;
    transform: translateY(-200%);
}

.skip-link:focus {
    transform: none;
}

.gradient-text {
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* ---------- Botones ---------- */

.btn {
    --btn-bg: var(--text);
    --btn-color: var(--bg);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 24px;
    border: 1px solid transparent;
    border-radius: 999px;
    background: var(--btn-bg);
    color: var(--btn-color);
    font: 600 1rem/1.2 var(--font-body);
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.2s var(--ease-out), box-shadow 0.2s, background-color 0.2s;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px -10px rgb(34 211 238 / 0.55);
}

.btn:active {
    transform: translateY(0);
}

.btn svg {
    width: 18px;
    height: 18px;
    flex: none;
}

.btn-primary {
    --btn-bg: var(--gradient);
    --btn-color: #05070c;
    background: var(--gradient);
}

.btn-ghost {
    --btn-bg: rgb(255 255 255 / 0.04);
    --btn-color: var(--text);
    border-color: var(--border-strong);
    backdrop-filter: blur(8px);
}

.btn-ghost:hover {
    background: rgb(255 255 255 / 0.08);
    box-shadow: none;
}

.btn-small {
    padding: 9px 18px;
    font-size: 0.9375rem;
}

/* ---------- Header ---------- */

.site-header {
    position: fixed;
    inset: 0 0 auto;
    z-index: 50;
    height: var(--header-h);
    transition: background-color 0.3s, border-color 0.3s;
    border-bottom: 1px solid transparent;
}

.site-header.is-scrolled {
    background: rgb(7 9 15 / 0.72);
    backdrop-filter: blur(14px) saturate(1.4);
    border-bottom-color: var(--border);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    height: 100%;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    font: 700 1.125rem/1 var(--font-display);
    text-decoration: none;
    letter-spacing: -0.01em;
}

.logo img {
    width: 30px;
    height: 30px;
}

.logo-text span {
    color: var(--muted);
    font-weight: 500;
}

.nav-desktop {
    display: flex;
    align-items: center;
    gap: 28px;
    margin-left: auto;
}

/* Selector de idioma (ES / EN) */
.nav-desktop .lang-switch,
.lang-switch-header {
    display: inline-grid;
    place-items: center;
    min-width: 40px;
    padding: 6px 10px;
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    color: var(--muted);
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-decoration: none;
    transition: color 0.2s, border-color 0.2s;
}

.nav-desktop .lang-switch:hover,
.lang-switch-header:hover {
    color: var(--text);
    border-color: var(--cyan);
}

.mobile-menu .lang-switch-mobile {
    color: var(--muted);
}

@media (max-width: 860px) {
    .lang-switch-header {
        margin-left: auto;
    }
}

.nav-desktop a:not(.btn) {
    color: var(--muted);
    font-size: 0.9375rem;
    text-decoration: none;
    transition: color 0.2s;
}

.nav-desktop a:not(.btn):hover {
    color: var(--text);
}

.menu-toggle {
    display: none;
    width: 44px;
    height: 44px;
    border: 1px solid var(--border-strong);
    border-radius: 12px;
    background: transparent;
    color: var(--text);
    cursor: pointer;
}

.menu-toggle svg {
    margin: auto;
}

.mobile-menu {
    inset: var(--header-h) 16px auto;
    width: auto;
    margin: 8px 0 0;
    padding: 12px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    background: rgb(12 17 27 / 0.96);
    backdrop-filter: blur(16px);
    color: var(--text);
}

.mobile-menu a {
    display: block;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
}

.mobile-menu a:hover {
    background: rgb(255 255 255 / 0.06);
}

.mobile-menu .btn {
    display: flex;
    margin-top: 8px;
}

@media (max-width: 860px) {
    .nav-desktop {
        display: none;
    }

    .menu-toggle {
        display: grid;
    }
}

/* ---------- Hero ---------- */

.hero {
    position: relative;
    display: grid;
    align-items: center;
    min-height: min(100svh, 920px);
    padding: calc(var(--header-h) + 48px) 0 96px;
    isolation: isolate;
    overflow: hidden;
}

.hero-canvas {
    position: absolute;
    inset: 0;
    z-index: -1;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1.4s ease;
}

.hero-canvas.is-ready {
    opacity: 1;
}

/* En móvil la escena queda detrás del texto: se atenúa para no competir con él */
@media (max-width: 960px) {
    .hero-canvas.is-ready {
        opacity: 0.45;
    }
}

/* Fondo de respaldo (sin WebGL, movimiento reducido o mientras carga three.js) */
.hero-bg {
    position: absolute;
    inset: 0;
    z-index: -2;
    background:
        radial-gradient(60% 50% at 75% 40%, rgb(139 92 246 / 0.22), transparent 70%),
        radial-gradient(50% 45% at 85% 70%, rgb(34 211 238 / 0.16), transparent 70%),
        radial-gradient(40% 40% at 10% 10%, rgb(34 211 238 / 0.08), transparent 70%);
}

.hero-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgb(148 163 184 / 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgb(148 163 184 / 0.06) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: radial-gradient(70% 60% at 50% 40%, #000 30%, transparent 75%);
}

.hero::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    z-index: -1;
    height: 160px;
    background: linear-gradient(transparent, var(--bg));
    pointer-events: none;
}

.hero-inner {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
    align-items: center;
    gap: clamp(32px, 4vw, 64px);
}

.hero-content {
    max-width: 680px;
}

@media (max-width: 1100px) {
    .hero-inner {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* ---------- Diagrama "herramientas conectadas" ---------- */

.hero-visual {
    width: 100%;
    max-width: 560px;
    justify-self: end;
    animation: rise 1s var(--ease-out) 0.3s both;
}

@media (max-width: 1100px) {
    .hero-visual {
        justify-self: center;
        max-width: 480px;
    }
}

.hv {
    display: block;
    width: 100%;
    height: auto;
    overflow: visible;
    font-family: var(--font-body);
}

.hv-line {
    fill: none;
    stroke: rgb(148 163 184 / 0.22);
    stroke-width: 1.5;
}

.hv-flow {
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-dasharray: 6 14;
    animation: hv-dash 1.6s linear infinite;
}

.hv-flow-in { stroke: rgb(34 211 238 / 0.55); }
.hv-flow-out { stroke: rgb(167 139 250 / 0.6); }

@keyframes hv-dash {
    to { stroke-dashoffset: -40; }
}

.hv-chip rect:first-child,
.hv-out rect {
    fill: rgb(12 17 27 / 0.92);
    stroke: rgb(148 163 184 / 0.22);
    stroke-width: 1;
}

.hv-chip text,
.hv-out text {
    fill: var(--text);
    font-size: 14px;
    font-weight: 500;
}

.hv-icon-bg {
    fill: rgb(34 211 238 / 0.12);
}

.hv-icon {
    fill: none;
    stroke: var(--cyan);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.hv-core {
    fill: #0c111b;
    stroke: url(#hv-grad);
    stroke-width: 2.5;
}

.hv-orbit {
    fill: none;
    stroke: rgb(139 92 246 / 0.55);
    stroke-width: 1.5;
    stroke-dasharray: 3 9;
    transform-box: fill-box;
    transform-origin: center;
    animation: hv-spin 14s linear infinite;
}

@keyframes hv-spin {
    to { transform: rotate(360deg); }
}

.hv-halo {
    transform-box: fill-box;
    transform-origin: center;
    animation: hv-breathe 3.2s ease-in-out infinite;
}

@keyframes hv-breathe {
    50% { transform: scale(1.12); opacity: 0.7; }
}

.hv-caption {
    fill: var(--muted);
    font-size: 12.5px;
    font-weight: 500;
    letter-spacing: 0.02em;
}

/* Resultados: cada uno se "completa" por turnos */
.hv-out rect,
.hv-check-bg,
.hv-check {
    animation: 6s ease-in-out infinite;
}

.hv-out rect { animation-name: hv-out-card; }
.hv-check-bg { fill: rgb(52 211 153 / 0.12); animation-name: hv-out-check-bg; }
.hv-check {
    fill: none;
    stroke: var(--green);
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 20;
    stroke-dashoffset: 20;
    animation-name: hv-out-check;
}

.hv-out-2 rect, .hv-out-2 .hv-check-bg, .hv-out-2 .hv-check { animation-delay: 2s; }
.hv-out-3 rect, .hv-out-3 .hv-check-bg, .hv-out-3 .hv-check { animation-delay: 4s; }

@keyframes hv-out-card {
    0%, 8% { stroke: rgb(148 163 184 / 0.22); }
    16%, 55% { stroke: rgb(52 211 153 / 0.7); }
    75%, 100% { stroke: rgb(148 163 184 / 0.22); }
}

@keyframes hv-out-check-bg {
    0%, 8% { fill: rgb(52 211 153 / 0.08); }
    16%, 55% { fill: rgb(52 211 153 / 0.22); }
    75%, 100% { fill: rgb(52 211 153 / 0.08); }
}

@keyframes hv-out-check {
    0%, 8% { stroke-dashoffset: 20; }
    18%, 60% { stroke-dashoffset: 0; }
    75%, 100% { stroke-dashoffset: 0; opacity: 0.35; }
}

@media (prefers-reduced-motion: reduce) {
    .hv-packets { display: none; }
    .hv-check { stroke-dashoffset: 0; }
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 28px;
    padding: 7px 14px 7px 12px;
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    background: rgb(12 17 27 / 0.6);
    backdrop-filter: blur(8px);
    color: var(--muted);
    font-size: 0.875rem;
}

.pulse-dot {
    position: relative;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--green);
}

.pulse-dot::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: var(--green);
    animation: pulse 2s ease-out infinite;
}

@keyframes pulse {
    to {
        transform: scale(3);
        opacity: 0;
    }
}

.hero h1 {
    font-size: clamp(2.3rem, 5vw, 3.9rem);
    font-weight: 700;
    margin-bottom: 24px;
}

.hero h1 .gradient-text {
    display: block;
}

.hero-lead {
    max-width: 58ch;
    color: var(--muted);
    font-size: clamp(1.0625rem, 2vw, 1.25rem);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 36px;
}

.hero-trust {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 22px;
    margin: 40px 0 0;
    padding: 0;
    list-style: none;
    color: var(--muted);
    font-size: 0.9rem;
}

.hero-trust li {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.hero-trust svg {
    width: 16px;
    height: 16px;
    color: var(--green);
}

.hero-entrance > * {
    animation: rise 0.9s var(--ease-out) both;
}

.hero-entrance > :nth-child(2) { animation-delay: 0.08s; }
.hero-entrance > :nth-child(3) { animation-delay: 0.16s; }
.hero-entrance > :nth-child(4) { animation-delay: 0.24s; }
.hero-entrance > :nth-child(5) { animation-delay: 0.32s; }

@keyframes rise {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
}

.scroll-hint {
    position: absolute;
    left: 50%;
    bottom: 28px;
    display: grid;
    place-items: center;
    width: 26px;
    height: 42px;
    border: 1.5px solid var(--border-strong);
    border-radius: 999px;
    translate: -50% 0;
}

.scroll-hint::before {
    content: "";
    width: 3px;
    height: 8px;
    border-radius: 2px;
    background: var(--muted);
    animation: scroll-hint 1.8s ease-in-out infinite;
}

@keyframes scroll-hint {
    0% { transform: translateY(-6px); opacity: 0; }
    40% { opacity: 1; }
    100% { transform: translateY(8px); opacity: 0; }
}

/* ---------- Marquee ---------- */

.marquee {
    padding: 28px 0;
    border-block: 1px solid var(--border);
    /* Translúcido: el brillo de "El problema" pasa por debajo sin cortarse */
    background: rgb(12 17 27 / 0.7);
    overflow: hidden;
}

.marquee-label {
    margin: 0 0 16px;
    color: var(--subtle);
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-align: center;
    text-transform: uppercase;
}

.marquee-track {
    display: flex;
    gap: 14px;
    width: max-content;
    margin: 0;
    padding: 0;
    list-style: none;
    animation: marquee 40s linear infinite;
    mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}

.marquee:hover .marquee-track {
    animation-play-state: paused;
}

.marquee-track li {
    padding: 8px 18px;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--muted);
    font-size: 0.9375rem;
    white-space: nowrap;
}

@keyframes marquee {
    to {
        transform: translateX(-50%);
    }
}

/* ---------- Secciones ---------- */

.section {
    position: relative;
    padding: clamp(80px, 12vw, 136px) 0;
}

/* Ambiente de color por sección: brillos suaves de la paleta detrás del contenido.
   La capa se extiende 35% por arriba y por abajo de la sección para que los círculos de luz no se
   corten en el borde: se mezclan con los de la sección vecina. Por eso las posiciones y alturas de
   los degradados están reescaladas (alto real de la sección = 100% / 1.7): se ven igual que si la
   capa midiera lo mismo que la sección. Con z-index -1 sin "isolation" en la sección, los brillos
   quedan detrás de todo el contenido, también del de la sección vecina. */
.section::before {
    content: "";
    position: absolute;
    inset: -35% 0;
    z-index: -1;
    pointer-events: none;
}

/* Línea separadora con degradado en el borde superior */
#servicios::after,
#proceso::after,
#faq::after {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    width: min(880px, 90%);
    height: 1px;
    translate: -50% 0;
    background: linear-gradient(90deg, transparent, rgb(34 211 238 / 0.45), rgb(139 92 246 / 0.45), transparent);
    pointer-events: none;
}

#problema::before {
    background:
        radial-gradient(55% 35.29% at 50% 38.24%, rgb(248 113 113 / 0.11), transparent 70%),
        radial-gradient(40% 29.41% at 8% 70.59%, rgb(251 191 36 / 0.06), transparent 70%),
        radial-gradient(40% 29.41% at 92% 67.65%, rgb(139 92 246 / 0.09), transparent 70%);
}

#servicios::before {
    background:
        radial-gradient(50% 32.35% at 0% 35.29%, rgb(34 211 238 / 0.11), transparent 70%),
        radial-gradient(55% 35.29% at 100% 64.71%, rgb(139 92 246 / 0.13), transparent 70%);
}

#proceso::before {
    background:
        radial-gradient(55% 35.29% at 50% 50%, rgb(139 92 246 / 0.15), transparent 72%),
        radial-gradient(35% 26.47% at 85% 29.41%, rgb(34 211 238 / 0.08), transparent 70%),
        radial-gradient(circle, rgb(148 163 184 / 0.12) 1px, transparent 1.5px) 0 0 / 26px 26px;
    mask-image: radial-gradient(75% 50% at 50% 50%, #000 45%, transparent 90%);
}

#sobre-mi::before {
    background:
        radial-gradient(45% 35.29% at 22% 50%, rgb(34 211 238 / 0.11), transparent 70%),
        radial-gradient(40% 29.41% at 85% 38.24%, rgb(139 92 246 / 0.1), transparent 70%);
}

#faq::before {
    background:
        radial-gradient(55% 32.35% at 50% 29.41%, rgb(139 92 246 / 0.11), transparent 70%),
        radial-gradient(35% 26.47% at 0% 79.41%, rgb(34 211 238 / 0.07), transparent 70%);
}

#ejemplos::before {
    background: radial-gradient(50% 23.53% at 50% 20.59%, rgb(139 92 246 / 0.12), transparent 70%);
}

.section-head {
    max-width: 680px;
    margin-bottom: 56px;
}

.section-head.center {
    margin-inline: auto;
    text-align: center;
}

.eyebrow {
    display: inline-block;
    margin-bottom: 14px;
    color: var(--cyan);
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.section h2 {
    font-size: clamp(2rem, 4.4vw, 3rem);
}

.section-head p {
    color: var(--muted);
    font-size: 1.125rem;
}

/* ---------- Tarjetas con spotlight ---------- */

.card {
    --mx: 50%;
    --my: 50%;
    position: relative;
    padding: 28px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background:
        radial-gradient(420px circle at var(--mx) var(--my), rgb(34 211 238 / 0.07), transparent 45%),
        var(--surface);
    transition: border-color 0.3s, transform 0.3s var(--ease-out);
}

.card:hover {
    border-color: var(--border-strong);
}

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

.card p {
    color: var(--muted);
    margin: 0;
}

.icon {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    margin-bottom: 20px;
    border: 1px solid var(--border-strong);
    border-radius: 12px;
    background: linear-gradient(140deg, rgb(34 211 238 / 0.14), rgb(139 92 246 / 0.14));
    color: var(--cyan);
}

.icon svg {
    width: 24px;
    height: 24px;
}

/* ---------- Problemas ---------- */

.pain-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.pain-grid .icon {
    background: rgb(248 113 113 / 0.08);
    border-color: rgb(248 113 113 / 0.25);
    color: var(--red);
}

.pain-note {
    margin: 40px auto 0;
    max-width: 640px;
    color: var(--muted);
    font-size: 1.125rem;
    text-align: center;
}

.pain-note strong {
    color: var(--text);
}

/* ---------- Servicios (bento) ---------- */

.bento {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(6, 1fr);
}

.bento .card {
    grid-column: span 2;
}

.bento .card-wide {
    grid-column: span 2;
}

.bento .card-feature {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    align-items: center;
    gap: 24px;
    grid-column: span 6;
    padding: 36px;
}

.card-feature h3 {
    font-size: 1.625rem;
}

.card-feature ul {
    display: grid;
    gap: 10px;
    margin: 20px 0 0;
    padding: 0;
    list-style: none;
    color: var(--muted);
}

.card-feature li {
    display: flex;
    gap: 10px;
}

.card-feature li svg {
    flex: none;
    width: 20px;
    height: 20px;
    margin-top: 3px;
    color: var(--green);
}

.mock {
    display: grid;
    gap: 14px;
    padding: 22px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    background: var(--bg);
    box-shadow: 0 24px 48px -16px rgb(0 0 0 / 0.6);
    font-size: 0.875rem;
}

.mock-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
}

.mock-badge {
    padding: 2px 8px;
    border-radius: 999px;
    background: rgb(148 163 184 / 0.12);
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 500;
}

.mock-row {
    display: grid;
    grid-template-columns: 1.3fr 1fr auto;
    align-items: center;
    gap: 12px;
    color: var(--muted);
}

.mock-bar {
    height: 6px;
    border-radius: 999px;
    background: rgb(148 163 184 / 0.12);
    overflow: hidden;
}

.mock-bar i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--gradient);
    transform-origin: left;
}

.mock-bar .w-90 { width: 90%; }
.mock-bar .w-70 { width: 70%; }
.mock-bar .w-55 { width: 55%; }
.mock-bar .w-35 { width: 35%; }

@supports (animation-timeline: view()) {
    .mock-bar i {
        animation: grow-bar linear both;
        animation-timeline: view();
        animation-range: entry 20% cover 40%;
    }
}

@keyframes grow-bar {
    from {
        transform: scaleX(0);
    }
}

.mock-row b {
    min-width: 52px;
    color: var(--green);
    font-size: 0.8125rem;
    text-align: right;
}

.mock-row b.mid { color: #fbbf24; }
.mock-row b.low { color: var(--muted); }

.tag {
    display: inline-block;
    margin-bottom: 14px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgb(52 211 153 / 0.12);
    color: var(--green);
    font-size: 0.8125rem;
    font-weight: 600;
}

@media (max-width: 960px) {
    .bento .card,
    .bento .card-wide {
        grid-column: span 3;
    }

    .bento .card-feature {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .bento {
        grid-template-columns: 1fr;
    }

    .bento .card,
    .bento .card-wide,
    .bento .card-feature {
        grid-column: auto;
    }

    .bento .card-feature {
        padding: 28px;
    }
}

/* ---------- Ejemplos (tabs) ---------- */

.tabs {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    width: fit-content;
    max-width: 100%;
    margin: 0 auto 40px;
    padding: 6px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
}

.tab {
    padding: 10px 20px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--muted);
    font: 500 0.9375rem/1.2 var(--font-body);
    cursor: pointer;
    transition: background-color 0.25s, color 0.25s;
}

.tab:hover {
    color: var(--text);
}

.tab[aria-selected="true"] {
    background: var(--text);
    color: var(--bg);
}

.tab-panel {
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    gap: 32px;
    align-items: center;
    padding: 32px;
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) + 8px);
    background: var(--surface);
}

.tab-panel[hidden] {
    display: none;
}

.tab-panel:not([hidden]) {
    animation: fade-in 0.5s var(--ease-out);
}

@keyframes fade-in {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
}

.tab-panel figure {
    margin: 0;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--bg);
}

.tab-panel figure img {
    width: 100%;
    height: auto;
}

.compare {
    display: grid;
    gap: 16px;
}

.compare h3 {
    font-size: 1.5rem;
}

.compare-box {
    padding: 18px 20px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.compare-box h4 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 0.8125rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.compare-box ul {
    display: grid;
    gap: 6px;
    margin: 0;
    padding-left: 18px;
    color: var(--muted);
    font-size: 0.9875rem;
}

.compare-box.before h4 { color: var(--red); }
.compare-box.before { background: rgb(248 113 113 / 0.04); }
.compare-box.after h4 { color: var(--green); }
.compare-box.after { background: rgb(52 211 153 / 0.05); border-color: rgb(52 211 153 / 0.22); }

.example-note {
    margin: 0;
    color: var(--subtle);
    font-size: 0.8125rem;
}

@media (max-width: 560px) {
    .tabs {
        flex-wrap: nowrap;
        justify-content: flex-start;
        gap: 2px;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .tab {
        flex: none;
        padding: 9px 13px;
        font-size: 0.875rem;
    }
}

@media (max-width: 900px) {
    .tab-panel {
        grid-template-columns: 1fr;
        padding: 20px;
    }
}

/* ---------- Proceso (timeline) ---------- */

.timeline {
    position: relative;
    display: grid;
    gap: 20px;
    max-width: 760px;
    margin: 0 auto;
    padding: 0 0 0 64px;
    list-style: none;
    counter-reset: step;
    isolation: isolate;
}

.timeline::before,
.timeline::after {
    content: "";
    position: absolute;
    top: 8px;
    bottom: 8px;
    left: 23px;
    width: 2px;
    border-radius: 2px;
    background: var(--border);
    z-index: -1;
}

.timeline::after {
    background: var(--gradient);
    transform-origin: top;
}

.timeline li {
    position: relative;
    counter-increment: step;
}

.timeline li::before {
    content: counter(step, decimal-leading-zero);
    position: absolute;
    top: 22px;
    left: -64px;
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border: 1px solid var(--border-strong);
    border-radius: 50%;
    background: var(--bg);
    color: var(--cyan);
    font: 600 0.9375rem/1 var(--font-display);
    z-index: 1;
}

@supports (animation-timeline: view()) {
    .timeline::after {
        animation: grow-line linear both;
        animation-timeline: view();
        animation-range: entry 30% cover 60%;
    }
}

@keyframes grow-line {
    from {
        transform: scaleY(0);
    }
}

/* ---------- Sobre mí ---------- */

.about {
    display: grid;
    grid-template-columns: 0.9fr 1.1fr;
    gap: clamp(32px, 6vw, 80px);
    align-items: center;
}

.about-visual {
    position: relative;
    border-radius: calc(var(--radius) + 8px);
    border: 1px solid var(--border);
    background: var(--surface);
    overflow: hidden;
}

.about-visual img {
    width: 100%;
    height: auto;
}

.about p {
    color: var(--muted);
}

.about p strong {
    color: var(--text);
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 24px 0 0;
    padding: 0;
    list-style: none;
}

.chips li {
    padding: 6px 14px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text);
    font-size: 0.875rem;
}

.callout {
    display: flex;
    gap: 14px;
    margin-top: 28px;
    padding: 18px 20px;
    border: 1px solid rgb(34 211 238 / 0.3);
    border-radius: var(--radius-sm);
    background: rgb(34 211 238 / 0.06);
}

.callout svg {
    flex: none;
    width: 22px;
    height: 22px;
    margin-top: 2px;
    color: var(--cyan);
}

.callout p {
    margin: 0;
    color: var(--text);
}

@media (max-width: 860px) {
    .about {
        grid-template-columns: 1fr;
    }
}

/* ---------- FAQ ---------- */

.faq {
    display: grid;
    gap: 12px;
    max-width: 800px;
    margin: 0 auto;
}

.faq details {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    transition: border-color 0.25s;
}

.faq details[open] {
    border-color: var(--border-strong);
}

.faq summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 22px;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
}

.faq summary::-webkit-details-marker {
    display: none;
}

.faq summary::after {
    content: "";
    flex: none;
    width: 12px;
    height: 12px;
    border-right: 2px solid var(--muted);
    border-bottom: 2px solid var(--muted);
    transform: rotate(45deg) translateY(-3px);
    transition: transform 0.3s var(--ease-out);
}

.faq details[open] summary::after {
    transform: rotate(-135deg) translateY(-3px);
}

.faq details p {
    margin: 0;
    padding: 0 22px 22px;
    color: var(--muted);
}

/* Animación de apertura nativa donde está soportada */
.faq details::details-content {
    block-size: 0;
    overflow: hidden;
    transition: block-size 0.35s var(--ease-out), content-visibility 0.35s allow-discrete;
}

.faq details[open]::details-content {
    block-size: auto;
}

@supports (interpolate-size: allow-keywords) {
    :root {
        interpolate-size: allow-keywords;
    }
}

/* ---------- CTA final ---------- */

.cta {
    position: relative;
    padding: clamp(40px, 7vw, 80px) clamp(24px, 5vw, 64px);
    border: 1px solid var(--border-strong);
    border-radius: calc(var(--radius) + 12px);
    background:
        radial-gradient(60% 80% at 100% 0%, rgb(139 92 246 / 0.28), transparent 70%),
        radial-gradient(60% 80% at 0% 100%, rgb(34 211 238 / 0.2), transparent 70%),
        var(--surface);
    text-align: center;
    overflow: hidden;
}

.cta h2 {
    max-width: 18ch;
    margin-inline: auto;
}

.cta p {
    max-width: 52ch;
    margin-inline: auto;
    color: var(--muted);
    font-size: 1.125rem;
}

.cta .hero-actions {
    justify-content: center;
}

/* ---------- Footer ---------- */

.site-footer {
    padding: 56px 0 32px;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 0.9375rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1.3fr 1fr;
    gap: 32px;
}

.footer-grid h2 {
    margin-bottom: 14px;
    color: var(--text);
    font-size: 0.875rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.footer-grid ul {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.footer-grid a {
    color: var(--muted);
    text-decoration: none;
}

.footer-grid a:hover {
    color: var(--text);
}

.footer-about p {
    max-width: 38ch;
    margin-top: 14px;
}

/* Iconos de redes sociales bajo el logo del pie de página */
.footer-grid .footer-social {
    display: flex;
    gap: 10px;
    margin: 18px 0 0;
    padding: 0;
    list-style: none;
}

.footer-grid .footer-social a {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--border-strong);
    border-radius: 50%;
    color: var(--muted);
    transition: color 0.2s, border-color 0.2s, background-color 0.2s;
}

.footer-grid .footer-social a:hover {
    border-color: var(--cyan);
    background: rgb(34 211 238 / 0.08);
    color: var(--text);
}

.footer-bottom {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 12px;
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    color: var(--subtle);
    font-size: 0.875rem;
}

@media (max-width: 720px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }

    .footer-about {
        grid-column: 1 / -1;
    }
}

/* ---------- Páginas legales ---------- */

.page-hero {
    position: relative;
    padding: calc(var(--header-h) + 72px) 0 48px;
    border-bottom: 1px solid var(--border);
    background: radial-gradient(50% 80% at 80% 0%, rgb(139 92 246 / 0.16), transparent 70%);
}

/* Brillos de las páginas legales, con la paleta de la portada. Van en capas detrás del contenido
   (z-index -1) y más grandes que su bloque, para que los círculos no se corten en ningún borde. */
.page-hero::before {
    content: "";
    position: absolute;
    inset: 0 0 -320px;
    z-index: -1;
    pointer-events: none;
    background: radial-gradient(520px 420px at 6% 55%, rgb(34 211 238 / 0.1), transparent 70%);
}

.legal {
    position: relative;
}

.legal::before {
    content: "";
    position: absolute;
    inset: 0 calc(50% - 50vw);
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(640px 520px at 100% 420px, rgb(139 92 246 / 0.13), transparent 70%),
        radial-gradient(560px 480px at 0% 1250px, rgb(34 211 238 / 0.11), transparent 70%),
        radial-gradient(620px 520px at 95% 2100px, rgb(248 113 113 / 0.08), transparent 70%),
        radial-gradient(600px 500px at 10% calc(100% - 240px), rgb(139 92 246 / 0.12), transparent 70%);
}

.page-hero h1 {
    font-size: clamp(2.2rem, 5vw, 3.4rem);
}

.page-hero p {
    max-width: 62ch;
    color: var(--muted);
}

.breadcrumbs {
    display: flex;
    gap: 8px;
    margin: 0 0 20px;
    padding: 0;
    list-style: none;
    color: var(--subtle);
    font-size: 0.875rem;
}

.breadcrumbs li + li::before {
    content: "/";
    margin-right: 8px;
}

.breadcrumbs a {
    color: var(--muted);
    text-decoration: none;
}

.legal {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 64px;
    padding: 56px 0 96px;
}

.legal-toc {
    position: sticky;
    top: calc(var(--header-h) + 24px);
    align-self: start;
}

.legal-toc h2 {
    margin-bottom: 12px;
    color: var(--subtle);
    font-size: 0.8125rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.legal-toc ol {
    display: grid;
    gap: 2px;
    margin: 0;
    padding: 0;
    list-style: none;
    border-left: 1px solid var(--border);
}

.legal-toc a {
    display: block;
    padding: 6px 0 6px 16px;
    margin-left: -1px;
    border-left: 1px solid transparent;
    color: var(--muted);
    font-size: 0.9375rem;
    text-decoration: none;
}

.legal-toc a:hover,
.legal-toc a.is-active {
    border-left-color: var(--cyan);
    color: var(--text);
}

.legal-body {
    max-width: 72ch;
}

.legal-body section + section {
    margin-top: 48px;
}

/* La última sección debe poder llegar arriba al saltar a ella desde el índice */
.legal-body section:last-of-type {
    min-height: calc(100svh - var(--header-h) - 120px);
}

.legal-body h2 {
    font-size: 1.5rem;
}

.legal-body p,
.legal-body li {
    color: var(--muted);
}

.legal-body strong {
    color: var(--text);
}

.legal-body ul {
    display: grid;
    gap: 6px;
    padding-left: 20px;
}

.legal-table {
    width: 100%;
    margin: 16px 0;
    border-collapse: collapse;
    font-size: 0.9375rem;
}

.legal-table th,
.legal-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
}

.legal-table th {
    color: var(--text);
    font-weight: 600;
}

.legal-table td {
    color: var(--muted);
}

.table-scroll {
    overflow-x: auto;
}

.summary-box {
    display: grid;
    gap: 12px;
    margin-bottom: 48px;
    padding: 24px;
    border: 1px solid rgb(34 211 238 / 0.3);
    border-radius: var(--radius);
    background: rgb(34 211 238 / 0.05);
}

.summary-box h2 {
    margin: 0;
    font-size: 1.125rem;
}

.summary-box ul {
    margin: 0;
}

@media (max-width: 860px) {
    .legal {
        grid-template-columns: minmax(0, 1fr);
        gap: 32px;
    }

    .legal-toc {
        position: static;
    }
}

/* ---------- 404 ---------- */

.not-found {
    display: grid;
    place-items: center;
    min-height: 100svh;
    padding: calc(var(--header-h) + 32px) 16px 64px;
    text-align: center;
}

.not-found img {
    width: min(420px, 100%);
    margin: 0 auto 32px;
}

.not-found h1 {
    font-size: clamp(2rem, 5vw, 3rem);
}

.not-found p {
    max-width: 48ch;
    margin-inline: auto;
    color: var(--muted);
}

.not-found .hero-actions {
    justify-content: center;
}

/* ---------- Animaciones al hacer scroll ---------- */

@supports (animation-timeline: view()) {
    .reveal {
        animation: reveal linear both;
        animation-timeline: view();
        animation-range: entry 0% entry 35%;
    }
}

@keyframes reveal {
    from {
        opacity: 0;
        transform: translateY(32px);
    }
}

/* Respaldo con IntersectionObserver para navegadores sin scroll-driven animations */
.js-reveal .reveal {
    opacity: 0;
    transform: translateY(32px);
    transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
}

.js-reveal .reveal.is-visible {
    opacity: 1;
    transform: none;
}

/* ==========================================================================
   Chat
   ========================================================================== */

.chat-launcher {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 40;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px 14px 16px;
    border: 0;
    border-radius: 999px;
    background: var(--gradient);
    color: #05070c;
    font: 600 0.9375rem/1 var(--font-body);
    box-shadow: 0 12px 32px -8px rgb(34 211 238 / 0.55);
    cursor: pointer;
    transition: transform 0.25s var(--ease-out);
}

.chat-launcher:hover {
    transform: translateY(-3px);
}

.chat-launcher svg {
    width: 22px;
    height: 22px;
}

.chat-launcher[hidden] {
    display: none;
}

@media (max-width: 520px) {
    .chat-launcher span {
        display: none;
    }

    .chat-launcher {
        padding: 16px;
    }
}

.chat {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 60;
    display: flex;
    flex-direction: column;
    width: min(400px, 100% - 32px);
    height: min(620px, 100dvh - 40px);
    border: 1px solid var(--border-strong);
    border-radius: 20px;
    background: rgb(12 17 27 / 0.94);
    backdrop-filter: blur(20px);
    box-shadow: 0 30px 60px -12px rgb(0 0 0 / 0.7);
    overflow: hidden;
    transform-origin: bottom right;
    transition: opacity 0.3s, transform 0.3s var(--ease-out), display 0.3s allow-discrete;
}

.chat[hidden] {
    display: none;
    opacity: 0;
    transform: translateY(16px) scale(0.97);
}

@starting-style {
    .chat:not([hidden]) {
        opacity: 0;
        transform: translateY(16px) scale(0.97);
    }
}

@media (max-width: 520px) {
    .chat {
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100dvh;
        border-radius: 0;
        border: 0;
    }
}

.chat-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--border);
}

.chat-avatar {
    position: relative;
    flex: none;
    width: 40px;
    height: 40px;
}

.chat-avatar img {
    width: 40px;
    height: 40px;
}

.chat-avatar::after {
    content: "";
    position: absolute;
    right: -1px;
    bottom: -1px;
    width: 11px;
    height: 11px;
    border: 2px solid var(--surface);
    border-radius: 50%;
    background: var(--green);
}

.chat-title {
    flex: 1;
    min-width: 0;
}

.chat-title strong {
    display: block;
    font-size: 0.9875rem;
}

.chat-title small {
    color: var(--muted);
    font-size: 0.8125rem;
}

.chat-close {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
}

.chat-close:hover {
    background: rgb(255 255 255 / 0.06);
    color: var(--text);
}

.chat-messages {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 18px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
}

.msg {
    max-width: 86%;
    padding: 11px 15px;
    border-radius: 16px;
    font-size: 0.9625rem;
    line-height: 1.55;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    animation: msg-in 0.35s var(--ease-out);
}

@keyframes msg-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
}

.msg-bot {
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    background: var(--surface-2);
    border: 1px solid var(--border);
}

.msg-user {
    align-self: flex-end;
    border-bottom-right-radius: 4px;
    background: var(--gradient);
    color: #05070c;
    font-weight: 500;
}

.msg-error {
    align-self: center;
    max-width: 100%;
    color: var(--red);
    font-size: 0.875rem;
    text-align: center;
}

.msg-success {
    align-self: center;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 100%;
    padding: 8px 14px;
    border: 1px solid rgb(52 211 153 / 0.3);
    border-radius: 999px;
    background: rgb(52 211 153 / 0.08);
    color: var(--green);
    font-size: 0.875rem;
}

.typing {
    display: inline-flex;
    gap: 5px;
    padding: 15px 16px;
}

.typing span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--muted);
    animation: typing 1.2s infinite ease-in-out;
}

.typing span:nth-child(2) { animation-delay: 0.15s; }
.typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-5px); opacity: 1; }
}

.chat-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 18px 12px;
}

.chat-suggestions:empty {
    display: none;
}

.chat-suggestions button {
    padding: 8px 14px;
    border: 1px solid rgb(34 211 238 / 0.35);
    border-radius: 999px;
    background: rgb(34 211 238 / 0.06);
    color: var(--text);
    font: 500 0.875rem/1.2 var(--font-body);
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
}

.chat-suggestions button:hover {
    background: rgb(34 211 238 / 0.14);
    border-color: var(--cyan);
}

.chat-turnstile:empty {
    display: none;
}

.chat-turnstile {
    padding: 0 18px 10px;
}

.chat-form {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    margin: 0 12px 10px;
    padding: 8px 8px 8px 16px;
    border: 1px solid var(--border-strong);
    border-radius: 16px;
    background: var(--bg);
    transition: border-color 0.2s;
}

.chat-form:focus-within {
    border-color: var(--cyan);
}

.chat-form textarea {
    flex: 1;
    max-height: 140px;
    padding: 8px 0;
    border: 0;
    background: transparent;
    color: var(--text);
    font: 0.9625rem/1.5 var(--font-body);
    resize: none;
    outline: none;
    field-sizing: content;
}

.chat-send {
    display: grid;
    place-items: center;
    flex: none;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 12px;
    background: var(--gradient);
    color: #05070c;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.2s;
}

/* Chat bloqueado mientras Cloudflare verifica al visitante */
.chat-suggestions button:disabled {
    opacity: 0.45;
    cursor: wait;
}

.chat.is-locked .chat-form textarea {
    cursor: wait;
}

.chat-send:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.chat-send svg {
    width: 18px;
    height: 18px;
}

.chat-footer {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 0 18px 14px;
    color: var(--subtle);
    font-size: 0.75rem;
}

.chat-footer a {
    color: var(--muted);
}

.chat-footer [hidden] {
    display: none;
}

/* ==========================================================================
   Formulario de contacto (dialog)
   ========================================================================== */

.contact {
    width: min(520px, 100% - 32px);
    max-height: calc(100dvh - 32px);
    padding: 0;
    border: 1px solid var(--border-strong);
    border-radius: 20px;
    background: var(--surface);
    color: var(--text);
    box-shadow: 0 30px 60px -12px rgb(0 0 0 / 0.7);
    opacity: 1;
    transform: none;
    transition: opacity 0.3s, transform 0.3s var(--ease-out), overlay 0.3s allow-discrete, display 0.3s allow-discrete;
}

.contact:not([open]) {
    opacity: 0;
    transform: translateY(16px) scale(0.97);
}

@starting-style {
    .contact[open] {
        opacity: 0;
        transform: translateY(16px) scale(0.97);
    }
}

.contact::backdrop {
    background: rgb(3 5 10 / 0.7);
    backdrop-filter: blur(6px);
    opacity: 1;
    transition: opacity 0.3s, overlay 0.3s allow-discrete, display 0.3s allow-discrete;
}

.contact:not([open])::backdrop {
    opacity: 0;
}

@starting-style {
    .contact[open]::backdrop {
        opacity: 0;
    }
}

.contact-panel {
    padding: 28px;
}

.contact-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 16px;
    margin-bottom: 20px;
}

.contact-header h2 {
    margin-bottom: 4px;
    font-size: 1.5rem;
}

.contact-header p {
    margin: 0;
    color: var(--muted);
}

.contact-form {
    display: grid;
    gap: 16px;
}

.contact-form[hidden] {
    display: none;
}

.field {
    display: grid;
    gap: 6px;
}

.field label {
    font-size: 0.875rem;
    font-weight: 600;
}

.field input,
.field textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--text);
    font: 1rem/1.5 var(--font-body);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.field textarea {
    resize: vertical;
    min-height: 120px;
}

.field input:focus,
.field textarea:focus {
    outline: none;
    border-color: var(--cyan);
    box-shadow: 0 0 0 3px rgb(34 211 238 / 0.15);
}

.field [aria-invalid="true"] {
    border-color: var(--red);
}

/* Campo trampa para bots: fuera de pantalla pero presente en el formulario */
.field-trap {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.contact-turnstile:empty {
    display: none;
}

.contact-note {
    margin: 0;
    color: var(--subtle);
    font-size: 0.8125rem;
    text-align: center;
}

.contact-status {
    margin: 16px 0 0;
    font-size: 0.9375rem;
}

.contact-status:empty {
    display: none;
}

.contact-status.is-error {
    color: var(--red);
}

.contact-status.is-success {
    padding: 16px;
    border: 1px solid rgb(52 211 153 / 0.3);
    border-radius: var(--radius-sm);
    background: rgb(52 211 153 / 0.08);
    color: var(--green);
}

.link-button {
    padding: 0;
    border: 0;
    background: none;
    color: var(--cyan);
    font: inherit;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.footer-grid .link-button {
    color: var(--muted);
    text-decoration: none;
}

.footer-grid .link-button:hover {
    color: var(--text);
}

/* ---------- Movimiento reducido ---------- */

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

    .reveal,
    .js-reveal .reveal {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }

    .marquee-track {
        animation: none;
    }
}

.not-found-en {
    margin-top: 28px;
    font-size: 0.9375rem;
}

/* ---------- Palabra clave sobre el título principal y enlaces a las páginas de servicio ---------- */

/* Parte del <h1> (para buscadores), pero se ve como una etiqueta pequeña sobre el título */
.hero-kicker {
    display: block;
    margin-bottom: 14px;
    color: var(--cyan);
    font-family: var(--font-body);
    font-size: 0.9375rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    line-height: 1.4;
    text-transform: uppercase;
}

/* Toda la tarjeta es clicable: el enlace del título se extiende sobre ella */
.card-link {
    color: inherit;
    text-decoration: none;
}

.card-link::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
}

.card-link:focus-visible {
    outline: none;
}

.card:has(.card-link:focus-visible) {
    outline: 2px solid var(--cyan);
    outline-offset: 3px;
}

/* pointer-events: none: el clic pasa al enlace de la tarjeta. Sin esto, al moverse en hover
   (translate) el texto queda por encima del enlace y el clic no navega. */
.card-more {
    display: inline-block;
    pointer-events: none;
    margin-top: 12px;
    color: var(--cyan);
    font-size: 0.9375rem;
    font-weight: 600;
    transition: translate 0.2s var(--ease-out);
}

.card:has(.card-link):hover .card-more {
    translate: 4px 0;
}

.card:has(.card-link):hover {
    border-color: rgb(34 211 238 / 0.45);
}

.page-hero .hero-actions {
    margin-top: 28px;
}

/* Botón "Volver a servicios", debajo de "Otros servicios" en las páginas de servicio */
.back-to-services {
    display: flex;
    justify-content: center;
    margin-top: 40px;
}

/* Lista de señales de las páginas de servicio ("Cuándo conviene...") */
.signal-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr));
    gap: 14px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.signal-list li {
    position: relative;
    padding: 18px 20px 18px 56px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: rgb(12 17 27 / 0.6);
    color: var(--muted);
}

/* Marca de verificación dibujada con bordes, dentro de un círculo */
.signal-list li::before {
    content: "";
    position: absolute;
    left: 18px;
    top: 19px;
    width: 24px;
    height: 24px;
    border: 1px solid rgb(34 211 238 / 0.45);
    border-radius: 50%;
    background: rgb(34 211 238 / 0.08);
}

.signal-list li::after {
    content: "";
    position: absolute;
    left: 27px;
    top: 25px;
    width: 6px;
    height: 10px;
    border: solid var(--cyan);
    border-width: 0 2px 2px 0;
    rotate: 45deg;
}

/* ---------- Botón flotante "volver al inicio" (lo crea main.js) ---------- */

.back-to-top {
    position: fixed;
    left: 20px;
    bottom: 20px;
    z-index: 40;
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border: 1px solid var(--border-strong);
    border-radius: 50%;
    background: rgb(12 17 27 / 0.82);
    backdrop-filter: blur(12px);
    color: var(--text);
    box-shadow: 0 12px 28px -10px rgb(0 0 0 / 0.7);
    opacity: 0;
    translate: 0 12px;
    pointer-events: none;
    transition: opacity 0.3s, translate 0.3s var(--ease-out), border-color 0.2s, color 0.2s;
}

.back-to-top.is-visible {
    opacity: 1;
    translate: 0 0;
    pointer-events: auto;
}

.back-to-top:hover {
    border-color: var(--cyan);
    color: var(--cyan);
}

.back-to-top:hover svg {
    translate: 0 -2px;
}

.back-to-top svg {
    transition: translate 0.2s var(--ease-out);
}

@media (max-width: 640px) {
    .back-to-top {
        left: 16px;
        bottom: 16px;
    }
}

/* ---------- Menú que marca la sección visible (assets/js/section-nav.js) ---------- */

.section-nav .nav-desktop {
    position: relative;
}

.section-nav .nav-desktop a[aria-current] {
    color: var(--text);
}

/* Sección actual en las demás páginas (la marca el servidor, ver $active en partials/header.php) */
.nav-desktop a[aria-current="page"] {
    position: relative;
    color: var(--text);
}

/* Misma posición que el subrayado deslizante de la portada (4 px bajo el enlace, ver section-nav.js) */
.nav-desktop a[aria-current="page"]::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -6px;
    height: 2px;
    border-radius: 2px;
    background: var(--gradient);
    box-shadow: 0 0 12px rgb(34 211 238 / 0.45);
}

.mobile-menu a[aria-current="page"] {
    background: rgb(34 211 238 / 0.1);
    color: var(--cyan);
}

/* Subrayado único que se desliza de un enlace a otro */
.nav-indicator {
    position: absolute;
    top: 0;
    left: 0;
    height: 2px;
    border-radius: 2px;
    background: var(--gradient);
    box-shadow: 0 0 12px rgb(34 211 238 / 0.45);
    opacity: 0;
    pointer-events: none;
    transition:
        translate 0.45s cubic-bezier(0.65, 0, 0.35, 1),
        width 0.45s cubic-bezier(0.65, 0, 0.35, 1),
        opacity 0.3s;
}

.section-nav .mobile-menu a[aria-current] {
    background: rgb(34 211 238 / 0.1);
    color: var(--cyan);
}

@media (prefers-reduced-motion: reduce) {
    .nav-indicator {
        transition: none;
    }
}
