/* Greyloft: tokens, base y componentes. Sin dependencias ni fuentes remotas. */

:root {
  --bg: #0F1216;
  --surface: #171B21;
  --surface-2: #1B2027;
  --slate: #2F3B48;
  --amber-dark: #3A2D17;
  --line: #2A313A;
  --muted: #8A94A0;
  --text: #F2F4F7;
  --text-2: #C3CAD3;
  --amber: #E8A33D;
  --on-amber: #16110A;

  /* Teal de la marca: solo dentro de .marca (logo). No se usa en ningún otro elemento. */
  --brand: #2BB3B3;
  --brand-dark: #1C6B78;

  /* Bloques de texto sobre la red de nodos: fondo propio al 90 % y un halo difuminado hacia afuera (estático, sin backdrop-filter). */
  --panel: 90%;
  --halo: 20px;
  --halo-spread: 14px;

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --gutter: 24px;
  --maxw: 1120px;
  --radius: 10px;
  --radius-sm: 6px;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1.0625rem/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

h1, h2, h3 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  color: var(--text);
}

h1 {
  font-size: clamp(2.5rem, 1.2rem + 5.4vw, 4.5rem);
  line-height: 1.03;
  letter-spacing: -0.02em;
  max-width: 15ch;
}

h2 {
  font-size: clamp(1.85rem, 1.1rem + 2.6vw, 2.75rem);
  line-height: 1.12;
  letter-spacing: -0.012em;
}

h3 {
  font-size: 1.4rem;
  line-height: 1.25;
}

h1, h2 { text-wrap: balance; }

p { margin: 0; }

a { color: inherit; }

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

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--amber);
  color: var(--on-amber);
  border-radius: var(--radius-sm);
  font-weight: 600;
}
.skip:focus { top: 12px; }

:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
}

/* Botones */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
  font: 600 0.9375rem/1 var(--sans);
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { border-color: var(--muted); }

.btn-primary {
  background: var(--amber);
  border-color: var(--amber);
  color: var(--on-amber);
}
.btn-primary:hover { background: #F0B05A; border-color: #F0B05A; }

.btn-ghost { border-color: #3B444F; }

.btn-small {
  min-height: 40px;
  padding: 0 16px;
  font-size: 0.875rem;
}

/* Cabecera */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(15, 18, 22, 0.94);
  border-bottom: 1px solid var(--line);
}

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  gap: 24px;
}

.brand {
  display: block;
  line-height: 0;
  text-decoration: none;
}

/* Logo extendido (palabra + icono, sin órbita): imagen estática y decorativa; el nombre del enlace va en su aria-label. */
.logo {
  display: block;
  width: auto;
  height: 36px;
}
.foot-brand .logo { height: 30px; }

/* Marca (logo): único lugar donde vive el teal. Las capas atrás/delante dan profundidad a la órbita. */
/* Icono con órbita animada: mitad derecha de la tarjeta del CTA, solo escritorio. */
.marca { display: block; flex: none; }
.marca-cta { width: 198px; height: 120px; }
.marca-g, .marca-circ { fill: var(--text); }
.marca-circ-teal, .marca-cubo-sup { fill: var(--brand); }
.marca-cubo-lado { fill: var(--brand-dark); }
.marca-orb-atras, .marca-orb-delante { fill: none; stroke-width: 4.3; }
.marca-orb-atras { stroke: var(--brand-dark); }
.marca-orb-delante { stroke: var(--brand); }

.nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-link {
  color: var(--text-2);
  font-size: 0.9375rem;
  text-decoration: none;
}
.nav-link:hover { color: var(--text); }

/* Hero */

.hero {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  min-height: min(86svh, 780px);
}

/* El degradado va bajo el canvas fijo (z -1) para no apagar los nodos, pero se desplaza con el hero. Sin isolation en .hero. */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background: radial-gradient(900px 520px at 82% 38%, #1A2028 0%, rgba(26, 32, 40, 0) 70%);
}

