/*
 * Paleta Agrover — https://coolors.co/19382b-c8d8aa-f5f1e7-a84b30-232b26
 * Contraste (WCAG AA): crema sobre verde profundo 11,4:1 · crema sobre terracota 5,0:1 ·
 * casi negro sobre crema 13,5:1 · casi negro sobre salvia 9,6:1 · terracota sobre crema 5,0:1 ·
 * crema sobre verde noche 13,6:1 · salvia sobre verde noche 10,1:1.
 * La terracota sobre verde noche da 2,7:1: ahí se usa sólo como fondo (botones, insignias con
 * texto crema) o como acento decorativo, nunca como color de texto.
 * Sin azules.
 */
:root {
  --verde-profundo: #19382b;
  --verde-noche: #0f2a1f;
  --salvia: #c8d8aa;
  --crema: #f5f1e7;
  --terracota: #a84b30;
  --casi-negro: #232b26;

  /* Derivados de la paleta (mismo tono, para estados y texto secundario) */
  --terracota-oscura: #8e3e27; /* hover del botón; crema encima 6,4:1 */
  --texto-suave: #4a524c; /* secundario sobre crema 7,2:1 y sobre salvia 5,3:1 */
  --crema-suave: rgba(245, 241, 231, 0.86); /* secundario sobre verde profundo */
  --linea: rgba(35, 43, 38, 0.14);
  --linea-clara: rgba(245, 241, 231, 0.22);

  --radius: 16px;
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 4.5rem;
}

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.6;
  color: var(--casi-negro);
  background: var(--crema);
}

a {
  color: var(--terracota);
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--terracota-oscura);
}

a:focus-visible,
.btn:focus-visible {
  outline: 3px solid var(--terracota);
  outline-offset: 3px;
}

h1,
h2,
h3 {
  margin: 0 0 1rem;
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: var(--verde-profundo);
}

h1 {
  font-size: clamp(2.2rem, 5.6vw, 4rem);
  letter-spacing: -0.03em;
}

h2 {
  font-size: clamp(1.7rem, 3.8vw, 2.5rem);
}

h3 {
  font-size: 1.25rem;
  letter-spacing: -0.01em;
}

strong {
  font-weight: 600;
}

.skip {
  position: absolute;
  left: -999px;
  top: 0.5rem;
  z-index: 30;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  background: var(--terracota);
  color: var(--crema);
}

.skip:focus {
  left: 0.5rem;
}

.wrap {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ---------- Barra superior ---------- */
/*
 * Flota sobre el hero. Sin JS queda en vidrio (legible en cualquier sección); app.js agrega
 * .is-top mientras la página está arriba de todo para que sea totalmente transparente.
 */
.topbar {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(245, 241, 231, 0.15);
  background: rgba(25, 56, 43, 0.75);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  box-shadow: none;
  transition:
    background-color 200ms ease,
    border-color 200ms ease,
    -webkit-backdrop-filter 200ms ease,
    backdrop-filter 200ms ease;
}

.topbar.is-top {
  border-bottom-color: transparent;
  background: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

@media (prefers-reduced-motion: reduce) {
  .topbar {
    transition: none;
  }
}

.topbar-inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  min-height: 4rem;
}

/* El logo es blanco y verde: sólo va sobre fondos oscuros (hero, header, pie). */
.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font);
  font-size: 1.45rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--crema);
  text-decoration: none;
}

.logo-img {
  display: block;
  width: auto;
  height: 36px;
}

.logo:hover {
  color: var(--crema);
}

.topbar nav {
  margin-left: auto;
}

