/* =====================================================================
   BASE — variables, reset, tipografía, botones y navegación
   Cambia la paleta aquí: todo el sitio usa estos roles de color
   ===================================================================== */
@property --reveal {
  syntax: '<percentage>';
  inherits: false;
  initial-value: 170%;
}

:root,
.screen {
  /* Paleta clara. La oscura está en dark.css; la pantalla del móvil del hero
     (.screen) se queda siempre con esta, como un dispositivo de verdad */
  color-scheme: light;
  --page: #F4F0E8;
  --panel: #F8F5EE;
  --card: #FFFFFF;
  --ink: #14161B;
  --grey: #6B6F77;
  --line: rgba(20, 22, 27, 0.08);
  --accent: #F6B51E;
  --accent-soft: #FDEFC8;
  /* Los mismos colores en canales, para usarlos con transparencia: rgb(var(--ink-rgb) / .5) */
  --ink-rgb: 20 22 27;
  --panel-rgb: 248 245 238;
  --card-rgb: 255 255 255;
  /* Texto sobre fondo de tinta y sobre el amarillo; fondo que siempre es oscuro (contacto) */
  --on-ink: #FFFFFF;
  --on-accent: #14161B;
  --night: #14161B;

  /* Suelos de las salas de la oficina del hero */
  --floor-ideas: #FAEDCB;
  --floor-prod: #DCE5E9;
  --floor-test: #E1E6D3;
  --floor-proj: #EFE8DC;
}

:root {
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font-display: 'Bricolage Grotesque', ui-sans-serif, system-ui, sans-serif;
  --font-body: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  --frame: 12px;
  --container: 1280px;
  --gutter: clamp(20px, 4vw, 56px);

  /* Cuándo empiezan las entradas del hero (se retrasan si hay splash) */
  --start: 0s;
}

.has-splash { --start: 2.24s; }

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}

img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, h5, h6, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
input, textarea { font: inherit; color: inherit; }

::selection { background: var(--accent); color: var(--on-accent); }

:where(a, button, input, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
  box-shadow: 0 0 0 6px var(--accent-soft);
}

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

.skip-link {
  position: fixed; top: 12px; left: 12px; z-index: 100;
  padding: 10px 16px; border-radius: 10px;
  background: var(--ink); color: var(--on-ink); font-weight: 600;
  transform: translateY(-160%);
  transition: transform .3s var(--ease);
}
.skip-link:focus { transform: none; }

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

section[id] { scroll-margin-top: 84px; }

[data-icon] { display: inline-grid; place-items: center; }
[data-icon] svg { width: 1em; height: 1em; }

.hide-sm { display: inline; }
.show-sm { display: none; }
@media (max-width: 639px) {
  .hide-sm { display: none; }
  .show-sm { display: inline; }
}

/* ---------- Frase rotatoria (palabra a palabra) ---------- */
.phrase { display: inline-flex; flex-wrap: nowrap; gap: 0 .26em; white-space: nowrap; }
/* Con el espaciado negativo de los títulos, la última letra (el punto) dibuja un poco más allá de
   su caja, y lo que recorta (la línea del título con overflow: hidden, el blur de la animación,
   la sombra) se lo comía. Un pequeño relleno a la derecha deja sitio para ese trocito */
.phrase { padding-right: .12em; }
.phrase .w { display: inline-block; padding-right: .1em; margin-right: -.1em; }
/* backwards (no both): al acabar no se queda el filter: blur(0), que recortaba el punto final */
.phrase .w-in { animation: word-in .75s var(--ease) calc(.15s + var(--i) * .09s) backwards; }
.phrase .w-out { animation: word-out .4s cubic-bezier(.4, 0, 1, 1) calc(var(--i) * .05s) forwards; }

@keyframes word-in {
  from { opacity: 0; transform: translateY(.35em); filter: blur(10px); }
  to { opacity: 1; transform: none; filter: blur(0); }
}
@keyframes word-out {
  from { opacity: 1; transform: none; filter: blur(0); }
  to { opacity: 0; transform: translateY(-.3em); filter: blur(10px); }
}

