/* =========================================================
   Kaelum · Infinito cielo
   Cielo celeste y blanco, naranjo como acento, azul profundo para leer.
   ========================================================= */

:root {
  /* Tinta: azul profundo en vez de negro */
  --ink: #17335A;
  --ink-2: #405D86;
  --ink-3: #587197;

  /* Blancos con un toque de cielo */
  --paper: #FCFEFF;
  --cloud: #F4FAFF;

  /* Celestes (alineados con el logo) */
  --sky-50: #F0F8FF;
  --sky-100: #E0F0FD;
  --sky-200: #C4E2FB;
  --sky-300: #9ACCF6;
  --sky-400: #67AEEE;
  --sky-500: #3D8FE3;
  --sky-600: #2B74CC;
  --sky-700: #2361B8;

  /* Naranjo (acento) */
  --orange: #F97A2E;
  --orange-hover: #FF8C45;
  --orange-ink: #AE4A0C;
  --orange-100: #FFE8D8;

  --shadow-soft: 0 18px 40px -22px rgb(43 116 204 / 0.38);
  --shadow-lift: 0 26px 50px -24px rgb(43 116 204 / 0.5);

  --font-display: "Fredoka", "Nunito", ui-rounded, system-ui, sans-serif;
  --font-body: "Nunito", ui-rounded, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-brand: "Montserrat", "Nunito", system-ui, sans-serif;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);

  --gutter: clamp(16px, 4vw, 40px);
  --section-y: clamp(88px, 11vw, 150px);
  --radius-card: 28px;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

img, svg { display: block; max-width: 100%; }
h1, h2, h3, p, figure, ol { margin: 0; }
ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
a, button { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }

::selection { background: var(--sky-200); color: var(--ink); }

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

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

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.875rem;
  transition: transform 200ms var(--ease-out);
}
.skip-link:focus-visible { transform: translateY(76px); }

/* ---------- Tipografía ---------- */

.display {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.7rem, 1.5rem + 5vw, 5.4rem);
  line-height: 1.02;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.heading {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2rem, 1.35rem + 2.4vw, 3.15rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.heading--xl { font-size: clamp(2.3rem, 1.4rem + 3.6vw, 4.2rem); }

.lead {
  font-size: clamp(1.0625rem, 1rem + 0.35vw, 1.25rem);
  line-height: 1.6;
  color: var(--ink-2);
  max-width: 33em;
  text-wrap: pretty;
}
.body-lg {
  font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.1875rem);
  line-height: 1.65;
  color: var(--ink-2);
  text-wrap: pretty;
}
.body { color: var(--ink-2); text-wrap: pretty; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  padding: 6px 14px 6px 10px;
  border-radius: 999px;
  background: var(--sky-100);
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--sky-700);
}
.eyebrow::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 0 3px var(--orange-100);
}

/* "capa a capa" con tres líneas suaves, como capas impresas */
.layered {
  white-space: nowrap;
  color: var(--sky-600);
  background-image:
    linear-gradient(var(--orange), var(--orange)),
    linear-gradient(var(--sky-300), var(--sky-300)),
    linear-gradient(var(--sky-200), var(--sky-200));
  background-repeat: no-repeat;
  background-size: 100% 0.07em, 92% 0.07em, 84% 0.07em;
  background-position: 0 94%, 4% 103%, 8% 112%;
  border-radius: 4px;
  padding-bottom: 0.1em;
}

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

.btn {
  --btn-pad-y: 12px;
  --btn-pad-x: 20px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
  padding: var(--btn-pad-y) var(--btn-pad-x);
  border: 0;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  user-select: none;
  transition:
    transform 180ms var(--ease-out),
    background-color 200ms ease,
    box-shadow 200ms ease;
}
.btn:active { transform: scale(0.97); }
.btn--sm { --btn-pad-y: 10px; --btn-pad-x: 18px; font-size: 0.875rem; min-height: 40px; }
.btn--lg { --btn-pad-y: 18px; --btn-pad-x: 28px; font-size: 1.0625rem; }

