/* ==========================================================================
   ZAPPIA v4 · Base global
   Tokens, tipografía, cabecera, menú, paleta de comandos, pie y botón de WhatsApp.
   Lo usan todas las páginas. La home añade home.css.
   ========================================================================== */

@property --lr {
  syntax: "<length>";
  inherits: true;
  initial-value: 0px;
}

:root {
  --ink: #12141c;
  --night: #1f2230;
  --night-2: #262a3a;
  --slate: #474956;
  --indigo: #5a6495;
  --indigo-soft: #9aa3d6;
  --gold: #eabf3f;
  --gold-soft: #f1cf67;
  --gold-fill: #eabf3f;
  --on-accent: #12141c;
  --paper: #f7f7f3;
  --white: #ffffff;

  --fg: #f2f0e8;
  --fg-rgb: 242, 240, 232;
  --ink-rgb: 18, 20, 28;
  --fg-dim: rgba(242, 240, 232, 0.64);
  --fg-mute: rgba(242, 240, 232, 0.56);
  --line: rgba(242, 240, 232, 0.09);
  --line-strong: rgba(242, 240, 232, 0.16);
  --panel: #171a25;
  --layer-1: #1f2230;
  --layer-2: #23273a;
  --layer-3: #282c40;
  --dim-color: #0b0c11;
  --shadow-strong: rgba(0, 0, 0, 0.7);

  --font-ui: "Manrope", "Segoe UI", system-ui, sans-serif;
  --font-code: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);

  --wrap: 1440px;
  --gutter: clamp(20px, 4vw, 56px);
  --zh-h: 76px;
  color-scheme: dark;
}

/* Modo claro: el mismo sistema con la luz encendida.
   El dorado como texto se oscurece (#eabf3f sobre claro no se lee); los rellenos dorados no cambian. */
[data-theme="light"] {
  --ink: #f5f4ef;
  --night: #ffffff;
  --night-2: #eceae3;
  --indigo-soft: #4a5490;
  --gold: #8a6a00;
  --fg: #1a1c26;
  --fg-rgb: 26, 28, 38;
  --ink-rgb: 245, 244, 239;
  --fg-dim: rgba(26, 28, 38, 0.74);
  --fg-mute: rgba(26, 28, 38, 0.64);
  --line: rgba(26, 28, 38, 0.1);
  --line-strong: rgba(26, 28, 38, 0.18);
  --panel: #ffffff;
  --layer-1: #ffffff;
  --layer-2: #fbfaf6;
  --layer-3: #f6f4ee;
  --dim-color: #d6d3c9;
  --shadow-strong: rgba(26, 28, 38, 0.14);
  color-scheme: light;
}

/* Las "terminales" son siempre oscuras, como un editor de código: el código de debajo, el asistente, las demos */
[data-theme="light"] :is(.hero__under, .hero__lens, .hero__ai, .term, .layer__demo, .phero__code, .cmdk, .spec) {
  --ink: #12141c;
  --night: #1f2230;
  --indigo-soft: #9aa3d6;
  --gold: #eabf3f;
  --fg: #f2f0e8;
  --fg-rgb: 242, 240, 232;
  --ink-rgb: 18, 20, 28;
  --fg-dim: rgba(242, 240, 232, 0.64);
  --fg-mute: rgba(242, 240, 232, 0.56);
  --line: rgba(242, 240, 232, 0.09);
  --line-strong: rgba(242, 240, 232, 0.16);
  --panel: #171a25;
  color-scheme: dark;
  color: var(--fg);
}

/* --------------------------------------------------------------- Utilidades */

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

.mono {
  font-family: var(--font-code);
  font-feature-settings: "calt" 1, "liga" 1;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 200;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--gold-fill);
  color: var(--on-accent);
  font: 600 14px/1 var(--font-ui);
  transform: translateY(-160%);
  transition: transform 0.3s var(--ease);
}

.skip:focus {
  transform: none;
}

/* Las páginas interiores aún cargan los estilos antiguos: que no se cuelen en la cabecera ni el pie */
:is(.zh, .zm, .zf, .cmdk, .wa-fab) :where(p, li, a, span, kbd, button, input) {
  font-family: inherit;
  max-width: none;
}

