/*
 * Estilos del sitio público. Portados de la versión en Node (globals.css), con dos ajustes:
 *
 * 1. Al principio va el subconjunto del reset de Tailwind sobre el que se escribieron esos
 *    estilos: márgenes en cero, enlaces que heredan color, etc. Sin él el sitio se vería distinto.
 * 2. No hay estilos en línea —la CSP no los permite—. Lo que antes era style={{...}} en React
 *    ahora son clases: .tone-* para los colores de cada tarjeta, .hp para el campo trampa.
 */

/* ── Reset ─────────────────────────────────────────────────────────────── */

*,
::before,
::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border: 0 solid;
}

html {
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  background: var(--paper);
}

h1, h2, h3, h4, h5, h6 {
  font-size: inherit;
  font-weight: inherit;
}

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

b, strong {
  font-weight: bolder;
}

small {
  font-size: 80%;
}

img, svg {
  display: block;
  vertical-align: middle;
}

img {
  max-width: 100%;
  height: auto;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
  background-color: transparent;
  border-radius: 0;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: default;
}

textarea {
  resize: vertical;
}

ol, ul {
  list-style: none;
}

/* ── Marca ─────────────────────────────────────────────────────────────── */

:root {
  --ink: #101424;
  --paper: #f6f7fb;
  --paper-strong: #ffffff;
  --blue: #31a9d8;
  --blue-deep: #2361a9;
  --purple: #5d3186;
  --magenta: #df2179;
  --lime: #8fc83f;
  --orange: #f49a1c;
  --lavender: #a47ad0;
  --muted: #6d7280;
  --line: rgba(16, 20, 36, 0.12);
  --radius: 1.5rem;
}

/* Color de acento de cada tarjeta de servicio y de cada paso del método. */
.tone-blue { --tone: var(--blue); }
.tone-blue-deep { --tone: var(--blue-deep); }
.tone-purple { --tone: var(--purple); }
.tone-magenta { --tone: var(--magenta); }
.tone-lime { --tone: var(--lime); }
.tone-orange { --tone: var(--orange); }
.tone-lavender { --tone: var(--lavender); }

body {
  color: var(--ink);
  background:
    radial-gradient(circle at 92% 5%, rgba(49, 169, 216, 0.1), transparent 23rem),
    var(--paper);
  font-family: Inter, "Segoe UI", Helvetica, Arial, sans-serif;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

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

:focus-visible {
  outline: 3px solid rgba(49, 169, 216, 0.55);
  outline-offset: 4px;
}

/* Visible sólo para lectores de pantalla. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.container-shell {
  width: min(100% - 2rem, 1320px);
  margin-inline: auto;
}

.section-pad {
  padding-block: clamp(5rem, 10vw, 9rem);
}

.display {
  font-family: "Arial Narrow", "Roboto Condensed", Inter, sans-serif;
  font-stretch: condensed;
  letter-spacing: -0.07em;
  line-height: 0.88;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.eyebrow::before {
  width: 2rem;
  height: 1px;
  content: "";
  background: currentColor;
}

/* ── Botones ───────────────────────────────────────────────────────────── */

.btn-primary,
.btn-ghost,
.btn-light {
  display: inline-flex;
  min-height: 3.25rem;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  border-radius: 999px;
  padding: 0.8rem 1.25rem;
  font-size: 0.88rem;
  font-weight: 750;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.btn-primary {
  color: white;
  background: var(--ink);
  box-shadow: 0 14px 32px rgba(16, 20, 36, 0.16);
}

.btn-primary:hover,
.btn-light:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 34px rgba(16, 20, 36, 0.22);
}

.btn-ghost {
  color: var(--ink);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.55);
}

.btn-ghost:hover {
  transform: translateY(-2px);
  background: white;
}

.btn-light {
  color: var(--ink);
  background: white;
}

.btn-light:disabled {
  opacity: 0.75;
  transform: none;
  box-shadow: none;
}

/* ── Cabecera ──────────────────────────────────────────────────────────── */

.site-header {
  position: fixed;
  z-index: 50;
  inset: 1rem 0 auto;
}

.nav-glass {
  display: flex;
  min-height: 4.5rem;
  align-items: center;
  justify-content: space-between;
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 1.25rem;
  padding: 0.65rem 0.7rem 0.65rem 1rem;
  background: rgba(250, 251, 253, 0.78);
  box-shadow: 0 18px 60px rgba(25, 35, 55, 0.08);
  backdrop-filter: blur(18px);
}

.brand-mark {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-weight: 800;
  letter-spacing: -0.035em;
}

.brand-symbol {
  position: relative;
  width: 2.6rem;
  height: 2.6rem;
  overflow: hidden;
  border-radius: 0.9rem;
  background: white;
}