.btn--accent {
  background: var(--orange);
  color: var(--ink);
  box-shadow: inset 0 -3px 0 rgb(23 51 90 / 0.14), 0 12px 24px -12px rgb(249 122 46 / 0.7);
}
.btn--ghost {
  background: rgb(252 254 255 / 0.7);
  color: var(--ink);
  box-shadow: inset 0 0 0 2px var(--sky-200);
}
.btn--paper {
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--shadow-soft);
}

.btn__icon {
  width: 18px;
  height: 18px;
  transition: transform 200ms var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .btn:hover { transform: translateY(-2px); }
  .btn:active { transform: translateY(0) scale(0.97); }
  .btn--accent:hover { background: var(--orange-hover); }
  .btn--ghost:hover { box-shadow: inset 0 0 0 2px var(--sky-400); background: var(--paper); }
  .btn--paper:hover { box-shadow: var(--shadow-lift); }
  .btn:hover .btn__icon { transform: translateX(3px); }
}

/* ---------- Navegación ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  transition: background-color 240ms ease, box-shadow 240ms ease;
}
.nav.is-scrolled {
  background: rgb(252 254 255 / 0.85);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  box-shadow: 0 10px 30px -24px rgb(43 116 204 / 0.6);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 76px;
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
}
.brand__mark { width: 38px; height: 38px; flex: none; }
.brand__word {
  display: block;
  font-family: var(--font-brand);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: 0.08em;
  color: var(--sky-600);
}
.brand__tag {
  display: block;
  margin-top: 2px;
  font-family: var(--font-brand);
  font-weight: 500;
  font-size: 0.6875rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.nav__links {
  display: flex;
  gap: 4px;
  font-size: 0.9375rem;
  font-weight: 600;
}
.nav__links a {
  padding: 10px 16px;
  border-radius: 999px;
  color: var(--ink-2);
  transition: color 160ms ease, background-color 160ms ease;
}
@media (hover: hover) and (pointer: fine) {
  .nav__links a:hover { color: var(--ink); background: rgb(252 254 255 / 0.8); }
}
.nav__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav__toggle {
  display: none;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgb(252 254 255 / 0.85);
  box-shadow: var(--shadow-soft);
  color: var(--ink);
  cursor: pointer;
  transition: transform 160ms var(--ease-out);
}
.nav__toggle:active { transform: scale(0.94); }
.nav__toggle svg { width: 22px; height: 22px; overflow: visible; }
.nav__toggle .bar {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  transform-box: fill-box;
  transform-origin: center;
  transition: transform 240ms var(--ease-out);
}
/* Las dos rayitas se cruzan en una X al abrir */
.nav__toggle[aria-expanded="true"] .bar--1 { transform: translateY(4px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] .bar--2 { transform: translateY(-4px) rotate(-45deg); }

.nav__sheet {
  position: absolute;
  top: calc(100% - 4px);
  left: 0;
  right: 0;
  display: grid;
  gap: 4px;
  margin: 0 var(--gutter);
  padding: 10px;
  border-radius: 24px;
  background: var(--paper);
  box-shadow: 0 24px 50px -24px rgb(23 51 90 / 0.45), inset 0 0 0 2px var(--sky-100);
  transform-origin: 100% 0;
  transition: opacity 180ms ease, transform 260ms var(--ease-out), display 260ms allow-discrete;
}
.nav__sheet[hidden] { display: none; }
.nav__sheet:not([hidden]) {
  @starting-style {
    opacity: 0;
    transform: translateY(-6px) scale(0.97);
  }
}
.nav__sheet a {
  display: flex;
  align-items: center;
  min-height: 52px;
  padding: 0 16px;
  border-radius: 16px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.25rem;
  color: var(--ink);
}
.nav__sheet a:active { background: var(--sky-50); }

@media (max-width: 760px) {
  .nav__links { display: none; }
  .nav__toggle { display: grid; }
  .nav__inner { height: 68px; }
  .hero { margin-top: -68px; padding-top: 68px; }
  .brand__mark { width: 34px; height: 34px; }
  .brand__word { font-size: 1.125rem; }
}
@media (min-width: 761px) {
  .nav__sheet { display: none !important; }
}

/* ---------- Cielo: nubes y destellos ---------- */

.sky {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background:
    radial-gradient(50% 45% at 78% 48%, rgb(252 254 255 / 0.9) 0%, transparent 70%),
    linear-gradient(180deg, #BFE0FB 0%, #D7ECFD 45%, #EEF7FF 80%, var(--paper) 100%);
}

.cloud {
  position: absolute;
  height: auto;
  filter: drop-shadow(0 18px 24px rgb(43 116 204 / 0.12));
  will-change: transform;
}
.cloud--a { width: 260px; top: 14%; left: -60px; opacity: 0.95; }
.cloud--b { width: 180px; top: 8%; left: 46%; opacity: 0.85; }
.cloud--c { width: 320px; bottom: 16%; right: -90px; opacity: 0.9; }
.cloud--d { width: 150px; bottom: 26%; left: 32%; opacity: 0.7; }

.js .cloud--a { animation: drift 70s linear infinite; }
.js .cloud--b { animation: drift 90s linear infinite reverse; }
.js .cloud--c { animation: drift 80s linear infinite reverse; }
.js .cloud--d { animation: drift 60s linear infinite; }
@keyframes drift {
  0%, 100% { translate: 0 0; }
  50% { translate: 60px 0; }
}

.sparkle {
  position: absolute;
  color: var(--paper);
  filter: drop-shadow(0 0 6px rgb(255 255 255 / 0.9));
}
.sparkle--1 { width: 22px; top: 22%; left: 40%; }
.sparkle--2 { width: 14px; top: 60%; left: 6%; color: var(--sky-300); }
.sparkle--3 { width: 18px; top: 12%; right: 12%; }
.sparkle--4 { width: 12px; bottom: 30%; right: 42%; color: var(--sky-300); }
.js .sparkle { animation: twinkle 3.6s ease-in-out infinite; }
.sparkle--2 { animation-delay: -1.2s !important; }
.sparkle--3 { animation-delay: -2.1s !important; }
.sparkle--4 { animation-delay: -0.6s !important; }
@keyframes twinkle {
  0%, 100% { opacity: 1; scale: 1; }
  50% { opacity: 0.35; scale: 0.7; }
}

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

.hero {
  position: relative;
  margin-top: -76px;
  padding-top: 76px;
  isolation: isolate;
}

.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(24px, 4vw, 64px);
  min-height: min(calc(100svh - 76px), 860px);
  padding-block: clamp(40px, 6vw, 88px) clamp(96px, 10vw, 140px);
}
.hero__copy { max-width: 600px; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 26px;
  padding: 8px 16px 8px 12px;
  border-radius: 999px;
  background: rgb(252 254 255 / 0.85);
  box-shadow: var(--shadow-soft);
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--ink-2);
}
.pill__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 0 4px var(--orange-100);
}