.nav {
  display: flex;
  gap: 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav a {
  color: var(--crema-suave);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
}

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

/* ---------- Botones ---------- */
.btn {
  display: inline-block;
  padding: 0.85rem 1.45rem;
  border: 2px solid var(--terracota);
  border-radius: 999px;
  background: var(--terracota);
  color: var(--crema);
  font-weight: 600;
  text-decoration: none;
  transition:
    background 0.15s ease,
    border-color 0.15s ease;
}

.btn:hover {
  background: var(--terracota-oscura);
  border-color: var(--terracota-oscura);
  color: var(--crema);
}

.btn-ghost {
  background: transparent;
  border-color: var(--crema);
  color: var(--crema);
}

.btn-ghost:hover {
  background: var(--crema);
  border-color: var(--crema);
  color: var(--verde-profundo);
}

.btn-small {
  padding: 0.5rem 1.05rem;
  font-size: 0.9rem;
  white-space: nowrap;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100svh;
  padding: 8rem 0 5rem;
  overflow: hidden;
  background: var(--verde-profundo);
  color: var(--crema);
  isolation: isolate;
}

.hero-video {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 65% 50%;
}

.hero-shade {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(
      90deg,
      var(--verde-profundo) 0%,
      rgba(25, 56, 43, 0.94) 30%,
      rgba(25, 56, 43, 0.7) 48%,
      rgba(25, 56, 43, 0) 70%
    ),
    linear-gradient(0deg, rgba(25, 56, 43, 0.55) 0%, rgba(25, 56, 43, 0) 30%);
}

.hero-content {
  width: 100%;
}

.hero-content > *,
.hero .lede {
  max-width: 34rem;
}

.hero-brand {
  margin: 0 0 1.25rem;
  font-size: clamp(2.8rem, 7vw, 5.25rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.045em;
  color: var(--crema);
}

.hero h1 {
  color: var(--crema);
  font-size: clamp(1.9rem, 4.2vw, 3.1rem);
}

.hero .lede {
  color: var(--crema-suave);
}

.hero .lede strong {
  color: var(--crema);
}

.hero .note {
  color: var(--crema-suave);
}

.hero .note a {
  color: var(--crema);
}

/* ---------- Secciones ---------- */
.band {
  padding: 5rem 0;
}

.eyebrow {
  margin: 0 0 0.75rem;
  color: var(--terracota);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.eyebrow-hero {
  color: var(--salvia);
}

.lede {
  max-width: 44rem;
  margin: 0 0 2rem;
  font-size: 1.15rem;
  color: var(--texto-suave);
}

.lede-narrow {
  font-size: 1.05rem;
}

.lede strong,
.prose strong,
.callout strong {
  color: var(--casi-negro);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 0 0 1.5rem;
}

.note {
  margin: 0;
  font-size: 0.95rem;
}

.two-col {
  display: grid;
  gap: 1.5rem 3rem;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr);
}

.prose {
  color: var(--texto-suave);
}

.prose p {
  margin: 0 0 1rem;
}

/* ---------- Roles ---------- */
.cards {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 2rem 0;
  padding: 0;
  list-style: none;
}

.card {
  padding: 1.6rem;
  border: 1px solid var(--linea);
  border-radius: var(--radius);
  background: var(--crema);
}

.card p {
  margin: 0;
  color: var(--texto-suave);
}

.card .card-tag {
  margin-bottom: 0.5rem;
  color: var(--terracota);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.callout {
  padding: 1.6rem;
  border-left: 5px solid var(--terracota);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--crema);
}

.callout p {
  margin: 0;
  color: var(--texto-suave);
}

/* ---------- Tabla de procedencia ---------- */
.table-scroll {
  overflow-x: auto;
  margin: 0 0 2rem;
  border: 1px solid var(--linea);
  border-radius: var(--radius);
  background: var(--crema);
}

.provenance {
  width: 100%;
  min-width: 36rem;
  border-collapse: collapse;
}

.provenance caption {
  padding: 1rem 1.25rem 0;
  text-align: left;
  color: var(--texto-suave);
  font-size: 0.9rem;
}

.provenance th,
.provenance td {
  padding: 0.95rem 1.25rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--linea);
}

.provenance tbody tr:last-child th,
.provenance tbody tr:last-child td {
  border-bottom: 0;
}

.provenance thead th {
  color: var(--texto-suave);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.provenance tbody th {
  font-weight: 600;
  color: var(--casi-negro);
}

.provenance td {
  color: var(--texto-suave);
}

.badge {
  display: inline-block;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  color: var(--crema);
}

.badge-sim {
  background: var(--terracota);
}

.badge-real {
  background: var(--verde-profundo);
}

/* ---------- Video ---------- */
.video-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 2px dashed rgba(25, 56, 43, 0.35);
  border-radius: var(--radius);
  background: var(--salvia);
}

.video-frame video {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--casi-negro);
}

.video-pending {
  display: grid;
  place-content: center;
  height: 100%;
  padding: 1.5rem;
  text-align: center;
  color: var(--casi-negro);
}

.video-pending p {
  max-width: 32rem;
  margin: 0 auto;
}

.video-pending .video-pending-title {
  margin-bottom: 0.5rem;
  color: var(--verde-profundo);
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

/* ---------- Límites y cierre ---------- */
.limits {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--casi-negro);
}

.limits li {
  margin-bottom: 0.6rem;
}

.closing {
  text-align: center;
  background: var(--verde-profundo);
  color: var(--crema);
}

