/* Tokens de los dos proyectos Astra Node: RTMP-AstraNode/frontend/styles.css y
   AstraNode/frontend/shared/style.css. */
@font-face {
  font-family: "Space Grotesk";
  src: url("assets/fonts/space-grotesk-latin-400-normal.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Space Grotesk";
  src: url("assets/fonts/space-grotesk-latin-500-normal.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Space Grotesk";
  src: url("assets/fonts/space-grotesk-latin-600-normal.woff2") format("woff2");
  font-weight: 600; font-style: normal; font-display: swap;
}

@font-face {
  font-family: "JetBrains Mono";
  src: url("assets/fonts/jetbrains-mono-latin-400-normal.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("assets/fonts/jetbrains-mono-latin-500-normal.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}

:root {
  --ink: #0a0d12;
  --panel: #12171f;
  --raised: #1a202c;
  --line: #2a2f3a;
  --paper: #f5f0eb;
  --muted: #a79b93;
  --copper: #d4a593;
  --copper-hi: #f3d0c1;
  --tally: #e0584b;
  --tally-off: #4b4f5b;
  --warn: #e8c56d;
  --ok: #7ec9a0;
  --err: #d8847a;

  --font: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --wrap: min(1120px, 100% - 40px);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 84px; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .lamp-wait, .lamp-live { animation: none !important; }
}

body {
  margin: 0;
  color: var(--paper);
  background:
    radial-gradient(70rem 40rem at 90% -10%, rgba(28, 56, 82, 0.38), transparent 70%),
    radial-gradient(40rem 28rem at -5% 45%, rgba(212, 165, 147, 0.06), transparent 70%),
    var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, p, dl, dd, ol, ul, figure { margin: 0; }
ul, ol { padding: 0; }
a { color: var(--copper); }
a:focus-visible, summary:focus-visible, .btn-main:focus-visible, .btn-line:focus-visible {
  outline: 2px solid var(--copper);
  outline-offset: 3px;
  border-radius: 6px;
}
img { display: block; max-width: 100%; }

.wrap { width: var(--wrap); margin-inline: auto; }

/* ---------- Barra superior ---------- */
.site {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(10, 13, 18, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-inner {
  height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--paper);
  text-decoration: none;
  font-weight: 600;
  font-size: 1.0625rem;
  letter-spacing: -0.01em;
}
.brand img { width: 34px; height: 34px; }
.site-nav { display: flex; gap: 24px; }
.site-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9375rem;
  padding: 6px 0;
  border-bottom: 1px solid transparent;
  transition: color 160ms ease, border-color 160ms ease;
}
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--paper); border-bottom-color: var(--copper); }

/* ---------- Botones ---------- */
.btn-main, .btn-line {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 24px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}
.btn-main { background: var(--copper); color: var(--ink); }
.btn-main:hover { background: var(--copper-hi); }
.btn-line { border: 1px solid #3a4150; color: var(--paper); }
.btn-line:hover { border-color: var(--copper); color: var(--copper-hi); }
.btn-small { padding: 10px 16px; font-size: 0.9375rem; border-radius: 8px; }
.os-ico { width: 18px; height: 18px; flex: none; fill: currentColor; }
.pick-guide { margin-top: 18px; font-size: 0.9375rem; }
.pick-guide a { color: var(--copper); }

/* ---------- Portada (descargas) ---------- */
.hero { padding: clamp(64px, 10vw, 120px) 0 clamp(56px, 8vw, 96px); }
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr);
  gap: clamp(40px, 6vw, 88px);
  align-items: center;
}
.hero h1 {
  font-size: clamp(2.8rem, 6.4vw, 5rem);
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 1;
  margin-bottom: 26px;
}
.lede {
  color: var(--muted);
  font-size: clamp(1.0625rem, 1.5vw, 1.25rem);
  line-height: 1.6;
  max-width: 34ch;
}
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.reassure {
  margin-top: 22px;
  color: var(--muted);
  font-size: 0.9375rem;
}

/* Capturas de la app, en un marco que parece ventana */
.stage { position: relative; min-height: 420px; }
.shot {
  margin: 0;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid #262c38;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(212, 165, 147, 0.05);
  background: var(--panel);
}
.shot img { width: 100%; height: auto; }
.shot figcaption {
  padding: 12px 16px;
  color: var(--muted);
  font-size: 0.875rem;
  border-top: 1px solid var(--line);
  background: var(--panel);
}
.stage .shot-rtmp { width: 82%; position: absolute; top: 0; left: 0; }
.stage .shot-webrtc { width: 74%; position: absolute; right: 0; bottom: 0; }

/* Elige tu opción */
.section { border-top: 1px solid var(--line); padding: clamp(64px, 9vw, 104px) 0; }
.section-head { max-width: 640px; margin-bottom: 48px; }
.section-head h2 {
  font-size: clamp(2.2rem, 4.6vw, 3.25rem);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.05;
  margin-bottom: 14px;
}
.section-head p { color: var(--muted); }

.pick {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
  padding: 44px 0;
  border-top: 1px solid var(--line);
}
.pick:first-of-type { border-top: 0; padding-top: 0; }
.pick:last-of-type { padding-bottom: 0; }
.pick .shot img { aspect-ratio: 1080 / 760; object-fit: cover; object-position: top; }
.pick h3 {
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 14px;
}
.pick p { color: var(--muted); max-width: 46ch; }
.pick ul { list-style: none; margin: 22px 0 0; display: grid; gap: 10px; }
.pick li { position: relative; padding-left: 26px; color: var(--paper); font-size: 1rem; }
.pick li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 12px;
  height: 2px;
  background: var(--copper);
}
.pick-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; align-items: center; }
.pick-meta { color: var(--muted); font-size: 0.875rem; margin-top: 14px; }

