/* Convocia · convocia.es
   Colores de la paleta «Arena» de la app (src/theme/colors.ts), en claro y oscuro.
   Formas: botones en píldora; fichas con radio de 22 px (radius.xl de la app); móviles con su propio radio.
   Movimiento: corto (≤ 450 ms), solo opacity y transform, y nada con «reducir movimiento». */

@font-face {
  font-family: 'Newsreader';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/fonts/newsreader-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308,
    U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light dark;

  --bg: #f5efe6;
  --surface: #fffbf5;
  --surface-muted: #ebe2d3;
  --border: #e0d5c3;
  --border-strong: #857765;
  --text: #2a2118;
  --text-2: #6a5c4b;
  --primary: #1f3a5f;
  --on-primary: #ffffff;
  --primary-soft: #dce5f1;
  --on-primary-soft: #16304f;
  --badge-bg: var(--primary-soft);
  --badge-fg: var(--on-primary-soft);
  --success: #2f6b43;
  --success-soft: #ddebdd;
  --panel: #1f3a5f;
  --on-panel: #f5efe6;
  --on-panel-2: #c9d5e6;
  --device: #1b1b1d;
  --shadow: 42 33 24;

  --serif: ui-serif, 'Newsreader', 'New York', Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;

  --radius: 22px;
  --pill: 999px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --page: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1c1813;
    --surface: #27211a;
    --surface-muted: #322a21;
    --border: #3a3227;
    --border-strong: #877b6b;
    --text: #f2e9db;
    --text-2: #b5a794;
    --primary: #8fb3e8;
    --on-primary: #0b1a33;
    --primary-soft: #1e2b42;
    --on-primary-soft: #b9d0f2;
    /* Las insignias (iconos de las fichas, «Premium») necesitan destacar sobre las fichas oscuras. */
    --badge-bg: #3e5880;
    --badge-fg: #dce8fa;
    --success: #8ccb9f;
    --success-soft: #1b2e21;
    --panel: #1e2b42;
    --on-panel: #f2e9db;
    --on-panel-2: #b9d0f2;
    --device: #0e0d0c;
    --shadow: 0 0 0;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 88px;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1.0625rem/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--primary);
  text-underline-offset: 0.18em;
}

:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 3px;
  border-radius: 6px;
}

h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: -0.015em;
  text-wrap: balance;
  margin: 0;
}

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

.icon {
  width: 1.25em;
  height: 1.25em;
  flex: none;
  fill: currentColor;
}

.wrap {
  width: 100%;
  max-width: var(--page);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: var(--pill);
  background: var(--primary);
  color: var(--on-primary);
  font-weight: 600;
  text-decoration: none;
}

.skip:focus {
  top: 12px;
}

/* ------------------------------------------------------------------ Cabecera */

.top {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 200ms ease;
}

.top.is-stuck {
  border-bottom-color: var(--border);
}