/* El isotipo viene con aire alrededor: se recorta a un cuadrado centrado en el símbolo. */
.brand-symbol img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 34%;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.6rem;
  color: #505563;
  font-size: 0.82rem;
  font-weight: 650;
}

.nav-links a {
  transition: color 160ms ease;
}

.nav-links a:hover {
  color: var(--ink);
}

/* ── Portada ───────────────────────────────────────────────────────────── */

.hero {
  position: relative;
  display: grid;
  min-height: 100svh;
  align-items: center;
  overflow: clip;
  padding: 9rem 0 4rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(340px, 0.9fr);
  gap: clamp(3rem, 7vw, 8rem);
  align-items: center;
}

.hero-title {
  max-width: 900px;
  margin: 1.65rem 0 2rem;
  font-size: clamp(4.3rem, 9.5vw, 9.2rem);
  font-weight: 760;
}

.hero-title .accent {
  color: transparent;
  background: linear-gradient(100deg, var(--blue-deep), var(--purple) 45%, var(--magenta));
  background-clip: text;
  -webkit-background-clip: text;
}

.hero-copy {
  display: grid;
  grid-template-columns: minmax(0, 34rem) auto;
  gap: 2rem;
  align-items: end;
}

.hero-copy p {
  color: #5c6270;
  font-size: clamp(1rem, 1.5vw, 1.18rem);
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 2rem;
}

.hero-visual {
  position: relative;
  min-height: 34rem;
}

.orbit {
  position: absolute;
  inset: 2rem;
  border: 1px solid rgba(93, 49, 134, 0.16);
  border-radius: 50%;
  animation: rotate 22s linear infinite;
}

.orbit::before,
.orbit::after {
  position: absolute;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  content: "";
  background: var(--magenta);
  box-shadow: 0 0 0 0.5rem rgba(223, 33, 121, 0.11);
}

.orbit::before {
  top: 10%;
  left: 16%;
}

.orbit::after {
  right: 9%;
  bottom: 19%;
  background: var(--blue);
  box-shadow: 0 0 0 0.5rem rgba(49, 169, 216, 0.11);
}

.signal-card {
  position: absolute;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 2.2rem;
  padding: 1.25rem;
  background: rgba(255, 255, 255, 0.68);
  box-shadow: 0 30px 80px rgba(38, 50, 86, 0.13);
  backdrop-filter: blur(16px);
}

.signal-main {
  inset: 8% 4% 10% 7%;
  transform: rotate(3deg);
}