.hero .lead { margin-top: 26px; }

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 38px;
}

.hero__wave {
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 100%;
  height: clamp(40px, 6vw, 80px);
}

/* Entrada escalonada */
.js .hero__in {
  animation: rise 900ms var(--ease-out) both;
  animation-delay: calc(120ms + var(--i) * 80ms);
}
@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
}

/* Escenario de la impresora */
.hero__stage {
  position: relative;
  perspective: 1200px;
}
.stage__tilt {
  position: relative;
  aspect-ratio: 420 / 480;
  max-width: 540px;
  margin-inline: auto;
  transform-style: preserve-3d;
  will-change: transform;
}
.stage__halo {
  position: absolute;
  inset: 6% 4% 12%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgb(252 254 255 / 0.95), rgb(252 254 255 / 0));
  transform: translateZ(-40px);
}

.printer {
  position: relative;
  aspect-ratio: 420 / 460;
}
.printer__frame,
.printer__head {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}
/* La figura ocupa exactamente su caja en coordenadas del dibujo (x 104–316, y 206–414) */
.printer__figure {
  position: absolute;
  left: 24.76%;
  top: 44.78%;
  width: 50.48%;
  height: 45.22%;
  filter: drop-shadow(0 10px 12px rgb(43 116 204 / 0.18));
}
.printer__figure .mascot { height: 100%; width: auto; margin-inline: auto; }