/* ---------- Botón CTA: baldosa de acento que se expande y etiqueta que rueda ---------- */
.cta {
  --h: 54px;
  --tile: 42px;
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  gap: 16px;
  height: var(--h);
  padding: 0 6px 0 22px;
  border-radius: 15px;
  background: var(--ink);
  color: var(--on-ink);
  font-weight: 600;
  font-size: 15.5px;
  overflow: hidden;
  transition: color .45s var(--ease), transform .2s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.cta:active { transform: scale(.98); }
.cta-sm { --h: 44px; --tile: 34px; gap: 12px; padding-left: 16px; font-size: 14.5px; border-radius: 12px; }

.cta-fill {
  position: absolute;
  z-index: -1;
  top: calc((var(--h) - var(--tile)) / 2);
  right: calc((var(--h) - var(--tile)) / 2);
  width: var(--tile);
  height: var(--tile);
  border-radius: 10px;
  background: var(--accent);
  transition: width .55s var(--ease), border-radius .55s var(--ease);
}
.cta-labels { position: relative; display: grid; overflow: hidden; line-height: 1.3; margin-right: auto; }
.cta-label { grid-area: 1 / 1; transition: transform .55s var(--ease); white-space: nowrap; }
.cta-hover { transform: translateY(115%); }
.cta-tile {
  display: grid; place-items: center;
  width: var(--tile); height: var(--tile);
  border-radius: 10px;
  color: var(--on-accent);
}
.cta-tile svg { width: 18px; height: 18px; stroke-width: 2.4; transition: transform .55s var(--ease); }

@media (hover: hover) {
  .cta:hover { color: var(--on-accent); }
  .cta:hover .cta-fill { width: calc(100% - (var(--h) - var(--tile))); }
  .cta:hover .cta-rest { transform: translateY(-115%); }
  .cta:hover .cta-hover { transform: none; }
  .cta:hover .cta-tile svg { transform: rotate(45deg); }
}

.ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 54px;
  padding: 0 22px;
  border-radius: 15px;
  border: 1px solid rgb(var(--ink-rgb) / .14);
  background: rgb(var(--card-rgb) / .55);
  backdrop-filter: blur(6px);
  font-weight: 600;
  font-size: 15.5px;
  transition: background .25s, border-color .25s, transform .2s var(--ease);
}
.ghost svg { width: 18px; height: 18px; }
.ghost:hover { background: var(--card); border-color: rgb(var(--ink-rgb) / .3); }
.ghost:active { transform: scale(.98); }

/* ---------- Navegación ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: var(--frame) var(--frame) 0;
}
.nav-shell {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: max(0px, calc(var(--gutter) - 16px));
}
.nav-bar {
  position: relative;
  display: flex;
  align-items: center;
  gap: 24px;
  height: 64px;
  padding-inline: 16px 10px;
  border-radius: 18px;
  border: 1px solid transparent;
  transition: background .35s, box-shadow .35s, border-color .35s, backdrop-filter .35s;
}
.nav[data-scrolled='true'] .nav-bar {
  background: rgb(var(--panel-rgb) / .78);
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
  backdrop-filter: saturate(1.6) blur(14px);
  border-color: var(--line);
  box-shadow: 0 12px 32px -20px rgba(20, 22, 27, .4);
}

.brand { display: flex; align-items: center; gap: 10px; min-width: 0; border-radius: 10px; }
.brand-mark { flex: none; }
/* Logo: el avatar del móvil, redondo y con un aro como el del widget */
.brand-mark {
  display: grid; place-items: center;
  width: 36px; height: 36px;
  border-radius: 50%;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: -.02em;
  box-shadow: 0 0 0 2px var(--card), 0 0 0 3px var(--line), 0 4px 10px -4px rgba(20, 22, 27, .35);
  transition: transform .4s var(--ease);
}
.brand-avatar { width: 100%; height: 100%; }
.brand:hover .brand-mark { transform: rotate(-8deg) scale(1.06); }
.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -.03em;
  /* Siempre en una línea: en pantallas muy estrechas se recorta con "…" */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (max-width: 420px) {
  .nav-bar { gap: 10px; }
  .brand-name { font-size: 16.5px; }
}

.nav-links {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: none;
  align-items: center;
  gap: 2px;
}
.nav-links a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 15px;
  border-radius: 10px;
  font-size: 14.5px;
  font-weight: 500;
  color: rgb(var(--ink-rgb) / .6);
  transition: color .2s;
}
.nav-links a:hover, .nav-links a.is-active { color: var(--ink); }
.nav-links a::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  margin-left: -13px;
  opacity: 0;
  transform: scale(0);
  transition: opacity .3s, transform .3s var(--ease), margin .3s var(--ease);
}
.nav-links a.is-active::before { opacity: 1; transform: none; margin-left: 0; }
.nav-pill {
  position: absolute;
  top: 0; left: 0;
  height: 100%;
  border-radius: 10px;
  background: rgb(var(--ink-rgb) / .06);
  opacity: 0;
  pointer-events: none;
  transition: transform .4s var(--ease), width .4s var(--ease), opacity .25s;
}