.zh,
.zm,
.zf,
.cmdk {
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

.zh *,
.zm *,
.zf *,
.cmdk *,
.wa-fab * {
  box-sizing: border-box;
}

.zh img,
.zf img {
  max-width: none;
}

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

.btn {
  --btn-bg: var(--gold-fill);
  --btn-fg: var(--on-accent);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 24px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font: 600 15px/1 var(--font-ui);
  letter-spacing: -0.01em;
  text-decoration: none;
  cursor: pointer;
  overflow: hidden;
  isolation: isolate;
  transition: transform 0.5s var(--ease), background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: var(--gold-soft);
  transform: translateY(101%);
  transition: transform 0.5s var(--ease);
}

.btn:hover::before,
.btn:focus-visible::before {
  transform: translateY(0);
}

.btn:active {
  transform: scale(0.97);
}

.btn:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.btn svg {
  width: 18px;
  height: 18px;
  flex: none;
  transition: transform 0.5s var(--ease);
}

.btn:hover svg {
  transform: translateX(3px);
}

.btn--ghost {
  --btn-bg: transparent;
  --btn-fg: var(--fg);
  border-color: var(--line-strong);
}

.btn--ghost::before {
  background: rgba(var(--fg-rgb), 0.08);
}

.btn--ghost:hover {
  border-color: rgba(var(--fg-rgb), 0.3);
}

.btn--wa svg {
  width: 19px;
  height: 19px;
}

.btn--wa:hover svg {
  transform: none;
}

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

.zh {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  padding-top: 14px;
  font-family: var(--font-ui);
  transition: transform 0.6s var(--ease);
}

.zh.is-hidden {
  transform: translateY(calc(-100% - 8px));
}

.zh__bar {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 62px;
  padding: 0 10px 0 22px;
  border: 1px solid transparent;
  border-radius: 18px;
  transition: background-color 0.5s ease, border-color 0.5s ease, backdrop-filter 0.5s ease;
}

.zh.is-solid .zh__bar,
.zh--solid .zh__bar {
  background: rgba(var(--ink-rgb), 0.72);
  border-color: var(--line);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  backdrop-filter: blur(18px) saturate(140%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.zh__logo {
  display: block;
  flex: none;
  border-radius: 6px;
  transition: opacity 0.3s ease;
}

.zh__logo img {
  display: block;
  height: 26px;
  width: auto;
}

.zh__logo:hover {
  opacity: 0.85;
}

.zh__logo:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 6px;
}

.zh__nav {
  position: relative;
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: 12px;
}

.zh__link {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  color: var(--fg-dim);
  font-size: 14.5px;
  font-weight: 500;
  letter-spacing: -0.005em;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.3s ease;
}

.zh__link:hover,
.zh__link:focus-visible,
.zh__link[aria-current="page"] {
  color: var(--fg);
  outline: none;
}

.zh__link[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 5px;
  width: 4px;
  height: 4px;
  margin-left: -2px;
  border-radius: 50%;
  background: var(--gold-fill);
}

/* El texto del enlace se "decodifica" al pasar el ratón */
.zh__link span {
  display: inline-block;
  text-align: center;
}

.zh__link.is-scrambling span {
  color: var(--gold);
}

.zh__pill {
  position: absolute;
  top: 50%;
  left: 0;
  z-index: 0;
  height: 40px;
  width: 0;
  margin-top: -20px;
  border-radius: 999px;
  background: rgba(var(--fg-rgb), 0.07);
  box-shadow: inset 0 0 0 1px rgba(var(--fg-rgb), 0.06);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.55s var(--ease), width 0.55s var(--ease), opacity 0.25s ease;
}

.zh__nav.has-pill .zh__pill {
  opacity: 1;
}

.zh__meta {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-left: auto;
  color: var(--fg-mute);
  font: 500 12px/1 var(--font-code);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.zh__status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--fg-dim);
}

.zh__status i {
  position: relative;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #5fd38d;
}

.zh__status i::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid #5fd38d;
  opacity: 0;
  animation: zh-ping 2.4s var(--ease) infinite;
}

@keyframes zh-ping {
  0% {
    transform: scale(0.4);
    opacity: 0.9;
  }
  100% {
    transform: scale(1.6);
    opacity: 0;
  }
}

