/*
 * =========================================================================
 * DESIGN TOKENS — Anfibia Lab
 * =========================================================================
 * Capa de "atoms" (Atomic Design): primitivos de color, tipografía y forma.
 * Todo el resto de la hoja de estilos consume estas variables; ningún
 * color de marca queda escrito "a mano" fuera de este bloque.
 *
 * Paleta de marca (fija por brief):
 *   Primario  (cian)    #10C2D8
 *   Secundario (verde)  #57941A
 *   Acento (magenta)    #A32EAA
 *   Base neutra ("negros" del sistema) #F8F8F8
 *
 * Cada color de marca incluye, además del tono "crudo" (para superficies,
 * iconografía y texto grande ≥ 24px), una variante "-700" u "-onDark"
 * verificada contra WCAG 2.1 AA (contraste ≥ 4.5:1 para texto normal,
 * ≥ 3:1 para texto grande/componentes UI). Todas las combinaciones usadas
 * en este archivo fueron calculadas y verificadas antes de aplicarlas.
 * =========================================================================
 */
:root {
  /* ---- Marca: primario (cian) -------------------------------------- */
  --color-primary: #10C2D8;        /* superficies, iconos, texto grande (≥24px) */
  --color-primary-600: #0DA3B5;    /* uso UI no textual sobre fondo claro (AA 3:1) */
  --color-primary-700: #0B808F;    /* texto pequeño sobre fondo claro (AA 4.5:1) */

  /* ---- Marca: secundario (verde) ------------------------------------ */
  --color-secondary: #57941A;      /* superficies, iconos, texto grande (≥24px) */
  --color-secondary-700: #4D8217;  /* texto pequeño sobre fondo claro (AA 4.65:1) */
  --color-secondary-onDark: #649D2C; /* texto pequeño sobre fondo oscuro (AA 5.6:1) */

  /* ---- Marca: acento (magenta) --------------------------------------
     #A32EAA ya cumple AA de texto normal sobre blanco (5.95:1); no
     necesita una variante "segura" adicional para uso en claro. */
  --color-accent: #A32EAA;
  --color-accent-onDark: #B75CBD;  /* texto pequeño sobre fondo oscuro (AA 4.63:1) */

  /* ---- Neutros ("negros" del sistema, según brief) ------------------
     #F8F8F8 es la superficie base solicitada. El resto de la escala se
     deriva en gris neutro estándar (sin tinte de marca) para que el
     contraste de texto sea predecible y auditable. */
  --color-neutral-0: #FFFFFF;
  --color-neutral-50: #F8F8F8;     /* superficie base del sitio */
  --color-neutral-100: #EDEDED;    /* superficie secundaria / bordes sutiles */
  --color-neutral-400: #9A9A9A;    /* bordes / elementos UI de baja énfasis */
  --color-neutral-600: #5C5C5C;    /* texto secundario (AA 6.7:1 sobre blanco) */
  --color-neutral-900: #141414;    /* texto principal y superficies oscuras (AA 17:1) */

  /* ---- Feedback del sistema (semántico, estándar WCAG AA) -----------
     Convención habitual de un design system: tono "-on" para texto/ícono
     sobre superficie clara y "-bg" como fondo suave a juego. */
  --color-success: #1E7B34;
  --color-success-bg: #E7F5EA;
  --color-warning: #8A5A00;
  --color-warning-bg: #FCEFD8;
  --color-danger: #C4281B;
  --color-danger-bg: #FBE7E5;
  --color-info: #0B6FA8;
  --color-info-bg: #E3F1FA;

  /* ---- Alias semánticos --------------------------------------------
     Mantienen los nombres que ya usa el resto de la hoja de estilos
     (capa de "molecules/organisms") apuntando a los primitivos de
     arriba, para que un futuro cambio de marca solo toque este bloque. */
  --paper: var(--color-neutral-50);
  --paper-soft: var(--color-neutral-100);
  --paper-bright: var(--color-neutral-0);
  --ink: var(--color-neutral-900);
  --ink-soft: var(--color-neutral-600);
  --deep: var(--color-neutral-900);
  --green: var(--color-secondary);
  --green-safe: var(--color-secondary-700);   /* texto pequeño sobre claro */
  --lime: var(--color-secondary);
  --cyan: var(--color-primary);
  --cyan-ui: var(--color-primary-600);        /* foco / bordes / iconos UI */
  --cyan-safe: var(--color-primary-700);      /* texto pequeño sobre claro */
  --violet: var(--color-accent);
  --line: rgba(20, 20, 20, 0.12);

  --card-radius: 24px;
  --shell: min(1180px, calc(100vw - 64px));
  --ease: cubic-bezier(0.2, 0.75, 0.25, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  background: var(--paper);
  color: var(--ink);
  /* FIX: la hoja cargaba Montserrat (link de Google Fonts en el <head>)
     pero nunca la declaraba aquí — se descargaba y no se usaba. Además
     "Sans" no es un nombre de familia válido (no es una tipografía real
     ni una palabra clave genérica de CSS). */
  font-family: "Montserrat", "Avenir Next", Arial, sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

body.menu-open {
  overflow: hidden;
}

::selection {
  color: white;
  background: var(--violet);
}

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

button {
  color: inherit;
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

svg,
img {
  display: block;
  max-width: 100%;
}

h1,
h2,
h3,
p,
ul {
  margin: 0;
}

ul {
  padding: 0;
  list-style: none;
}

:focus-visible {
  /* var(--cyan-ui): variante AA (3:1) para contraste no-textual, ya que
     el tono de marca crudo (2.16:1) no cumple WCAG 1.4.11 sobre claro. */
  outline: 3px solid var(--cyan-ui);
  outline-offset: 4px;
}

.skip-link {
  position: fixed;
  z-index: 300;
  top: 10px;
  left: 10px;
  padding: 11px 17px;
  transform: translateY(-150%);
  border-radius: 999px;
  background: var(--deep);
  color: white;
  font-size: 0.8rem;
  font-weight: 700;
  transition: transform 180ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.section-shell {
  width: var(--shell);
  margin-inline: auto;
}

.screen {
  position: relative;
}

.scroll-progress {
  position: fixed;
  z-index: 220;
  inset: 0 0 auto;
  height: 3px;
  pointer-events: none;
}

.scroll-progress span {
  display: block;
  width: 100%;
  height: 100%;
  transform: scaleX(0);
  transform-origin: left;
  background: linear-gradient(90deg, var(--cyan), var(--lime), var(--violet));
}

.site-header {
  position: fixed;
  z-index: 200;
  top: 0;
  right: 0;
  left: 0;
  padding-top: 14px;
  transition: padding 240ms var(--ease);
}

.header-inner {
  width: var(--shell);
  min-height: 66px;
  margin-inline: auto;
  padding: 0 9px 0 15px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 28px;
  border: 1px solid transparent;
  border-radius: 100px;
  transition:
    min-height 240ms var(--ease),
    background 240ms ease,
    border-color 240ms ease,
    box-shadow 240ms ease;
}

.site-header.is-scrolled {
  padding-top: 8px;
}

.site-header.is-scrolled .header-inner {
  min-height: 58px;
  border-color: rgba(20, 20, 20, 0.1);
  background: rgba(248, 248, 248, 0.95);
  box-shadow: 0 10px 35px rgba(20, 20, 20, 0.08);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  width: fit-content;
}

/*
 * FIX (logotipo mal posicionado en header/footer): la versión anterior
 * envolvía el PNG en un <svg><image></svg> con un viewBox recortado a
 * mano (746 300 860 220) sobre un tamaño de imagen declarado (1672×941)
 * que no correspondía al archivo real (anfibia.png mide 1520×305). El
 * navegador forzaba el raster a esas medidas y luego recortaba una
 * ventana arbitraria de ese lienzo deformado: el logo se veía estirado
 * y mal encuadrado. Se reemplaza por un <img> simple, con las
 * proporciones reales del archivo, que es además más liviano, más
 * accesible (alt real en vez de <title> dentro de un SVG) y más
 * estándar que el truco de SVG+viewBox.
 */
.brand-logo {
  display: block;
  flex: 0 0 auto;
  width: 100%;
  height: auto;
  transition: opacity 200ms ease;
  /* Difumina levemente el borde del PNG contra el fondo claro. */
  mix-blend-mode: darken;
}

.brand:hover .brand-logo {
  opacity: 0.78;
}

.brand-logo--header {
  width: 232px;
}

.primary-nav {
  display: flex;
  justify-content: center;
  gap: 34px;
}

.primary-nav a {
  position: relative;
  padding: 8px 0;
  color: var(--ink-soft);
  font-size: 0.76rem;
  font-weight: 600;
}

.primary-nav a::after {
  position: absolute;
  right: 0;
  bottom: 2px;
  left: 0;
  height: 1px;
  content: "";
  transform: scaleX(0);
  transform-origin: right;
  background: var(--cyan);
  transition: transform 220ms var(--ease);
}

.primary-nav a:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

.menu-toggle {
  display: none;
}

.button {
  min-height: 50px;
  padding: 0 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 17px;
  border: 1px solid var(--deep);
  border-radius: 999px;
  background: transparent;
  color: var(--deep);
  font-size: 0.82rem;
  font-weight: 700;
  transition:
    transform 220ms var(--ease),
    background 220ms ease,
    border-color 220ms ease,
    color 220ms ease;
}

.button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 220ms var(--ease);
}

.button:hover {
  transform: translateY(-2px);
}

.button:hover svg {
  transform: translate(2px, -2px);
}

.button-primary,
.button-small {
  background: var(--deep);
  color: white;
}

.button-primary:hover,
.button-small:hover {
  border-color: var(--cyan);
  background: var(--cyan);
  color: var(--deep);
}

.button-small {
  min-height: 42px;
  padding-inline: 18px;
}

.hero {
  /* FIX: la declaración original ("background-image: ./bg.png;") era
     CSS inválido (sin url(), sin comillas) y apuntaba a un archivo que
     no existe en el proyecto; el navegador la descartaba en silencio.
     Se retira: el fondo hereda var(--paper) del body. */
  min-height: min(820px, 100svh);
  padding: 116px 0 50px;
  display: grid;
  align-items: center;
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(390px, 0.92fr);
  align-items: center;
  gap: clamp(24px, 4vw, 66px);
}

.hero-copy {
  position: relative;
  z-index: 3;
}

.eyebrow,
.section-tag {
  display: flex;
  align-items: center;
  gap: 11px;
  /* var(--green-safe): texto pequeño en mayúsculas necesita AA 4.5:1 */
  color: var(--green-safe);
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.eyebrow::before,
.section-tag::before {
  width: 29px;
  height: 1px;
  content: "";
  background: var(--cyan);
}

.hero h1 {
  max-width: 710px;
  margin-top: 24px;
  font-size: clamp(3.35rem, 5.6vw, 5.6rem);
  font-weight: 600;
  /* FIX: unidad inválida ("au7em"); el navegador descartaba toda la
     declaración y el titular perdía el tracking ajustado. */
  letter-spacing: -0.06em;
  line-height: 0.98;
}

.hero h1 em {
  display: inline;
  color: var(--violet);
  font-style: normal;
}

.hero h1 em:last-child {
  color: var(--violet);
}

.hero-lead {
  max-width: 620px;
  margin-top: 25px;
  color: var(--ink-soft);
  font-size: clamp(1rem, 1.3vw, 1.14rem);
  font-weight: 400;
  line-height: 1.65;
}

.hero-actions {
  margin-top: 29px;
  display: flex;
  align-items: center;
  gap: 27px;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  font-size: 0.8rem;
  font-weight: 700;
}

.text-link span {
  /* var(--cyan-safe): es texto pequeño (AA 4.5:1) */
  color: var(--cyan-safe);
}

.hero-logic {
  margin-top: 38px;
  padding-top: 18px;
  display: flex;
  align-items: center;
  gap: 13px;
  border-top: 1px solid var(--line);
}

.hero-logic span {
  color: var(--ink-soft);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.hero-logic i {
  width: 25px;
  height: 1px;
  background: linear-gradient(90deg, var(--cyan), var(--violet));
}

.hero-visual {
  position: relative;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}

.hero-mark {
  /* Proporción real de anfibia-brand.png (1492×1317). El viewBox de SVG
     original ("96 132 646 612", con la imagen forzada a 1672×941) no
     correspondía a este archivo y recortaba el isotipo de forma
     incorrecta; ver también la nota sobre .brand-logo más arriba. */
  position: relative;
  z-index: 2;
  width: min(100%, 560px);
  height: auto;
  aspect-ratio: 1492 / 1317;
  mix-blend-mode: darken;
}

.orbit {
  position: absolute;
  z-index: 1;
  border: 1px solid rgba(20, 20, 20, 0.12);
  border-radius: 50%;
  pointer-events: none;
}

.orbit::after {
  position: absolute;
  width: 7px;
  height: 7px;
  content: "";
  border: 3px solid var(--paper);
  border-radius: 50%;
  background: var(--cyan);
}

.orbit-a {
  width: 91%;
  height: 91%;
  animation: orbit 24s linear infinite;
}

.orbit-a::after {
  top: 20%;
  right: 4%;
}

.orbit-b {
  width: 70%;
  height: 70%;
  border-style: dashed;
  animation: orbit-back 29s linear infinite;
}

.orbit-b::after {
  bottom: 8%;
  left: 17%;
  background: var(--violet);
}

.visual-label {
  position: absolute;
  z-index: 4;
  min-width: 130px;
  padding: 12px 15px;
  border: 1px solid rgba(20, 20, 20, 0.11);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 12px 30px rgba(20, 20, 20, 0.09);
}

.visual-label span,
.visual-label strong {
  display: block;
}

.visual-label span {
  color: var(--ink-soft);
  font-size: 0.56rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.visual-label strong {
  margin-top: 2px;
  font-size: 0.75rem;
}

.label-one {
  top: 20%;
  left: -1%;
}

.label-two {
  right: 35%;
  bottom: 1%;
}

.label-three {
  right: -6%;
  bottom: 60%;
}


.value {
  padding: 96px 0 86px;
  background: var(--paper);
}

.value-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(310px, 0.75fr);
  gap: clamp(55px, 8vw, 120px);
  align-items: end;
}

.value h2 {
  max-width: 760px;
  margin-top: 13px;
  font-size: clamp(2.55rem, 4.4vw, 4.75rem);
  font-weight: 600;
  letter-spacing: -0.055em;
  line-height: 1.03;
}

.value h2 span {
  color: var(--green);
  font-weight: 400;
}

.value-copy > p:first-child {
  color: var(--ink);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.75;
}

.value-statement {
  margin-top: 25px;
  padding: 18px 0 0 20px;
  border-top: 1px solid var(--line);
  border-left: 3px solid var(--violet);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.55;
}

.value-principles {
  margin-top: 66px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
}

.value-principle {
  min-height: 140px;
  padding: 26px 30px 12px 0;
}

.value-principle + .value-principle {
  padding-left: 30px;
  border-left: 1px solid var(--line);
}

.value-principle span {
  font-size: 0.82rem;
  font-weight: 700;
}

.value-principle p {
  max-width: 310px;
  margin-top: 17px;
  color: var(--ink-soft);
  font-size: 0.86rem;
  font-weight: 400;
  line-height: 1.6;
}

.core {
  min-height: 820px;
  padding: 88px 0;
  display: flex;
  align-items: center;
  background: var(--paper-bright);
}

.section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 55px;
  align-items: end;
}

.section-head h2 {
  margin-top: 13px;
  font-size: clamp(2.55rem, 4vw, 4.25rem);
  font-weight: 600;
  letter-spacing: -0.055em;
  line-height: 1;
}

.section-head h2 span {
  color: var(--violet);
  font-weight: 400;
}

.section-summary {
  color: var(--ink-soft);
  font-size: 0.92rem;
  font-weight: 400;
  line-height: 1.7;
}

.service-grid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--card-radius);
  background: var(--paper-bright);
}

.service-card {
  min-height: 252px;
  padding: 24px 26px;
  transition:
    background 260ms ease,
    color 260ms ease;
}

.service-card + .service-card {
  border-left: 1px solid var(--line);
}

.service-card:hover {
  background: var(--deep);
  color: white;
}

.service-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  /* var(--cyan-safe): numeración en texto pequeño necesita AA 4.5:1 */
  color: var(--cyan-safe);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.service-meta i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.service-meta .cyan {
  background: var(--cyan);
}

.service-meta .green {
  background: var(--lime);
}

.service-meta .violet {
  background: var(--violet);
}

.service-card h3 {
  margin-top: 23px;
  font-size: clamp(1.55rem, 2.3vw, 2.35rem);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.1;
}

.service-card > p {
  max-width: 325px;
  margin-top: 11px;
  color: var(--ink-soft);
  font-size: 0.8rem;
  font-weight: 400;
  line-height: 1.55;
  transition: color 260ms ease;
}

.service-card:hover > p {
  color: rgba(255, 255, 255, 0.72);
}

.service-card ul {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.service-card li {
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  /* var(--green-safe): etiqueta en texto muy pequeño necesita AA 4.5:1 */
  color: var(--green-safe);
  font-size: 0.57rem;
  font-weight: 700;
  text-transform: uppercase;
}

.service-card:hover li {
  border-color: rgba(255, 255, 255, 0.18);
  color: var(--cyan);
}

.core-tools {
  margin-top: 39px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.method-panel {
  min-height: 216px;
  padding: 22px 25px;
  border: 1px solid var(--line);
  border-radius: var(--card-radius);
  background: var(--paper-bright);
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
}

.micro-label {
  /* FIX: el valor original (#f8f8f8, casi blanco) se usaba también sobre
     fondos claros (.method-panel, .contact-card), dejando el texto
     prácticamente invisible (contraste ~1:1). Por defecto ahora usa un
     tono oscuro AA-seguro; los usos sobre fondo oscuro se sobrescriben
     explícitamente más abajo (.habitat-panel, .lab-card). */
  color: var(--ink-soft);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.panel-head h3 {
  margin-top: 5px;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.025em;
}

.panel-number {
  color: var(--green);
  font-size: 1.8rem;
  font-weight: 300;
  line-height: 1;
}

.method-tabs {
  margin-top: 23px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  border-block: 1px solid var(--line);
}

.method-tabs button {
  min-height: 47px;
  padding: 0 9px;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
  color: var(--ink-soft);
  font-size: 0.95rem;
  font-weight: 600;
  transition:
    background 180ms ease,
    color 180ms ease;
}

.method-tabs button:last-child {
  border-right: 0;
}

.method-tabs button:hover,
.method-tabs button[aria-selected="true"] {
  background: var(--deep);
  color: white;
}

.panel-output {
  margin-top: 16px;
  color: var(--ink-soft);
  font-size: 0.95rem;
  font-weight: 500;
}

.contexts {
  padding: 92px 0 98px;
  overflow: hidden;
  background: var(--paper);
}

.context-explorer {
  /* Valores iniciales = rubro "Salud" (activo por defecto). app.js
     actualiza los tres al cambiar de pestaña.
       --context-accent      → texto/indicador sobre fondo claro (menú, AA 4.5:1)
       --context-accent-dark → texto/indicador sobre fondo oscuro (panel, AA 4.5:1)
       --context-accent-soft → resplandor decorativo (no es texto, sin requisito AA) */
  --context-accent: var(--cyan-safe);
  --context-accent-dark: var(--cyan);
  --context-accent-soft: rgba(16, 194, 216, 0.24);
  margin-top: 42px;
  display: grid;
  grid-template-columns: 240px 1fr;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--card-radius);
  background: var(--paper-bright);
  box-shadow: 0 20px 55px rgba(20, 20, 20, 0.06);
}

.context-menu {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: var(--paper-bright);
}

.context-menu button {
  position: relative;
  min-height: 62px;
  padding: 0 21px;
  display: flex;
  align-items: center;
  gap: 14px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  text-align: left;
  font-size: 0.76rem;
  font-weight: 600;
  transition:
    padding 260ms var(--ease),
    background 200ms ease,
    color 200ms ease;
}

.context-menu button:last-child {
  border-bottom: 0;
}

.context-menu button::after {
  position: absolute;
  top: 0;
  right: -1px;
  bottom: 0;
  width: 3px;
  content: "";
  transform: scaleY(0);
  background: var(--context-accent);
  transition: transform 260ms var(--ease);
}

.context-menu button:hover,
.context-menu button[aria-selected="true"] {
  padding-left: 27px;
}

.context-menu button:hover {
  background: var(--paper-soft);
  color: var(--ink);
}

.context-menu button[aria-selected="true"] {
  background: var(--deep);
  color: white;
}

.context-menu button[aria-selected="true"]::after {
  transform: scaleY(1);
}

.context-menu button span {
  color: var(--context-accent);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.habitat-panel {
  position: relative;
  min-height: 372px;
  padding: 31px 36px 30px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.025), transparent 46%),
    radial-gradient(circle at 85% 85%, var(--context-accent-soft), transparent 36%),
    var(--deep);
  color: white;
  isolation: isolate;
}

.context-aura {
  position: absolute;
  z-index: -1;
  right: -80px;
  bottom: -150px;
  width: 390px;
  height: 390px;
  /* var(--context-accent-dark): esta forma vive sobre el fondo oscuro
     del panel, no sobre el menú claro. */
  border: 1px solid var(--context-accent-dark);
  border-radius: 43% 57% 62% 38% / 61% 39% 61% 39%;
  opacity: 0.42;
  transform: rotate(12deg);
  transition:
    border-radius 600ms var(--ease),
    transform 600ms var(--ease),
    border-color 300ms ease;
}

.context-aura::after {
  position: absolute;
  inset: 66px;
  content: "";
  border: 1px solid var(--context-accent-dark);
  border-radius: 62% 38% 39% 61% / 47% 63% 37% 53%;
  opacity: 0.52;
}

.habitat-panel.is-changing .context-aura {
  border-radius: 67% 33% 48% 52% / 36% 64% 36% 64%;
  transform: rotate(-15deg) scale(0.94);
}

.context-large-word {
  position: absolute;
  z-index: -1;
  right: -0.04em;
  bottom: -0.17em;
  color: transparent;
  font-size: clamp(5rem, 10vw, 9rem);
  font-weight: 800;
  letter-spacing: -0.08em;
  line-height: 0.9;
  -webkit-text-stroke: 1px rgba(255, 255, 255, 0.08);
  transition: opacity 160ms ease;
}

.habitat-head {
  display: flex;
  justify-content: space-between;
  gap: 28px;
  color: var(--context-accent-dark);
}

.habitat-head p {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.habitat-head span {
  color: rgba(255, 255, 255, 0.48);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.1em;
}

.habitat-grid {
  max-width: 750px;
  margin-top: 69px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 55px;
  transition: opacity 160ms ease;
}

.habitat-panel .micro-label {
  /* var(--context-accent-dark): variante AA verificada contra el fondo
     oscuro del panel (var(--context-accent), pensada para fondo claro,
     no garantiza 4.5:1 aquí). */
  color: var(--context-accent-dark);
}

.habitat-grid p {
  margin-top: 12px;
  color: rgba(255, 255, 255, 0.84);
  font-size: 0.96rem;
  font-weight: 400;
  line-height: 1.6;
}

.habitat-panel.is-changing .context-large-word,
.habitat-panel.is-changing .habitat-grid {
  opacity: 0.14;
}

.context-meter {
  position: absolute;
  right: 36px;
  bottom: 28px;
  left: 36px;
  display: flex;
  align-items: center;
  gap: 13px;
}

.context-meter span {
  color: rgba(255, 255, 255, 0.43);
  font-size: 0.55rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.context-meter > div {
  height: 1px;
  flex: 1;
  background: rgba(255, 255, 255, 0.14);
}

.context-meter i {
  width: 58%;
  height: 100%;
  display: block;
  background: var(--context-accent-dark);
  transition: width 450ms var(--ease);
}

.proof {
  min-height: 900px;
  padding: 82px 0 72px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: var(--paper-bright);
}

.project-grid {
  margin-top: 34px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.project-card {
  position: relative;
  min-height: 240px;
  padding: 26px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--card-radius);
  background: var(--paper-bright);
  transition:
    transform 260ms var(--ease),
    box-shadow 260ms ease;
}

.project-card::before {
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  content: "";
  background: var(--project-color);
}

.project-card::after {
  position: absolute;
  right: -55px;
  bottom: -90px;
  width: 170px;
  height: 190px;
  content: "";
  border: 1px solid var(--project-color);
  border-radius: 61% 39% 55% 45% / 42% 60% 40% 58%;
  opacity: 0.17;
  /* --blob-parallax: fijada por app.js vía data-parallax-blob en el
     .project-card padre (una custom property hereda a sus pseudo-
     elementos); 0px si no hay JS o el usuario prefiere menos movimiento. */
  transform: rotate(15deg) translate3d(0, var(--blob-parallax, 0px), 0);
}

.project-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 18px 42px rgba(20, 20, 20, 0.1);
}

.project-cyan {
  --project-color: var(--cyan);
}

.project-green {
  --project-color: var(--lime);
}

.project-violet {
  --project-color: var(--violet);
}

.project-type {
  /* var(--green-safe): etiqueta en texto muy pequeño necesita AA 4.5:1 */
  color: var(--green-safe);
  font-size: 0.59rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.project-card h3 {
  position: relative;
  z-index: 1;
  max-width: 310px;
  margin-top: 27px;
  font-size: clamp(1.3rem, 1.9vw, 1.85rem);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.17;
}

.project-card p {
  position: relative;
  z-index: 1;
  margin-top: 21px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  /* font-size: 0.71rem; */
  font-weight: 400;
  line-height: 1.5;
}

.project-card p strong {
  color: var(--ink);
  font-weight: 700;
}

.closing-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 14px;
}

.lab-card,
.contact-card {
  min-height: 224px;
  padding: 27px 30px;
  border: 1px solid var(--line);
  border-radius: var(--card-radius);
  margin-top: 24px;
}

.lab-card {
  background: var(--violet);
  color: var(--color-neutral-0);
}

.lab-card .micro-label {
  /* Blanco sobre magenta de marca: AA 5.95:1. El valor heredado de
     .micro-label (ahora oscuro, pensado para fondo claro) no serviría aquí. */
  color: var(--color-neutral-0);
}

.lab-card h3,
.contact-card h3 {
  margin-top: 10px;
  font-size: clamp(1.45rem, 2.35vw, 2.35rem);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.1;
}

.lab-card p,
.contact-card p {
  margin-top: 11px;
  color: rgba(255, 255, 255, 0.66);
  /* font-size: 0.76rem; */
  font-weight: 400;
}

.lab-sequence {
  margin-top: 22px;
  display: flex;
  align-items: center;
  gap: 9px;
}

.lab-sequence span {
  font-size: 0.52rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lab-sequence i {
  width: 17px;
  height: 1px;
  background: var(--violet);
}

.contact-card {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 95% 115%, rgba(163, 46, 170, 0.23), transparent 17rem),
    radial-gradient(circle at 82% 0%, rgba(16, 194, 216, 0.11), transparent 14rem),
    var(--paper-bright);
}

.contact-card::after {
  position: absolute;
  right: -100px;
  bottom: -160px;
  width: 270px;
  height: 270px;
  content: "";
  border: 34px solid transparent;
  border-radius: 53% 47% 61% 39% / 44% 58% 42% 56%;
  background:
    linear-gradient(var(--paper-bright), var(--paper-bright)) padding-box,
    linear-gradient(135deg, var(--cyan), var(--green), var(--violet)) border-box;
  opacity: 0.62;
  transform: rotate(18deg) translate3d(0, var(--blob-parallax, 0px), 0);
}

.contact-card h3,
.contact-card p,
.contact-card .button,
.contact-card .micro-label {
  position: relative;
  z-index: 2;
}

.contact-card p {
  color: var(--ink-soft);
}

.contact-card .button {
  min-height: 42px;
  margin-top: 19px;
}

.site-footer {
  padding: 28px 0;
  border-top: 1px solid var(--line);
  background: var(--paper);
}

.footer-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 42px;
}

.brand-logo--footer {
  width: 195px;
}

.footer-inner p {
  color: var(--ink-soft);
  font-size: 0.7rem;
  font-weight: 400;
}

.footer-inner > span {
  color: var(--ink-soft);
  font-size: 0.61rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/*
 * =========================================================================
 * FEEDBACK DEL SISTEMA (atoms) — success / warning / danger / info
 * =========================================================================
 * El sitio actual no tiene formularios ni notificaciones, por lo que
 * estas clases no se usan todavía en ninguna sección; se dejan listas
 * como base reutilizable (mensajes de formulario, estados de envío,
 * avisos), ya verificadas contra WCAG 2.1 AA (texto ≥ 4.5:1 sobre su
 * propio fondo "-bg" y sobre var(--paper-bright)).
 * =========================================================================
 */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
}

.badge-success {
  background: var(--color-success-bg);
  color: var(--color-success);
}

.badge-warning {
  background: var(--color-warning-bg);
  color: var(--color-warning);
}

.badge-danger {
  background: var(--color-danger-bg);
  color: var(--color-danger);
}

.badge-info {
  background: var(--color-info-bg);
  color: var(--color-info);
}

/*
 * =========================================================================
 * SCROLL EFFECTS — reveal (entrada al hacer scroll) + parallax
 * =========================================================================
 * Reveal: variantes sobre el mismo mecanismo original (IntersectionObserver
 * en app.js agrega ".is-visible"; aquí solo se define el estado inicial y
 * el final de cada variante). ".reveal" sigue siendo la base (fundido +
 * desplazamiento vertical); ".reveal-scale/-left/-right" son modificadores
 * opcionales que se agregan junto a ".reveal" en el HTML.
 *
 * Parallax: capas decorativas (isotipo del hero, palabra gigante del panel
 * de "Contextos", manchas de las tarjetas) se mueven a una fracción de la
 * velocidad del scroll mediante la variable --parallax-y / --blob-parallax,
 * que app.js actualiza en cada frame. Sin JS o con
 * prefers-reduced-motion, la variable nunca se define y el valor por
 * defecto (0px) la deja inmóvil — no se necesita CSS adicional para el
 * caso reducido.
 * =========================================================================
 */
.reveal {
  opacity: 1;
  transform: none;
}

.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 620ms var(--ease),
    transform 620ms var(--ease);
}

/* Variante "pop": para tarjetas y paneles (en vez de solo desplazarse,
   entran desde una escala levemente menor). Se usa junto a ".reveal". */
.js .reveal-scale {
  transform: scale(0.94);
}

/* Variantes direccionales: para pares de columnas (texto vs. copy). */
.js .reveal-left {
  transform: translateX(-28px);
}

.js .reveal-right {
  transform: translateX(28px);
}

.reveal-delay-1 {
  transition-delay: 70ms !important;
}

.reveal-delay-2 {
  transition-delay: 140ms !important;
}

.reveal-delay-3 {
  transition-delay: 210ms !important;
}

.js .reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.js .reveal-scale.is-visible {
  transform: scale(1);
}

.js .reveal-left.is-visible,
.js .reveal-right.is-visible {
  transform: translateX(0);
}

/* ---- Parallax: capas independientes del scroll, ver app.js ----
   Nota: no se aplica a .hero-visual (el contenedor) porque ese elemento
   ya usa "transform" para su propia animación de entrada (.reveal); dos
   mecanismos no pueden animar la misma propiedad en el mismo elemento
   sin pisarse. El movimiento de parallax vive en su hijo .hero-mark,
   que no tiene reveal propio. */
.hero-mark,
.context-large-word {
  transform: translate3d(0, var(--parallax-y, 0px), 0);
}

.hero-mark {
  will-change: transform;
}

@keyframes orbit {
  to {
    transform: rotate(360deg);
  }
}

@keyframes orbit-back {
  to {
    transform: rotate(-360deg);
  }
}

@media (max-width: 980px) {
  :root {
    --shell: min(100% - 42px, 820px);
  }

  .hero {
    min-height: auto;
    padding-top: 125px;
    padding-bottom: 65px;
  }

  .hero-grid {
    grid-template-columns: 1fr;
  }

  .hero-copy {
    max-width: 760px;
  }

  .hero-visual {
    width: min(600px, 88vw);
    margin: -25px auto 0;
  }

  .value,
  .core,
  .contexts,
  .proof {
    min-height: auto;
    padding-block: 78px;
  }

  .value-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .value-copy {
    max-width: 630px;
  }

  .value-principles {
    margin-top: 50px;
  }

  .section-head {
    grid-template-columns: 1fr;
    gap: 19px;
  }

  .section-summary {
    max-width: 600px;
  }

  .service-card {
    padding-inline: 22px;
  }

  .core-tools {
    grid-template-columns: 1fr;
  }

  .context-explorer {
    grid-template-columns: 205px 1fr;
  }

  .closing-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 760px) {
  :root {
    --shell: min(100% - 30px, 620px);
  }

  .header-inner {
    grid-template-columns: auto 1fr auto;
  }

  .brand-logo--header {
    width: 185px;
  }

  .header-cta {
    display: none;
  }

  .menu-toggle {
    z-index: 4;
    width: 42px;
    height: 42px;
    padding: 0;
    display: grid;
    grid-column: 3;
    place-content: center;
    gap: 6px;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: var(--paper);
  }

  .menu-toggle span {
    width: 17px;
    height: 1.5px;
    display: block;
    background: var(--ink);
    transition: transform 220ms var(--ease);
  }

  .menu-toggle[aria-expanded="true"] span:first-child {
    transform: translateY(3.75px) rotate(45deg);
  }

  .menu-toggle[aria-expanded="true"] span:last-child {
    transform: translateY(-3.75px) rotate(-45deg);
  }

  .primary-nav {
    position: fixed;
    z-index: 3;
    inset: 0;
    padding: 110px 24px 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    visibility: hidden;
    background:
      radial-gradient(circle at 80% 20%, rgba(16, 194, 216, 0.15), transparent 18rem),
      var(--paper);
    opacity: 0;
    transform: translateY(-15px);
    transition:
      opacity 220ms ease,
      transform 250ms var(--ease),
      visibility 0s 250ms;
  }

  .primary-nav.is-open {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0s;
  }

  .primary-nav a {
    font-size: 2rem;
    font-weight: 500;
    letter-spacing: -0.04em;
  }

  .hero h1 {
    font-size: clamp(3rem, 11vw, 4.5rem);
  }

  .service-grid {
    grid-template-columns: 1fr;
  }

  .service-card {
    min-height: auto;
  }

  .service-card + .service-card {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .value-principles {
    grid-template-columns: 1fr;
  }

  .value-principle {
    min-height: auto;
    padding: 24px 0;
  }

  .value-principle + .value-principle {
    padding-left: 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .value-principle p {
    margin-top: 10px;
  }

  .method-tabs {
    overflow-x: auto;
    grid-template-columns: repeat(5, minmax(110px, 1fr));
    scrollbar-width: none;
  }

  .method-tabs::-webkit-scrollbar {
    display: none;
  }

  .context-explorer {
    grid-template-columns: 1fr;
  }

  .context-menu {
    overflow-x: auto;
    flex-direction: row;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    scrollbar-width: none;
  }

  .context-menu::-webkit-scrollbar {
    display: none;
  }

  .context-menu button {
    min-width: 145px;
    min-height: 58px;
    border-right: 1px solid var(--line);
    border-bottom: 0;
  }

  .context-menu button::after {
    top: auto;
    right: 0;
    bottom: -1px;
    left: 0;
    width: auto;
    height: 3px;
    transform: scaleX(0);
  }

  .context-menu button[aria-selected="true"]::after {
    transform: scaleX(1);
  }

  .habitat-panel {
    min-height: 410px;
  }

  .project-grid {
    grid-template-columns: 1fr;
  }

  .project-card {
    min-height: 215px;
  }

  .closing-grid {
    grid-template-columns: 1fr;
  }

  .footer-inner {
    grid-template-columns: 1fr auto;
  }

  .footer-inner p {
    display: none;
  }
}

@media (max-width: 480px) {
  :root {
    --shell: calc(100% - 26px);
  }

  html {
    scroll-padding-top: 75px;
  }

  .site-header {
    padding-top: 7px;
  }

  .header-inner,
  .site-header.is-scrolled .header-inner {
    min-height: 56px;
    padding-left: 10px;
  }

  .brand-logo--header {
    width: 163px;
  }

  .hero {
    padding-top: 104px;
    padding-bottom: 52px;
  }

  .eyebrow {
    font-size: 0.57rem;
    letter-spacing: 0.1em;
  }

  .hero h1 {
    margin-top: 18px;
    font-size: clamp(2.75rem, 13.8vw, 4rem);
  }

  .hero-lead {
    margin-top: 20px;
    font-size: 0.93rem;
  }

  .hero-actions {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .hero-actions .button {
    width: 100%;
  }

  .hero-logic {
    margin-top: 28px;
    gap: 8px;
  }

  .hero-logic span {
    font-size: 0.51rem;
  }

  .hero-logic i {
    width: 14px;
  }

  .hero-visual {
    width: 107%;
    margin: -10px -3.5% -20px;
  }

  .visual-label {
    display: none;
  }

  .value,
  .core,
  .contexts,
  .proof {
    padding-block: 64px;
  }

  .value h2 {
    font-size: clamp(2.35rem, 10.8vw, 3.4rem);
  }

  .value-principles {
    margin-top: 38px;
  }

  .section-head h2 {
    font-size: clamp(2.35rem, 10.8vw, 3.4rem);
  }

  .service-grid {
    margin-top: 18px;
  }

  .core-tools {
    margin-top: 30px;
  }

  .service-card {
    padding: 21px 22px;
  }

  .service-card h3 {
    font-size: 1.8rem;
  }

  .method-panel {
    padding: 21px;
  }

  .method-tabs {
    grid-template-columns: repeat(5, minmax(100px, 1fr));
  }

  .context-explorer {
    margin-top: 30px;
  }

  .context-menu button {
    min-width: 132px;
    padding-inline: 17px;
  }

  .habitat-panel {
    min-height: 485px;
    padding: 25px 22px;
  }

  .habitat-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }

  .habitat-grid {
    margin-top: 45px;
    grid-template-columns: 1fr;
    gap: 23px;
  }

  .habitat-grid p {
    margin-top: 8px;
    font-size: 0.92rem;
  }

  .context-meter {
    right: 22px;
    bottom: 24px;
    left: 22px;
  }

  .context-meter span {
    display: none;
  }

  .context-large-word {
    font-size: 4.6rem;
  }

  .project-grid {
    margin-top: 30px;
  }

  .project-card {
    padding: 23px;
  }

  .project-card h3 {
    font-size: 1.55rem;
  }

  .lab-card,
  .contact-card {
    min-height: 235px;
    padding: 25px;
  }

  .lab-sequence {
    flex-wrap: wrap;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .brand-logo--footer {
    width: 178px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .js .reveal {
    opacity: 1;
    transform: none;
  }
}
