/* Cloud Patrol. Tokens según docs/direccion-visual.md */

@font-face {
  font-family: "Sora";
  src: url("../fonts/sora-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 800;
  font-display: swap;
}
@font-face {
  font-family: "Hanken Grotesk";
  src: url("../fonts/hanken-grotesk-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  /* Color */
  --noche: #0c0d3b;
  --noche-2: #10124a;
  --marino: #171962;
  --azul: #3662e3;
  --cian: #71eafb;
  --hielo: #e8f0ff;
  --niebla: #a7b3d9;
  --linea: rgba(167, 179, 217, .22);
  --degradado: linear-gradient(100deg, #659bfe, #71eafb);

  /* Tipografía */
  --font-display: "Sora", system-ui, sans-serif;
  --font-body: "Hanken Grotesk", system-ui, sans-serif;
  --text-s: .9375rem;
  --text-m: 1.0625rem;
  --text-l: clamp(1.0625rem, 1rem + .35vw, 1.25rem);
  --title-3: clamp(1.25rem, 1.1rem + .6vw, 1.5rem);
  --title-2: clamp(1.75rem, 1.15rem + 2.4vw, 2.75rem);
  --title-1: clamp(2.25rem, 1.2rem + 4.6vw, 4.25rem);

  /* Espacio */
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --space-section: clamp(4rem, 3rem + 5vw, 7rem);
  --header-h: 4.5rem;
  --container: 72rem;
  /* margen lateral que alinea encabezado, hero y secciones en la misma columna */
  --edge: max(var(--gutter), calc((100% - var(--container)) / 2));
}

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

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

body {
  margin: 0;
  background: var(--noche);
  color: var(--hielo);
  font-family: var(--font-body);
  font-size: var(--text-m);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
body.menu-open { overflow: hidden; }

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

a { color: inherit; }

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

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

.skip-link {
  position: fixed;
  left: var(--gutter);
  top: -4rem;
  z-index: 30;
  padding: .6rem 1rem;
  background: var(--hielo);
  color: var(--noche);
  font-weight: 500;
  border-radius: 6px;
}
.skip-link:focus { top: .75rem; }

.container {
  width: min(100% - 2 * var(--gutter), var(--container));
  margin-inline: auto;
}

/* Encabezado */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  height: var(--header-h);
  padding-inline: var(--edge);
  transition: background-color .2s ease, backdrop-filter .2s ease;
}
.site-header.is-scrolled,
.site-header.is-open {
  background: rgba(12, 13, 59, .92);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.site-header.is-scrolled { box-shadow: 0 1px 0 var(--linea); }

.brand img { width: 9.5rem; height: auto; }

.site-nav { display: flex; gap: 2rem; }
.site-nav a {
  position: relative;
  white-space: nowrap;
  color: var(--niebla);
  text-decoration: none;
  font-weight: 500;
  font-size: .975rem;
}
.site-nav a:hover,
.site-nav a[aria-current="true"] { color: var(--hielo); }
.site-nav a[aria-current="true"]::after {
  content: "";
  position: absolute;
  inset: auto 0 -.45rem 0;
  height: 2px;
  background: var(--cian);
}

/* Botón del menú (solo móvil) */
.menu-toggle {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  padding: .55rem 1rem;
  border: 1px solid var(--linea);
  border-radius: 999px;
  background: transparent;
  color: var(--hielo);
  font: 500 .9375rem/1 var(--font-body);
  cursor: pointer;
}
.menu-toggle__bars {
  position: relative;
  width: 1.1rem;
  height: 2px;
  background: currentColor;
  transition: background-color .15s ease;
}
.menu-toggle__bars::before,
.menu-toggle__bars::after {
  content: "";
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: currentColor;
  transition: transform .2s ease, top .2s ease;
}
.menu-toggle__bars::before { top: -6px; }
.menu-toggle__bars::after { top: 6px; }
.site-header.is-open .menu-toggle__bars { background: transparent; }
.site-header.is-open .menu-toggle__bars::before { top: 0; transform: rotate(45deg); }
.site-header.is-open .menu-toggle__bars::after { top: 0; transform: rotate(-45deg); }

/* Panel del menú en móvil */
.site-menu {
  position: fixed;
  inset: var(--header-h) 0 auto 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 1.5rem;
  padding: 1.5rem var(--gutter) 2rem;
  background: var(--noche);
  border-bottom: 1px solid var(--linea);
  visibility: hidden;
  opacity: 0;
  transform: translateY(-.5rem);
  transition: opacity .2s ease, transform .2s ease, visibility 0s linear .2s;
}
.site-header.is-open .site-menu {
  visibility: visible;
  opacity: 1;
  transform: none;
  transition: opacity .2s ease, transform .2s ease;
}
.site-menu .site-nav { flex-direction: column; gap: 0; }
.site-menu .site-nav a { padding: .9rem 0; font-size: 1.125rem; border-bottom: 1px solid var(--linea); }
.site-menu .site-nav a[aria-current="true"]::after { display: none; }
.site-menu .button { text-align: center; }

@media (min-width: 62rem) {
  .menu-toggle { display: none; }
  .site-menu {
    position: static;
    flex-direction: row;
    align-items: center;
    gap: 2rem;
    padding: 0;
    margin-left: auto;
    background: none;
    border: 0;
    visibility: visible;
    opacity: 1;
    transform: none;
  }
  .site-menu .site-nav { flex-direction: row; gap: 2rem; }
  .site-menu .site-nav a { padding: 0; font-size: .975rem; border: 0; }
  .site-menu .site-nav a[aria-current="true"]::after { display: block; }
}

/* Botones */
.button {
  display: inline-block;
  padding: .95rem 1.6rem;
  border-radius: 999px;
  background: var(--degradado);
  color: var(--noche);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  line-height: 1.2;
  transition: filter .18s ease, transform .18s ease;
}
.button:hover { filter: brightness(1.08); transform: translateY(-1px); }
.button:active { transform: translateY(0); }
.button--small { padding: .65rem 1.2rem; font-size: .9rem; white-space: nowrap; }

@media (max-width: 29.99rem) {
  .brand img { width: 7.75rem; }
}

.link {
  color: var(--hielo);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: var(--azul);
  text-decoration-thickness: 2px;
  text-underline-offset: .35em;
}
.link:hover { text-decoration-color: var(--cian); }

/* Hero */
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 100svh;
  display: grid;
  grid-template-rows: 1fr auto;
  padding: calc(var(--header-h) + 3rem) var(--edge) 2rem;
  background: #0e0f47;
}

.hero__facets {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
}

/* El isotipo recortado por el borde: el único gesto memorable */
.hero__mark {
  position: absolute;
  z-index: -1;
  width: min(150vw, 78rem);
  height: auto;
  right: -34%;
  bottom: -6%;
  opacity: .92;
  filter: drop-shadow(0 2rem 4rem rgba(12, 13, 59, .5));
  animation: mark-in 1.1s cubic-bezier(.2, .7, .2, 1) backwards;
}

@keyframes mark-in {
  from { opacity: 0; transform: translateX(4%) scale(.96); }
  to   { opacity: .92; transform: none; }
}

.hero__body {
  align-self: center;
  max-width: 41rem;
}

h1 {
  margin: 0 0 1.5rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--title-1);
  line-height: 1.06;
  letter-spacing: -.02em;
  text-wrap: balance;
}

.hero__lead {
  margin: 0 0 2.25rem;
  max-width: 32rem;
  color: var(--niebla);
  font-size: var(--text-l);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem 2rem;
}

.hero__motto {
  margin: 3rem 0 0;
  font-weight: 400;
  font-size: 1rem;
  letter-spacing: .02em;
  color: var(--hielo);
}
.hero__motto span { color: var(--cian); }

@media (min-width: 62rem) {
  .hero__mark { width: min(76vw, 82rem); right: -22%; bottom: auto; top: 50%; translate: 0 -46%; }
  .hero__motto { margin-top: 2rem; }
}

/* En pantallas medias el isotipo se corre a la derecha y la columna de texto se limita, para que el texto no pase por
   encima de la cinta clara (contraste medido) y el menú entre en una línea */
@media (min-width: 62rem) and (max-width: 79.99rem) {
  .hero__mark { width: 66vw; right: -27%; }
  .hero__body { max-width: min(41rem, 56vw); }
  .site-menu { gap: 1.25rem; }
  .site-menu .site-nav { gap: 1rem; }
  .site-menu .site-nav a { font-size: .875rem; }
}

@media (max-width: 61.99rem) {
  /* en móvil el isotipo baja y queda recortado bajo el texto */
  .hero { align-content: start; grid-template-rows: auto auto; row-gap: 3rem; padding-bottom: 12rem; }
  .hero__mark { width: 130%; right: -30%; bottom: -6%; }
  .hero__motto { align-self: end; }
}

/* Secciones */
.section {
  padding-block: var(--space-section);
  scroll-margin-top: var(--header-h);
}
.section--alt { background: var(--noche-2); }

h2 {
  margin: 0 0 1.25rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--title-2);
  line-height: 1.12;
  letter-spacing: -.015em;
  text-wrap: balance;
}

/* Texto de apoyo bajo los títulos de sección */
.lead {
  max-width: 40rem;
  margin: 0 0 2.5rem;
  color: var(--niebla);
  font-size: var(--text-l);
}

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* Servicios */
.service-index {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  margin-bottom: 1rem;
}
.service-index a {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .5rem .95rem .5rem .75rem;
  border: 1px solid var(--linea);
  border-radius: 999px;
  color: var(--hielo);
  font-size: var(--text-s);
  font-weight: 500;
  text-decoration: none;
  transition: border-color .15s ease, background-color .15s ease;
}
.service-index a:hover { border-color: var(--cian); background: rgba(113, 234, 251, .08); }
.service-index svg { width: 1.15rem; height: 1.15rem; color: var(--cian); }

.service {
  display: grid;
  gap: 1.75rem 4rem;
  padding-block: 3rem;
  border-top: 1px solid var(--linea);
  scroll-margin-top: calc(var(--header-h) + 1rem);
}
.service:first-child { margin-top: 2rem; }

.service__icon {
  width: 2.75rem;
  height: 2.75rem;
  margin-bottom: 1.1rem;
  padding: .6rem;
  border: 1px solid var(--linea);
  border-radius: 12px;
  color: var(--cian);
}
.service h3 {
  margin: 0 0 .9rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--title-3);
  line-height: 1.25;
  letter-spacing: -.01em;
  text-wrap: balance;
}
.service__main p { margin: 0 0 1.5rem; max-width: 34rem; color: var(--niebla); }

