/* Páginas legales de hackü.
 *
 * Los tokens son los mismos del dashboard (hacku/static/css/corporative/
 * ai-console.css), extraídos de documentation/designs/agents.pen: quien llega
 * acá desde la pantalla de consentimiento de Google tiene que reconocer el
 * producto, no aterrizar en un documento genérico.
 *
 * El layout es de documentación —índice fijo a la izquierda, contenido a la
 * derecha— y no de hoja suelta: son textos largos que la gente escanea
 * buscando una sección puntual, casi nunca se leen de corrido.
 *
 * Geist viene de Google Fonts porque estas páginas se sirven en Cloudflare
 * Pages, fuera del monolito, sin acceso a los estáticos de Django. La pila de
 * respaldo es la del sistema, así que el texto sigue siendo legible si la
 * fuente no carga. */

:root {
  --brand: #572D88;
  --brand-ink: #46236F;
  --brand-soft: #F5F3FF;
  --brand-border: #DDD6FE;
  --surface: #F8FAFC;
  --card: #FFFFFF;
  --border: #E2E8F0;
  --border-strong: #CBD5E1;
  --text-strong: #0F172A;
  --text-body: #334155;
  --text-secondary: #64748B;
  --text-faint: #94A3B8;
  --success: #16A34A;
  --success-soft: #F0FDF4;
  --success-border: #BBF7D0;
  --warning: #D97706;
  --warning-soft: #FFFBEB;
  --warning-border: #FDE68A;
  color-scheme: light;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--surface);
  color: var(--text-body);
  font-family: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 15.5px;
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
}

.shell { max-width: 1180px; padding: 0 32px; margin: 0 auto; }

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar .shell {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand { display: inline-flex; gap: 12px; align-items: center; border: 0; }
.brand img { display: block; width: 92px; height: auto; }
.brand span {
  padding-left: 12px;
  border-left: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
}

.langs { display: inline-flex; padding: 3px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); }
.langs a {
  padding: 4px 12px;
  border: 0;
  border-radius: 999px;
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .3px;
}
.langs a:hover { color: var(--text-strong); }
.langs a[aria-current] { background: var(--card); color: var(--brand); box-shadow: 0 1px 2px rgba(15, 23, 42, .08); }

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

.hero {
  background:
    radial-gradient(60% 120% at 12% 0%, var(--brand-soft) 0%, rgba(245, 243, 255, 0) 70%),
    var(--card);
  border-bottom: 1px solid var(--border);
}
.hero .shell { padding-top: 52px; padding-bottom: 44px; }

.kicker {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  padding: 5px 12px 5px 8px;
  margin-bottom: 18px;
  border: 1px solid var(--brand-border);
  border-radius: 999px;
  background: var(--card);
  color: var(--brand);
  font-size: 12px;
  font-weight: 600;
}
.kicker .dot { width: 6px; height: 6px; border-radius: 999px; background: var(--brand); }

h1 {
  max-width: 20ch;
  margin: 0 0 12px;
  color: var(--text-strong);
  font-size: 40px;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -1px;
}
.updated { display: inline-flex; gap: 8px; align-items: center; margin: 0; color: var(--text-secondary); font-size: 14px; }
.updated svg { width: 15px; height: 15px; }

/* ── Dos columnas ─────────────────────────────────────────────────────── */

.layout { display: grid; grid-template-columns: 216px minmax(0, 1fr); gap: 56px; padding-top: 44px; padding-bottom: 88px; }

.toc { position: sticky; top: 96px; align-self: start; }
.toc-title {
  margin: 0 0 12px;
  color: var(--text-faint);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .8px;
  text-transform: uppercase;
}
.toc ol { padding: 0; margin: 0; list-style: none; counter-reset: toc; }
.toc li { counter-increment: toc; }
.toc a {
  display: block;
  padding: 6px 0 6px 14px;
  border: 0;
  border-left: 2px solid var(--border);
  color: var(--text-secondary);
  font-size: 13.5px;
  line-height: 1.45;
}
.toc a:hover { border-left-color: var(--border-strong); color: var(--text-strong); }
.toc a.is-active { border-left-color: var(--brand); color: var(--brand); font-weight: 600; }