.zh__cmd {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
  color: var(--fg-dim);
  font: 500 12px/1 var(--font-code);
  cursor: pointer;
  transition: border-color 0.3s ease, color 0.3s ease;
}

.zh__cmd:hover,
.zh__cmd:focus-visible {
  border-color: var(--line-strong);
  color: var(--fg);
  outline: none;
}

.zh__cmd kbd {
  font: inherit;
}

.zh__cta {
  min-height: 44px;
  padding: 0 18px;
  font-size: 14px;
  white-space: nowrap;
}

.zh__burger {
  display: none;
  align-items: center;
  gap: 10px;
  height: 44px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--fg);
  font: 500 14px/1 var(--font-ui);
  cursor: pointer;
}

.zh__burger-icon {
  position: relative;
  width: 16px;
  height: 10px;
}

.zh__burger-icon::before,
.zh__burger-icon::after {
  content: "";
  position: absolute;
  left: 0;
  width: 100%;
  height: 1.5px;
  border-radius: 2px;
  background: currentColor;
  transition: transform 0.5s var(--ease), top 0.5s var(--ease);
}

.zh__burger-icon::before {
  top: 1px;
}

.zh__burger-icon::after {
  top: 7.5px;
}

.zh__burger[aria-expanded="true"] .zh__burger-icon::before {
  top: 4.25px;
  transform: rotate(45deg);
}

.zh__burger[aria-expanded="true"] .zh__burger-icon::after {
  top: 4.25px;
  transform: rotate(-45deg);
}

@media (max-width: 1380px) {
  .zh__meta .zh__clock {
    display: none;
  }
}

@media (max-width: 1220px) {
  .zh__meta {
    display: none;
  }
}

@media (max-width: 1080px) {
  .zh__nav,
  .zh__meta,
  .zh__cmd {
    display: none;
  }

  .zh__burger {
    display: inline-flex;
    margin-left: auto;
  }
}

@media (max-width: 560px) {
  .zh {
    padding-top: 10px;
  }

  .zh__bar {
    gap: 10px;
    padding: 0 6px 0 16px;
  }

  .zh__logo img {
    height: 22px;
  }

  .zh__cta {
    display: none;
  }
}

/* ------------------------------------------------------------ Menú móvil */

.zm {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: calc(var(--zh-h) + 40px) var(--gutter) 32px;
  background: var(--ink);
  color: var(--fg);
  font-family: var(--font-ui);
  clip-path: inset(0 0 100% 0);
  visibility: hidden;
  transition: clip-path 0.8s var(--ease), visibility 0s linear 0.8s;
}

.zm.is-open {
  clip-path: inset(0 0 0 0);
  visibility: visible;
  transition: clip-path 0.8s var(--ease), visibility 0s;
}

.zm__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.zm__list li {
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

.zm__list a {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 14px 0;
  color: var(--fg);
  font-size: clamp(30px, 9vw, 52px);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1.05;
  text-decoration: none;
  transform: translateY(110%);
  transition: transform 0.8s var(--ease);
}

.zm__list a span {
  color: var(--gold);
  font: 500 12px/1 var(--font-code);
  letter-spacing: 0;
}

.zm.is-open .zm__list a {
  transform: none;
}

.zm.is-open .zm__list li:nth-child(2) a { transition-delay: 0.04s; }
.zm.is-open .zm__list li:nth-child(3) a { transition-delay: 0.08s; }
.zm.is-open .zm__list li:nth-child(4) a { transition-delay: 0.12s; }
.zm.is-open .zm__list li:nth-child(5) a { transition-delay: 0.16s; }
.zm.is-open .zm__list li:nth-child(6) a { transition-delay: 0.2s; }
.zm.is-open .zm__list li:nth-child(7) a { transition-delay: 0.24s; }

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

.zm__foot p {
  margin: 0;
  color: var(--fg-mute);
  font: 500 12px/1.6 var(--font-code);
}

/* ------------------------------------------------- Paleta de comandos ⌘K */

.cmdk {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: start center;
  padding: 14vh 16px 16px;
  font-family: var(--font-ui);
  visibility: hidden;
  pointer-events: none;
}

.cmdk.is-open {
  visibility: visible;
  pointer-events: auto;
}

.cmdk__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 11, 16, 0.6);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.cmdk.is-open .cmdk__backdrop {
  opacity: 1;
}