.nav-end { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.nav-cta { display: none; }

/* Botón de modo claro / oscuro: la luna se va girando y entra el sol (y al revés) */
.theme-toggle {
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
  width: 44px; height: 44px;
  border-radius: 12px;
  border: 1px solid rgb(var(--ink-rgb) / .12);
  overflow: hidden;
  transition: background .25s, border-color .25s;
}
.theme-toggle:hover { background: rgb(var(--ink-rgb) / .06); border-color: rgb(var(--ink-rgb) / .22); }
.theme-icon {
  grid-area: 1 / 1;
  display: grid;
  transition: transform .5s var(--ease), opacity .3s;
}
.theme-icon svg { width: 19px; height: 19px; }
.theme-sun { opacity: 0; transform: translateY(120%) rotate(-90deg); }
[data-theme='dark'] .theme-moon { opacity: 0; transform: translateY(-120%) rotate(90deg); }
[data-theme='dark'] .theme-sun { opacity: 1; transform: none; color: var(--accent); }

.nav-toggle {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  border-radius: 12px;
  border: 1px solid rgb(var(--ink-rgb) / .12);
}
.nav-toggle span {
  position: absolute;
  width: 18px; height: 2px;
  border-radius: 2px;
  background: var(--ink);
  transition: transform .35s var(--ease);
}
.nav-toggle span:first-child { transform: translateY(-4px); }
.nav-toggle span:last-child { transform: translateY(4px); }
.nav-toggle[aria-expanded='true'] span:first-child { transform: rotate(45deg); }
.nav-toggle[aria-expanded='true'] span:last-child { transform: rotate(-45deg); }

.nav-menu {
  position: absolute;
  inset-inline: 12px;
  top: calc(100% + 8px);
  padding: 8px;
  border-radius: 18px;
  background: var(--card);
  box-shadow: 0 24px 60px -20px rgba(20, 22, 27, .35), 0 0 0 1px var(--line);
  animation: menu-in .3s var(--ease);
}
.nav-menu a {
  display: flex;
  align-items: center;
  min-height: 50px;
  padding: 0 16px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 17px;
}
.nav-menu a:hover { background: var(--panel); }
@keyframes menu-in { from { opacity: 0; transform: translateY(-8px); } }

@media (min-width: 640px) {
  .nav-cta { display: inline-flex; }
}
@media (min-width: 1024px) {
  .nav-links { display: flex; }
  .nav-toggle { display: none; }
  .nav-menu { display: none; }
}

/* ---------- Encabezados de sección ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--grey);
}
.eyebrow-num {
  display: grid; place-items: center;
  height: 24px;
  padding: 0 8px;
  border-radius: 7px;
  background: var(--ink);
  color: var(--accent);
  font-family: var(--font-display);
  letter-spacing: 0;
}
.section-title {
  margin-top: 18px;
  font-family: var(--font-display);
  font-weight: 650;
  font-size: clamp(2.3rem, 1.2rem + 3.6vw, 4.2rem);
  line-height: 1;
  letter-spacing: -.045em;
}
.section-title em {
  font-style: normal;
  background: linear-gradient(transparent 60%, var(--accent) 60% 92%, transparent 92%);
  padding-inline: .06em;
}
.section-lede {
  margin-top: 18px;
  max-width: 34rem;
  color: rgb(var(--ink-rgb) / .65);
  font-size: 17px;
  line-height: 1.6;
}

/* ---------- Revelado al hacer scroll ---------- */
.js .reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .9s var(--ease), transform .9s var(--ease);
  transition-delay: var(--rd, 0s);
}
.js .reveal.is-in { opacity: 1; transform: none; }