.part {
  position: absolute;
  width: clamp(48px, 7vw, 74px);
  height: auto;
  filter: drop-shadow(0 14px 14px rgb(43 116 204 / 0.18));
}
.part--star { top: 22%; right: -2%; }
.part--cube { bottom: 22%; left: -3%; width: clamp(54px, 7.5vw, 82px); }
.part--heart { top: 40%; left: 2%; width: clamp(38px, 5vw, 54px); }

.js .part { animation: pop 700ms var(--ease-out) both; }
.js .part--star { animation-delay: 700ms; }
.js .part--cube { animation-delay: 820ms; }
.js .part--heart { animation-delay: 940ms; }
@keyframes pop {
  from { opacity: 0; scale: 0.85; }
}
.part--star { --float: 7s; }
.part--cube { --float: 9s; }
.part--heart { --float: 6s; }
.float-on .part {
  animation: pop 700ms var(--ease-out) both, float var(--float) ease-in-out infinite;
}
@keyframes float {
  0%, 100% { translate: 0 0; rotate: 0deg; }
  50% { translate: 0 -10px; rotate: 5deg; }
}

.stage__hud {
  position: absolute;
  left: 50%;
  bottom: -2px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 6px 6px 16px;
  border-radius: 999px;
  background: var(--paper);
  box-shadow: var(--shadow-soft);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink-3);
  white-space: nowrap;
  transform: translateX(-50%) translateZ(30px);
}
.hud__label b {
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.hud__replay {
  min-height: 34px;
  padding: 6px 14px;
  border: 0;
  border-radius: 999px;
  background: var(--sky-100);
  color: var(--ink);
  font-size: 0.8125rem;
  font-weight: 700;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 240ms ease, transform 160ms var(--ease-out), background-color 160ms ease;
}
.hud__replay.is-ready { opacity: 1; pointer-events: auto; }
.hud__replay:active { transform: scale(0.96); }
@media (hover: hover) and (pointer: fine) {
  .hud__replay:hover { background: var(--sky-200); }
}

@media (max-width: 900px) {
  .hero__grid {
    grid-template-columns: 1fr;
    min-height: 0;
    gap: 36px;
  }
  .stage__tilt { max-width: min(420px, 90%); }
}
@media (max-width: 480px) {
  .hero__actions .btn { flex: 1 1 100%; }
}

/* ---------- Mascota (piezas compartidas) ---------- */

.mascot {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 800 / 783;
  user-select: none;
}
.mascot img {
  display: block;
  width: 100%;
  height: 100%;
  -webkit-user-drag: none;
}
/* Párpados: se cierran sobre los ojos de la ilustración para parpadear */
.m-lid {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(120% 90% at 50% 20%, #FFFFFF 55%, #EEF5FD 100%);
  transform: scaleY(0);
  transform-origin: 50% 0;
  transition: transform 80ms ease-out;
}
.m-lid::after {
  /* línea del ojo cerrado, como una sonrisita */
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: 30%;
  height: 32%;
  border-bottom: var(--lid-line, 3px) solid #1B4596;
  border-radius: 0 0 50% 50%;
}
.m-lid--l { left: 8.6%; top: 50.6%; width: 12.4%; height: 21.4%; }
.m-lid--r { left: 33.8%; top: 56.8%; width: 16.6%; height: 19.8%; }
.is-blinking .m-lid { transform: scaleY(1); }

/* Textura de capas impresas, recortada a la silueta de la mascota */
.mascot__lines {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(180deg, transparent 0 4px, rgb(43 116 204 / 0.13) 4px 5px);
  -webkit-mask: url("assets/kaelum-mascota.webp") center / 100% 100% no-repeat;
  mask: url("assets/kaelum-mascota.webp") center / 100% 100% no-repeat;
  pointer-events: none;
}

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

.section { padding-block: var(--section-y); }

/* Qué hacemos */
.about__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  align-items: center;
  gap: clamp(48px, 8vw, 120px);
}
.about__text .heading { max-width: 12em; }
.about__text .body-lg { margin-top: 26px; max-width: 34em; }
.about__text .body { margin-top: 16px; max-width: 34em; }

.macro {
  position: relative;
  justify-self: center;
  width: min(100%, 380px);
}
.macro__lens {
  position: relative;
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  background: var(--sky-300);
  box-shadow:
    0 0 0 12px var(--paper),
    0 0 0 14px var(--sky-100),
    0 34px 60px -26px rgb(43 116 204 / 0.55);
}
.macro__lines {
  position: absolute;
  inset: -20% 0;
  background:
    linear-gradient(90deg,
      rgb(35 97 184 / 0.5) 0%,
      rgb(255 255 255 / 0) 22%,
      rgb(255 255 255 / 0.6) 40%,
      rgb(255 255 255 / 0) 62%,
      rgb(35 97 184 / 0.55) 100%),
    repeating-linear-gradient(180deg,
      #CDE6FC 0px,
      #EEF7FF 7px,
      #B5D8F9 15px,
      #86BDF2 17px,
      #CDE6FC 18px);
}
@supports (animation-timeline: view()) {
  .macro__lines {
    animation: lens-drift linear both;
    animation-timeline: view();
  }
  @keyframes lens-drift {
    from { transform: translateY(-8%); }
    to { transform: translateY(8%); }
  }
}
.macro__spark {
  position: absolute;
  width: 34px;
  top: 4%;
  left: 4%;
  color: var(--orange);
}
.macro__caption {
  margin-top: 36px;
  text-align: center;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--ink-2);
}

@media (max-width: 900px) {
  .about__grid { grid-template-columns: 1fr; }
  .macro { width: min(78%, 320px); }
}

/* Proceso */
.process {
  position: relative;
  background: linear-gradient(180deg, var(--sky-100), var(--sky-50));
  padding-block: calc(var(--section-y) + 30px);
}
.process__wave {
  position: absolute;
  left: 0;
  width: 100%;
  height: clamp(30px, 4vw, 60px);
}
.process__wave--top { top: -1px; }
.process__wave--bottom { bottom: -1px; }
.process__head { max-width: 640px; }
.process .eyebrow { background: var(--paper); }

.steps {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(20px, 3vw, 40px);
  margin-top: clamp(48px, 6vw, 80px);
}
/* Camino punteado que une los pasos */
.steps::before {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  top: calc(var(--art-h, 260px) * 0.5);
  border-top: 3px dotted var(--sky-300);
}

.step { position: relative; z-index: 1; }
.step:nth-child(2) { margin-top: 40px; }
.step:nth-child(3) { margin-top: 80px; }

.step__art {
  aspect-ratio: 1 / 0.9;
  display: grid;
  place-items: center;
  border-radius: var(--radius-card);
  background: var(--paper);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  transition: transform 300ms var(--ease-out), box-shadow 300ms ease;
}
.step__art > * { width: 74%; height: auto; overflow: visible; }
.art-print { padding: 4%; }

@media (hover: hover) and (pointer: fine) {
  .step:hover .step__art {
    transform: translateY(-6px) rotate(-1deg);
    box-shadow: var(--shadow-lift);
  }
}

.step__num {
  display: inline-block;
  margin-top: 26px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--orange-100);
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--orange-ink);
}
.step__title {
  margin-top: 12px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.4rem, 1.2rem + 0.6vw, 1.65rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
}
.step__text {
  margin-top: 8px;
  max-width: 30em;
  color: var(--ink-2);
  text-wrap: pretty;
}