.closing h2 {
  color: var(--crema);
}

.closing .lede {
  margin-left: auto;
  margin-right: auto;
  color: var(--crema-suave);
}

/* ---------- Pie ---------- */
.footer {
  padding: 2rem 0;
  border-top: 1px solid var(--linea-clara);
  background: var(--verde-profundo);
  color: var(--crema-suave);
  font-size: 0.9rem;
}

.footer strong {
  color: var(--crema);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
}

.footer-brand {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.25rem;
}

.logo-footer {
  gap: 0.75rem;
  font-size: 1.75rem;
}

.logo-footer .logo-img {
  height: 56px;
}

.footer p {
  margin: 0;
}

/* ---------- Secciones verde noche: La propuesta, La demo, Con honestidad ---------- */
.band-noche {
  background: var(--verde-noche);
  color: var(--crema);
}

.band-noche h2,
.band-noche h3 {
  color: var(--crema);
}

.band-noche .eyebrow,
.band-noche .card .card-tag {
  color: var(--salvia);
}

.band-noche .lede,
.band-noche .prose,
.band-noche .card p,
.band-noche .callout p,
.band-noche .provenance td,
.band-noche .provenance caption,
.band-noche .provenance thead th {
  color: var(--crema-suave);
}

.band-noche strong,
.band-noche .lede strong,
.band-noche .prose strong,
.band-noche .callout strong,
.band-noche .provenance tbody th,
.band-noche .limits {
  color: var(--crema);
}

.band-noche .limits li::marker {
  color: var(--terracota);
}

.band-noche a:not(.btn) {
  color: var(--salvia);
}

.band-noche .provenance th,
.band-noche .provenance td,
.band-noche .provenance tbody tr {
  border-bottom-color: rgba(245, 241, 231, 0.12);
}

/* Insignias: terracota y salvia como fondo, con texto de contraste AA */
.band-noche .badge-real {
  background: var(--salvia);
  color: var(--casi-negro);
}

/* Liquid glass para tarjetas y bloques */
.band-noche .card,
.band-noche .callout,
.band-noche .table-scroll,
.band-noche .limits {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border: 1px solid rgba(245, 241, 231, 0.18);
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(245, 241, 231, 0.1), rgba(245, 241, 231, 0.03));
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  backdrop-filter: blur(16px) saturate(150%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.15),
    0 10px 30px rgba(0, 0, 0, 0.25);
}

.band-noche .card::before,
.band-noche .callout::before,
.band-noche .table-scroll::before,
.band-noche .limits::before {
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: radial-gradient(
    120% 80% at 0% 0%,
    rgba(245, 241, 231, 0.14) 0%,
    rgba(245, 241, 231, 0) 55%
  );
  content: '';
  pointer-events: none;
}

.band-noche .callout {
  border-left: 1px solid rgba(245, 241, 231, 0.18);
}

/* Acento terracota decorativo (no es texto) en el bloque de supervisión */
.band-noche .callout h3::before {
  display: inline-block;
  width: 0.6rem;
  height: 0.6rem;
  margin-right: 0.6rem;
  border-radius: 999px;
  background: var(--terracota);
  vertical-align: 0.15em;
  content: '';
}

.band-noche .limits {
  margin: 0;
  padding: 1.6rem 1.6rem 1.6rem 2.8rem;
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .topbar {
    background: rgba(25, 56, 43, 0.9);
  }

  .band-noche .card,
  .band-noche .callout,
  .band-noche .table-scroll,
  .band-noche .limits {
    background: rgba(25, 56, 43, 0.9);
  }
}

/* ---------- Contacto ---------- */
[hidden] {
  display: none !important;
}

.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;
}

