/* Mundo visual compartido de las maquetas: aurora + vidrio iOS 26 */

@view-transition { navigation: auto; }
/* Cambio de tema en burbuja (mundo.js): se reemplaza el fundido por el círculo que crece */
.theme-bubble::view-transition-old(root),
.theme-bubble::view-transition-new(root) { animation: none; mix-blend-mode: normal; }

:root {
  --font: "Albert Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --r-xl: 34px;
  --r-lg: 28px;
  --r-md: 22px;
  --r-sm: 16px;
  --blur: 26px;
  --maxw: 1280px;
  --ease: cubic-bezier(.16, 1, .3, 1);          /* salida fuerte: entradas y respuestas */
  --ease-drawer: cubic-bezier(.32, .72, 0, 1);  /* tipo iOS: abrir y cerrar paneles */
  --ease-drift: cubic-bezier(.37, 0, .63, 1);   /* vaivén suave del fondo */
  --press: 160ms;

  --bg: #030c1b;
  --ink: #f1f7fc;
  --ink-2: #bdcddd;
  --ink-3: #93a9bf;
  --grad-text: linear-gradient(95deg, #7dd3fc 0%, #6ee7c8 55%, #a7f3a0 100%);
  --btn: linear-gradient(120deg, #1d4ed8 0%, #0e62c4 45%, #0f766e 100%);
  --btn-glow: 0 12px 26px -10px rgba(0, 6, 20, .6), 0 3px 8px -3px rgba(0, 6, 20, .4);
  --icon-a: linear-gradient(160deg, #60a5fa, #1d4ed8);
  --icon-b: linear-gradient(160deg, #5eead4, #0f766e);
  --ok: #86efac;
  --warn: #fcd34d;
  --track: rgba(255, 255, 255, .12);
  --focus: #7dd3fc;
  --line: rgba(255, 255, 255, .14);

  --glass-bg: linear-gradient(150deg, rgba(255, 255, 255, .15) 0%, rgba(255, 255, 255, .06) 38%, rgba(255, 255, 255, .03) 62%, rgba(255, 255, 255, .09) 100%);
  --glass-strong: linear-gradient(150deg, rgba(255, 255, 255, .22) 0%, rgba(255, 255, 255, .10) 45%, rgba(255, 255, 255, .14) 100%);
  --glass-rim: linear-gradient(140deg, rgba(255, 255, 255, .75) 0%, rgba(255, 255, 255, .10) 28%, rgba(255, 255, 255, .03) 62%, rgba(150, 230, 255, .45) 100%);
  --glass-inner: inset 0 1px 1px rgba(255, 255, 255, .28), inset 0 -22px 40px -22px rgba(255, 255, 255, .07);
  --glass-shadow: 0 30px 60px -18px rgba(0, 4, 18, .65), 0 3px 10px -2px rgba(0, 4, 18, .35);
  --shine: rgba(255, 255, 255, .20);

  --au-1: rgba(45, 212, 191, .70);
  --au-2: rgba(74, 222, 128, .48);
  --au-3: rgba(37, 99, 235, .70);
  --au-4: rgba(20, 184, 166, .45);
  --au-5: rgba(29, 78, 216, .55);
  --au-blend: screen;
  --grain: .07;
  --sheet: rgba(3, 12, 27, .88);
  --tint: rgba(255, 255, 255, .10);
  --hover: rgba(255, 255, 255, .07);
  --field: rgba(255, 255, 255, .07);
  --ex-bg: rgba(3, 12, 27, .35);
  --map-block: rgba(255, 255, 255, .07);
  --map-street: rgba(255, 255, 255, .22);
  --map-river: rgba(56, 189, 248, .55);

  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #e6eff6;
    --ink: #0a1a2b;
    --ink-2: #33485d;
    --ink-3: #4e6377;
    --grad-text: linear-gradient(95deg, #1d4ed8 0%, #0f766e 60%, #047857 100%);
    --ok: #047857;
    --warn: #92400e;
    --track: rgba(10, 26, 43, .10);
    --focus: #1d4ed8;
    --line: rgba(10, 26, 43, .12);
    --glass-bg: linear-gradient(150deg, rgba(255, 255, 255, .78) 0%, rgba(255, 255, 255, .46) 45%, rgba(255, 255, 255, .58) 100%);
    --glass-strong: linear-gradient(150deg, rgba(255, 255, 255, .92) 0%, rgba(255, 255, 255, .68) 100%);
    --glass-rim: linear-gradient(140deg, #fff 0%, rgba(255, 255, 255, .45) 35%, rgba(255, 255, 255, .25) 62%, rgba(255, 255, 255, .95) 100%);
    --glass-inner: inset 0 1px 1px #fff, inset 0 -22px 40px -22px rgba(255, 255, 255, .5);
    --glass-shadow: 0 30px 60px -22px rgba(20, 55, 95, .28), 0 3px 10px -2px rgba(20, 55, 95, .10);
    --shine: rgba(255, 255, 255, .65);
    --au-1: rgba(45, 212, 191, .45);
    --au-2: rgba(134, 239, 172, .50);
    --au-3: rgba(96, 165, 250, .50);
    --au-4: rgba(94, 234, 212, .40);
    --au-5: rgba(147, 197, 253, .45);
    --au-blend: multiply;
    --grain: .05;
    --sheet: rgba(255, 255, 255, .92);
    --tint: rgba(10, 26, 43, .06);
    --hover: rgba(255, 255, 255, .6);
    --field: rgba(255, 255, 255, .7);
    --ex-bg: rgba(255, 255, 255, .7);
    --map-block: rgba(10, 26, 43, .06);
    --map-street: rgba(10, 26, 43, .18);
    --map-river: rgba(37, 99, 235, .45);
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #e6eff6;
  --ink: #0a1a2b;
  --ink-2: #33485d;
  --ink-3: #4e6377;
  --grad-text: linear-gradient(95deg, #1d4ed8 0%, #0f766e 60%, #047857 100%);
  --ok: #047857;
  --warn: #92400e;
  --track: rgba(10, 26, 43, .10);
  --focus: #1d4ed8;
  --line: rgba(10, 26, 43, .12);
  --glass-bg: linear-gradient(150deg, rgba(255, 255, 255, .78) 0%, rgba(255, 255, 255, .46) 45%, rgba(255, 255, 255, .58) 100%);
  --glass-strong: linear-gradient(150deg, rgba(255, 255, 255, .92) 0%, rgba(255, 255, 255, .68) 100%);
  --glass-rim: linear-gradient(140deg, #fff 0%, rgba(255, 255, 255, .45) 35%, rgba(255, 255, 255, .25) 62%, rgba(255, 255, 255, .95) 100%);
  --glass-inner: inset 0 1px 1px #fff, inset 0 -22px 40px -22px rgba(255, 255, 255, .5);
  --glass-shadow: 0 30px 60px -22px rgba(20, 55, 95, .28), 0 3px 10px -2px rgba(20, 55, 95, .10);
  --shine: rgba(255, 255, 255, .65);
  --au-1: rgba(45, 212, 191, .45);
  --au-2: rgba(134, 239, 172, .50);
  --au-3: rgba(96, 165, 250, .50);
  --au-4: rgba(94, 234, 212, .40);
  --au-5: rgba(147, 197, 253, .45);
  --au-blend: multiply;
  --grain: .05;
  --sheet: rgba(255, 255, 255, .92);
  --tint: rgba(10, 26, 43, .06);
  --hover: rgba(255, 255, 255, .6);
  --field: rgba(255, 255, 255, .7);
  --ex-bg: rgba(255, 255, 255, .7);
  --map-block: rgba(10, 26, 43, .06);
  --map-street: rgba(10, 26, 43, .18);
  --map-river: rgba(37, 99, 235, .45);
  color-scheme: light;
}

@property --mx { syntax: "<percentage>"; inherits: false; initial-value: 12%; }
@property --my { syntax: "<percentage>"; inherits: false; initial-value: 0%; }

/* Base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scrollbar-color: rgba(125, 211, 252, .45) transparent; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  caret-color: var(--focus);
  font-feature-settings: "ss01";
}
::selection { background: rgba(45, 212, 191, .35); color: var(--ink); }
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-thumb { background: rgba(125, 211, 252, .35); border-radius: 99px; border: 2px solid transparent; background-clip: padding-box; }
a { color: inherit; text-underline-offset: .22em; text-decoration-thickness: 1px; }
img, svg { display: block; }
h1, h2, h3, h4 { margin: 0; line-height: 1.06; letter-spacing: -.03em; font-weight: 700; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
.num { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 10px; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; padding: 10px 14px; border-radius: 12px; background: var(--bg); }
.skip:focus { left: 16px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { width: min(100% - 32px, var(--maxw)); margin-inline: auto; }

/* Aurora */
.aurora { position: fixed; inset: 0; z-index: -2; overflow: hidden; pointer-events: none; background: var(--bg); }
.aurora i {
  position: absolute;
  display: block;
  border-radius: 50%;
  filter: blur(70px);
  mix-blend-mode: var(--au-blend);
  animation: sway 26s var(--ease-drift) infinite alternate;
}
.aurora i:nth-child(1) { width: 120vw; height: 30vh; left: -25vw; top: 2vh; transform: rotate(-11deg); background: linear-gradient(90deg, transparent 5%, var(--au-1) 35%, var(--au-2) 60%, transparent 92%); }
.aurora i:nth-child(2) { width: 70vw; height: 70vh; left: -12vw; top: 18vh; background: radial-gradient(closest-side, var(--au-3), transparent); animation-duration: 32s; }
.aurora i:nth-child(3) { width: 110vw; height: 34vh; right: -30vw; top: 40vh; transform: rotate(14deg); background: linear-gradient(90deg, transparent 8%, var(--au-4) 40%, var(--au-2) 70%, transparent 95%); animation-duration: 38s; }
.aurora i:nth-child(4) { width: 60vw; height: 60vh; right: -10vw; top: -18vh; background: radial-gradient(closest-side, var(--au-5), transparent); animation-duration: 30s; }
.aurora i:nth-child(5) { width: 90vw; height: 40vh; left: -20vw; bottom: -14vh; transform: rotate(-6deg); background: linear-gradient(90deg, transparent, var(--au-2) 30%, var(--au-1) 55%, transparent 90%); animation-duration: 42s; }
.aurora::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: var(--grain);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  mix-blend-mode: overlay;
}
@keyframes sway {
  50% { translate: 4vw -3vh; }
  100% { translate: -3vw 4vh; scale: 1.08; }
}

/* Vidrio */
.glass {
  position: relative;
  isolation: isolate;
  background: var(--glass-bg);
  border-radius: var(--r-lg);
  box-shadow: var(--glass-inner), var(--glass-shadow);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(185%) brightness(1.06);
  backdrop-filter: blur(var(--blur)) saturate(185%) brightness(1.06);
}
.glass::before,
.glass::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  pointer-events: none;
}
.glass::before {
  --mx: inherit;
  --my: inherit;
  background: radial-gradient(90% 70% at var(--mx) var(--my), var(--shine), transparent 55%);
  opacity: .9;
  transition: --mx .35s var(--ease), --my .35s var(--ease);
}
.glass::after {
  padding: 1px;
  background: var(--glass-rim);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
.glass-strong { background: var(--glass-strong); }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass { background: var(--glass-strong); }
}
@media (prefers-reduced-transparency: reduce) {
  .glass { background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .aurora i { opacity: .35; }
}

/* Tipografía de página */
.display { font-size: clamp(42px, 6.4vw, 78px); letter-spacing: -.04em; line-height: 1.02; }
.h2 { font-size: clamp(30px, 4.2vw, 50px); letter-spacing: -.035em; }
.h3 { font-size: 20px; letter-spacing: -.02em; line-height: 1.2; }
.grad { background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { font-size: clamp(17px, 1.5vw, 20px); color: var(--ink-2); max-width: 36em; }
.muted { color: var(--ink-2); }
.small { font-size: 14px; }

/* Controles */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 50px;
  padding: 13px 24px;
  border: 0;
  border-radius: 999px;
  font: 600 16px/1 var(--font);
  letter-spacing: -.005em;
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
  transition: transform var(--press) var(--ease), box-shadow .3s ease, filter .3s ease;
}
.btn svg { transition: transform .3s var(--ease); }
@media (hover: hover) and (pointer: fine) {
  .btn:hover svg { transform: translateX(4px); }
}
.btn:active { transform: scale(.97); }
.btn-primary {
  color: #fff;
  background: var(--btn);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), inset 0 -8px 16px -8px rgba(0, 0, 0, .25), var(--btn-glow);
}
.btn-primary::after {
  content: "";
  position: absolute;
  inset: 1px 1px 50% 1px;
  border-radius: 999px 999px 40% 40% / 999px 999px 20px 20px;
  background: linear-gradient(rgba(255, 255, 255, .28), rgba(255, 255, 255, 0));
  pointer-events: none;
}
.btn-primary:hover { filter: brightness(1.1) saturate(1.1); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), inset 0 -8px 16px -8px rgba(0, 0, 0, .25), 0 16px 30px -10px rgba(0, 6, 20, .65), 0 4px 10px -3px rgba(0, 6, 20, .45); }
.btn-glass:hover { filter: brightness(1.12); }
.btn-sm { min-height: 42px; padding: 10px 18px; font-size: 15px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 16px 8px 12px;
  border-radius: 999px;
  font-size: 14px;
  color: var(--ink-2);
}
.hero-meta .chip { display: flex; width: fit-content; margin: 0 0 12px; }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }

.note {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px;
  border: 1px dashed currentColor;
  border-radius: 999px;
  font-size: .8em;
  font-weight: 600;
  color: var(--warn);
  white-space: nowrap;
  vertical-align: .1em;
}

.app-icon {
  flex: none;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  color: #fff;
  background: var(--icon-a);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, .55), inset 0 -10px 18px -10px rgba(0, 0, 0, .35), 0 10px 22px -8px rgba(0, 6, 20, .5);
}
.app-icon.teal { background: var(--icon-b); }
.app-icon.sm { width: 38px; height: 38px; border-radius: 11px; }

.round-btn {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: var(--ink);
  cursor: pointer;
  transition: transform var(--press) var(--ease);
}
.round-btn:active { transform: scale(.95); }

/* Encabezado */
.top { position: sticky; top: 12px; z-index: 50; padding-inline: 16px; }
.nav {
  width: min(100%, var(--maxw));
  margin-inline: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 8px 8px 16px;
  border-radius: 999px;
}
.brand { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 700; letter-spacing: -.02em; text-decoration: none; }
.brand-name span { font-weight: 400; }
.nav-links { display: flex; gap: 2px; margin: 0 auto; padding: 4px; list-style: none; border-radius: 999px; }
.nav-links a {
  display: block;
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 15px;
  color: var(--ink-2);
  text-decoration: none;
  transition: color .25s var(--ease), background .25s var(--ease);
}
.nav-links a:hover { color: var(--ink); background: rgba(255, 255, 255, .08); }
.nav-links a[aria-current="page"] { color: var(--ink); background: var(--glass-strong); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3); }
.nav-actions { display: flex; align-items: center; gap: 8px; }
.menu-btn { display: none; }

/* Preguntas frecuentes */
.faq { display: grid; gap: 10px; }
.faq details { border-radius: var(--r-md); }
.faq summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 18px 22px;
  font-weight: 600;
  list-style: none;
  cursor: pointer;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary svg { flex: none; color: var(--ink-2); transition: transform .3s var(--ease), color .25s ease; }
.faq summary:hover svg { color: var(--ink); }
.faq details[open]:not(.closing) summary svg { transform: rotate(45deg); color: var(--ink); }
.faq details p { padding: 0 22px 20px; color: var(--ink-2); max-width: 62ch; }

/* Pie */
.site-foot { padding: 48px 0 120px; font-size: 14px; color: var(--ink-2); }
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 20px 40px; padding: 28px 30px; }
.foot strong { color: var(--ink); font-size: 16px; }
.foot ul { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0; padding: 0; list-style: none; }
.foot a { text-decoration: none; }
.foot a:hover { color: var(--ink); text-decoration: underline; }

.to-top { position: fixed; right: 16px; bottom: 24px; z-index: 40; opacity: 0; translate: 0 8px; scale: .95; pointer-events: none; transition: opacity .2s ease, translate .3s var(--ease), scale .3s var(--ease), transform var(--press) var(--ease); }
.to-top.show { opacity: 1; translate: none; scale: 1; pointer-events: auto; }
.dock { display: none; }
.proto { padding: 8px 16px 0; text-align: center; font-size: 13px; color: var(--ink-3); }
.proto a { color: var(--ink-2); }

/* Aparición al entrar en pantalla. El contenido es visible por defecto:
   mundo.js agrega .motion al <html> y .in a cada .reveal cuando aparece.
   Los que aparecen juntos se escalonan con --ri. */
.motion .reveal:not(.in) { opacity: 0; }
.motion .reveal.in { animation: rise .7s var(--ease) backwards; animation-delay: calc(min(var(--ri, 0), 6) * 60ms); }
@keyframes rise { from { opacity: 0; translate: 0 18px; filter: blur(6px); } }
@media print { .motion .reveal:not(.in) { opacity: 1; } }
.enter { animation: enter .9s var(--ease) both; }
.enter-2 { animation-delay: .12s; }
.enter-3 { animation-delay: .24s; }
@keyframes enter { from { opacity: 0; translate: 0 22px; filter: blur(10px); } }

/* Movimiento reducido: sin desplazamientos, se mantienen los cambios de color y opacidad */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-property: opacity, color, background-color, border-color, outline-color !important;
  }
}

@media (max-width: 860px) {
  :root { --blur: 16px; }
  body { font-size: 16px; }
  .aurora i { filter: blur(50px); }
  .top { top: 8px; padding-inline: 10px; }
  .nav { flex-wrap: wrap; padding: 6px 6px 6px 14px; border-radius: 28px; }
  .nav-actions { margin-left: auto; }
  .nav-actions .btn { display: none; }
  .menu-btn { display: grid; }
  .nav-links { display: none; order: 3; width: 100%; flex-direction: column; margin: 4px 0; }
  .nav-links.open { display: flex; transition: opacity .2s ease, translate .25s var(--ease); }
  @starting-style { .nav-links.open { opacity: 0; translate: 0 -6px; } }
  .nav-links a { padding: 13px 14px; font-size: 16px; }
  .dock {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    z-index: 45;
    display: flex;
    gap: 8px;
    padding: 7px;
    border-radius: 999px;
  }
  .dock .btn { flex: 1; min-height: 46px; padding: 10px 12px; font-size: 15px; }
  .to-top { bottom: 88px; }
  .foot { padding: 22px; }
}