.service__list {
  margin: 0;
  padding: 0;
  list-style: none;
  align-self: center;
}
.service__list li {
  position: relative;
  padding: .85rem 0 .85rem 1.6rem;
  border-bottom: 1px solid var(--linea);
}
.service__list li:first-child { border-top: 1px solid var(--linea); }
.service__list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1.45rem;
  width: .5rem;
  height: .5rem;
  border-radius: 2px;
  background: var(--cian);
}

@media (min-width: 62rem) {
  .service { grid-template-columns: 1.1fr 1fr; }
}

/* Cómo trabajamos: una secuencia real, por eso va numerada */
.steps {
  display: grid;
  gap: 2rem;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}
.step {
  position: relative;
  padding-left: 3.75rem;
  counter-increment: step;
}
.step::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--cian);
  border-radius: 50%;
  color: var(--cian);
  font-family: var(--font-display);
  font-weight: 600;
}
.step:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 1.25rem;
  top: 2.9rem;
  bottom: -1.7rem;
  width: 1px;
  background: var(--linea);
}
.step h3 {
  margin: .2rem 0 .5rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.125rem;
  line-height: 1.3;
}
.step p { margin: 0; color: var(--niebla); max-width: 22rem; }

@media (min-width: 62rem) {
  .steps { grid-template-columns: repeat(4, 1fr); gap: 2.5rem; }
  .step { padding: 3.75rem 0 0; }
  .step:not(:last-child)::after {
    left: 3.1rem;
    right: -1.4rem;
    top: 1.25rem;
    bottom: auto;
    width: auto;
    height: 1px;
  }
}