@media (prefers-reduced-transparency: reduce) {
  .top {
    background: var(--bg);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

.top-inner {
  display: flex;
  align-items: center;
  gap: 28px;
  height: 68px;
}

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

.brand img {
  width: 34px;
  height: 34px;
  border-radius: 9px;
}

.nav {
  display: flex;
  gap: 4px;
  margin-left: auto;
}

.nav a {
  padding: 10px 14px;
  border-radius: var(--pill);
  color: var(--text-2);
  font-weight: 500;
  text-decoration: none;
  transition:
    color 160ms ease,
    background-color 160ms ease;
}

.nav a:hover {
  color: var(--text);
  background: var(--surface-muted);
}

.top .store {
  --store-pad: 8px 16px 8px 12px;
}

@media (max-width: 860px) {
  .nav {
    display: none;
  }
  .top .store {
    margin-left: auto;
  }
}

@media (max-width: 420px) {
  .top .store {
    display: none;
  }
}

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

.store {
  --store-pad: 11px 22px 11px 16px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: var(--store-pad);
  border-radius: var(--pill);
  background: var(--primary);
  color: var(--on-primary);
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 1px 0 rgb(255 255 255 / 0.12) inset;
  transition:
    transform 160ms var(--ease),
    background-color 160ms ease;
}

.store .icon {
  width: 26px;
  height: 26px;
}

.store-text {
  display: grid;
  line-height: 1.15;
  text-align: left;
}

.store-text small {
  font-size: 0.72rem;
  font-weight: 500;
  opacity: 0.86;
}

.store-text strong {
  font-size: 1.08rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.top .store-text strong {
  font-size: 0.95rem;
}

.top .store .icon {
  width: 22px;
  height: 22px;
}

.store[href]:hover {
  transform: translateY(-1px);
}

.store[href]:active {
  transform: scale(0.98);
}

.store[aria-disabled='true'] {
  cursor: default;
}

.link-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 6px;
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}

.link-button .icon {
  transition: transform 200ms var(--ease);
}

.link-button:hover .icon {
  transform: translateX(3px);
}

/* ------------------------------------------------------------------ Móvil (marco) */

.device {
  position: relative;
  padding: 10px;
  /* Proporción de un iPhone: el radio crece con el ancho (horizontal / vertical). */
  border-radius: 16.5% / 7.6%;
  background: var(--device);
  box-shadow:
    0 0 0 1px rgb(255 255 255 / 0.06) inset,
    0 30px 60px -20px rgb(var(--shadow) / 0.35),
    0 12px 24px -12px rgb(var(--shadow) / 0.25);
}

.device img {
  width: 100%;
  border-radius: 14.5% / 6.7%;
  background: var(--surface);
}

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

.hero {
  padding-block: clamp(32px, 6vw, 80px) clamp(48px, 7vw, 96px);
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(32px, 5vw, 72px);
}

.hero h1 {
  font-size: clamp(2.6rem, 5.6vw, 4.5rem);
  line-height: 1.04;
  letter-spacing: -0.025em;
}

.hero-lead {
  margin-top: 22px;
  max-width: 34ch;
  color: var(--text-2);
  font-size: clamp(1.1rem, 1.6vw, 1.3rem);
  line-height: 1.5;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 22px;
  margin-top: 34px;
}

.hero-visual {
  position: relative;
  display: grid;
  justify-items: center;
  min-height: 560px;
}

.hero-visual .device {
  width: min(300px, 62vw);
}

.hero-visual .device.back {
  position: absolute;
  top: 46px;
  right: max(0px, 6%);
  width: min(250px, 50vw);
  opacity: 0.96;
  transform: rotate(4deg);
}

.hero-visual .device.front {
  position: relative;
  margin-right: min(150px, 22%);
  transform: rotate(-2deg);
}

.float {
  position: absolute;
  z-index: 2;
  height: auto;
  filter: drop-shadow(0 18px 30px rgb(var(--shadow) / 0.22));
}

.float-a {
  width: min(250px, 46vw);
  top: 16%;
  left: -2%;
}

.float-b {
  width: min(240px, 44vw);
  right: -4%;
  bottom: 4%;
}

.hero-visual .device.front {
  z-index: 1;
}

@media (max-width: 860px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }
  .hero-visual {
    min-height: 0;
    margin-top: 8px;
  }
  .hero-visual .device.front {
    margin-right: 30%;
  }
  .hero-visual .device.back {
    top: 34px;
    right: 4%;
  }
}

/* ------------------------------------------------------------------ Datos */

.facts {
  border-block: 1px solid var(--border);
}

.facts-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.fact {
  padding: 30px 28px 32px;
}

.fact + .fact {
  border-left: 1px solid var(--border);
}

.fact-figure {
  display: block;
  font: 600 clamp(2.2rem, 4vw, 3rem) / 1 var(--serif);
  letter-spacing: -0.02em;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
}

.fact p {
  margin-top: 10px;
  max-width: 26ch;
  color: var(--text-2);
}

@media (max-width: 760px) {
  .facts-grid {
    grid-template-columns: 1fr;
  }
  .fact {
    padding: 22px 4px;
  }
  .fact + .fact {
    border-left: 0;
    border-top: 1px solid var(--border);
  }
}

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

.section {
  padding-block: clamp(72px, 10vw, 128px);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  color: var(--primary);
  font-size: 0.82rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.h2 {
  font-size: clamp(2rem, 3.8vw, 3rem);
  line-height: 1.08;
}

.lead {
  margin-top: 18px;
  max-width: 54ch;
  color: var(--text-2);
  font-size: 1.15rem;
}

/* Llegar: historia con el móvil fijo (la pantalla cambia con cada paso) */

.story-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.8fr);
  gap: clamp(40px, 7vw, 96px);
}

.story-step {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 78vh;
  padding-block: 6vh;
  transition: opacity 300ms ease;
}

.js .story-step:not(.is-active) {
  opacity: 0.35;
}

.h3 {
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  line-height: 1.1;
}