/* ── Contenido ────────────────────────────────────────────────────────── */

.sheet {
  padding: 40px 44px 44px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--card);
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}

.lede {
  padding-bottom: 28px;
  margin: 0 0 4px;
  border-bottom: 1px solid var(--border);
  color: var(--text-body);
  font-size: 17px;
  line-height: 1.6;
}

h2 {
  display: flex;
  gap: 12px;
  align-items: baseline;
  margin: 44px 0 14px;
  color: var(--text-strong);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -.3px;
  scroll-margin-top: 96px;
}
h2 .num {
  flex-shrink: 0;
  min-width: 26px;
  color: var(--brand);
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
h3 { margin: 28px 0 8px; color: var(--text-strong); font-size: 15.5px; font-weight: 600; }

p { margin: 0 0 14px; }
ul { padding-left: 0; margin: 0 0 14px; list-style: none; }
ul li { position: relative; padding-left: 22px; margin: 10px 0; }
ul li::before {
  content: "";
  position: absolute;
  top: .68em;
  left: 6px;
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: var(--brand-border);
}
strong { color: var(--text-strong); font-weight: 600; }

a { color: var(--brand); text-decoration: none; border-bottom: 1px solid var(--brand-border); }
a:hover { border-bottom-color: var(--brand); color: var(--brand-ink); }

code {
  padding: 2px 7px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text-strong);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px;
}

/* ── Piezas del sistema ───────────────────────────────────────────────── */

.callout {
  display: flex;
  gap: 13px;
  padding: 16px 18px;
  margin: 22px 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}
.callout p { margin: 0; font-size: 14.5px; line-height: 1.6; }
.callout .mark { flex-shrink: 0; width: 18px; height: 18px; margin-top: 2px; }
.callout.brand { border-color: var(--brand-border); background: var(--brand-soft); }
.callout.brand .mark { color: var(--brand); }
.callout.ok { border-color: var(--success-border); background: var(--success-soft); }
.callout.ok .mark { color: var(--success); }
.callout.warn { border-color: var(--warning-border); background: var(--warning-soft); }
.callout.warn .mark { color: var(--warning); }

table {
  width: 100%;
  margin: 20px 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  font-size: 14.5px;
}
thead th {
  padding: 11px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .2px;
  text-align: left;
}
tbody td { padding: 15px 16px; border-bottom: 1px solid var(--border); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
tbody td:first-child { width: 36%; color: var(--text-strong); }
tbody td:first-child code { display: inline-block; margin-bottom: 4px; }

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

footer { border-top: 1px solid var(--border); background: var(--card); }
footer .shell {
  display: flex;
  gap: 10px 20px;
  align-items: center;
  flex-wrap: wrap;
  padding-top: 28px;
  padding-bottom: 28px;
  color: var(--text-secondary);
  font-size: 14px;
}
footer a { border-bottom: 0; color: var(--text-secondary); font-weight: 500; }
footer a:hover { color: var(--brand); }
footer .sep { color: var(--border-strong); }

/* ── Pantallas angostas ───────────────────────────────────────────────── */

@media (max-width: 900px) {
  .shell { padding: 0 20px; }
  .layout { grid-template-columns: minmax(0, 1fr); gap: 0; padding-top: 28px; padding-bottom: 56px; }
  /* El índice deja de tener sentido apilado sobre el texto: en una sola
     columna el lector ya hace scroll por el documento entero. */
  .toc { display: none; }
  .hero .shell { padding-top: 36px; padding-bottom: 32px; }
  h1 { font-size: 30px; letter-spacing: -.6px; }
  .sheet { padding: 26px 22px 30px; border-radius: 14px; }
  .lede { font-size: 16px; }
  h2 { margin-top: 36px; font-size: 18px; }
  .brand span { display: none; }
  table { font-size: 13.5px; }
  thead th, tbody td { padding: 11px 12px; }
  tbody td:first-child { width: auto; }
}