.cmdk__panel {
  position: relative;
  width: min(620px, 100%);
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background: rgba(26, 29, 41, 0.96);
  box-shadow: 0 40px 80px -20px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  overflow: hidden;
  opacity: 0;
  transform: translateY(-10px) scale(0.98);
  transition: opacity 0.3s ease, transform 0.5s var(--ease);
}

.cmdk.is-open .cmdk__panel {
  opacity: 1;
  transform: none;
}

.cmdk__field {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
}

.cmdk__field span {
  color: var(--gold);
  font: 500 15px/1 var(--font-code);
}

.cmdk__input {
  flex: 1;
  height: 58px;
  border: 0;
  background: transparent;
  color: var(--fg);
  font: 400 16px/1 var(--font-ui);
  outline: none;
}

.cmdk__input::placeholder {
  color: var(--fg-mute);
}

.cmdk__list {
  list-style: none;
  max-height: min(52vh, 420px);
  margin: 0;
  padding: 8px;
  overflow-y: auto;
}

.cmdk__group {
  padding: 12px 12px 6px;
  color: var(--fg-mute);
  font: 500 11px/1 var(--font-code);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.cmdk__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 10px;
  color: var(--fg-dim);
  font-size: 15px;
  cursor: pointer;
}

.cmdk__item svg {
  width: 18px;
  height: 18px;
  flex: none;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cmdk__item kbd {
  margin-left: auto;
  color: var(--fg-mute);
  font: 500 11px/1 var(--font-code);
}

.cmdk__item[aria-selected="true"] {
  background: rgba(234, 191, 63, 0.1);
  color: var(--fg);
}

.cmdk__item[aria-selected="true"] svg {
  stroke: var(--gold);
}

.cmdk__empty {
  padding: 28px 12px;
  color: var(--fg-mute);
  font: 500 13px/1.5 var(--font-code);
  text-align: center;
}

.cmdk__foot {
  display: flex;
  gap: 18px;
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  color: var(--fg-mute);
  font: 500 11px/1 var(--font-code);
}

/* --------------------------------------------------------------------- Pie */

.zf {
  position: relative;
  overflow: hidden;
  padding: 96px 0 28px;
  background: var(--ink);
  color: var(--fg);
  font-family: var(--font-ui);
  border-top: 1px solid var(--line);
}

.zf__grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 40px;
}

.zf__intro img {
  height: 28px;
  width: auto;
}

.zf__intro p {
  max-width: 34ch;
  margin: 22px 0 0;
  color: var(--fg-dim);
  font-size: 15px;
  line-height: 1.6;
}

.zf__title {
  margin: 0 0 18px;
  color: var(--fg-mute);
  font: 500 12px/1 var(--font-code);
}

.zf__list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.zf__list a,
.zf__list span {
  color: var(--fg-dim);
  font-size: 15px;
  text-decoration: none;
  transition: color 0.3s ease;
}

.zf__list a:hover,
.zf__list a:focus-visible {
  color: var(--gold);
  outline: none;
}

/* Relleno que se desvanece hacia abajo (no contorno: con letras tan grandes el trazo de 1 px
   se ve escalonado y dibuja las uniones internas de la fuente variable) */
.zf__tag {
  /* El relleno ocupa la caja del texto: se amplía para que no corte el punto de la i ni las colas de las p */
  margin: calc(72px - 0.14em) 0 -0.24em;
  padding: 0.14em 0 0.24em;
  color: transparent;
  font: 700 clamp(64px, 17vw, 260px) / 0.82 var(--font-code);
  letter-spacing: -0.06em;
  white-space: nowrap;
  background: linear-gradient(180deg, rgba(var(--fg-rgb), 0.14) 20%, rgba(var(--fg-rgb), 0.015) 92%);
  -webkit-background-clip: text;
  background-clip: text;
  user-select: none;
  opacity: 0.85;
  transition: opacity 0.6s ease;
}

.zf__tag em {
  font-style: normal;
  background: linear-gradient(180deg, rgba(234, 191, 63, 0.55) 20%, rgba(234, 191, 63, 0.04) 92%);
  -webkit-background-clip: text;
  background-clip: text;
}

.zf:hover .zf__tag {
  opacity: 1;
}