.contact-card {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
  gap: 2.5rem 3.5rem;
  align-items: center;
  overflow: hidden;
  padding: clamp(2rem, 5vw, 3.5rem);
  border: 1px solid rgba(245, 241, 231, 0.15);
  border-radius: 32px;
  background: linear-gradient(135deg, var(--verde-noche) 0%, var(--verde-profundo) 100%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  backdrop-filter: blur(16px) saturate(150%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.15),
    0 10px 30px rgba(0, 0, 0, 0.25);
  color: var(--crema);
}

/* Brillo salvia en la esquina superior derecha */
.contact-card::before {
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: radial-gradient(
    60% 70% at 100% 0%,
    rgba(200, 216, 170, 0.22) 0%,
    rgba(200, 216, 170, 0) 70%
  );
  content: '';
  pointer-events: none;
}

.contact-card h2 {
  color: var(--crema);
}

.contact-lede {
  margin: 0 0 1.5rem;
  font-size: 1.1rem;
  color: rgba(245, 241, 231, 0.85);
}

.contact-checks {
  display: grid;
  gap: 0.6rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-weight: 600;
}

.contact-checks li {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.contact-checks li::before {
  flex: none;
  display: grid;
  place-items: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 999px;
  background: rgba(200, 216, 170, 0.18);
  color: var(--salvia);
  font-size: 0.85rem;
  font-weight: 800;
  content: '✓';
}

.contact-direct {
  margin: 1.5rem 0 0;
  color: rgba(245, 241, 231, 0.85);
}

.contact-direct a {
  color: var(--salvia);
}

.contact-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.contact-form input {
  width: 100%;
  padding: 0.85rem 1.25rem;
  border: 1px solid rgba(245, 241, 231, 0.3);
  border-radius: 999px;
  background: rgba(245, 241, 231, 0.08);
  color: var(--crema);
  font: inherit;
  font-size: 0.95rem;
  appearance: none;
}

.contact-form input::placeholder {
  color: var(--crema);
  opacity: 0.75;
}

.contact-form input:focus-visible {
  outline: 2px solid var(--salvia);
  outline-offset: 2px;
  border-color: var(--salvia);
}

.contact-form input[aria-invalid='true'] {
  border-color: var(--salvia);
  box-shadow: 0 0 0 1px var(--salvia);
}

.contact-actions {
  display: flex;
  justify-content: center;
  margin-top: 1.5rem;
}

.contact-submit {
  cursor: pointer;
  font: inherit;
  font-weight: 600;
}

/* Hover un poco más claro: crema sobre #b0503a mantiene 4,59:1 */
.contact-submit:hover {
  border-color: #b0503a;
  background: #b0503a;
}

.contact-submit:focus-visible {
  outline: 3px solid var(--salvia);
  outline-offset: 3px;
}

.contact-honeypot {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.contact-turnstile {
  margin: 0.75rem 0 0;
}

.contact-error {
  margin: 0.75rem 0 0;
  color: var(--terracota);
  font-size: 0.95rem;
  font-weight: 600;
}

.contact-note {
  margin: 1rem 0 0;
  text-align: center;
  font-size: 0.82rem;
  color: rgba(245, 241, 231, 0.85);
}

.contact-success {
  padding: 2.5rem 1.5rem;
  border: 1px solid rgba(245, 241, 231, 0.18);
  border-radius: 24px;
  background: rgba(245, 241, 231, 0.06);
  text-align: center;
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.contact-success:focus {
  outline: none;
}

.contact-success p {
  margin: 0;
}

/* ---------- 404 ---------- */
.page-404 {
  display: grid;
  place-items: center;
  padding: 2rem;
  background: var(--verde-profundo);
  color: var(--crema);
}

.not-found h1 {
  color: var(--crema);
}

/* ---------- Móvil ---------- */
@media (max-width: 820px) {
  .two-col,
  .cards,
  .contact-card,
  .contact-fields {
    grid-template-columns: 1fr;
  }

  .contact-submit {
    width: 100%;
    text-align: center;
  }

  .topbar nav {
    display: none;
  }

  .topbar .logo-img {
    height: 30px;
  }

  .topbar .logo {
    font-size: 1.25rem;
  }

  .topbar-inner {
    justify-content: space-between;
  }

  .hero {
    justify-content: flex-end;
    padding: 6.5rem 0 4rem;
  }

  .hero-video {
    object-position: 72% 50%;
  }

  /* En pantallas angostas el texto ocupa todo el ancho: el degradé sube desde abajo */
  .hero-shade {
    background: linear-gradient(
      0deg,
      var(--verde-profundo) 0%,
      rgba(25, 56, 43, 0.9) 45%,
      rgba(25, 56, 43, 0.75) 75%,
      rgba(25, 56, 43, 0.6) 100%
    );
  }

  .band {
    padding: 3.5rem 0;
  }

  .video-frame {
    aspect-ratio: 4 / 3;
  }

  /* La tabla de procedencia se apila para leerse sin desplazamiento lateral. */
  .provenance {
    min-width: 0;
  }

  .provenance thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .provenance tbody tr {
    display: grid;
    gap: 0.4rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--linea);
  }

  .provenance tbody tr:last-child {
    border-bottom: 0;
  }

  .provenance th,
  .provenance td {
    padding: 0;
    border-bottom: 0;
  }

  .badge {
    justify-self: start;
  }
}