.story-ficha {
  width: min(380px, 100%);
  margin-top: 30px;
  filter: drop-shadow(0 16px 28px rgb(var(--shadow) / 0.18));
}

.story-stage {
  position: sticky;
  top: max(84px, calc(50vh - 330px));
  align-self: start;
  margin-top: 6vh;
}

.story-stage .device {
  width: min(310px, 100%);
  margin-inline: auto;
}

.story-stage img {
  transition: opacity 400ms var(--ease);
}

.story-stage img + img {
  position: absolute;
  top: 10px;
  left: 10px;
  width: calc(100% - 20px);
}

.story-stage img:not(.is-active) {
  opacity: 0;
}

.story-inline {
  display: none;
}

.checks {
  display: grid;
  gap: 14px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}

.checks li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.checks .icon {
  margin-top: 0.12em;
  color: var(--success);
}

@media (max-width: 860px) {
  .story-grid {
    grid-template-columns: 1fr;
  }
  .story-steps {
    display: grid;
    gap: 88px;
  }
  .story-step {
    min-height: 0;
    padding-block: 0;
  }
  .js .story-step:not(.is-active) {
    opacity: 1;
  }
  .story-stage {
    display: none;
  }
  .story-inline {
    display: block;
    width: min(300px, 80vw);
    margin: 40px auto 0;
  }
}

/* Radar: mosaico. Arriba, la ficha grande (texto e iPhone lado a lado) con dos de texto apiladas;
   abajo, dos fichas iguales, también con su iPhone al lado. Cada ficha mide lo que lleva. */

.bento {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 18px;
  margin-top: 48px;
}

.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 28px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  overflow: hidden;
}

.tile h3 {
  font-size: 1.5rem;
  line-height: 1.15;
}

.tile p {
  color: var(--text-2);
}

.tile .icon-badge {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--badge-bg);
  color: var(--badge-fg);
}

.tile .icon-badge .icon {
  width: 24px;
  height: 24px;
}

.tile-tag {
  align-self: flex-start;
  padding: 3px 10px;
  border-radius: var(--pill);
  background: var(--badge-bg);
  color: var(--badge-fg);
  font-size: 0.8rem;
  font-weight: 650;
}

.tile-copy {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tile-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 28px;
}

.tile-shot .device {
  width: 200px;
}

.tile-big {
  grid-column: 1 / span 4;
  grid-row: 1 / span 2;
  padding: 36px;
  background: var(--primary-soft);
  border-color: transparent;
}

.tile-big h3 {
  font-size: clamp(1.7rem, 2.6vw, 2.2rem);
  color: var(--on-primary-soft);
}

.tile-big p {
  max-width: 34ch;
  color: var(--on-primary-soft);
  opacity: 0.86;
}

.tile-big .icon-badge {
  background: var(--surface);
  color: var(--primary);
}

.tile-big .tile-shot .device {
  width: 250px;
}

.tile-warm {
  grid-column: 5 / span 2;
  background: var(--surface-muted);
  border-color: transparent;
}

.tile-big + .tile-warm + .tile {
  grid-column: 5 / span 2;
}

.tile-half {
  grid-column: span 3;
}

@media (max-width: 1040px) {
  .tile-shot .device {
    width: 170px;
  }
  .tile-big .tile-shot .device {
    width: 220px;
  }
}

@media (max-width: 960px) {
  .bento {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .tile-big,
  .tile-half {
    grid-column: 1 / -1;
    grid-row: auto;
  }
  .tile-warm,
  .tile-big + .tile-warm + .tile {
    grid-column: span 1;
  }
}

@media (max-width: 640px) {
  .bento {
    grid-template-columns: 1fr;
  }
  .tile-warm,
  .tile-big + .tile-warm + .tile {
    grid-column: 1 / -1;
  }
  .tile-split {
    grid-template-columns: 1fr;
  }
  .tile-split .tile-shot {
    padding-top: 12px;
  }
  .tile-shot .device,
  .tile-big .tile-shot .device {
    width: min(230px, 78%);
    margin-inline: auto;
  }
}

/* Compañeros: centrado con el móvil asomando */

.together {
  text-align: center;
}

.together .lead {
  margin-inline: auto;
}

.together-notes {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 26px;
}

.together-notes span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--pill);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  font-weight: 500;
}

.together-notes .icon {
  color: var(--primary);
}

.together-shot {
  width: min(300px, 78vw);
  margin: 56px auto 0;
}