.zf__bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 14px;
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  color: var(--fg-mute);
  font: 500 12px/1.5 var(--font-code);
}

.zf__bottom a {
  color: inherit;
  text-decoration: none;
}

.zf__bottom a:hover {
  color: var(--gold);
}

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

  .zf__intro {
    grid-column: 1 / -1;
  }
}

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

  /* Enlaces del pie con altura de dedo */
  .zf__list {
    gap: 0;
  }

  .zf__list a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }

  .zf__bottom a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }
}

/* En móvil la barra de la cabecera, más opaca: el texto que pasa por debajo no se cruza con el logo */
@media (max-width: 760px) {
  .zh.is-solid .zh__bar {
    background: rgba(var(--ink-rgb), 0.92);
  }
}

/* ----------------------------------------------------- WhatsApp flotante */

.wa-fab {
  position: fixed;
  right: clamp(16px, 2.5vw, 28px);
  bottom: clamp(16px, 2.5vw, 28px);
  z-index: 80;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #25b763;
  color: #fff;
  box-shadow: 0 16px 34px -10px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  opacity: 0;
  transform: translateY(20px) scale(0.7);
  pointer-events: none;
  transition: opacity 0.4s ease, transform 0.6s var(--ease);
}

.wa-fab.is-visible {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.wa-fab svg {
  width: 28px;
  height: 28px;
}

.wa-fab::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  animation: wa-ring 2.8s ease-out infinite;
}

@keyframes wa-ring {
  0% {
    box-shadow: 0 0 0 0 rgba(37, 183, 99, 0.5);
  }
  70%,
  100% {
    box-shadow: 0 0 0 16px rgba(37, 183, 99, 0);
  }
}

.wa-fab__tip {
  position: absolute;
  right: calc(100% + 12px);
  padding: 9px 13px;
  border-radius: 10px;
  background: var(--fg);
  color: var(--on-accent);
  font: 600 13px/1 var(--font-ui);
  white-space: nowrap;
  opacity: 0;
  transform: translateX(6px);
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.4s var(--ease);
}

.wa-fab:hover .wa-fab__tip,
.wa-fab:focus-visible .wa-fab__tip {
  opacity: 1;
  transform: none;
}

.wa-fab:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 4px;
}

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

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

/* ------------------------------------------------------ Botón de tema */

.zh__theme {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: none;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
  color: var(--fg-dim);
  cursor: pointer;
  transition: border-color 0.3s ease, color 0.3s ease;
}

.zh__theme:hover,
.zh__theme:focus-visible {
  border-color: var(--line-strong);
  color: var(--fg);
  outline: none;
}

.zh__theme:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.zh__theme svg {
  width: 20px;
  height: 20px;
  overflow: visible;
}

/* Luna en oscuro, sol en claro: el mismo círculo cambia de forma */
.ti-core,
.ti-rays {
  transform-box: fill-box;
  transform-origin: center;
}

.ti-core {
  transform: scale(1.45);
  transition: transform 0.7s var(--ease);
}

.ti-cut {
  transition: transform 0.7s var(--ease);
}

.ti-rays {
  opacity: 0;
  transform: rotate(-70deg) scale(0.4);
  transition: transform 0.7s var(--ease), opacity 0.35s ease;
}

[data-theme="light"] .ti-core {
  transform: scale(1);
}

[data-theme="light"] .ti-cut {
  transform: translate(10px, -10px);
}

[data-theme="light"] .ti-rays {
  opacity: 1;
  transform: none;
}

@media (max-width: 1080px) {
  .zh__theme {
    margin-left: auto;
  }

  .zh__burger {
    margin-left: 0;
  }
}

/* Logo: versión clara u oscura según el tema */
.logo-on-light {
  display: none !important;
}

[data-theme="light"] .logo-on-dark {
  display: none !important;
}

[data-theme="light"] .logo-on-light {
  display: block !important;
}

[data-theme="light"] .zh.is-solid .zh__bar {
  box-shadow: 0 14px 30px -20px rgba(26, 28, 38, 0.3);
}

/* Transiciones entre páginas: la cabecera se queda y el contenido cambia con un fundido */
@view-transition {
  navigation: auto;
}

.zh {
  view-transition-name: zh;
}

