/* ============================================================
   TERRENO PROPIO — landing newsletter
   Paleta: negro + amarillo eléctrico. Estética servidor/terminal.
   ============================================================ */

:root {
  /* Paleta: Mostaza Medianoche */
  --ink:    #0B0B0D;   /* fondo */
  --ink-2:  #1E1F22;   /* superficies */
  --paper:  #F2EFE8;   /* texto claro */
  --muted:  #8A897F;   /* texto secundario */
  --yellow: #FFD34D;   /* acento */
  --amber:  #CAA400;   /* sombra del acento / mostaza oscura */
  --line:   #2C2D30;   /* bordes */

  --f-display: 'Space Grotesk', system-ui, sans-serif;
  --f-mono: 'IBM Plex Mono', ui-monospace, monospace;

  --wrap: 68rem;
  --pad: clamp(1.25rem, 5vw, 4rem);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* Fondos animados WebGL, confinados a su bloque */
.sec-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  display: block;
  pointer-events: none;
}
.sec-canvas--pillar { mix-blend-mode: screen; }

/* Velo de legibilidad sobre los beams del hero */
.sec-veil {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(115% 90% at 50% 42%, rgba(11, 11, 13, .30) 0%, rgba(11, 11, 13, .74) 58%, rgba(11, 11, 13, .92) 100%);
}

/* Las secciones con fondo animado recortan y apilan su contenido encima */
.hero, .learn { position: relative; overflow: hidden; }
.hero > *:not(.sec-canvas):not(.sec-veil),
.learn > *:not(.sec-canvas) { position: relative; z-index: 1; }

html { scroll-behavior: smooth; }

body {
  background: var(--ink);
  color: var(--paper);
  font-family: var(--f-display);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Cinta hazard superior — la firma amarillo/negro */
.tape {
  height: 8px;
  background: repeating-linear-gradient(
    -45deg,
    var(--yellow) 0 18px,
    var(--ink) 18px 36px
  );
}

/* ---------- Layout base de secciones ---------- */
main > section {
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--pad);
  text-align: center;
}

/* Bloques con ancho limitado: centrar en el eje horizontal */
.hero-title,
.hero-body,
.argument,
.argument .lead,
.argument p,
.section-title,
.signup-pitch,
.signup-title,
.learn-foot,
.ps {
  margin-inline: auto;
}

.hero-body { justify-items: center; }

.mark {
  color: var(--ink);
  background: var(--yellow);
  padding: 0 .18em;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.eyebrow,
.card-idx,
.status,
.foot-status,
.ps-tag {
  font-family: var(--f-mono);
  letter-spacing: .04em;
}

/* ---------- Topbar ---------- */
.topbar {
  max-width: var(--wrap);
  margin-inline: auto;
  padding: 1.25rem var(--pad);
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand {
  font-family: var(--f-mono);
  font-weight: 600;
  font-size: .8rem;
  letter-spacing: .12em;
}

.status,
.foot-status {
  font-size: .72rem;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: .5rem;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 0 0 0 0 rgba(255, 211, 77, .6);
  animation: pulse 2.4s ease-out infinite;
}

@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(255, 211, 77, .55); }
  70%  { box-shadow: 0 0 0 7px rgba(255, 211, 77, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 211, 77, 0); }
}

/* ---------- Hero ---------- */
.hero { padding-top: clamp(3rem, 9vw, 6rem); padding-bottom: clamp(3rem, 8vw, 5rem); }

.eyebrow {
  font-size: .78rem;
  text-transform: uppercase;
  color: var(--yellow);
  margin-bottom: 1.5rem;
}

.hero-title {
  font-weight: 700;
  font-size: clamp(2.9rem, 11vw, 4.75rem);
  line-height: 1.03;
  letter-spacing: -.025em;
  max-width: 16ch;
  text-wrap: balance;
}

.hero-body {
  margin-top: 2rem;
  max-width: 46ch;
  color: #D8D5C7;
  display: grid;
  gap: 1rem;
}

.hero-body strong { color: var(--paper); }

.cta-inline {
  display: inline-block;
  margin-top: 2.25rem;
  font-family: var(--f-mono);
  font-size: .9rem;
  color: var(--yellow);
  text-decoration: none;
  border-bottom: 2px solid var(--yellow);
  padding-bottom: 2px;
  transition: gap .2s, opacity .2s;
}
.cta-inline:hover { opacity: .7; }