/* Dos móviles a distinta altura (y, al hacer scroll, a distinta velocidad) */

.duo-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(24px, 6vw, 96px);
  max-width: 880px;
  margin: 56px auto 0;
  align-items: start;
}

.duo-item {
  margin: 0;
}

.duo-item .device {
  width: min(300px, 100%);
  margin-inline: auto;
}

.duo-b {
  margin-top: 140px;
}

.duo-item figcaption {
  max-width: 32ch;
  margin: 26px auto 0;
  text-align: center;
}

.duo-item figcaption strong {
  display: block;
  font: 600 1.35rem/1.25 var(--serif);
}

.duo-item figcaption span {
  display: block;
  margin-top: 8px;
  color: var(--text-2);
}

.duo-note {
  margin-top: 40px;
  text-align: center;
  color: var(--text-2);
}

@media (max-width: 640px) {
  .duo-grid {
    grid-template-columns: 1fr;
    gap: 64px;
  }
  .duo-b {
    margin-top: 0;
  }
}

/* Principios: bloque a todo el ancho que entra como ficha y se abre (efecto marco) */

.panel {
  --frame-x: max(var(--gutter), calc((100% - var(--page)) / 2 + var(--gutter)));
  padding-block: clamp(64px, 9vw, 120px);
  background: var(--panel);
  color: var(--on-panel);
  clip-path: inset(0 var(--frame-x) round calc(var(--radius) * 1.5));
}

.panel-inner {
  padding-inline: calc(var(--gutter) + clamp(28px, 5vw, 72px));
}

.panel .h2 {
  color: var(--on-panel);
  max-width: 18ch;
}

.panel .lead {
  color: var(--on-panel-2);
}

.principles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 26px 48px;
  margin: 44px 0 0;
  padding: 0;
  list-style: none;
}

.principles li {
  display: flex;
  gap: 14px;
}

.principles .icon {
  width: 26px;
  height: 26px;
  margin-top: 2px;
  color: var(--on-panel-2);
}

.principles strong {
  display: block;
  font-weight: 650;
}

.principles span {
  color: var(--on-panel-2);
}

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

/* Precio */

.plans {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-top: 48px;
}

.plan {
  padding: 34px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
}

.plan-premium {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary) inset;
}

.plan h3 {
  font-size: 1.9rem;
}

.plan > p {
  margin-top: 8px;
  color: var(--text-2);
}

.plan ul {
  display: grid;
  gap: 12px;
  margin: 26px 0 0;
  padding: 0;
  list-style: none;
}

.plan li {
  display: flex;
  gap: 12px;
}

.plan li .icon {
  margin-top: 0.15em;
  color: var(--primary);
}

.plan-note {
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  color: var(--text-2);
  font-size: 0.95rem;
}

@media (max-width: 760px) {
  .plans {
    grid-template-columns: 1fr;
  }
  .plan {
    padding: 26px;
  }
}

/* Preguntas */

.faq {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: clamp(32px, 6vw, 80px);
  align-items: start;
}

.faq-list {
  border-top: 1px solid var(--border);
}

.faq details {
  border-bottom: 1px solid var(--border);
}

.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 64px;
  padding: 18px 0;
  cursor: pointer;
  list-style: none;
  font: 600 1.2rem/1.3 var(--serif);
}

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

.faq summary .icon {
  color: var(--primary);
  transition: transform 220ms var(--ease);
}

.faq details[open] summary .icon {
  transform: rotate(45deg);
}

.faq details p {
  padding: 0 40px 22px 0;
  color: var(--text-2);
}

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

/* Final */

.closing {
  text-align: center;
}

.closing .h2 {
  font-size: clamp(2.2rem, 4.6vw, 3.6rem);
}

.closing .lead {
  margin-inline: auto;
}

.closing .store {
  margin-top: 34px;
}

.closing-mark {
  width: 72px;
  height: 72px;
  margin: 0 auto 28px;
  border-radius: 18px;
  box-shadow: 0 16px 32px -14px rgb(var(--shadow) / 0.45);
}

/* Pie */

.foot {
  padding-block: 40px 56px;
  border-top: 1px solid var(--border);
  color: var(--text-2);
  font-size: 0.95rem;
}

.foot-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 18px 36px;
  align-items: center;
  justify-content: space-between;
}

.foot-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
}

.foot a {
  color: var(--text);
}

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