@media (max-width: 860px) {
  .steps { grid-template-columns: 1fr; gap: 56px; }
  .steps::before { display: none; }
  .step:nth-child(n) { margin-top: 0; }
  .step__art { aspect-ratio: 4 / 3; }
  .step__art > * { width: min(62%, 240px); }
}

/* Contacto */
.cta__panel {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
  align-items: center;
  gap: 32px;
  padding: clamp(40px, 6vw, 88px);
  border-radius: 40px;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(60% 80% at 85% 50%, rgb(252 254 255 / 0.85) 0%, transparent 70%),
    linear-gradient(160deg, #CBE6FD 0%, #E4F2FE 60%, #D2E9FD 100%);
}
.cta__panel .cloud { z-index: -1; }
.cloud--cta1 { width: 240px; left: -50px; bottom: -24px; opacity: 0.9; }
.cloud--cta2 { width: 170px; right: 26%; top: -20px; opacity: 0.8; }
.js .cloud--cta1 { animation: drift 50s linear infinite; }
.js .cloud--cta2 { animation: drift 70s linear infinite reverse; }

.cta__copy .body-lg { margin-top: 22px; max-width: 30em; }
.cta__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 38px;
}

.contact-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}
.contact-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 8px 16px 8px 10px;
  border-radius: 18px;
  background: rgb(252 254 255 / 0.65);
  box-shadow: inset 0 0 0 1.5px rgb(252 254 255 / 0.9);
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--ink);
  overflow-wrap: anywhere;
  transition: background-color 160ms ease, box-shadow 200ms ease, transform 180ms var(--ease-out);
}
.contact-link svg {
  flex: none;
  width: 34px;
  height: 34px;
  padding: 7px;
  border-radius: 12px;
  background: var(--sky-100);
  color: var(--sky-700);
}
.contact-link small {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ink-3);
}
.contact-link:active { transform: scale(0.97); }
@media (hover: hover) and (pointer: fine) {
  .contact-link:hover { background: var(--paper); box-shadow: var(--shadow-soft); transform: translateY(-2px); }
}
@media (max-width: 480px) {
  .contact-list li { flex: 1 1 100%; }
  .contact-link { width: 100%; }
}