/* Fondo fijo de toda la página. Va como hijo directo de body, sin ancestros que creen contexto de apilamiento. */
.page-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}
.page-bg canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(15, 18, 22, 0.95) 0%, rgba(15, 18, 22, 0.62) 42%, rgba(15, 18, 22, 0) 74%);
}

.hero-inner {
  padding-block: clamp(72px, 11vw, 136px);
}

.lead {
  max-width: 34rem;
  margin-top: 28px;
  color: var(--text);
  font-size: clamp(1.125rem, 1rem + 0.5vw, 1.3rem);
  line-height: 1.5;
}

.lead-sub {
  max-width: 34rem;
  margin-top: 14px;
  color: var(--text-2);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 36px;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 28px;
  margin: 44px 0 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 0.875rem;
}
.legend li { display: flex; align-items: center; gap: 10px; }

.dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
}
.dot-grey { background: var(--muted); }
.dot-amber { background: var(--amber); }

/* Cifras */

.figures {
  border-block: 1px solid var(--line);
}

.figures ul {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
}

.figures li {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: baseline;
  gap: 18px;
  padding: 30px 28px 30px 0;
}
.figures li + li {
  padding-left: 28px;
  border-left: 1px solid var(--line);
}

.count {
  font: 400 clamp(2.5rem, 1.6rem + 3vw, 3.4rem)/1 var(--serif);
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.figures span {
  max-width: 30ch;
  color: var(--text-2);
  font-size: 0.9375rem;
  line-height: 1.5;
}

/* Secciones */

.section {
  padding-block: clamp(64px, 9vw, 120px);
}
.section-alt { border-block: 1px solid var(--line); }

/* Bandas (cifras y secciones alternas): el tono va bajo el canvas fijo, así los nodos conservan todo su brillo sobre la banda. */
.figures,
.section-alt {
  position: relative;
  --panel-bg: var(--surface-2);
}
.figures::before,
.section-alt::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background: var(--surface-2);
}

.section-intro {
  max-width: 34rem;
  margin-top: 18px;
  color: var(--text-2);
}

/* Proceso */

.process {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(32px, 6vw, 96px);
}

.process-head {
  position: sticky;
  top: 104px;
  align-self: start;
}

.steps {
  --p: 1;
  --tail: 0px;
  position: relative;
  margin: 0;
  padding: 0 0 0 64px;
  list-style: none;
  counter-reset: step;
}
.steps::before,
.steps::after {
  content: "";
  position: absolute;
  left: 15px;
  top: 16px;
  bottom: var(--tail);
  width: 2px;
}
.steps::before { background: var(--line); }
.steps::after {
  background: var(--amber);
  transform-origin: top;
  transform: scaleY(var(--p));
}

.step {
  position: relative;
  margin-bottom: 44px;
  counter-increment: step;
}
.step:last-child { margin-bottom: 0; }

.step::before {
  content: counter(step);
  position: absolute;
  left: -64px;
  top: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 2px solid var(--line);
  border-radius: 50%;
  background: var(--bg);
  color: var(--muted);
  font: 600 0.875rem/1 var(--sans);
}
.step.is-reached::before {
  border-color: var(--amber);
  color: var(--amber);
}

.step h3 { padding-top: 2px; }
.step p {
  max-width: 38rem;
  margin-top: 10px;
  color: var(--text-2);
}

/* Tarjetas con gradiente (Granim pinta el canvas; el CSS es el respaldo) */

.cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  margin-top: 48px;
}