@media (prefers-reduced-motion: no-preference) {
  .hero-copy > * {
    animation: rise 420ms var(--ease) both;
  }
  .hero-copy > :nth-child(2) {
    animation-delay: 60ms;
  }
  .hero-copy > :nth-child(3) {
    animation-delay: 120ms;
  }
  .hero-visual .device {
    animation: rise 450ms var(--ease) 140ms both;
  }
  .hero-visual .device.back {
    animation-delay: 220ms;
  }
  .float {
    animation: rise 450ms var(--ease) 320ms both;
  }
  .float-b {
    animation-delay: 380ms;
  }

  .js .reveal {
    opacity: 0;
    transform: translateY(18px);
    transition:
      opacity 420ms var(--ease),
      transform 420ms var(--ease);
    transition-delay: var(--delay, 0ms);
  }
  .js .reveal.is-in {
    opacity: 1;
    transform: none;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    translate: 0 16px;
  }
  to {
    opacity: 1;
    translate: 0 0;
  }
}

/* Efectos ligados al scroll (CSS, sin escuchar el scroll con JavaScript). Donde el navegador no los
   soporta, o con «reducir movimiento», la página se queda quieta y completa. */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    /* Portada: capas a distinta velocidad; el móvil de delante sube y se endereza. */
    .hero-visual .device.front {
      animation:
        rise 450ms var(--ease) 140ms both,
        depth-front linear both;
      animation-timeline: auto, scroll(root);
      animation-range: normal, 0 85vh;
    }
    .hero-visual .device.back {
      animation:
        rise 450ms var(--ease) 220ms both,
        depth-back linear both;
      animation-timeline: auto, scroll(root);
      animation-range: normal, 0 85vh;
    }
    .float-a {
      animation:
        rise 450ms var(--ease) 320ms both,
        depth-float-a linear both;
      animation-timeline: auto, scroll(root);
      animation-range: normal, 0 85vh;
    }
    .float-b {
      animation:
        rise 450ms var(--ease) 380ms both,
        depth-float-b linear both;
      animation-timeline: auto, scroll(root);
      animation-range: normal, 0 85vh;
    }

    /* Cada bloque aparece al entrar en pantalla. */
    .js .reveal {
      opacity: 1;
      transform: none;
      transition: none;
      animation: reveal-in linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 70%;
    }

    /* Dos móviles a distinta velocidad. */
    .duo-a .device {
      animation: drift-a linear both;
      animation-timeline: view();
    }
    .duo-b .device {
      animation: drift-b linear both;
      animation-timeline: view();
    }

    /* El bloque azul entra como ficha y se abre a todo el ancho. */
    .panel {
      animation: frame-open linear both;
      animation-timeline: view();
      animation-range: entry 0% cover 40%;
    }
  }
}

@keyframes depth-front {
  from {
    transform: rotate(-2deg);
  }
  to {
    transform: translateY(-80px) rotate(0deg);
  }
}

@keyframes depth-back {
  from {
    transform: rotate(4deg);
  }
  to {
    transform: translateY(40px) rotate(8deg);
  }
}

@keyframes depth-float-a {
  to {
    transform: translateY(-170px);
  }
}

@keyframes depth-float-b {
  to {
    transform: translateY(-50px);
  }
}

@keyframes reveal-in {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes drift-a {
  from {
    transform: translateY(40px);
  }
  to {
    transform: translateY(-40px);
  }
}

@keyframes drift-b {
  from {
    transform: translateY(110px);
  }
  to {
    transform: translateY(-110px);
  }
}

@keyframes frame-open {
  from {
    clip-path: inset(0 var(--frame-x) round calc(var(--radius) * 1.5));
  }
  to {
    clip-path: inset(0 0 round 0);
  }
}

/* ------------------------------------------------------------------ Página legal */

.legal {
  max-width: 46rem;
  padding-block: 48px 80px;
}

.legal h1 {
  font-size: clamp(2.2rem, 5vw, 3rem);
  line-height: 1.1;
}

.legal h2 {
  margin: 2.6rem 0 0.6rem;
  font-size: 1.5rem;
  line-height: 1.25;
}

.legal p,
.legal ul,
.legal table {
  margin: 0.9rem 0;
}

.legal ul {
  padding-left: 1.25rem;
}

.legal li {
  margin: 0.4rem 0;
}

.legal .suave {
  color: var(--text-2);
}

.legal .tabla {
  overflow-x: auto;
}

.legal table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.97rem;
}

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

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

.legal .aviso {
  margin-top: 2.6rem;
  padding: 1.1rem 1.35rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
}