/* ---------- Argumento ---------- */
.argument {
  padding-block: clamp(2.5rem, 6vw, 4rem);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 1.15rem;
  max-width: 52rem;
}
.argument p { color: #CFCCBE; max-width: 54ch; }

.argument .lead p {
  font-family: var(--f-display);
  font-size: clamp(1.65rem, 6vw, 2rem);
  font-weight: 600;
  line-height: 1.2;
  color: var(--paper);
}
.argument em { font-style: normal; color: var(--yellow); }

/* Frases divididas: cada frase su propio <p>, todo centrado */
.split {
  text-align: center;
  max-width: 100%;
  margin-inline: auto;
  display: grid;
  gap: .35rem;
}
.split > * { margin: 0; max-width: none; }

.hero-verdict { margin-top: 1.25rem; }
.hero-verdict strong { color: var(--paper); }

/* ---- Página de gracias / confirmación ---- */
.hero.thanks {
  min-height: 78vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.thanks-tag {
  font-family: var(--f-mono);
  font-size: .78rem;
  letter-spacing: .12em;
  color: var(--yellow);
  margin-bottom: 1.5rem;
}
.thanks .hero-body { margin-top: 1.75rem; color: #D8D5C7; }
.thanks-hint {
  margin-top: 1.75rem;
  font-family: var(--f-mono);
  font-size: .82rem;
  color: var(--muted);
}

/* ---------- Qué aprendes ---------- */
.learn { padding-block: clamp(3.5rem, 8vw, 6rem); }

.section-title {
  font-size: clamp(2.05rem, 7vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -.015em;
  max-width: 18ch;
  margin-bottom: 2.5rem;
}

.grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.card {
  background: var(--ink);
  padding: 1.75rem;
  transition: background .2s;
}
.card:hover { background: var(--ink-2); }

.card-idx {
  display: block;
  font-size: .8rem;
  color: var(--yellow);
  margin-bottom: 1.25rem;
}

.card h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: .5rem;
}
.card p { color: var(--muted); font-size: .95rem; line-height: 1.55; }

/* ---- ScrollStack: tarjetas que se apilan al hacer scroll ---- */
.scroll-stack {
  max-width: 44rem;
  margin: 2.5rem auto 0;
  text-align: left;
}

.scroll-stack-card {
  min-height: 14rem;
  padding: 2.75rem;
  background: linear-gradient(155deg, #232427 0%, var(--ink-2) 60%);
  border: 1px solid var(--line);
  border-radius: 26px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .55);
  transform-origin: top center;
  backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.scroll-stack-card .card-idx {
  font-size: .85rem;
  margin-bottom: 1.1rem;
}
.scroll-stack-card h3 {
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 600;
  letter-spacing: -.01em;
  margin-bottom: .6rem;
}
.scroll-stack-card p {
  color: #C4C1B4;
  font-size: 1.05rem;
  max-width: 34ch;
}

.scroll-stack-end { width: 100%; height: 1px; }

.learn-foot {
  margin-top: 2rem;
  font-family: var(--f-mono);
  font-size: .85rem;
  color: var(--muted);
}

/* ---------- Suscripción ---------- */
.signup {
  padding-block: clamp(3.5rem, 8vw, 6rem);
  border-top: 1px solid var(--line);
}

.signup-pitch {
  max-width: 48ch;
  color: #CFCCBE;
  margin-bottom: 2rem;
}

.signup-title {
  font-size: clamp(2.2rem, 8vw, 3rem);
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.08;
  max-width: 16ch;
  margin-bottom: 2.5rem;
}

.form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  max-width: 30rem;
  margin-inline: auto;
}

.h-captcha { min-height: 78px; }

.form input {
  width: 100%;
  background: var(--ink-2);
  border: 1px solid var(--line);
  color: var(--paper);
  font-family: var(--f-mono);
  font-size: 1rem;
  padding: 1rem 1.1rem;
  border-radius: 0;
}
.form input::placeholder { color: #6B6857; }
.form input:focus-visible {
  outline: none;
  border-color: var(--yellow);
  box-shadow: 0 0 0 3px rgba(255, 211, 77, .22);
}

.form button {
  width: 100%;
  background: var(--yellow);
  color: var(--ink);
  font-family: var(--f-mono);
  font-weight: 600;
  font-size: .95rem;
  border: none;
  padding: 1rem 1.4rem;
  cursor: pointer;
  transition: transform .12s, box-shadow .12s;
  box-shadow: 4px 4px 0 var(--amber);
}
.form button:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--amber); }
.form button:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--amber); }
.form button:focus-visible { outline: 3px solid var(--paper); outline-offset: 2px; }