.gcard {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border: 1px solid #2C3541;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #1B2027 0%, #2F3B48 100%);
}
.gcard::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 2;
  height: 2px;
  background: var(--amber);
}
.gcard-warm { background: linear-gradient(135deg, #1B2027 0%, #3A2D17 100%); }

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

.gcard-body { position: relative; padding: 36px 32px 40px; }
.gcard-body > p { max-width: 34rem; margin-top: 14px; color: var(--text-2); }

.gcard-sub {
  margin-top: 4px;
  color: var(--text);
  font-weight: 600;
}
.gcard-body > .gcard-sub { color: var(--text); margin-top: 6px; }

.ticks {
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
  color: var(--text-2);
  font-size: 0.9688rem;
}
.ticks li {
  position: relative;
  padding: 10px 0 10px 22px;
  border-top: 1px solid rgba(242, 244, 247, 0.12);
}
.ticks li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1.15em;
  width: 8px;
  height: 2px;
  background: var(--amber);
}

.gcard-cta .gcard-body { padding: clamp(36px, 6vw, 64px); }
@media (min-width: 901px) {
  .gcard-cta .gcard-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; }
  .gcard-cta .gcard-body > :not(.marca) { grid-column: 1; }
  .gcard-cta .marca { grid-column: 2; grid-row: 1 / span 3; place-self: center; }
}
.gcard-cta h2 { max-width: 20ch; }
.gcard-cta .gcard-body > p { margin-top: 18px; }
.gcard-cta .gcard-body > .cta-actions { margin-top: 30px; }

/* Scorecard de ejemplo */

.example {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(32px, 6vw, 96px);
  align-items: center;
}

.note {
  max-width: 30rem;
  margin-top: 22px;
  padding-left: 16px;
  border-left: 2px solid var(--amber);
  color: var(--text);
}

.scorecard {
  position: relative;
  overflow: hidden;
  width: 100%;
  max-width: 540px;
  margin-inline: auto;
  padding: 28px;
  border: 1px solid var(--line);
  border-top: 2px solid var(--amber);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: 0 24px 48px -24px rgba(0, 0, 0, 0.6);
  will-change: transform;
}

.sc-tag {
  color: var(--muted);
  font-size: 0.8125rem;
}
.sc-head h3 { margin-top: 10px; font-size: 1.35rem; }
.sc-meta { margin-top: 6px; color: var(--text-2); font-size: 0.9375rem; }

.sc-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 22px 0 0;
  padding: 16px 0;
  border-block: 1px solid var(--line);
}
.fact dt { color: var(--muted); font-size: 0.8125rem; }
.fact dd { margin: 4px 0 0; font-weight: 600; font-variant-numeric: tabular-nums; }

.veil {
  display: inline-block;
  transition: filter 0.45s ease;
}
.scorecard[data-blind="true"] .veil {
  filter: blur(7px);
  user-select: none;
}

.scorecard h4 {
  margin: 24px 0 10px;
  color: var(--muted);
  font: 600 0.875rem/1.3 var(--sans);
}

.sc-gates {
  margin: 0;
  padding: 0;
  list-style: none;
}
.sc-gates li {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: 12px;
  align-items: start;
  padding: 9px 0;
  border-top: 1px solid var(--line);
}
.sc-gates li:first-child { border-top: 0; padding-top: 0; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
}
.chip::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
}
.chip-pending { color: var(--amber); }
.chip-pending::before { background: var(--amber); }

cite {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.8125rem;
  font-style: normal;
}
.sc-line cite { margin-top: 4px; }

.sc-foot { margin-top: 26px; }

/* Preguntas */

.faq {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(32px, 6vw, 96px);
}

details { border-top: 1px solid var(--line); }
details:last-of-type { border-bottom: 1px solid var(--line); }

summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 0;
  font: 400 1.25rem/1.3 var(--serif);
  cursor: pointer;
  list-style: none;
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: "+";
  flex: none;
  color: var(--amber);
  font: 400 1.6rem/1 var(--sans);
}
details[open] summary::after { content: "\2013"; }

details p {
  max-width: 40rem;
  margin: 0 0 24px;
  color: var(--text-2);
}

/* Páginas de texto (aviso de privacidad) */

.prose { max-width: 44rem; }
.prose h1 { max-width: none; }
.prose h2 { margin-top: 48px; font-size: 1.5rem; line-height: 1.25; }
.prose p { margin-top: 14px; color: var(--text-2); }
.prose .note-date { margin-top: 18px; color: var(--muted); font-size: 0.9375rem; }
.prose a { color: var(--text); text-decoration-color: var(--amber); text-underline-offset: 3px; }

/* Aviso de borrador: gris, no ámbar (el ámbar es solo para lo elegido). Se retira al aprobar la revisión legal. */
.draft-banner {
  margin: 0;
  padding: 12px var(--gutter);
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  font-size: 0.9375rem;
  text-align: center;
}

