/* ==========================================================================
   HollowCrest — hoja de estilos del sitio
   Tokens → base → layout → componentes → páginas → utilidades
   ========================================================================== */

@font-face {
  font-family: "Heros Cn";
  src: url("/fonts/heros-cn-bold.woff") format("woff");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("/fonts/inter-regular.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("/fonts/inter-medium.woff") format("woff");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("/fonts/inter-semibold.woff") format("woff");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Color */
  --ink: #0f1e2b;          /* fondo: azul tinta de plano técnico */
  --ink-2: #13263a;        /* secciones alternas */
  --surface: #182e43;      /* superficies elevadas */
  --line: #29445c;         /* trazos y bordes */
  --line-strong: #3d5d79;
  --text: #eaf0f4;         /* texto principal (tiza) */
  --muted: #a7bacb;        /* texto secundario */
  --signal: #f2c14e;       /* ámbar: foco, estado activo */
  --ok: #8fd8b0;
  --danger: #ff9e8f;

  /* Tipografía */
  --font-display: "Heros Cn", "Arial Narrow", "Roboto Condensed", sans-serif-condensed, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --step--1: 0.875rem;  /* 14 */
  --step-0: 1.0625rem;  /* 17 */
  --step-1: 1.25rem;    /* 20 */
  --step-2: 1.5rem;     /* 24 */
  --step-3: clamp(1.875rem, 1.4rem + 1.6vw, 2.5rem);   /* 30 → 40 */
  --step-4: clamp(2.375rem, 1.6rem + 2.8vw, 3.5rem);   /* 38 → 56 */
  --step-5: clamp(2.875rem, 1.6rem + 4.6vw, 5.25rem);  /* 46 → 84 */

  /* Espacio */
  --gutter: 24px;
  --section: clamp(4rem, 3rem + 4vw, 7rem);
  --radius: 3px;
  --measure: 66ch;

  color-scheme: dark;
}

@media (max-width: 640px) {
  :root { --gutter: 16px; }
}

/* ---------- Base ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 88px;
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.6;
  font-feature-settings: "kern", "liga";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: 0;
  text-wrap: balance;
}
h3 { font-size: var(--step-2); line-height: 1.15; }

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

a { color: var(--text); text-decoration-color: var(--line-strong); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-color: currentColor; }

:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 3px;
  border-radius: 1px;
}

img, svg { display: block; max-width: 100%; }
ul[role="list"], ol[role="list"] { list-style: none; margin: 0; padding: 0; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.92em; }
::selection { background: var(--signal); color: var(--ink); }

/* ---------- Layout ---------- */

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

main:focus { outline: none; }

.section { padding-block: var(--section); }
.section--alt { background: var(--ink-2); border-block: 1px solid var(--line); }
.section--flush { padding-top: 0; }

.section-head {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 1.5rem 3rem;
  align-items: end;
  margin-bottom: clamp(2rem, 1.5rem + 2vw, 3.5rem);
}
.section-title { font-size: var(--step-4); }
.section-intro { color: var(--muted); font-size: var(--step-1); line-height: 1.5; max-width: 52ch; }
.section-more { margin-top: 2.5rem; }

@media (max-width: 820px) {
  .section-head { grid-template-columns: 1fr; }
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 100;
  padding: 0.75rem 1rem;
  background: var(--text);
  color: var(--ink);
  font-weight: 600;
}
.skip-link:focus { top: 12px; }

/* ---------- Cabecera ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgb(15 30 43 / 0.96);
  border-bottom: 1px solid var(--line);
}
@supports (backdrop-filter: blur(1px)) {
  .site-header { background: rgb(15 30 43 / 0.88); backdrop-filter: blur(10px); }
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 68px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text);
  text-decoration: none;
}
.logo-mark { width: 28px; height: 28px; color: var(--text); }
.brand-name {
  font-family: var(--font-display);
  font-size: 1.5rem;
  line-height: 1;
  letter-spacing: 0.01em;
}

.site-nav { display: flex; align-items: center; gap: 2rem; }
.site-nav ul { display: flex; gap: 1.75rem; }
.site-nav a:not(.btn) {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 500;
  padding-block: 0.5rem;
  border-bottom: 2px solid transparent;
}
.site-nav a:not(.btn):hover { color: var(--text); }
.site-nav a[aria-current="page"] { color: var(--text); border-bottom-color: var(--signal); }

.menu-toggle {
  display: none;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.8rem;
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: none;
  font: inherit;
  cursor: pointer;
}
.menu-toggle-bars,
.menu-toggle-bars::before,
.menu-toggle-bars::after {
  display: block;
  width: 16px;
  height: 2px;
  background: currentColor;
  position: relative;
}
.menu-toggle-bars::before,
.menu-toggle-bars::after { content: ""; position: absolute; left: 0; }
.menu-toggle-bars::before { top: -5px; }
.menu-toggle-bars::after { top: 5px; }

@media (max-width: 900px) {
  .menu-toggle { display: inline-flex; }
  .site-nav {
    display: none;
    position: absolute;
    inset: 68px 0 auto;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.5rem var(--gutter) 1.5rem;
    background: var(--ink);
    border-bottom: 1px solid var(--line);
  }
  .site-nav.is-open { display: flex; }
  .site-nav ul { flex-direction: column; gap: 0; }
  .site-nav a:not(.btn) {
    display: block;
    padding: 0.9rem 0;
    font-size: var(--step-1);
    border-bottom: 1px solid var(--line);
  }
  .site-nav a[aria-current="page"] { border-bottom-color: var(--line); box-shadow: inset 3px 0 0 var(--signal); padding-left: 0.9rem; }
  .nav-cta { margin-top: 1.25rem; align-self: flex-start; }
}

/* ---------- Botones ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 46px;
  padding: 0.7rem 1.3rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font: inherit;
  font-size: 0.9875rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.btn--primary { background: var(--text); color: var(--ink); }
.btn--primary:hover { background: #fff; }
.btn--secondary { background: transparent; color: var(--text); border-color: var(--line-strong); }
.btn--secondary:hover { border-color: var(--text); }
.btn--quiet {
  background: transparent;
  color: var(--text);
  padding-inline: 0.25rem;
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 0.3em;
}
.btn--quiet:hover { text-decoration-color: currentColor; }
.btn[disabled] { opacity: 0.6; cursor: progress; }

.text-link {
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--signal);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.35em;
}
.text-link:hover { color: var(--signal); }

/* ---------- Hero ---------- */

.hero {
  position: relative;
  padding-block: clamp(3.5rem, 2rem + 6vw, 7.5rem) clamp(3.5rem, 2rem + 5vw, 6.5rem);
  border-bottom: 1px solid var(--line);
  background-image:
    linear-gradient(to right, rgb(41 68 92 / 0.35) 1px, transparent 1px),
    linear-gradient(to bottom, rgb(41 68 92 / 0.35) 1px, transparent 1px);
  background-size: 40px 40px;
  background-position: -1px -1px;
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 3rem;
  align-items: center;
}
.hero-title {
  font-size: var(--step-5);
  line-height: 0.98;
  max-width: 15ch;
}
.hero-lead {
  margin-top: 1.75rem;
  max-width: 50ch;
  font-size: var(--step-1);
  line-height: 1.55;
  color: var(--muted);
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin-top: 2.25rem;
}

@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-title { max-width: 14ch; }
}