/* Beneficios: tres columnas con regla superior */
.perks {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(24px, 4vw, 48px);
}
.perks > div { border-top: 1px solid var(--copper); padding-top: 22px; }
.perks h3 { font-size: 1.25rem; font-weight: 600; letter-spacing: -0.01em; margin-bottom: 10px; }
.perks p { color: var(--muted); font-size: 0.975rem; }

/* ---------- Guías ---------- */
.guide-hero { padding: clamp(56px, 8vw, 96px) 0 clamp(40px, 6vw, 64px); }
.back {
  display: inline-flex;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9375rem;
  margin-bottom: 28px;
}
.back:hover { color: var(--copper-hi); }
.guide-hero h1 {
  font-size: clamp(2.6rem, 5.8vw, 4.4rem);
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 1.02;
  margin-bottom: 22px;
  max-width: 16ch;
}
.guide-hero .lede { max-width: 52ch; }
.guide-hero figure { margin-top: 56px; }

.explain {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: clamp(28px, 5vw, 72px);
  padding: clamp(48px, 7vw, 80px) 0;
  border-top: 1px solid var(--line);
}
.explain h2 {
  font-size: clamp(1.9rem, 3.6vw, 2.5rem);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.1;
}
.explain p { color: var(--muted); margin-bottom: 16px; max-width: 60ch; }
.explain p:last-child { margin-bottom: 0; }
.explain b { color: var(--paper); font-weight: 500; }