/* ---------- Aviso flotante ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px 12px 14px;
  border-radius: 14px;
  background: var(--ink);
  color: var(--on-ink);
  font-size: 14.5px;
  font-weight: 500;
  box-shadow: 0 18px 40px -16px rgba(20, 22, 27, .55);
  transform: translate(-50%, 140%);
  opacity: 0;
  transition: transform .45s var(--ease), opacity .3s;
  pointer-events: none;
}
.toast svg { width: 18px; height: 18px; color: var(--accent); stroke-width: 2.6; }
.toast.is-on { transform: translate(-50%, 0); opacity: 1; }

.live-dot {
  position: relative;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #2BB673;
  flex: none;
}
.live-dot::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid #2BB673;
  animation: live-ping 1.8s var(--ease) infinite;
}
@keyframes live-ping {
  from { transform: scale(.4); opacity: .9; }
  to { transform: scale(1.5); opacity: 0; }
}

/* ---------- Animación de "mensaje enviado" (PF.ui.sentFX, js/ui/sent-fx.js) ---------- */
.sent-fx {
  --sf-bg: rgba(20, 22, 27, .94);
  --sf-ink: #fff;
  --sf-sub: rgba(255, 255, 255, .7);
  position: absolute;
  inset: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 20px 20px 120px;
  border-radius: inherit;
  overflow: hidden;
  background: var(--sf-bg);
  backdrop-filter: blur(8px);
  color: var(--sf-ink);
  text-align: center;
  cursor: pointer;
  animation: sf-in .35s var(--ease) both;
}
/* En el móvil deja a la vista la barra de estado y la de navegación de Android */
.sent-fx.is-light { --sf-bg: rgba(255, 255, 255, .96); --sf-ink: #1F1F1F; --sf-sub: #5F6368; inset: 32px 0 40px; border-radius: 0; padding-bottom: 110px; }
.sent-fx.is-out { animation: sf-out .4s var(--ease) forwards; }
.sf-badge {
  position: relative;
  width: 76px; height: 76px;
  margin-bottom: 12px;
  border-radius: 50%;
  background: #34C26B;
  box-shadow: 0 12px 30px -8px rgba(52, 194, 107, .6);
  animation: sf-pop .55s cubic-bezier(.34, 1.56, .64, 1) .05s both;
}
.sf-badge::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow: 0 0 0 3px #34C26B;
  animation: sf-ring .9s ease-out .35s both;
}
.sf-badge svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.sf-check {
  fill: none;
  stroke: #fff;
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 40;
  stroke-dashoffset: 40;
  animation: sf-draw .45s var(--ease) .35s forwards;
}
.sf-bit {
  position: absolute;
  top: 50%; left: 50%;
  width: 7px; height: 11px;
  margin: -5px 0 0 -3px;
  border-radius: 2px;
  background: var(--c);
  opacity: 0;
  animation: sf-burst 1.1s cubic-bezier(.2, .8, .3, 1) calc(.45s + var(--d)) both;
}
.sf-bit:nth-child(3n) { border-radius: 50%; width: 8px; height: 8px; }
.sf-title {
  font-family: var(--font-display);
  font-size: clamp(20px, 2.4vw, 26px);
  font-weight: 800;
  letter-spacing: -.01em;
  animation: sf-up .5s var(--ease) .3s both;
}
.sf-text { max-width: 30ch; font-size: 14px; line-height: 1.45; color: var(--sf-sub); animation: sf-up .5s var(--ease) .4s both; }
.is-light .sf-title { font-size: 19px; }
.is-light .sf-text { font-size: 12.5px; }
.sf-guy {
  position: absolute;
  bottom: -8px; left: 50%;
  width: 120px;
  overflow: visible;
  animation: sf-rise .7s cubic-bezier(.34, 1.4, .64, 1) .45s both;
}
.is-light .sf-guy { width: 104px; }
.sf-knuckle { fill: none; stroke: #C9946B; stroke-width: 1.8; stroke-linecap: round; }
.sf-smile { fill: none; stroke: #14161B; stroke-width: 2.6; stroke-linecap: round; }
.sf-arm {
  transform-box: view-box;
  transform-origin: 96px 106px;
  animation: sf-thumb 1.3s cubic-bezier(.34, 1.56, .64, 1) .9s both;
}
.sf-head {
  transform-box: view-box;
  transform-origin: 60px 86px;
  animation: sf-nod 1.2s ease-in-out 1.3s both;
}
@keyframes sf-in { from { opacity: 0; } }
@keyframes sf-out { to { opacity: 0; transform: scale(.98); } }
@keyframes sf-pop { from { transform: scale(0) rotate(-30deg); } }
@keyframes sf-ring { from { transform: scale(1); opacity: .9; } to { transform: scale(1.7); opacity: 0; } }
@keyframes sf-draw { to { stroke-dashoffset: 0; } }
@keyframes sf-up { from { opacity: 0; transform: translateY(8px); } }
@keyframes sf-burst {
  0% { opacity: 1; transform: translate(0, 0) rotate(0) scale(.4); }
  70% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--dx), calc(var(--dy) + 24px)) rotate(var(--r)) scale(1); }
}
@keyframes sf-rise { from { transform: translate(-50%, 105%); } to { transform: translate(-50%, 0); } }
/* El brazo sube desde abajo, enseña el pulgar y lo agita un poco */
@keyframes sf-thumb {
  0% { transform: rotate(150deg); }
  45% { transform: rotate(0); }
  60% { transform: rotate(-10deg); }
  75% { transform: rotate(4deg); }
  100% { transform: rotate(0); }
}
@keyframes sf-nod { 30% { transform: rotate(-6deg); } 65% { transform: rotate(4deg); } }

/* ---------- Menos movimiento ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0s !important;
    transition-duration: .01ms !important;
    transition-delay: 0s !important;
  }
}