.signal-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #6d7280;
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.live-dot {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.live-dot::before {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  content: "";
  background: var(--lime);
  box-shadow: 0 0 0 0.3rem rgba(143, 200, 63, 0.13);
}

.signal-logo {
  position: relative;
  align-self: center;
  width: min(80%, 18rem);
  aspect-ratio: 0.68;
  overflow: hidden;
  border-radius: 10rem 10rem 2.5rem 2.5rem;
  filter: saturate(0.94);
}

.signal-logo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.signal-bottom {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.metric {
  border-top: 1px solid var(--line);
  padding-top: 0.75rem;
}

.metric strong {
  display: block;
  font-size: 1.15rem;
}

.metric span {
  color: var(--muted);
  font-size: 0.67rem;
}

.floating-tag {
  position: absolute;
  z-index: 2;
  right: -1.2rem;
  bottom: 22%;
  max-width: 12rem;
  border-radius: 1rem;
  padding: 0.9rem 1rem;
  color: white;
  background: var(--ink);
  box-shadow: 0 18px 42px rgba(16, 20, 36, 0.25);
  transform: rotate(-4deg);
}

.floating-tag strong {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.82rem;
}

.floating-tag span {
  color: #b8becc;
  font-size: 0.67rem;
}

.color-rail {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  grid-template-columns: 1.6fr 1fr 0.8fr 0.5fr 0.35fr;
  height: 0.3rem;
}

.color-rail span:nth-child(1) { background: var(--blue); }
.color-rail span:nth-child(2) { background: var(--purple); }
.color-rail span:nth-child(3) { background: var(--magenta); }
.color-rail span:nth-child(4) { background: var(--lime); }
.color-rail span:nth-child(5) { background: var(--orange); }

/* ── Secciones ─────────────────────────────────────────────────────────── */

.intro-line {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 4rem;
}

.section-title {
  max-width: 850px;
  margin: 0;
  font-size: clamp(3.3rem, 7vw, 7rem);
  font-weight: 750;
}

.section-note {
  max-width: 23rem;
  color: var(--muted);
  line-height: 1.7;
}

.section-note.spaced {
  margin-top: 2rem;
}

/* ── Servicios ─────────────────────────────────────────────────────────── */

.services-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  border-top: 1px solid var(--line);
}

.service-card {
  position: relative;
  grid-column: span 4;
  min-height: 22rem;
  overflow: hidden;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 1.5rem;
  transition: color 260ms ease, background 260ms ease, transform 260ms ease;
}

.service-card:nth-child(3n) {
  border-right: 0;
}

.service-card:hover {
  z-index: 2;
  color: white;
  background: var(--ink);
  transform: translateY(-0.35rem);
}

.service-card::after {
  position: absolute;
  right: -4rem;
  bottom: -4rem;
  width: 11rem;
  height: 11rem;
  border-radius: 50%;
  content: "";
  background: var(--tone);
  filter: blur(3px);
  opacity: 0.12;
  transition: transform 400ms ease, opacity 300ms ease;
}

.service-card:hover::after {
  opacity: 0.38;
  transform: scale(1.65);
}

.service-index {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.12em;
}

.service-card:hover .service-index,
.service-card:hover p {
  color: #b8becc;
}

.service-icon {
  display: grid;
  width: 3.4rem;
  height: 3.4rem;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
  transition: transform 250ms ease;
}

.service-card:hover .service-icon {
  color: var(--ink);
  background: white;
  transform: rotate(8deg) scale(1.06);
}

.service-card h3 {
  margin: 5.3rem 0 0.65rem;
  font-size: clamp(1.5rem, 2vw, 2rem);
  letter-spacing: -0.05em;
}

.service-card p {
  max-width: 17rem;
  color: var(--muted);
  line-height: 1.6;
}

/* ── Método ────────────────────────────────────────────────────────────── */

.method-section {
  color: white;
  background:
    radial-gradient(circle at 85% 10%, rgba(49, 169, 216, 0.23), transparent 25rem),
    radial-gradient(circle at 5% 95%, rgba(223, 33, 121, 0.18), transparent 26rem),
    var(--ink);
}

.method-section .eyebrow,
.method-section .section-note {
  color: #adb4c4;
}

.method-flow {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  margin-top: 5rem;
}

.method-step {
  position: relative;
  min-height: 15rem;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  padding: 1.25rem 1rem 0 0;
}

.method-step::before {
  position: absolute;
  top: -0.36rem;
  left: 0;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  content: "";
  background: var(--tone);
  box-shadow: 0 0 0 0.45rem color-mix(in srgb, var(--tone), transparent 82%);
}

.method-step span {
  color: #798294;
  font-size: 0.7rem;
  font-weight: 750;
  letter-spacing: 0.12em;
}

.method-step h3 {
  margin-top: 4.5rem;
  font-size: clamp(1.2rem, 2vw, 1.75rem);
  letter-spacing: -0.04em;
}

/* ── Tecnología ────────────────────────────────────────────────────────── */

.tech-layout {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 6rem;
  align-items: start;
}

.tech-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  border-top: 1px solid var(--line);
}

.tech-item {
  min-height: 9rem;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 1.3rem;
}

.tech-item:nth-child(2n) {
  border-right: 0;
}