.cta__mark {
  position: relative;
  justify-self: center;
  width: min(100%, 260px);
}
.cta__star {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 24px 30px rgb(43 116 204 / 0.3));
}
.js .cta__star { animation: hover-float 6s ease-in-out infinite; }
@keyframes hover-float {
  0%, 100% { translate: 0 0; rotate: -3deg; }
  50% { translate: 0 -12px; rotate: 3deg; }
}
.sparkle--cta1 { width: 26px; top: 0; right: 6%; color: var(--orange); }
.sparkle--cta2 { width: 16px; bottom: 10%; left: 4%; color: var(--paper); }

@media (max-width: 860px) {
  .cta__panel { grid-template-columns: 1fr; }
  .cta__mark { display: none; }
}
@media (max-width: 480px) {
  .cta__actions .btn { flex: 1 1 100%; }
}

/* Footer */
/* Espacio extra abajo para que la mascota fija no tape el pie */
.footer { padding-block: 32px calc(140px + env(safe-area-inset-bottom)); }
.footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 32px;
  border-top: 2px dotted var(--sky-200);
}
.brand--logo img { width: auto; height: 84px; }
.footer__note { font-size: 0.9375rem; color: var(--ink-3); }
.footer__social { display: flex; gap: 8px; }
.footer__social a {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--sky-50);
  color: var(--sky-700);
  transition: background-color 160ms ease, transform 180ms var(--ease-out);
}
.footer__social svg { width: 22px; height: 22px; }
.footer__social a:active { transform: scale(0.95); }
@media (hover: hover) and (pointer: fine) {
  .footer__social a:hover { background: var(--sky-100); transform: translateY(-2px); }
}

/* ---------- Revelado al hacer scroll ---------- */

.js [data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 800ms var(--ease-out), transform 800ms var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
}
.js [data-reveal].is-in {
  opacity: 1;
  transform: none;
}

/* =========================================================
   Mascota asistente (esquina inferior derecha)
   ========================================================= */

.buddy {
  --buddy-size: 96px;
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 70;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  pointer-events: none;
}
.buddy > * { pointer-events: auto; }

.buddy__avatar {
  position: relative;
  display: grid;
  place-items: center;
  width: var(--buddy-size);
  height: var(--buddy-size);
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  cursor: pointer;
  transition: transform 220ms var(--ease-out);
}
.buddy__avatar::before {
  /* sombrita en el "suelo" */
  content: "";
  position: absolute;
  left: 22%;
  right: 22%;
  bottom: -2px;
  height: 10px;
  border-radius: 50%;
  background: rgb(43 116 204 / 0.22);
  filter: blur(3px);
  transition: transform 220ms var(--ease-out);
}
.buddy__avatar .mascot {
  --lid-line: 2px;
  filter: drop-shadow(0 10px 14px rgb(43 116 204 / 0.28));
  transition: rotate 400ms var(--ease-out);
}
.buddy__avatar:active { transform: scale(0.94); }
@media (hover: hover) and (pointer: fine) {
  .buddy__avatar:hover { transform: scale(1.06) rotate(-4deg); }
}