::view-transition-old(root) {
  animation: vt-out 0.26s var(--ease-in-out) both;
}

::view-transition-new(root) {
  animation: vt-in 0.55s var(--ease) both;
}

@keyframes vt-out {
  to {
    opacity: 0;
    transform: translateY(-14px);
  }
}

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

/* El cambio de tema se revela en círculo desde el botón (ver zappia.js): ahí no hay fundido */
:root.vt-theme::view-transition-old(root),
:root.vt-theme::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}

:root.vt-theme .zh {
  view-transition-name: none;
}

@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) {
    animation: none !important;
  }
}

/* ------------------------------------------------------- Modo lluvia */
/* Tercer estado del botón: nube con gotas. La lluvia cae sobre el modo oscuro */

[data-weather] .ti-core {
  transform: scale(0);
}

[data-weather] .ti-rays {
  opacity: 0;
}

[data-weather="rain"] .ti-drop {
  animation: ti-drop 0.9s linear infinite;
}

[data-weather="rain"] .ti-drop:nth-child(3) {
  animation-delay: 0.3s;
}

[data-weather="rain"] .ti-drop:nth-child(4) {
  animation-delay: 0.6s;
}

@keyframes ti-drop {
  0% {
    opacity: 0;
    transform: translateY(-3px);
  }
  30% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(3px);
  }
}

.zp-rain {
  position: fixed;
  inset: 0;
  z-index: 95;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.8s ease;
}

.zp-rain.is-on {
  opacity: 1;
}

.zp-toast {
  position: fixed;
  left: 50%;
  bottom: clamp(20px, 4vw, 36px);
  z-index: 120;
  width: max-content;
  max-width: min(560px, calc(100vw - 32px));
  padding: 12px 18px;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: rgba(var(--ink-rgb), 0.92);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: var(--fg);
  font: 500 13px/1.4 var(--font-code);
  text-align: center;
  box-shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.6);
  opacity: 0;
  transform: translate(-50%, 16px);
  pointer-events: none;
  transition: opacity 0.4s ease, transform 0.6s var(--ease);
}

.zp-toast.is-on {
  opacity: 1;
  transform: translate(-50%, 0);
}

.zp-toast b {
  color: var(--gold);
  font-weight: 500;
}

/* ------------------------------------------------- Temporadas (tercer modo) */
/* Mismos colores de marca, con la luz de cada época. Solo se ven al pulsar el botón. */

[data-season="invierno"] {
  --ink: #0e1022;
  --ink-rgb: 14, 16, 34;
  --night: #171a33;
  --night-2: #1d2040;
  --layer-1: #171a33;
  --layer-2: #1c1f3d;
  --layer-3: #22254a;
  --panel: #13152c;
  --dim-color: #07081a;
  --indigo-soft: #b0a8ec;
}

[data-season="halloween"] {
  --ink: #120a16;
  --ink-rgb: 18, 10, 22;
  --night: #1c1022;
  --night-2: #241429;
  --layer-1: #1c1022;
  --layer-2: #23132a;
  --layer-3: #2a1733;
  --panel: #170d1c;
  --dim-color: #080409;
  --indigo-soft: #c9a3ea;
  --gold: #f59a3c;
  --gold-fill: #f28c28;
  --gold-soft: #f7a85a;
  --on-accent: #1a0e06;
}

[data-season="navidad"] {
  --ink: #0b1612;
  --ink-rgb: 11, 22, 18;
  --night: #10211b;
  --night-2: #14281f;
  --layer-1: #10211b;
  --layer-2: #14281f;
  --layer-3: #183025;
  --panel: #0e1b16;
  --dim-color: #050c09;
  --indigo-soft: #e8a0a0;
}


/* En Halloween y Navidad, un punto en el botón avisa de que hay sorpresa */
.zh__theme {
  position: relative;
}

[data-season-hint] .zh__theme::after {
  content: "";
  position: absolute;
  top: -3px;
  right: -3px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 2px solid var(--ink);
  animation: hint-pulse 2.4s ease-in-out infinite;
}

[data-season-hint="halloween"] .zh__theme::after {
  background: #f28c28;
}

[data-season-hint="navidad"] .zh__theme::after {
  background: #e5484d;
}

@keyframes hint-pulse {
  50% {
    transform: scale(1.25);
  }
}