.tech-item small {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.tech-item strong {
  display: block;
  margin-top: 2.5rem;
  font-size: 1.1rem;
}

/* ── Contacto ──────────────────────────────────────────────────────────── */

.contact-panel {
  position: relative;
  overflow: hidden;
  border-radius: 2.4rem;
  padding: clamp(2rem, 6vw, 5rem);
  color: white;
  background: linear-gradient(135deg, #502b79 0%, #293d85 50%, #158dbf 100%);
  box-shadow: 0 40px 90px rgba(43, 58, 113, 0.25);
}

.contact-panel::after {
  position: absolute;
  width: 25rem;
  height: 25rem;
  right: -8rem;
  bottom: -12rem;
  border: 1px solid rgba(255, 255, 255, 0.19);
  border-radius: 50%;
  content: "";
  box-shadow: 0 0 0 4rem rgba(255, 255, 255, 0.025), 0 0 0 8rem rgba(255, 255, 255, 0.02);
}

.contact-panel .eyebrow {
  color: rgba(255, 255, 255, 0.7);
}

.contact-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: clamp(3rem, 8vw, 8rem);
}

.contact-title {
  margin: 1.5rem 0;
  font-size: clamp(3.2rem, 6vw, 6.4rem);
  font-weight: 750;
}

.contact-copy {
  max-width: 28rem;
  color: rgba(255, 255, 255, 0.68);
  font-size: 1rem;
  line-height: 1.7;
}

.contact-form {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.form-field {
  display: grid;
  gap: 0.45rem;
}

.form-field.full {
  grid-column: 1 / -1;
}

.form-field label {
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.7rem;
  font-weight: 750;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.form-field input,
.form-field select,
.form-field textarea {
  min-height: 3.25rem;
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 0.9rem;
  padding: 0.75rem 0.9rem;
  color: white;
  background: rgba(12, 18, 46, 0.22);
  outline: none;
}

.form-field input::placeholder,
.form-field textarea::placeholder {
  color: rgba(255, 255, 255, 0.38);
}

.form-field select option {
  color: var(--ink);
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  border-color: rgba(255, 255, 255, 0.55);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08);
}

/* Errores por campo: ahora los devuelve el servidor junto al campo, no un solo mensaje general. */
.form-field [aria-invalid="true"] {
  border-color: #ffb3c7;
}

.field-error {
  color: #ffd0db;
  font-size: 0.78rem;
}

.form-status {
  grid-column: 1 / -1;
  min-height: 1.5rem;
  font-size: 0.82rem;
  color: white;
}

.form-status.is-error {
  color: #ffd0db;
}

.form-status.is-success {
  border-radius: 0.9rem;
  padding: 0.9rem 1rem;
  background: rgba(143, 200, 63, 0.18);
}

/* Campo trampa: fuera de la vista de las personas, al alcance de los robots. */
.hp {
  position: absolute;
  left: -10000px;
}

.spin {
  animation: rotate 0.9s linear infinite;
}

/* ── Pie ───────────────────────────────────────────────────────────────── */

.site-footer {
  padding: 3rem 0;
}

.footer-line {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 3rem;
  align-items: center;
  border-top: 1px solid var(--line);
  padding-top: 2rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.footer-links {
  display: flex;
  gap: 1.25rem;
}

/* ── Páginas de error ──────────────────────────────────────────────────── */

.error-page {
  min-height: 70svh;
  padding: 11rem 0 4rem;
}

.error-page h1 {
  margin: 1.5rem 0 1rem;
  font-size: clamp(3rem, 8vw, 5.5rem);
  font-weight: 750;
}

.error-page .lead {
  max-width: 36rem;
  margin-bottom: 2rem;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1.7;
}

.error-detail {
  margin-top: 3rem;
  border: 1px solid var(--magenta);
  border-radius: 0.75rem;
  padding: 1rem 1.25rem;
  background: #fff5f9;
}

.error-detail summary {
  cursor: pointer;
  font-weight: 600;
}

.error-detail pre {
  margin-top: 1rem;
  overflow-x: auto;
  font-size: 0.8rem;
  white-space: pre-wrap;
  word-break: break-word;
}

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

/* ── Adaptación a pantallas ────────────────────────────────────────────── */

@media (max-width: 980px) {
  .nav-links { display: none; }
  .hero { min-height: auto; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-title { font-size: clamp(4.2rem, 15vw, 7.5rem); }
  .hero-visual { min-height: 38rem; max-width: 37rem; width: 100%; margin-inline: auto; }
  .hero-copy { grid-template-columns: 1fr; }
  .service-card { grid-column: span 6; }
  .service-card:nth-child(3n) { border-right: 1px solid var(--line); }
  .service-card:nth-child(2n) { border-right: 0; }
  .method-flow { grid-template-columns: 1fr; }
  .method-step { min-height: 9rem; border-top: 0; border-left: 1px solid rgba(255,255,255,.2); padding: 0 0 2rem 2rem; }
  .method-step::before { top: .25rem; left: -.36rem; }
  .method-step h3 { margin-top: 1.1rem; }
  .tech-layout, .contact-grid { grid-template-columns: 1fr; gap: 3rem; }
}

@media (max-width: 640px) {
  .container-shell { width: min(100% - 1.25rem, 1320px); }
  .site-header { inset-block-start: .6rem; }
  .nav-glass { min-height: 3.9rem; border-radius: 1rem; }
  .brand-mark > span:not(.brand-symbol) { display: none; }
  .nav-glass .btn-primary { min-height: 2.75rem; padding: .65rem .9rem; font-size: .75rem; }
  .hero { padding-top: 7.5rem; }
  .hero-title { font-size: clamp(3.8rem, 20vw, 5.3rem); }
  .hero-copy p { font-size: .96rem; }
  .hero-actions > a { flex: 1; }
  .hero-visual { min-height: 31rem; }
  .signal-main { inset: 7% 1% 8%; }
  .floating-tag { right: -.2rem; bottom: 17%; }
  .intro-line { flex-direction: column; }
  .section-title { font-size: clamp(3.2rem, 17vw, 5rem); }
  .service-card { grid-column: 1 / -1; min-height: 19rem; border-right: 0 !important; }
  .service-card h3 { margin-top: 3.6rem; }
  .tech-list, .contact-form { grid-template-columns: 1fr; }
  .tech-item { border-right: 0; }
  .contact-panel { border-radius: 1.5rem; }
  .footer-line { grid-template-columns: 1fr; gap: 1rem; }
  .error-page { padding-top: 8rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