.form-note {
  margin-top: 1rem;
  font-family: var(--f-mono);
  font-size: .78rem;
  color: var(--muted);
}
.form-note.ok { color: var(--yellow); }

.ps {
  margin-top: 3rem;
  padding-top: 1.75rem;
  border-top: 1px dashed var(--line);
  max-width: 52ch;
  font-size: .95rem;
  color: var(--muted);
  font-style: italic;
}
.ps-tag {
  font-style: normal;
  font-weight: 600;
  color: var(--yellow);
  margin-right: .5rem;
}

/* ---------- Footer ---------- */
.foot {
  max-width: var(--wrap);
  margin-inline: auto;
  padding: 3rem var(--pad) 3rem;
  border-top: 1px solid var(--line);
  font-family: var(--f-mono);
  font-size: .78rem;
  color: var(--muted);
  text-align: left;
}

.foot-top {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem 3rem;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 2rem;
}

.foot-brand { max-width: 26ch; }
.foot-brand .brand {
  display: inline-block;
  margin-bottom: .75rem;
  font-size: .82rem;
}
.foot-tagline {
  color: var(--muted);
  font-size: .78rem;
  line-height: 1.6;
}

.foot-nav {
  display: grid;
  gap: .6rem;
}
.foot-nav a {
  color: var(--paper);
  text-decoration: none;
  transition: color .15s;
}
.foot-nav a:hover { color: var(--yellow); }

.foot-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  align-items: center;
  padding-top: 1.75rem;
  border-top: 1px solid var(--line);
  font-size: .72rem;
}

@media (max-width: 640px) {
  .foot-top { flex-direction: column; gap: 2rem; }
  .foot-bottom { flex-direction: column; align-items: flex-start; gap: .75rem; }
}

/* ---- Páginas legales ---- */
.legal {
  max-width: 46rem !important;
  text-align: left !important;
  padding-block: clamp(3rem, 7vw, 5rem);
}
.legal h1 {
  font-size: clamp(2.1rem, 7vw, 2.8rem);
  font-weight: 700;
  letter-spacing: -.02em;
  margin-bottom: .5rem;
}
.legal .legal-updated {
  font-family: var(--f-mono);
  font-size: .78rem;
  color: var(--muted);
  margin-bottom: 2.5rem;
}
.legal h2 {
  font-size: 1.3rem;
  font-weight: 600;
  margin: 2.5rem 0 .75rem;
  color: var(--paper);
}
.legal p, .legal li { color: #CFCCBE; margin-bottom: .9rem; }
.legal ul { padding-left: 1.25rem; margin-bottom: .9rem; }
.legal a { color: var(--yellow); }
.legal .fill {
  background: rgba(255, 211, 77, .14);
  border-bottom: 1px dashed var(--yellow);
  padding: 0 .2em;
  font-style: normal;
}
.legal .back {
  display: inline-block;
  margin-top: 3rem;
  font-family: var(--f-mono);
  font-size: .85rem;
  color: var(--yellow);
  text-decoration: none;
  border-bottom: 2px solid var(--yellow);
  padding-bottom: 2px;
}

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

/* Reveal por scroll (entrada + salida) — controlado por IntersectionObserver */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .6s ease, transform .6s cubic-bezier(.2, .7, .2, 1);
  transition-delay: var(--d, 0s);
  will-change: opacity, transform;
}
.reveal.in {
  opacity: 1;
  transform: none;
}

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  body { font-size: 1.05rem; }

  /* Hero con más aire arriba, sin quedar apretado */
  .hero {
    padding-top: clamp(2.5rem, 12vw, 4rem);
    padding-bottom: 3rem;
  }
  .hero-body { margin-top: 1.5rem; }
  .cta-inline { margin-top: 2rem; }

  /* Cards en columna, más presencia */
  .grid { grid-template-columns: 1fr; }
  .card { padding: 1.9rem 1.6rem; }
  .card-idx { font-size: .85rem; margin-bottom: 1rem; }
  .card h3 { font-size: 1.3rem; }
  .card p { font-size: 1rem; }

  /* Formulario apilado y cómodo al pulgar */
  .form { gap: .85rem; }
  .form input { flex: 1 1 100%; text-align: center; padding: 1.05rem 1rem; }
  .form button { flex: 1 1 100%; padding: 1.1rem 1.4rem; font-size: 1rem; }

  .ps { margin-top: 2.5rem; }
}

@media (max-width: 380px) {
  .hero-title { font-size: 2.6rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1 !important; transform: none !important; }
}