/* Marcadores de relleno visibles hasta que el dueño entregue los datos. */
.prose .owner { margin: 14px 0 0; }
.prose .owner div { padding: 10px 0; border-top: 1px solid var(--line); }
.prose .owner dt { color: var(--muted); font-size: 0.8125rem; }
.prose .owner dd { margin: 4px 0 0; color: var(--text-2); }
.fill { padding: 2px 8px; border: 1px dashed var(--muted); border-radius: var(--radius-sm); background: transparent; color: var(--text); }

/* Pie */

.site-footer {
  padding-block: 48px 56px;
  border-top: 1px solid var(--line);
}
.foot {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: 16px 48px;
  align-items: start;
}
.foot-brand { line-height: 0; }
.foot-legal { color: var(--muted); font-size: 0.875rem; max-width: 46rem; }
.foot-copy { grid-column: 2; color: var(--muted); font-size: 0.875rem; }
/* El padding vertical da el objetivo táctil de 40px del documento, sección 7. */
.foot-link { display: inline-block; padding-block: 11px; }

/* Bloques de texto sobre la red de nodos: fondo propio (token --panel) con halo hacia afuera, para que no se vea el borde.
   El panel va en ::before con z-index -1 dentro del .wrap aislado: queda bajo todo el texto y nunca lo cubre. */
.lead,
.lead-sub,
.legend,
.wrap > .section-intro,
#servicios-title,
.example-copy,
.faq-head,
.figures li,
details,
.foot-legal,
.foot-copy { position: relative; }
.legend,
#servicios-title,
.foot-copy { width: fit-content; }

.lead::before,
.lead-sub::before,
.legend::before,
.wrap > .section-intro::before,
#servicios-title::before,
.process-head::before,
.example-copy::before,
.faq-head::before,
.figures li::before,
.step::after,
details::before,
.foot-legal::before,
.foot-copy::before {
  content: "";
  position: absolute;
  inset: -8px -12px;
  z-index: -1;
  pointer-events: none;
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel-bg, var(--bg)) var(--panel), transparent);
  box-shadow: 0 0 var(--halo) var(--halo-spread) color-mix(in srgb, var(--panel-bg, var(--bg)) var(--panel), transparent);
}
/* En las celdas de cifras y las filas de preguntas el panel llena la celda: sin margen extra. */
.figures li::before,
details::before { inset: 0; }

/* Movimiento: una sola secuencia al cargar el hero */

@media (prefers-reduced-motion: no-preference) {
  .hero-inner > * {
    animation: rise 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) backwards;
  }
  .hero-inner > :nth-child(2) { animation-delay: 0.1s; }
  .hero-inner > :nth-child(3) { animation-delay: 0.18s; }
  .hero-inner > :nth-child(4) { animation-delay: 0.26s; }
  .hero-inner > :nth-child(5) { animation-delay: 0.38s; }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

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

/* Pantallas medianas y pequeñas */

@media (max-width: 900px) {
  .nav-link { display: none; }

  .marca-cta { display: none; }

  .process,
  .example,
  .faq { grid-template-columns: 1fr; }

  .process-head { position: relative; top: auto; }

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

  .foot { grid-template-columns: 1fr; }
  .foot-copy { grid-column: 1; }
}

@media (max-width: 720px) {
  :root { --gutter: 20px; }

  .hero { min-height: 0; }
  .hero::after {
    background: linear-gradient(180deg, rgba(15, 18, 22, 0.9) 0%, rgba(15, 18, 22, 0.7) 60%, rgba(15, 18, 22, 0.35) 100%);
  }

  .figures ul { grid-template-columns: 1fr; }
  .figures li { padding: 22px 0; }
  .figures li + li {
    padding-left: 0;
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .steps { padding-left: 52px; }
  .step::before { left: -52px; }
  .steps::before,
  .steps::after { left: 15px; }

  .gcard-body { padding: 30px 22px 34px; }
  .scorecard { padding: 22px; }
  .sc-gates li { grid-template-columns: 1fr; gap: 4px; }
}