/* Marca visible de todo dato de ejemplo (se busca por [data-dummy] y .dummy-tag) */
.dummy-tag {
  display: inline-block;
  margin: 0 0 1.5rem;
  padding: .25rem .75rem;
  border: 1px dashed #ffd166;
  border-radius: 999px;
  color: #ffd166;
  font-size: .8125rem;
  font-weight: 500;
}

.subhead {
  margin: 3rem 0 1.25rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--title-3);
  line-height: 1.25;
}

/* Quiénes somos */
.about { display: grid; gap: 2.5rem 4rem; }
.about__text p { margin: 0 0 1.25rem; max-width: 36rem; color: var(--niebla); font-size: var(--text-l); }
.team__list { margin: 0; padding: 0; list-style: none; }
.team__list li {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--linea);
}
.team__list li:first-child { border-top: 1px solid var(--linea); }
.team__avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: var(--marino);
  color: var(--cian);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: .9375rem;
}
.team__list strong { font-weight: 600; }
.team__list li span:last-child { color: var(--niebla); font-size: var(--text-s); }
.team__list li strong { color: var(--hielo); font-size: var(--text-m); }

@media (min-width: 62rem) {
  .about { grid-template-columns: 1.2fr 1fr; align-items: start; }
}

/* Clientes, casos y certificaciones */
.logo-wall {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.logo-wall li {
  display: grid;
  place-items: center;
  min-height: 5rem;
  border: 1px dashed var(--linea);
  border-radius: 10px;
  color: var(--niebla);
  font-size: var(--text-s);
}

.cases { display: grid; gap: 2.5rem 4rem; }
.case { padding-top: 1.25rem; border-top: 1px solid var(--linea); }
.case h4 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.125rem;
}
.case__sector { margin: .25rem 0 1.25rem; color: var(--niebla); font-size: var(--text-s); }
.case dl { margin: 0; }
.case dt { margin-top: 1rem; font-weight: 600; color: var(--cian); font-size: var(--text-s); }
.case dd { margin: .2rem 0 0; color: var(--niebla); }