/* Entrada de la mascota */
.js .buddy__avatar {
  animation: buddy-in 900ms var(--ease-out) 1.1s both;
}
@keyframes buddy-in {
  from { opacity: 0; translate: 0 40px; scale: 0.9; }
}

/* Flotación y aleteo */
.buddy.is-alive .buddy__avatar .mascot { animation: bob 3.2s ease-in-out infinite; }
.buddy.is-alive .buddy__avatar::before { animation: shadow-bob 3.2s ease-in-out infinite; }
/* "Respira": se estira y se aplasta apenas, como un globito */
.buddy.is-alive .buddy__avatar .mascot img {
  transform-origin: 50% 80%;
  animation: breathe 1.6s ease-in-out infinite;
}
@keyframes bob {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -8px; }
}
@keyframes shadow-bob {
  0%, 100% { scale: 1; opacity: 1; }
  50% { scale: 0.8; opacity: 0.6; }
}
@keyframes breathe {
  0%, 100% { scale: 1 1; }
  50% { scale: 1.025 0.975; }
}

/* Globo de diálogo */
.buddy__bubble {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 6px;
  max-width: min(280px, calc(100vw - 32px));
  margin-right: 18px;
  padding: 14px 10px 14px 18px;
  border-radius: 22px 22px 6px 22px;
  background: var(--paper);
  box-shadow: var(--shadow-lift), inset 0 0 0 2px var(--sky-100);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.45;
  color: var(--ink);
  transform-origin: 100% 100%;
  opacity: 0;
  transform: translateY(8px) scale(0.92);
  pointer-events: none;
  transition: opacity 220ms ease, transform 320ms var(--ease-out);
}
.buddy__bubble.is-visible {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}
.buddy__bubble p { padding-top: 2px; }
.buddy__bubble-close {
  flex: none;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin: -4px 0 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-3);
  cursor: pointer;
  transition: background-color 160ms ease;
}
.buddy__bubble-close svg { width: 14px; height: 14px; }
@media (hover: hover) and (pointer: fine) {
  .buddy__bubble-close:hover { background: var(--sky-100); color: var(--ink); }
}

/* Panel de chat */
.buddy__panel {
  display: flex;
  flex-direction: column;
  width: min(360px, calc(100vw - 32px));
  max-height: min(520px, calc(100svh - 150px));
  border-radius: 28px;
  background: var(--paper);
  box-shadow: 0 30px 70px -28px rgb(23 51 90 / 0.45), inset 0 0 0 2px var(--sky-100);
  overflow: hidden;
  transform-origin: 100% 100%;
  transition: opacity 200ms ease, transform 300ms var(--ease-out), display 300ms allow-discrete;
}
.buddy__panel[hidden] { display: none; }
.buddy__panel:not([hidden]) {
  @starting-style {
    opacity: 0;
    transform: translateY(10px) scale(0.95);
  }
}

.buddy__head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 12px 14px 14px;
  background: linear-gradient(160deg, #CBE6FD, #EAF5FF);
}
.buddy__head-avatar {
  flex: none;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--paper);
  box-shadow: 0 6px 14px -8px rgb(43 116 204 / 0.6);
  display: grid;
  place-items: center;
}
.buddy__head-avatar .mascot { width: 40px; --lid-line: 1.5px; }
.buddy__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.0625rem;
  line-height: 1.2;
}
.buddy__subtitle { font-size: 0.8125rem; color: var(--ink-2); }
.buddy__close {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-left: auto;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgb(252 254 255 / 0.7);
  color: var(--ink-2);
  cursor: pointer;
  transition: background-color 160ms ease;
}
.buddy__close svg { width: 16px; height: 16px; }
@media (hover: hover) and (pointer: fine) {
  .buddy__close:hover { background: var(--paper); color: var(--ink); }
}