/* Iconos de temporada: cada tercer modo enseña el suyo */
.ti-w {
  opacity: 0;
  transform: translateY(4px) scale(0.55);
  transform-box: fill-box;
  transform-origin: center;
  transition: opacity 0.35s ease, transform 0.7s var(--ease);
}

[data-weather="rain"] .ti-w[data-icon="rain"],
[data-weather="snow"] .ti-w[data-icon="snow"],
[data-weather="pumpkin"] .ti-w[data-icon="pumpkin"],
[data-weather="flower"] .ti-w[data-icon="flower"],
[data-weather="lemon"] .ti-w[data-icon="lemon"],
[data-weather="heat"] .ti-w[data-icon="heat"],
[data-weather="leaf"] .ti-w[data-icon="leaf"] {
  opacity: 1;
  transform: none;
}

[data-weather="snow"] .ti-w[data-icon="snow"],
[data-weather="flower"] .ti-w[data-icon="flower"] {
  animation: ti-spin 10s linear infinite;
}

[data-weather="leaf"] .ti-w[data-icon="leaf"],
[data-weather="lemon"] .ti-w[data-icon="lemon"] {
  animation: ti-sway 2.6s ease-in-out infinite;
}

[data-weather="pumpkin"] .ti-w[data-icon="pumpkin"] {
  animation: ti-bob 1.8s ease-in-out infinite;
}

[data-weather="heat"] .ti-wave {
  animation: ti-heat 1.2s ease-in-out infinite;
}

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

@keyframes ti-sway {
  0%,
  100% {
    transform: rotate(-10deg);
  }
  50% {
    transform: rotate(10deg);
  }
}

@keyframes ti-bob {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-1.5px) scale(1.06);
  }
}

@keyframes ti-heat {
  0%,
  100% {
    opacity: 0.35;
  }
  50% {
    opacity: 1;
  }
}

[data-season-hint="bando"] .zh__theme::after {
  background: #f4d23c;
}

/* Paletas de las estaciones nuevas (las de invierno, Halloween y Navidad están arriba) */
[data-season="primavera"] {
  --ink: #141019;
  --ink-rgb: 20, 16, 25;
  --night: #1e1724;
  --night-2: #241b2b;
  --layer-1: #1e1724;
  --layer-2: #241b2b;
  --layer-3: #2a2032;
  --panel: #19131f;
  --dim-color: #09060b;
  --indigo-soft: #f3a6c8;
  --gold: #f2d16b;
  --gold-fill: #f2d16b;
  --gold-soft: #f6dd8c;
  --on-accent: #1a1408;
}

[data-season="bando"] {
  --ink: #0c1a10;
  --ink-rgb: 12, 26, 16;
  --night: #12261a;
  --night-2: #163020;
  --layer-1: #12261a;
  --layer-2: #163020;
  --layer-3: #1a3824;
  --panel: #0f2014;
  --dim-color: #050c07;
  --indigo-soft: #f2b04a;
  --gold: #f4d23c;
  --gold-fill: #f4d23c;
  --gold-soft: #f7df6b;
  --on-accent: #172007;
}

[data-season="verano"] {
  --ink: #1c0d06;
  --ink-rgb: 28, 13, 6;
  --night: #2a140a;
  --night-2: #32180c;
  --layer-1: #2a140a;
  --layer-2: #32180c;
  --layer-3: #3a1d0f;
  --panel: #230f07;
  --dim-color: #0c0502;
  --indigo-soft: #ffb36b;
  --gold: #ff9a2e;
  --gold-fill: #ff8a1e;
  --gold-soft: #ffa64d;
  --on-accent: #1c0a02;
}

[data-season="otono"] {
  --ink: #17110b;
  --ink-rgb: 23, 17, 11;
  --night: #221910;
  --night-2: #2a1f14;
  --layer-1: #221910;
  --layer-2: #2a1f14;
  --layer-3: #312418;
  --panel: #1c150e;
  --dim-color: #0a0704;
  --indigo-soft: #e0a46a;
  --gold: #e9a23b;
  --gold-fill: #e9a23b;
  --gold-soft: #f0b862;
  --on-accent: #1a1006;
}

/* Tiempo real de carga en el pie */
[data-perf]:empty {
  display: none;
}