/* Ilustración: de información dispersa a flujo ordenado */
.trace {
  margin: 0;
  padding: 1.5rem;
  background: rgb(15 30 43 / 0.85);
  border: 1px solid var(--line);
}
.trace-svg { width: 100%; height: auto; overflow: visible; }
.trace-svg text { font-family: var(--font-body); font-size: 15px; fill: var(--muted); }
.trace-source circle { fill: var(--ink); stroke: var(--muted); stroke-width: 1.5; }
.trace-wire { fill: none; stroke: var(--line-strong); stroke-width: 1.5; stroke-dasharray: 0.02 0.015; }
.trace-spine { stroke: var(--line-strong); stroke-width: 2; }
.trace-step rect { fill: var(--surface); stroke: var(--line); stroke-width: 1; }
.trace-step text { fill: var(--text); font-weight: 500; }
.trace-dot { fill: var(--ink); stroke: var(--muted); stroke-width: 1.5; }
.trace-step--done .trace-dot { fill: var(--text); stroke: var(--text); }
.trace-step--current rect { stroke: var(--signal); }
.trace-step--current .trace-dot { fill: var(--signal); stroke: var(--signal); }
.trace-step--pending text { fill: var(--muted); }
.trace-caption { margin-top: 1rem; font-size: var(--step--1); color: var(--muted); }