.badges { display: flex; flex-wrap: wrap; gap: .75rem; margin: 0; padding: 0; list-style: none; }
.badges li {
  padding: .6rem 1.1rem;
  border: 1px dashed var(--linea);
  border-radius: 999px;
  color: var(--niebla);
  font-size: var(--text-s);
}

@media (min-width: 48rem) {
  .logo-wall { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 62rem) {
  .logo-wall { grid-template-columns: repeat(6, 1fr); }
  .cases { grid-template-columns: 1fr 1fr; }
}

/* Preguntas frecuentes */
.faq { max-width: 52rem; border-top: 1px solid var(--linea); }
.faq__item { border-bottom: 1px solid var(--linea); }
.faq__item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.25rem 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.0625rem;
  line-height: 1.35;
  cursor: pointer;
  list-style: none;
}
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary::after {
  content: "";
  flex: none;
  width: .65rem;
  height: .65rem;
  border-right: 2px solid var(--cian);
  border-bottom: 2px solid var(--cian);
  transform: rotate(45deg);
  transition: transform .2s ease;
}
.faq__item[open] summary::after { transform: rotate(-135deg); }
.faq__item summary:hover { color: var(--cian); }
.faq__item p { margin: 0 0 1.5rem; max-width: 42rem; color: var(--niebla); }

