:root {
  --bg: #121410;
  --paper: #f3f0e8;
  --signal: #d6ff4a;
  --ink: #171910;
  --muted: #c8ccbf;
  --soft: #5e6456;
  --line: rgba(243, 240, 232, 0.16);
  --ink-line: rgba(23, 25, 16, 0.14);
  color-scheme: dark;
  font-family: "Geist", "Avenir Next", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--paper);
  font-size: 1.02rem;
  line-height: 1.5;
  background-image:
    linear-gradient(rgba(214, 255, 74, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(214, 255, 74, 0.04) 1px, transparent 1px);
  background-size: 28px 28px;
}

::selection { background: var(--signal); color: var(--bg); }

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

a { color: inherit; }

code {
  font-family: "Geist", ui-monospace, monospace;
  font-size: 0.92em;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  background: var(--signal);
  color: var(--bg);
  padding: 0.4rem 0.7rem;
  z-index: 5;
}

.skip:focus { top: 1rem; }

.wrap {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
}

.top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  padding: 1.15rem 0;
  border-bottom: 1px solid var(--line);
}

.mark {
  font-family: "Fraunces", "Iowan Old Style", Palatino, serif;
  font-weight: 620;
  font-size: 1.5rem;
  letter-spacing: -0.03em;
  text-decoration: none;
}

.top nav { display: flex; gap: 1rem; }

.top nav a { text-decoration: none; }

.pill {
  margin-left: auto;
  border: 1px solid var(--signal);
  color: var(--signal);
  padding: 0.25rem 0.55rem;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(16rem, 0.7fr);
  gap: 2.5rem;
  align-items: end;
  padding: 3.5rem 0 2.5rem;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.75rem;
  color: var(--signal);
}

.sheet .eyebrow { color: var(--ink); }

.dot {
  width: 0.55rem;
  height: 0.55rem;
  background: var(--signal);
  display: inline-block;
}

h1, h2, h3, .sid, .facts dt, .mark {
  font-family: "Fraunces", "Iowan Old Style", Palatino, serif;
  font-weight: 560;
}

h1 {
  margin: 0;
  font-size: clamp(3rem, 7.4vw, 6rem);
  line-height: 0.92;
  letter-spacing: -0.04em;
}

h1 em {
  font-style: italic;
  font-weight: 520;
  color: var(--signal);
}

h2 {
  margin: 0 0 0.8rem;
  font-size: clamp(2rem, 4vw, 3.15rem);
  line-height: 1;
  letter-spacing: -0.03em;
}

.lead { font-size: 1.12rem; max-width: 42rem; color: var(--muted); }

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

.ingest-status {
  margin: 0.9rem 0 0;
  min-height: 1.6em;
  font-family: "Fraunces", "Iowan Old Style", Palatino, serif;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
}

.ingest-status a { color: var(--signal); }

.btn {
  display: inline-flex;
  align-items: center;
  background: var(--signal);
  color: var(--bg);
  text-decoration: none;
  padding: 0.75rem 1rem;
  border: 0;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
}

.btn:disabled {
  cursor: default;
  opacity: 0.72;
}

.btn.ghost {
  background: transparent;
  color: var(--paper);
  box-shadow: inset 0 0 0 1px rgba(243, 240, 232, 0.45);
}

.facts { margin: 0; display: grid; grid-template-columns: 1fr 1fr; }

.facts div {
  padding: 0.9rem 0.8rem 0.9rem 0;
  border-top: 1px solid var(--line);
}

.facts dt { font-size: 1.35rem; margin: 0; }

.facts dd { margin: 0.2rem 0 0; color: var(--muted); }

.sheet {
  background: var(--paper);
  color: var(--ink);
  color-scheme: light;
  padding: clamp(1.2rem, 3vw, 2.4rem);
  margin: 1.2rem 0 2.4rem;
  box-shadow: 8px 8px 0 0 var(--signal);
}

.sheet a { text-underline-offset: 0.18em; }

.spec { width: 100%; border-collapse: collapse; }

.spec th, .spec td {
  text-align: left;
  vertical-align: top;
  padding: 0.85rem 0.8rem 0.85rem 0;
  border-top: 1px solid var(--ink-line);
  font-weight: 400;
}

.spec th { font-family: "Fraunces", serif; font-size: 1.2rem; width: 9rem; }

.spec thead th {
  font-family: "Geist", sans-serif;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--soft);
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 1.6rem;
}

.split ul { margin: 0.4rem 0 0; padding-left: 1.1rem; }

.pipe {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.8rem;
  padding: 0;
  margin: 0 0 2rem;
}

.pipe li {
  border-top: 1px solid var(--line);
  padding-top: 0.6rem;
}

.pipe span {
  display: block;
  color: var(--signal);
  font-family: "Fraunces", serif;
  font-style: italic;
}

.demo-intro { padding-bottom: 1rem; }

.demo-intro p { max-width: 44rem; color: var(--muted); }

.instrument {
  border: 1px solid var(--line);
  background: #191b15;
  padding: 12px;
  margin-bottom: 2.5rem;
}

.demo-grid {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) 300px;
  gap: 12px;
}

.panel {
  background: #22251c;
  padding: 0.75rem;
  min-width: 0;
}

.panel h3 {
  margin: 0 0 0.6rem;
  font-size: 1.25rem;
}

.session-list {
  display: flex;
  flex-direction: column;
  max-height: 640px;
  overflow: auto;
}

.session {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.12rem;
  width: 100%;
  text-align: left;
  background: transparent;
  color: inherit;
  border: 0;
  border-left: 2px solid transparent;
  padding: 0.7rem 0.55rem;
  cursor: pointer;
  font: inherit;
}

