/* =========================================================
   itteralabs — estilos base
   Tokens desde palette.scss + estrategia de marca §5
   ========================================================= */

:root {
  /* Paleta */
  --coral: #ff6259;
  --coral-hover: #f24e45;
  --coral-soft: rgba(255, 98, 89, 0.10);
  --white: #ffffff;
  --platinum: #eeeeee;
  --jet: #2c3038;
  --black: #000000;

  /* Semánticos (modo claro) */
  --bg: var(--white);
  --bg-rgb: 255, 255, 255;      /* para velos y fondos translúcidos */
  --surface: #f6f6f7;
  --text: var(--jet);
  --text-muted: #6b7079;
  --border: #e3e4e7;
  --pill-bg: var(--jet);        /* píldora activa del menú */
  --pill-text: var(--white);

  /* Tipografía */
  --font-sans: "JetBrains Mono", "Fira Code", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --font-mono: "JetBrains Mono", "Fira Code", ui-monospace, monospace;

  /* Layout */
  --container: 1200px;
  --header-h: 72px;
  --radius-pill: 999px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* Modo oscuro (Jet Black como superficie principal, §5 estrategia de marca).
   Se activa con la clase .is-dark en <html> (toggle del header, persistido). */
html.is-dark {
  --bg: var(--jet);
  --bg-rgb: 44, 48, 56;
  --surface: #363b44;
  --text: #f5f5f6;
  --text-muted: #aab0b9;
  --border: rgba(255, 255, 255, 0.14);
  --pill-bg: var(--white);
  --pill-text: var(--jet);
  color-scheme: dark;
}

/* ---------- Reset mínimo ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  transition: background-color .3s var(--ease), color .3s var(--ease);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
img, svg { display: block; max-width: 100%; }

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

/* =========================================================
   HEADER
   ========================================================= */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: rgba(var(--bg-rgb), 0.85);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s var(--ease), box-shadow .25s var(--ease);
}
.header.is-scrolled {
  border-bottom-color: var(--border);
  box-shadow: 0 1px 0 rgba(44, 48, 56, 0.02), 0 8px 24px -16px rgba(44, 48, 56, 0.18);
}

.header__inner {
  height: 100%;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
}

/* --- Logo --- */
.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  justify-self: start;
}
.logo__mark { width: 28px; height: 28px; }
.logo__mark-ink { fill: var(--text); }   /* el círculo del logo sigue al tema */
.logo__text {
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  color: var(--text);
}

/* --- Menú central (píldora) --- */
.nav { justify-self: center; }
.nav__cta { display: none; }
.nav__list {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--border);
  background: transparent;
  border-radius: var(--radius-pill);
}
.nav__link {
  display: inline-block;
  padding: 9px 20px;
  border-radius: var(--radius-pill);
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color .2s var(--ease), background-color .2s var(--ease);
}
.nav__link:hover { color: var(--text); }
.nav__link.is-active {
  color: var(--pill-text);
  background: var(--pill-bg);
}

/* --- Acciones derecha --- */
.header__actions {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 20px;
}
.header__cta {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text);
  position: relative;
}
.header__cta::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -4px;
  height: 1.5px;
  background: var(--coral);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .25s var(--ease);
}
.header__cta:hover::after { transform: scaleX(1); }

/* --- Toggle modo claro / oscuro --- */
.theme-toggle {
  width: 40px;
  height: 40px;
  display: grid;
  place-content: center;
  border-radius: 10px;
  color: var(--text);
  transition: background-color .2s var(--ease), color .2s var(--ease);
}
.theme-toggle:hover { background: var(--surface); }
.theme-toggle svg { width: 20px; height: 20px; }
.theme-toggle__sun { display: none; }
html.is-dark .theme-toggle__sun { display: block; }
html.is-dark .theme-toggle__moon { display: none; }

.burger {
  width: 40px;
  height: 40px;
  display: grid;
  place-content: center;
  gap: 6px;
  border-radius: 10px;
  transition: background-color .2s var(--ease);
}
.burger:hover { background: var(--surface); }
.burger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform .3s var(--ease), opacity .2s var(--ease);
}
.burger[aria-expanded="true"] span:first-child { transform: translateY(4px) rotate(45deg); }
.burger[aria-expanded="true"] span:last-child  { transform: translateY(-4px) rotate(-45deg); }

/* =========================================================
   HERO
   ========================================================= */
.hero {
  position: relative;
  overflow: hidden;
  padding: 64px 0 88px;
  min-height: calc(100vh - var(--header-h));
  display: flex;
  align-items: center;
}

/* Fondo: la ilustración interactiva (chip + procesos) ocupa el 100% del hero,
   anclada a la derecha. Un velo blanco de izquierda a derecha garantiza la
   legibilidad del copy y del CTA sin bloquear el hover sobre los procesos. */
.hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;           /* solo la ilustración recibe el cursor */
  overflow: hidden;
}
.hero__bg .hero__viz {
  position: absolute;
  top: 50%;
  left: 53%;
  height: 130%;
  width: auto;
  aspect-ratio: 1 / 1;
  transform: translate(-50%, -50%);
  pointer-events: auto;
  z-index: 0;
}
/* Velo lateral (legibilidad del copy) */
.hero__bg::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  /* Solo detrás de la columna de texto; a partir de la mitad la ilustración
     se ve con sus tonos reales (igual que en ia-procesos.html). */
  background: linear-gradient(90deg,
    rgba(var(--bg-rgb), 0.97) 0%,
    rgba(var(--bg-rgb), 0.95) 40%,
    rgba(var(--bg-rgb), 0.75) 52%,
    rgba(var(--bg-rgb), 0.25) 62%,
    rgba(var(--bg-rgb), 0) 72%,
    rgba(var(--bg-rgb), 0) 100%);
}
/* Fundido inferior hacia el blanco de la siguiente sección */
.hero__bg::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 120px;
  z-index: 1;
  background: linear-gradient(180deg, rgba(var(--bg-rgb), 0) 0%, var(--bg) 100%);
}

.hero__inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 640px);
  align-items: center;
  pointer-events: none;           /* deja pasar el cursor a la ilustración */
}
.hero__content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  pointer-events: auto;
}
.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--bg);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  animation: rise .6s var(--ease) both;
}
.hero__eyebrow-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--coral);
  box-shadow: 0 0 0 4px var(--coral-soft);
}

.hero__title {
  max-width: 640px;
  margin: 28px 0 0;
  font-size: clamp(1.875rem, 3.6vw, 3rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.03em;
  color: var(--text);
  text-wrap: pretty;
  animation: rise .6s .08s var(--ease) both;
}
.hero__title-accent {
  color: var(--coral);
  white-space: nowrap;            /* "cada proceso" nunca se parte en dos líneas */
}

.hero__subtitle {
  max-width: 560px;
  margin: 24px 0 0;
  font-size: clamp(1rem, 1.3vw, 1.125rem);
  line-height: 1.6;
  color: var(--text-muted);
  text-wrap: pretty;
  animation: rise .6s .16s var(--ease) both;
}

.hero__actions {
  display: flex;
  flex-direction: column;         /* nota debajo del botón */
  align-items: flex-start;
  gap: 12px;
  margin-top: 36px;
  animation: rise .6s .24s var(--ease) both;
}
.hero__note {
  padding-left: 4px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* --- Botón primario (coral = solo acción) --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 28px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 1rem;
  line-height: 1;
  transition: transform .2s var(--ease), background-color .2s var(--ease), box-shadow .2s var(--ease);
}
.btn--primary {
  background: var(--coral);
  color: var(--white);
  box-shadow: 0 10px 30px -10px rgba(255, 98, 89, 0.6);
}
.btn--primary:hover {
  background: var(--coral-hover);
  transform: translateY(-2px);
  box-shadow: 0 14px 34px -10px rgba(255, 98, 89, 0.7);
}
.btn--primary:active { transform: translateY(0); }
.btn--primary svg { transition: transform .2s var(--ease); }
.btn--primary:hover svg { transform: translateX(3px); }

/* --- Stats --- */
.hero__stats {
  display: flex;
  gap: 40px;
  margin-top: 48px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
  animation: rise .6s .32s var(--ease) both;
}
.hero__stats li {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}
.hero__stat-value {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.02em;
}
.hero__stat-value small {
  font-size: 0.9rem;
  color: var(--text-muted);
}
.hero__stat-label {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero__eyebrow, .hero__title, .hero__subtitle, .hero__actions, .hero__stats { animation: none; }
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 960px) {
  .header__inner {
    grid-template-columns: auto 1fr;
  }
  .header__cta { display: none; }

  /* Menú desplegable móvil */
  .nav {
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    width: 100%;
    padding: 12px 24px 24px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 16px 32px -20px rgba(44, 48, 56, 0.25);
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    transition: transform .3s var(--ease), opacity .25s var(--ease), visibility 0s .3s;
  }
  .nav.is-open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    transition: transform .3s var(--ease), opacity .25s var(--ease), visibility 0s;
  }
  .nav__list {
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 6px;
    border-radius: 18px;
  }
  .nav__link {
    display: block;
    padding: 12px 18px;
    border-radius: 12px;
    font-size: 1rem;
  }
  .nav__cta {
    display: flex;
    justify-content: center;
    margin-top: 12px;
    padding: 14px 20px;
    border-radius: 14px;
    background: var(--coral);
    color: var(--white);
    font-weight: 600;
  }
  body.nav-locked { overflow: hidden; }

  .hero { padding: 48px 0 72px; min-height: 0; }
  .hero__inner { grid-template-columns: 1fr; gap: 32px; }
  .hero__content { align-items: center; text-align: center; }
  .hero__actions { align-items: center; }
  .hero__note { padding-left: 0; }
  .hero__stats { gap: 24px; flex-wrap: wrap; justify-content: center; }
  .hero__stats li { align-items: center; }
  .hero__bg .hero__viz {
    top: -6%;
    left: 50%;
    width: 130%;
    height: auto;
    transform: translateX(-50%);
  }
  .hero__bg::before {
    background: linear-gradient(180deg,
      rgba(var(--bg-rgb), 0.72) 0%,
      rgba(var(--bg-rgb), 0.93) 32%,
      rgba(var(--bg-rgb), 0.985) 100%);
  }
  .hero__inner { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .container { padding-inline: 20px; }
  .hero__eyebrow { font-size: 0.6875rem; padding: 7px 12px 7px 10px; }
  .hero__eyebrow-extra { display: none; }
  .hero__stats { flex-direction: column; gap: 20px; }
  .btn { width: 100%; justify-content: center; }
  .hero__actions { width: 100%; }
  .hero__bg .hero__viz { width: 170%; top: -4%; }
}