/* Única animación orquestada del sitio: el flujo se ordena al cargar. */
@media (prefers-reduced-motion: no-preference) {
  .trace-wire { animation: trace-wire 1.4s cubic-bezier(.3,.7,.2,1) both; }
  .trace-source[data-i="1"] .trace-wire { animation-delay: 0.12s; }
  .trace-source[data-i="2"] .trace-wire { animation-delay: 0.24s; }
  .trace-source[data-i="3"] .trace-wire { animation-delay: 0.36s; }
  .trace-step { animation: trace-step 0.5s ease-out both; }
  .trace-step[data-i="0"] { animation-delay: 0.9s; }
  .trace-step[data-i="1"] { animation-delay: 1.05s; }
  .trace-step[data-i="2"] { animation-delay: 1.2s; }
  .trace-step[data-i="3"] { animation-delay: 1.35s; }
  .trace-step[data-i="4"] { animation-delay: 1.5s; }
  .trace-spine { animation: trace-step 0.4s ease-out 0.9s both; }
}
@keyframes trace-wire {
  from { stroke-dasharray: 0 1; }
  to { stroke-dasharray: 0.02 0.015; }
}
@keyframes trace-step {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ---------- Encabezado de página interna ---------- */

.page-head {
  padding-block: clamp(2.5rem, 2rem + 3vw, 5rem) clamp(2.5rem, 2rem + 2.5vw, 4rem);
  border-bottom: 1px solid var(--line);
}
.page-title { font-size: var(--step-5); max-width: 18ch; }
.page-lead { margin-top: 1.25rem; max-width: 56ch; color: var(--muted); font-size: var(--step-1); line-height: 1.55; }

.crumbs ol { display: flex; flex-wrap: wrap; gap: 0.25rem 0; margin: 0 0 1.5rem; padding: 0; list-style: none; font-size: var(--step--1); color: var(--muted); }
.crumbs li + li::before { content: "/"; margin-inline: 0.6rem; color: var(--line-strong); }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--text); }

/* ---------- Áreas (inicio) ---------- */

.areas {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line-strong);
}
.area { padding: 1.75rem 1.75rem 0.5rem 0; }
.area + .area { padding-left: 1.75rem; border-left: 1px solid var(--line); }
.area-title { font-size: var(--step-2); margin-bottom: 0.9rem; }
.area p { color: var(--muted); }

@media (max-width: 960px) {
  .areas { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .area:nth-child(3) { padding-left: 0; border-left: 0; }
  .area:nth-child(n + 3) { border-top: 1px solid var(--line); margin-top: 1.5rem; }
}
@media (max-width: 600px) {
  .areas { grid-template-columns: 1fr; }
  .area, .area + .area { padding: 1.5rem 0; border-left: 0; margin-top: 0; }
  .area + .area { border-top: 1px solid var(--line); }
}

/* ---------- Filas de servicios ---------- */

.rows { border-top: 1px solid var(--line-strong); }
.row {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 1rem 3rem;
  padding-block: 2.25rem;
  border-bottom: 1px solid var(--line);
}
.row-title { font-size: var(--step-3); }
.row-body > p { font-size: var(--step-1); line-height: 1.55; max-width: 52ch; }
.row-body .ticks { margin-block: 1.25rem 1.5rem; }
@media (max-width: 820px) {
  .row { grid-template-columns: 1fr; padding-block: 1.75rem; }
}

.ticks { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; color: var(--muted); }
.ticks li { position: relative; padding-left: 1.4rem; }
.ticks li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 0.6rem;
  height: 2px;
  background: var(--line-strong);
}

/* ---------- Pasos ---------- */

.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 2.5rem; }
.step { position: relative; padding: 1.5rem 0 2.25rem; border-top: 2px solid var(--line-strong); }
.step-n {
  display: block;
  font-family: var(--font-display);
  font-size: var(--step-2);
  color: var(--signal);
  margin-bottom: 0.75rem;
  font-variant-numeric: tabular-nums;
}
.step-title { font-size: var(--step-2); }
.step-text { margin-top: 0.75rem; color: var(--muted); max-width: 34ch; }

