/* Portada viva de Ruta Clara: la foto avanza despacio, las vías del logo recorren la pantalla
   y todo toma el tono del trámite elegido. Quieto con "reducir movimiento" o con el botón de pausa. */
@property --tono { syntax: "<color>"; inherits: true; initial-value: #5c6b54; }
[data-tramite="traspaso"]       { --tono: #5c6b54; }
[data-tramite="desintegracion"] { --tono: #9a5326; }
[data-tramite="color"]          { --tono: #2b6a84; }
[data-tramite="identificadores"] { --tono: #6e5a2c; }

.hero--escena { position: relative; height: 100svh; min-height: 640px; overflow: hidden; isolation: isolate; color: #f5f3ef;
  background: #1d1c1a; display: flex; align-items: flex-end; padding: calc(var(--nav) + var(--s-8)) 0 var(--s-8);
  transition: --tono 1.1s ease; }
/* el lienzo empieza bajo la barra fija; sin JavaScript se ve la foto quieta del fondo */
.hero--escena { background: #1d1c1a url(assets/img/portada-traspaso.webp) center / cover no-repeat; }
.escena__lienzo { position: absolute; left: 0; right: 0; top: var(--nav); bottom: 0; z-index: 0; width: 100%; height: calc(100% - var(--nav)); display: block; }
/* sombra y color del trámite en una sola capa, sobre las fotos y bajo el texto */
.hero--escena::after { content: ""; position: absolute; inset: var(--nav) 0 0 0; z-index: 0; pointer-events: none;
  background:
    linear-gradient(90deg, color-mix(in oklab, var(--tono) 30%, rgb(20 19 17 / .93)) 0%, color-mix(in oklab, var(--tono) 26%, rgb(20 19 17 / .74)) 38%, color-mix(in oklab, var(--tono) 30%, transparent) 74%, color-mix(in oklab, var(--tono) 18%, transparent) 100%),
    linear-gradient(0deg, rgb(20 19 17 / .62) 0%, transparent 46%); }
.hero--escena > .wrap { position: relative; z-index: 1; }
@media (prefers-reduced-motion: reduce) {
  .hero--escena, #servicios { transition: none; }
}

.escena__texto { max-width: 760px; display: grid; gap: var(--s-5); }
.escena__texto .hero__kicker { color: rgb(245 243 239 / .85); margin: 0; font-size: var(--t-small); }
.escena__texto h1 { color: #fbfaf7; margin: 0; font-size: clamp(42px, 4.4vw + 8px, 80px); line-height: 1.02; }
.escena__texto .hero__lead { color: #ebe8e2; margin: 0; min-height: 3lh; max-width: 46ch; font-size: var(--t-lead); line-height: 1.5; transition: opacity .3s ease; }
.escena__texto .hero__lead.is-cambiando { opacity: 0; }

.opciones { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); }
.opciones__label { width: 100%; margin: 0 0 var(--s-1); font-size: var(--t-label); font-weight: 500; color: rgb(245 243 239 / .8); }
.opcion { height: 44px; min-height: 44px; flex: none; padding: 0 var(--s-5); border-radius: 999px; border: 1px solid rgb(255 255 255 / .4);
  background: rgb(255 255 255 / .05); color: #f5f3ef; font: 500 15px/1 var(--font-text); cursor: pointer;
  transition: background-color .25s, color .25s, border-color .25s, transform .15s; }
.opcion:hover { border-color: #fff; background: rgb(255 255 255 / .14); }
.opcion:active { transform: scale(.97); }
.opcion[aria-pressed="true"] { background: #f5f3ef; color: #1f1e1c; border-color: #f5f3ef; }
.opcion:focus-visible, .escena__pausa:focus-visible { outline: 2px solid #f5f3ef; outline-offset: 3px; }
.hero--escena .btn--secondary { color: #f5f3ef; }

.escena__pausa { position: absolute; right: 0; bottom: 0; width: 44px; height: 44px; border-radius: 999px;
  border: 1px solid rgb(255 255 255 / .4); background: rgb(20 19 17 / .35); color: #f5f3ef; display: grid; place-items: center; cursor: pointer; }

@media (max-width: 639px) {
  .hero--escena { padding: calc(var(--nav) + var(--s-6)) 0 var(--s-6); min-height: 0; }
  .hero--escena::after { background: linear-gradient(0deg, color-mix(in oklab, var(--tono) 20%, rgb(20 19 17 / .92)) 0%, color-mix(in oklab, var(--tono) 20%, rgb(20 19 17 / .72)) 50%, color-mix(in oklab, var(--tono) 18%, rgb(20 19 17 / .12)) 100%); }
  .escena__texto { gap: var(--s-4); }
  .escena__texto .hero__lead { min-height: 0; font-size: 16px; }
  .opcion { padding: 0 var(--s-4); font-size: 14px; }
  .escena__pausa { top: -8px; bottom: auto; }
}

/* la sección de servicios toma el tono del trámite elegido o de la fila señalada */
#servicios { background: color-mix(in oklab, var(--tono) 8%, var(--p-bg)); transition: --tono .9s ease; }

/* ---------- Tarjetas de servicios: foto grande, título encima, flecha redonda ---------- */
.section-head--fila { display: flex; justify-content: space-between; align-items: end; gap: var(--s-5); flex-wrap: wrap; }
.section-head--fila p { margin: 0; }
.tarjetas { row-gap: var(--s-5); }
.tarjeta { position: relative; display: block; height: min(560px, calc(100svh - 300px)); min-height: 380px; border-radius: 20px; overflow: hidden;
  isolation: isolate; color: #fbfaf7; text-decoration: none; background: #1d1c1a; }
.tarjeta img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.2,.7,.2,1); }
.tarjeta::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgb(18 17 15 / .82) 0%, rgb(18 17 15 / .25) 45%, transparent 70%); }
.tarjeta__texto { position: absolute; left: var(--s-5); right: 76px; bottom: var(--s-5); z-index: 1; display: grid; gap: var(--s-2); }
.tarjeta__titulo { font: var(--display-weight) 28px/1.1 var(--font-display); letter-spacing: -0.01em; }
.tarjeta__linea { font-size: 15px; line-height: 1.45; color: rgb(251 250 247 / .86); }
.tarjeta__flecha { position: absolute; right: var(--s-5); bottom: var(--s-5); z-index: 1; width: 44px; height: 44px; border-radius: 999px;
  display: grid; place-items: center; background: rgb(255 255 255 / .16); border: 1px solid rgb(255 255 255 / .35);
  transition: background-color .25s, transform .25s; }
.tarjeta:hover img { transform: scale(1.04); }
.tarjeta:hover .tarjeta__flecha { background: #fbfaf7; color: #1d1c1a; transform: translateX(3px); }
.tarjeta:focus-visible { outline: 2px solid var(--p-action); outline-offset: 4px; }
@media (max-width: 1279px) { .section-head--fila { flex-direction: column; align-items: start; } }
@media (min-width: 640px) and (max-width: 1023px) { .tarjeta { grid-column: auto / span 6; height: 560px; } #servicios { --h: 2; } }
@media (max-width: 639px) { .tarjeta { height: 300px; min-height: 0; } #servicios { --hm: 2; } }
@media (prefers-reduced-motion: reduce) { .tarjeta img, .tarjeta__flecha { transition: none; } }
/* botones de la portada en forma de píldora, el secundario como vidrio */
.hero--escena .btn { border-radius: 999px; }
.hero--escena .btn--secondary { background: rgb(255 255 255 / .1); border: 1px solid rgb(255 255 255 / .4); padding-inline: var(--s-6); text-decoration: none; }
.hero--escena .btn--secondary:hover { background: rgb(255 255 255 / .2); }

/* ---------- Fondos vivos: un video quieto hasta que la sección se ve, bajo un velo que cuida la lectura ---------- */
.seccion-viva { position: relative; isolation: isolate; overflow: hidden; }
.fondo-vivo { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.seccion-viva::before { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(180deg, color-mix(in oklab, var(--tono) 22%, rgb(20 19 17 / .8)) 0%, rgb(20 19 17 / .7) 55%, color-mix(in oklab, var(--tono) 18%, rgb(20 19 17 / .84)) 100%); }
.seccion-viva--clara::before { background: linear-gradient(180deg, rgb(238 236 234 / .9), rgb(238 236 234 / .84) 50%, rgb(238 236 234 / .92)); }
.seccion-viva > .wrap { position: relative; z-index: 2; }
/* tarjetas y formularios sobre fondo oscuro: superficie propia, legible */
.seccion-viva.ground-inverse .card { background: rgb(28 27 25 / .72); backdrop-filter: blur(6px); border-color: rgb(255 255 255 / .12); }
.seccion-viva.ground-inverse .form--panel { background: #f3f1ee; color: #333231; --ink: #333231; --muted: #625f5b; --bg: #f3f1ee; }
.seccion-viva.ground-inverse .rows li { border-color: rgb(255 255 255 / .16); }
.seccion-viva.ground-inverse .frame { box-shadow: 0 0 0 1px rgb(255 255 255 / .08); }
/* las tarjetas de servicios: el video cubre la foto cuando ya puede reproducirse */
.tarjeta__video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.2,.7,.2,1); }
.tarjeta:hover .tarjeta__video { transform: scale(1.04); }
@media (prefers-reduced-motion: reduce) { .tarjeta__video { display: none; } }
/* los pasos también se mueven: el video cubre la foto del panel */
.panel { position: relative; }
.panel__video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
@media (prefers-reduced-motion: reduce) { .panel__video { display: none; } }