.buddy__log {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px 16px 8px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.msg {
  max-width: 86%;
  padding: 11px 15px;
  border-radius: 20px;
  font-size: 0.9375rem;
  line-height: 1.5;
  animation: msg-in 320ms var(--ease-out) both;
}
.msg--bot {
  align-self: flex-start;
  border-bottom-left-radius: 6px;
  background: var(--sky-100);
  color: var(--ink);
}
.msg--user {
  align-self: flex-end;
  border-bottom-right-radius: 6px;
  background: var(--sky-600);
  color: #FCFEFF;
}
.msg__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
@keyframes msg-in {
  from { opacity: 0; transform: translateY(6px); }
}
.typing {
  display: inline-flex;
  gap: 4px;
  padding: 14px 16px;
}
.typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--sky-400);
  animation: dot 1s ease-in-out infinite;
}
.typing span:nth-child(2) { animation-delay: 120ms; }
.typing span:nth-child(3) { animation-delay: 240ms; }
@keyframes dot {
  0%, 100% { opacity: 0.35; translate: 0 0; }
  50% { opacity: 1; translate: 0 -3px; }
}

.buddy__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 16px 16px;
}
.chip {
  min-height: 40px;
  padding: 8px 14px;
  border: 0;
  border-radius: 999px;
  background: var(--paper);
  box-shadow: inset 0 0 0 2px var(--sky-200);
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--sky-700);
  cursor: pointer;
  transition: background-color 160ms ease, box-shadow 160ms ease, transform 160ms var(--ease-out);
}
.chip:active { transform: scale(0.96); }
@media (hover: hover) and (pointer: fine) {
  .chip:hover { background: var(--sky-50); box-shadow: inset 0 0 0 2px var(--sky-400); }
}

@media (max-width: 600px) {
  .buddy {
    --buddy-size: 70px;
    right: max(10px, env(safe-area-inset-right));
    bottom: max(12px, env(safe-area-inset-bottom));
    transition: transform 320ms var(--ease-out), opacity 240ms ease;
  }
  /* Mientras haces scroll, la mascota se asoma desde el borde */
  .buddy.is-tucked {
    transform: translateX(46%);
    opacity: 0.75;
  }
  .buddy__bubble {
    max-width: min(240px, calc(100vw - 100px));
    margin-right: 8px;
    padding: 12px 8px 12px 14px;
    font-size: 0.875rem;
  }
  .buddy__panel {
    width: calc(100vw - 20px);
    max-height: min(560px, calc(100svh - 120px));
  }
  .hud__replay { min-height: 40px; }
}
.buddy__bubble-close::before {
  /* área táctil más grande que el ícono */
  content: "";
  position: absolute;
  inset: -8px;
}
.buddy__bubble-close { position: relative; }

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 80;
  max-width: calc(100% - 140px);
  padding: 12px 18px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.9375rem;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 200ms ease, transform 300ms var(--ease-out);
}
.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}
@media (max-width: 600px) {
  .toast { left: 16px; right: 110px; max-width: none; transform: translateY(12px); border-radius: 18px; }
  .toast.is-visible { transform: none; }
}

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .hero__in,
  .js .part,
  .float-on .part,
  .js .buddy__avatar { animation: fade 400ms ease both; }
  .js .cloud,
  .js .sparkle,
  .js .cta__star,
  .buddy.is-alive .buddy__avatar .mascot img,
  .buddy.is-alive .buddy__avatar .mascot,
  .buddy.is-alive .buddy__avatar::before,
  .macro__lines,
  .typing span { animation: none !important; }
  .js [data-reveal] { transform: none; transition: opacity 400ms ease; }
  .stage__tilt { transform: none !important; }
  .buddy__bubble,
  .buddy__panel { transform: none !important; transition: opacity 200ms ease; }
  .msg { animation: fade 200ms ease both; }
  .btn, .chip, .step__art, .btn__icon, .buddy__avatar { transition-property: opacity, background-color, box-shadow; }
  .btn:hover, .step:hover .step__art, .buddy__avatar:hover { transform: none !important; }
  .toast { transition: opacity 200ms ease; }
  .buddy.is-tucked { transform: none; opacity: 0.6; }
  .nav__sheet, .nav__toggle .bar { transition: opacity 150ms ease; }
}
@keyframes fade { from { opacity: 0; } }