.session[aria-selected="true"] {
  border-left-color: var(--signal);
  background: rgba(214, 255, 74, 0.07);
}

.sid { font-size: 1.15rem; }

.meta, .fn-rate, .status-meta, .legend, .sample-count {
  color: var(--muted);
  font-size: 0.85rem;
}

.session .result { color: var(--signal); font-size: 0.88rem; }

.stage-top {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  background: var(--bg);
  padding: 0.45rem 0.6rem;
  font-size: 0.78rem;
}

.dots { display: flex; gap: 0.28rem; }

.dots i {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--paper);
  display: block;
  opacity: 0.7;
}

.url { color: var(--muted); }

.mask-flag {
  margin-left: auto;
  background: var(--signal);
  color: var(--bg);
  padding: 0.05rem 0.35rem;
  font-weight: 600;
}

.stage-view {
  position: relative;
  height: 300px;
  overflow: hidden;
  background: var(--paper);
  color: var(--ink);
  color-scheme: light;
}

.mini {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  min-height: 120%;
  padding: 18px 16px 28px;
  display: none;
}

.mini.is-on { display: block; }

.mini-kicker {
  margin: 0 0 0.35rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.68rem;
}

.mini-title {
  font-family: "Fraunces", serif;
  font-size: 1.7rem;
  line-height: 1;
  letter-spacing: -0.03em;
  margin: 0 0 0.45rem;
}

.mini-copy { margin: 0 0 0.7rem; }

.mini-btn {
  display: inline-block;
  background: var(--bg);
  color: var(--paper);
  padding: 0.4rem 0.55rem;
  font-size: 0.85rem;
}

.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }

.plans article {
  border: 1px solid rgba(23, 25, 16, 0.22);
  padding: 8px;
  margin: 0;
}

.plans h3 { margin: 0; font-size: 1.05rem; color: var(--ink); }

.plans p { margin: 0.2rem 0 0; font-size: 0.82rem; }

.plans article.is-hot {
  background: var(--signal);
  border-color: var(--bg);
}

.alta-view label {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid rgba(23, 25, 16, 0.2);
  padding: 0.45rem 0;
}

.cursor {
  position: absolute;
  width: 14px;
  height: 14px;
  margin-left: -2px;
  border-radius: 50%;
  border: 2px solid var(--bg);
  background: var(--signal);
  z-index: 3;
  pointer-events: none;
}

.cursor.is-down { transform: scale(0.8); }

.transport {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 0.55rem;
  align-items: center;
  margin-top: 0.7rem;
}

button, input { font: inherit; color: inherit; }

.transport button, .seg button, .funnel button {
  background: transparent;
  border: 1px solid var(--line);
  padding: 0.35rem 0.55rem;
  cursor: pointer;
}

.transport button[aria-pressed="true"],
.seg button[aria-pressed="true"] {
  background: var(--signal);
  color: var(--bg);
  border-color: var(--signal);
}

input[type="range"] { width: 100%; accent-color: var(--signal); }

.caption { min-height: 2.8em; margin: 0.55rem 0 0; }

.seg { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 0.55rem; }

.heat-canvas {
  width: 100%;
  height: 220px;
  display: block;
  background: var(--bg);
}

.legend { display: flex; align-items: center; gap: 0.35rem; }

.swatch { width: 0.7rem; height: 0.7rem; display: inline-block; }

.swatch.low { background: #3d4a12; }

.swatch.high { background: var(--signal); }

.funnel { display: flex; flex-direction: column; }

.funnel button {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.15rem 0.6rem;
  width: 100%;
  text-align: left;
  border: 0;
  border-top: 1px solid var(--line);
  padding: 0.7rem 0.15rem;
}

.funnel .bar { grid-column: 1 / -1; height: 7px; background: rgba(243, 240, 232, 0.12); }

.funnel .bar span { display: block; height: 100%; background: var(--signal); }

.funnel button[aria-pressed="true"] { color: var(--signal); }

.fn-rate { grid-column: 1 / -1; }

.status-list { list-style: none; margin: 1rem 0 0; padding: 0; }

.status-item {
  display: grid;
  grid-template-columns: minmax(8rem, 1fr) auto minmax(0, 1.4fr);
  gap: 0.7rem;
  align-items: baseline;
  padding: 0.75rem 0;
  border-top: 1px solid var(--ink-line);
}

.status-name { font-family: "Fraunces", serif; font-size: 1.25rem; }

.status-badge {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.15rem 0.4rem;
}

.status-item[data-state="live"] .status-badge { background: var(--signal); color: var(--bg); }

.status-item[data-state="stub"] .status-badge { background: var(--bg); color: var(--paper); }

.status-item[data-state="schema"] .status-badge { box-shadow: inset 0 0 0 1px var(--bg); }

.status-item[data-state="pendiente"] .status-badge { color: var(--soft); }

.status-url { display: inline-block; margin-top: 0.4rem; }

.prose { max-width: 68ch; }

.prose h2 { font-size: clamp(1.8rem, 3vw, 2.6rem); }

.prose h3 { margin: 1.4rem 0 0.3rem; font-size: 1.45rem; }

.foot {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem 1.4rem;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  padding: 1.2rem 0 2rem;
  color: var(--muted);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.empty, .noscript { color: var(--muted); }

@media (max-width: 980px) {
  .hero, .demo-grid, .split, .pipe { grid-template-columns: 1fr; }
  .pill { margin-left: 0; }
  .status-item { grid-template-columns: 1fr; gap: 0.2rem; }
}

@media (max-width: 720px) {
  .spec thead { display: none; }
  .spec, .spec tbody, .spec tr, .spec th, .spec td { display: block; width: auto; }
  .transport { grid-template-columns: 1fr 1fr; }
  .transport input { grid-column: 1 / -1; }
}

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