/* Contacto */
.contact { display: grid; justify-items: start; gap: 1.25rem; }
.contact__mail { margin: 0; color: var(--niebla); }
.contact__mail strong { color: var(--hielo); font-weight: 600; }
.contact .dummy-tag { margin: 0; }
.contact__status { margin: 0; min-height: 1.6em; color: var(--cian); font-size: var(--text-s); }

.link-button {
  margin-left: .5rem;
  padding: 0;
  border: 0;
  background: none;
  color: var(--hielo);
  font: inherit;
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: var(--azul);
  text-decoration-thickness: 2px;
  text-underline-offset: .35em;
  cursor: pointer;
}
.link-button:hover { text-decoration-color: var(--cian); }

/* Lugar reservado para el chatbot de la etapa 2: oculto hasta que se monte */
.chatbot-slot:not([hidden]) {
  position: fixed;
  right: var(--gutter);
  bottom: 1.25rem;
  z-index: 25;
}

/* Página legal */
.legal { padding-top: calc(var(--header-h) + var(--space-section) * .6); }
.legal__title {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--title-2);
  line-height: 1.12;
  letter-spacing: -.015em;
}
.legal__body { max-width: 44rem; }
.legal__body h2 { margin: 2.5rem 0 .75rem; font-size: var(--title-3); line-height: 1.25; letter-spacing: -.01em; }
.legal__body p { margin: 0 0 1rem; color: var(--niebla); }
.legal__body strong { color: var(--hielo); font-weight: 600; }
.legal__updated { margin-top: 2rem; }
.site-footer__legal--solo { margin-top: 0; padding-top: 0; border-top: 0; }
.site-footer .site-footer__legal a {
  color: var(--hielo);
  text-decoration: underline;
  text-decoration-color: var(--azul);
  text-decoration-thickness: 2px;
  text-underline-offset: .3em;
}
.site-footer .site-footer__legal a:hover { text-decoration-color: var(--cian); }

/* Página 404 */
.notfound {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  align-items: center;
  min-height: 100svh;
  padding-top: var(--header-h);
  background: #0e0f47;
}
.notfound__mark {
  position: absolute;
  z-index: -1;
  width: min(120vw, 64rem);
  height: auto;
  right: -30%;
  bottom: -12%;
  opacity: .5;
}
.notfound__body { padding-block: 3rem; }
.notfound__body .lead { max-width: 30rem; }

/* Pie */
.site-footer {
  padding-block: 3.5rem 2rem;
  background: var(--noche);
  border-top: 1px solid var(--linea);
}
.site-footer__grid {
  display: grid;
  gap: 2.5rem;
}
.site-footer__brand img { width: 9.5rem; height: auto; }
.site-footer__motto { margin: 1rem 0 0; font-size: var(--text-s); color: var(--niebla); }
.site-footer__motto span { color: var(--cian); }
.site-footer__nav,
.site-footer__social { display: flex; flex-direction: column; gap: .6rem; align-items: flex-start; }
.site-footer a { color: var(--hielo); text-decoration: none; font-size: var(--text-s); }
.site-footer a:hover { text-decoration: underline; text-decoration-color: var(--cian); text-underline-offset: .3em; }
.site-footer__legal {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--linea);
  font-size: var(--text-s);
  color: var(--niebla);
}
.site-footer__legal p { margin: 0; }

@media (min-width: 48rem) {
  .site-footer__grid { grid-template-columns: 1.4fr 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero__mark { animation: none; }
  .button,
  .service-index a,
  .faq__item summary::after,
  .site-header,
  .site-menu,
  .menu-toggle__bars,
  .menu-toggle__bars::before,
  .menu-toggle__bars::after { transition: none; }
}