.checklist { list-style: none; display: grid; gap: 14px; }
.checklist li {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  color: var(--paper);
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.checklist li::before {
  content: "";
  width: 14px;
  height: 14px;
  margin-top: 6px;
  border-radius: 4px;
  border: 1.5px solid var(--copper);
}
.checklist span { color: var(--muted); display: block; font-size: 0.9375rem; }

.steps-wrap { padding: clamp(48px, 7vw, 80px) 0; border-top: 1px solid var(--line); }
.steps-wrap h2 {
  font-size: clamp(1.9rem, 3.6vw, 2.5rem);
  font-weight: 600;
  letter-spacing: -0.035em;
  margin-bottom: 40px;
}
.steps {
  list-style: none;
  counter-reset: step;
  border-left: 1px solid var(--line);
  margin-left: 16px;
  max-width: 820px;
}
.steps li {
  position: relative;
  counter-increment: step;
  padding: 0 0 48px 46px;
}
.steps li:last-child { padding-bottom: 0; }
.steps li::before {
  content: counter(step);
  position: absolute;
  left: -17px;
  top: -2px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--copper);
  border-radius: 50%;
  background: var(--ink);
  color: var(--copper);
  font-weight: 600;
  font-size: 0.9375rem;
}
.steps h3 {
  font-size: 1.3125rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.3;
  margin-bottom: 10px;
  padding-top: 4px;
}
.steps p { color: var(--muted); max-width: 60ch; }
.steps p + p { margin-top: 10px; }
.steps b { color: var(--paper); font-weight: 500; }
.steps .inline-shot { margin-top: 22px; max-width: 560px; }

.tips { list-style: none; display: grid; gap: 12px; margin-top: 14px; }
.tips li { color: var(--muted); padding-left: 0; }
.tips b { color: var(--paper); font-weight: 500; }

.lamps { display: grid; gap: 0; border-top: 1px solid var(--line); margin-top: 16px; max-width: 620px; }
.lamps > div {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}
.lamps b { color: var(--paper); font-weight: 500; }

.help { padding: clamp(48px, 7vw, 80px) 0; border-top: 1px solid var(--line); }
.help h2 {
  font-size: clamp(1.9rem, 3.6vw, 2.5rem);
  font-weight: 600;
  letter-spacing: -0.035em;
  margin-bottom: 28px;
}
details { border-bottom: 1px solid var(--line); max-width: 760px; }
details:first-of-type { border-top: 1px solid var(--line); }
summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 18px 0;
  cursor: pointer;
  font-weight: 500;
  font-size: 1.0625rem;
  list-style: none;
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: "+";
  flex: none;
  color: var(--copper);
  font-size: 1.375rem;
  line-height: 1;
}
details[open] summary::after { content: "−"; }
details p { color: var(--muted); padding: 0 0 20px; max-width: 60ch; }

.closer {
  border-top: 1px solid var(--line);
  padding: clamp(64px, 9vw, 104px) 0;
  text-align: left;
}
.closer h2 {
  font-size: clamp(2.2rem, 4.8vw, 3.4rem);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.04;
  max-width: 18ch;
  margin-bottom: 28px;
}

/* ---------- Pie ---------- */
.site-foot {
  border-top: 1px solid var(--line);
  padding: 30px 0 42px;
  color: var(--muted);
  font-size: 0.875rem;
}
.site-foot .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }

/* ---------- Luces de estado (mismos colores que la app WebRTC) ---------- */
.lamp {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--tally-off);
}
.lamp-live {
  background: var(--tally);
  box-shadow: 0 0 0 4px rgba(224, 88, 75, 0.18), 0 0 14px rgba(224, 88, 75, 0.6);
}
.lamp-wait {
  background: var(--warn);
  animation: tally-pulse 1.2s ease-in-out infinite;
}
.lamp-error {
  background: transparent;
  box-shadow: inset 0 0 0 2px var(--err);
}
@keyframes tally-pulse { 50% { opacity: 0.35; } }

/* ---------- Anchos menores ---------- */
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); }
  .lede { max-width: 56ch; }
  .stage { min-height: 0; display: grid; gap: 16px; }
  .stage .shot-rtmp, .stage .shot-webrtc { position: static; width: 100%; }
  .pick { grid-template-columns: minmax(0, 1fr); }
  .perks { grid-template-columns: minmax(0, 1fr); }
  .explain { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  body { font-size: 1rem; }
  .site-nav { gap: 16px; }
  .site-nav a { font-size: 0.875rem; }
  .btn-main, .btn-line { width: 100%; }
  .cta-row { flex-direction: column; }
  .pick .shot img { aspect-ratio: 4 / 3; }
  .steps { margin-left: 14px; }
  .steps li { padding-left: 42px; }
}