.steps--compact { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; }
.steps--compact .step { padding: 1.25rem 1.25rem 0.5rem 0; }
.steps--compact .step-title { font-family: var(--font-display); font-size: var(--step-2); display: block; }

@media (max-width: 960px) {
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps--compact { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .steps, .steps--compact { grid-template-columns: 1fr; }
  .steps--compact .step { display: flex; align-items: baseline; gap: 1rem; padding: 1rem 0; }
  .steps--compact .step-n { margin: 0; }
}

/* ---------- Productos ---------- */

.products { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; }
.products--list { grid-template-columns: 1fr; gap: 0; border-top: 1px solid var(--line-strong); }
.product {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 1.75rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.product:hover { border-color: var(--line-strong); }
.product-top { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1.75rem; }
.product-kind { margin: 0; font-size: var(--step--1); color: var(--muted); }
.product-name { font-size: var(--step-3); }
.product-name a { text-decoration: none; }
.product-name a::after { content: ""; position: absolute; inset: 0; }
.product-name a:focus-visible { outline: none; }
.product:has(.product-name a:focus-visible) { outline: 2px solid var(--signal); outline-offset: 3px; }
.product-desc { margin-top: 0.9rem; color: var(--muted); }

.products--list .product {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  grid-template-areas: "name top" "name desc";
  gap: 0.75rem 3rem;
  padding: 2.25rem 0;
  background: none;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
}
.products--list .product-top { grid-area: top; margin: 0; justify-content: flex-start; }
.products--list .product-name { grid-area: name; }
.products--list .product-desc { grid-area: desc; margin: 0; font-size: var(--step-1); line-height: 1.55; max-width: 52ch; }

@media (max-width: 960px) {
  .products { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .products--list .product { grid-template-columns: 1fr; grid-template-areas: "top" "name" "desc"; }
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.2rem 0.6rem;
  font-size: 0.8125rem;
  font-weight: 500;
  border: 1px solid var(--line-strong);
  border-radius: 99px;
  white-space: nowrap;
}
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.status--en-desarrollo { border-color: rgb(242 193 78 / 0.55); }
.status--en-desarrollo::before { background: var(--signal); }
.status--disponible { border-color: rgb(143 216 176 / 0.55); }
.status--disponible::before { background: var(--ok); }

.product-detail { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: 3rem; }
.product-meta { margin: 0; border-top: 1px solid var(--line-strong); }
.product-meta div { padding: 1rem 0; border-bottom: 1px solid var(--line); }
.product-meta dt { font-size: var(--step--1); color: var(--muted); margin-bottom: 0.35rem; }
.product-meta dd { margin: 0; }
.product-body h2 { font-size: var(--step-3); margin: 0 0 1rem; }
.product-body h2:not(:first-child) { margin-top: 2.75rem; }
.product-body > p { font-size: var(--step-1); line-height: 1.55; max-width: 58ch; color: var(--muted); }
.product-body .ticks { color: var(--text); }
.product-actions { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 3rem; }
@media (max-width: 820px) { .product-detail { grid-template-columns: 1fr; } }

/* ---------- Tecnología ---------- */

.tech { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 2rem; }
.tech-name { font-family: var(--font-body); font-size: var(--step--1); font-weight: 500; color: var(--muted); margin-bottom: 1rem; padding-bottom: 0.75rem; border-bottom: 1px solid var(--line); }
.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip {
  padding: 0.4rem 0.75rem;
  font-size: 0.9375rem;
  font-weight: 500;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.chip--cap { background: transparent; border-style: dashed; color: var(--muted); }
@media (max-width: 1080px) { .tech { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 680px) { .tech { grid-template-columns: 1fr 1fr; } }
@media (max-width: 420px) { .tech { grid-template-columns: 1fr; } }

/* ---------- Definiciones (valores, principios) ---------- */

.def-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 2.5rem; margin: 0; }
.def-grid > div { padding: 1.5rem 0 2rem; border-top: 1px solid var(--line-strong); }
.def-grid dt { font-family: var(--font-display); font-size: var(--step-2); line-height: 1.15; margin-bottom: 0.7rem; }
.def-grid dd { margin: 0; color: var(--muted); max-width: 38ch; }
@media (max-width: 900px) { .def-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .def-grid { grid-template-columns: 1fr; } }

.statements { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; }
.statement { padding-top: 1.5rem; border-top: 2px solid var(--signal); }
.statement h2, .statement h3 { font-size: var(--step-2); margin-bottom: 1rem; }
.statement p { font-size: var(--step-1); line-height: 1.55; }
.statements--large .statement p { font-size: var(--step-2); line-height: 1.45; }
@media (max-width: 820px) { .statements { grid-template-columns: 1fr; } }

.prose { max-width: var(--measure); }
.prose-cols .prose p { font-size: var(--step-1); line-height: 1.6; }
.prose h3 { font-family: var(--font-body); font-size: var(--step-0); font-weight: 600; margin: 1.75rem 0 0.75rem; }
.prose ul, .prose ol { padding-left: 1.3rem; margin: 0 0 1em; }
.prose li { margin-bottom: 0.4rem; }
.prose li::marker { color: var(--muted); }

.note { margin-top: 2rem; font-size: var(--step--1); color: var(--muted); max-width: 70ch; }

/* ---------- FAQ ---------- */

.faq { max-width: 860px; border-top: 1px solid var(--line-strong); }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-q {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.4rem 0;
  font-family: var(--font-display);
  font-size: var(--step-2);
  line-height: 1.2;
  cursor: pointer;
  list-style: none;
}
.faq-q::-webkit-details-marker { display: none; }
.faq-q::after {
  content: "+";
  flex: none;
  font-family: var(--font-body);
  font-weight: 400;
  color: var(--muted);
}
.faq-item[open] .faq-q::after { content: "−"; }
.faq-item p { padding-bottom: 1.5rem; color: var(--muted); max-width: 64ch; }

/* ---------- Banda de llamada a la acción ---------- */

.cta-band { border-top: 1px solid var(--line); background: var(--ink-2); }
.cta-inner { display: flex; align-items: center; justify-content: space-between; gap: 2rem; padding-block: clamp(3rem, 2rem + 3vw, 4.5rem); }
.cta-title { font-size: var(--step-3); max-width: 24ch; }
.cta-text { margin-top: 0.75rem; color: var(--muted); }
@media (max-width: 720px) { .cta-inner { flex-direction: column; align-items: flex-start; } }

/* ---------- Formularios ---------- */

.contact-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: 4rem; align-items: start; }
@media (max-width: 900px) { .contact-grid { grid-template-columns: 1fr; gap: 3rem; } }

.contact-form { display: grid; gap: 1.5rem; }
.field { display: grid; gap: 0.45rem; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
@media (max-width: 600px) { .field-row { grid-template-columns: 1fr; } }

.field label { font-weight: 500; }
.optional { color: var(--muted); font-weight: 400; }
.field input[type="text"],
.field input[type="email"],
.field input[type="tel"],
.field select,
.field textarea {
  width: 100%;
  min-height: 48px;
  padding: 0.7rem 0.85rem;
  color: var(--text);
  background: var(--ink-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  font: inherit;
  font-size: 1rem;
}
.field textarea { resize: vertical; min-height: 10rem; line-height: 1.5; }
.field select {
  appearance: none;
  padding-right: 2.5rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23a7bacb' stroke-width='1.6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
}
.field input:hover, .field select:hover, .field textarea:hover { border-color: var(--muted); }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible { outline-offset: 0; border-color: var(--signal); }
.field [aria-invalid="true"] { border-color: var(--danger); }
.field-help { margin: 0; font-size: var(--step--1); color: var(--muted); }
.field-error { margin: 0; font-size: var(--step--1); color: var(--danger); font-weight: 500; }

.field--check { grid-template-columns: auto 1fr; align-items: start; column-gap: 0.75rem; }
.field--check input { width: 20px; height: 20px; margin: 0.2rem 0 0; accent-color: var(--signal); cursor: pointer; }
.field--check label { font-weight: 400; }
.field--check .field-error { grid-column: 2; }

.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.form-actions { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; }
.form-sending { display: inline-flex; align-items: center; gap: 0.6rem; color: var(--muted); }
.spinner { width: 18px; height: 18px; border: 2px solid var(--line-strong); border-top-color: var(--text); border-radius: 50%; }
@media (prefers-reduced-motion: no-preference) {
  .spinner { animation: spin 0.8s linear infinite; }
}
@keyframes spin { to { transform: rotate(360deg); } }

.form-status {
  padding: 1rem 1.15rem;
  border: 1px solid var(--line-strong);
  border-left-width: 4px;
  border-radius: var(--radius);
  font-weight: 500;
}
.form-status:focus { outline: none; }
.form-status--ok { border-color: var(--ok); background: rgb(143 216 176 / 0.08); }
.form-status--error { border-color: var(--danger); background: rgb(255 158 143 / 0.08); }

.contact-aside { padding: 1.75rem; border: 1px solid var(--line); background: var(--ink-2); }
.contact-aside h2 { font-family: var(--font-body); font-size: var(--step--1); font-weight: 500; color: var(--muted); margin-bottom: 0.4rem; }
.contact-aside p { margin-bottom: 1.5rem; }
.contact-aside p:last-child { margin-bottom: 0; color: var(--muted); font-size: var(--step--1); }

/* ---------- Páginas legales ---------- */

.section--legal { padding-top: clamp(2.5rem, 2rem + 2vw, 4rem); }
.legal-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 9fr); gap: 4rem; align-items: start; }
.legal-side { position: sticky; top: 96px; }
.legal-nav ul { display: grid; gap: 0.15rem; border-left: 1px solid var(--line); }
.legal-nav a { display: block; padding: 0.4rem 0 0.4rem 1rem; margin-left: -1px; color: var(--muted); text-decoration: none; font-size: 0.9375rem; border-left: 2px solid transparent; }
.legal-nav a:hover { color: var(--text); }
.legal-nav a[aria-current="page"] { color: var(--text); border-left-color: var(--signal); }
@media (max-width: 900px) {
  .legal-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .legal-side { position: static; order: 2; }
}

.legal-doc { max-width: 760px; }
.legal-dates { display: flex; flex-wrap: wrap; gap: 0.5rem 2.5rem; margin: 0 0 1.5rem; padding-bottom: 1.25rem; border-bottom: 1px solid var(--line); font-size: var(--step--1); }
.legal-dates dt { color: var(--muted); }
.legal-dates dd { margin: 0; font-weight: 500; }
.review-note { padding: 0.9rem 1.1rem; border: 1px solid rgb(242 193 78 / 0.5); border-left-width: 4px; border-radius: var(--radius); font-size: var(--step--1); }
.legal-intro { margin-block: 1.75rem; font-size: var(--step-1); line-height: 1.55; }
.toc { margin-bottom: 1rem; padding: 1.25rem 1.5rem; border: 1px solid var(--line); background: var(--ink-2); }
.toc-title { font-family: var(--font-body); font-size: var(--step--1); font-weight: 500; color: var(--muted); margin-bottom: 0.6rem; }
.toc ol { margin: 0; padding-left: 1.3rem; columns: 2; column-gap: 2rem; }
.toc li { margin-bottom: 0.3rem; break-inside: avoid; }
.toc a { text-decoration: none; color: var(--text); }
.toc a:hover { text-decoration: underline; }
@media (max-width: 600px) { .toc ol { columns: 1; } }

.legal-section { padding-top: 2.25rem; }
.legal-section h2 { font-size: var(--step-3); margin-bottom: 1rem; }

.facts, .defs { margin: 0; border-top: 1px solid var(--line); }
.facts > div, .defs > div { display: grid; grid-template-columns: 12rem 1fr; gap: 1rem; padding: 0.8rem 0; border-bottom: 1px solid var(--line); }
.facts dt, .defs dt { color: var(--muted); }
.defs dt { color: var(--text); font-weight: 600; }
.facts dd, .defs dd { margin: 0; }
.defs dd { color: var(--muted); }
@media (max-width: 600px) { .facts > div, .defs > div { grid-template-columns: 1fr; gap: 0.25rem; } }

.table-wrap { overflow-x: auto; margin: 1.25rem 0; border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; line-height: 1.5; }
th, td { text-align: left; vertical-align: top; padding: 0.75rem 1rem; border-bottom: 1px solid var(--line); }
thead th { background: var(--ink-2); font-weight: 600; color: var(--muted); font-size: var(--step--1); }
tbody tr:last-child td { border-bottom: 0; }
td code { white-space: nowrap; }

/* ---------- Consentimiento de cookies ---------- */

.cookie-banner {
  position: fixed;
  inset: auto var(--gutter) var(--gutter);
  z-index: 60;
  max-width: 1152px;
  margin-inline: auto;
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: 0 18px 50px rgb(0 0 0 / 0.45);
}
.cookie-banner[hidden] { display: none; }
.cookie-banner-inner { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1.5rem 2.5rem; align-items: center; }
.cookie-banner h2 { font-size: var(--step-2); margin-bottom: 0.5rem; }
.cookie-banner p { font-size: 0.9375rem; color: var(--muted); max-width: 70ch; }
.cookie-banner p a { color: var(--text); }
.cookie-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }
@media (max-width: 900px) {
  .cookie-banner-inner { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .cookie-banner { inset: auto 0 0; border-radius: 0; border-inline: 0; padding: 1.25rem var(--gutter); }
  .cookie-actions .btn--secondary { flex: 1 1 100%; }
}

.consent-dialog {
  width: min(560px, calc(100vw - 2 * var(--gutter)));
  max-height: calc(100dvh - 2 * var(--gutter));
  padding: 0;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
}
.consent-dialog::backdrop { background: rgb(5 12 18 / 0.7); }
.consent-form { padding: 1.75rem; }
.consent-form--page { padding: 0; }
.consent-dialog h2 { font-size: var(--step-3); margin-bottom: 0.75rem; }
.consent-dialog .consent-form > p { color: var(--muted); font-size: 0.9375rem; }
.consent-options { margin: 1.5rem 0; padding: 0; border: 0; border-top: 1px solid var(--line); }
.consent-option { display: flex; justify-content: space-between; align-items: flex-start; gap: 1.5rem; padding: 1.1rem 0; border-bottom: 1px solid var(--line); }
.consent-label { font-weight: 600; }
.consent-help { margin: 0.3rem 0 0; font-size: var(--step--1); color: var(--muted); max-width: 52ch; }
.consent-state { min-height: 1.5em; font-size: var(--step--1); color: var(--muted); margin-bottom: 1rem; }

.switch {
  appearance: none;
  flex: none;
  position: relative;
  width: 46px;
  height: 26px;
  margin: 0.1rem 0 0;
  background: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: 99px;
  cursor: pointer;
}
.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform 0.15s ease;
}
.switch:checked { background: var(--text); border-color: var(--text); }
.switch:checked::after { transform: translateX(20px); background: var(--ink); }
.switch:disabled { opacity: 0.55; cursor: not-allowed; }

/* ---------- Pie ---------- */

.site-footer { border-top: 1px solid var(--line); padding-top: 4rem; font-size: 0.9375rem; }
.footer-grid { display: grid; grid-template-columns: minmax(0, 4fr) repeat(3, minmax(0, 2.6fr)); gap: 2.5rem; padding-bottom: 3rem; }
.footer-legal-name { margin-top: 1.25rem; font-weight: 600; }
.footer-note { color: var(--muted); max-width: 32ch; }
.footer-title { font-family: var(--font-body); font-size: var(--step--1); font-weight: 500; color: var(--muted); margin-bottom: 1rem; }
.site-footer ul { display: grid; gap: 0.55rem; }
.site-footer ul a { text-decoration: none; }
.site-footer ul a:hover { text-decoration: underline; }
.footer-base { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 2rem; padding-block: 1.5rem 2rem; border-top: 1px solid var(--line); color: var(--muted); font-size: var(--step--1); }
@media (max-width: 960px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-brand { grid-column: 1 / -1; } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; } }

/* ---------- Utilidades ---------- */

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

[hidden] { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

@media print {
  .site-header, .site-footer, .cookie-banner, .consent-dialog, .legal-side, .cta-band, .hero .trace { display: none !important; }
  body { background: #fff; color: #000; }
  a { color: #000; }
}
