/* =============================================================================
 * telos-design.css — UTILITY CLASSES pra telas internas.
 *
 * Este arquivo NÃO duplica nada de styles.css. styles.css é a fonte da verdade
 * pra: topbar, footer, brand, bg-art, .panel, .btn, .modal, .art-drawer,
 * .sticky-cta, body base, tokens (--gold-telos, --surface-ink, etc).
 *
 * Aqui ficam classes utility que telos-shell.js + telas internas usam e
 * styles.css não define:
 *   .telos-form, .telos-input, .telos-textarea, .telos-select, .telos-label,
 *   .telos-mood-chip, .telos-slider-row, .telos-card, .telos-grid,
 *   .telos-kpis, .telos-kpi, .telos-h1/h2/h3, .telos-display, .telos-lead,
 *   .telos-eyebrow, .telos-empty, .telos-table, .telos-badge,
 *   .page-head*, .dash-top, .page-mascot, .topbar-nav, .toolbar, .section,
 *   .telos-main.
 *
 * Aliases: telas migradas pré-existentes usam var(--ink), var(--accent), etc.
 * Re-aliasamos em body.telos-shell pra apontar pros surface tokens da Home.
 * ============================================================================= */

/* ============================================================================
 * 1. ALIASES — re-mapeia tokens locais pros surface tokens da Home.
 *    body.telos-shell sempre teve fundo escuro (pintura), então texto creme.
 *    Se theme-picker setar data-surface="light", surface tokens viram escuros.
 * ============================================================================ */
body.telos-shell {
  /* Neutraliza o body bg creme/dourado claro do styles.css (que é o fundo da
     Home antes do alien.js + WebGL ativar). Telas internas usam pintura via
     .bg-art como fundo único — sem creme atrás. */
  background: #0a0608 !important;
}

/* (Sem overrides pra bg-art — a tag <img> estática + styles.css + alien.js
   cuidam de tudo, igual à Home. styles.css define animation Ken Burns 90s,
   alien.js adiciona canvas WebGL com turbulência + partículas em high-perf. */

body.telos-shell {

  /* Surface: defaults dark (telas internas costumam ter pintura escurecida ou
     glass panel). Theme-picker pode mudar via data-surface. */
  --surface-ink: #f7eccd;
  --surface-ink-soft: rgba(247, 236, 205, .82);
  --surface-divider: rgba(247, 236, 205, .16);

  /* Aliases — telas migradas usam var(--ink), var(--accent), etc no <style>
     inline. Mantemos compatibilidade redirecionando pros surface tokens. */
  --ink:         var(--surface-ink);
  --ink-soft:    var(--surface-ink);
  --ink-dim:     var(--surface-ink-soft);
  --ink-faint:   rgba(247, 236, 205, .58);
  --line:        var(--surface-divider);
  --line-mid:    rgba(212, 168, 87, .42);
  --line-strong: rgba(212, 168, 87, .65);

  --paper:       rgba(15, 8, 6, .82);
  --paper-soft:  rgba(15, 8, 6, .55);
  --paper-glass: rgba(14, 10, 6, .36);

  --accent:      var(--gold-telos);
  --accent-warm: #fbe8b4;
  --accent-deep: #a87930;

  --font-display: "Cormorant Garamond", Georgia, serif;
  --font-body:    Inter, system-ui, -apple-system, sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

body.telos-shell[data-surface="light"] {
  --surface-ink: #1a1410;
  --surface-ink-soft: rgba(20, 14, 5, .74);
  --surface-divider: rgba(20, 14, 5, .16);
  --ink-faint: rgba(20, 14, 5, .48);
}

/* ============================================================================
 * 2. LAYOUT — telos-main, section
 *    .wrap já existe em styles.css
 * ============================================================================ */
.telos-main { position: relative; z-index: 4; padding: 28px 0 80px; }

.section { padding: 36px 0; }
.section--lg { padding: 56px 0; }
.section + .section { border-top: 1px solid var(--line); }

.telos-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.telos-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.telos-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 720px) {
  .telos-grid--2, .telos-grid--3 { grid-template-columns: 1fr; }
}

/* ============================================================================
 * 3. TIPOGRAFIA UTILITY — Cormorant Garamond pra display, italic gold em em
 * ============================================================================ */
.telos-h1, .telos-h2, .telos-h3 { margin: 0; color: var(--surface-ink); }
.telos-h1 {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(38px, 5.6vmin, 68px); line-height: 1.08;
  letter-spacing: -.01em; text-wrap: balance;
}
.telos-h2 {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(26px, 3.4vmin, 38px); line-height: 1.12;
  letter-spacing: -.005em;
}
.telos-h3 {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(20px, 2.4vmin, 26px); line-height: 1.2;
}
.telos-h1 em, .telos-h2 em, .telos-h3 em, .telos-display em {
  font-style: italic; font-weight: 600;
  background: linear-gradient(120deg, var(--accent-warm) 0%, #e8c477 60%, var(--gold-telos) 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--gold-telos);
}

.telos-lead {
  font-size: 17px; line-height: 1.55;
  color: var(--ink-dim); max-width: 60ch;
}
.telos-eyebrow {
  font-family: var(--font-body);
  font-size: 11px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--accent); font-weight: 700;
}

/* ============================================================================
 * 4. PAGE-HEAD — glass mini-panel pra cabeçalho de tela interna
 * ============================================================================ */
.page-head {
  padding: clamp(20px, 2.8vmin, 30px) clamp(22px, 3vmin, 32px);
  margin-bottom: 28px;
  background: var(--paper-glass);
  border: 1px solid var(--line);
  border-radius: 14px;
  backdrop-filter: blur(14px) saturate(1.18);
  -webkit-backdrop-filter: blur(14px) saturate(1.18);
  box-shadow: 0 14px 40px rgba(0,0,0,.28);
}
.page-head__crumbs {
  font-size: 13px;
  color: var(--ink-dim);
  margin-bottom: 10px;
}
.page-head__crumbs a {
  color: var(--ink); text-decoration: none;
  border-bottom: 1px dashed currentColor;
}
.page-head__crumbs a:hover { color: var(--accent-warm); border-color: var(--accent); }
.page-head__title {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(32px, 4.4vmin, 48px);
  margin: 0 0 6px; letter-spacing: -.01em; line-height: 1.05;
  color: var(--ink);
}
.page-head__title em { font-style: italic; color: var(--accent); }
.page-head__sub {
  font-size: 16px; color: var(--ink-dim);
  max-width: 60ch; margin: 0; line-height: 1.55;
}
.page-head__aside {
  font-size: 13px; color: var(--ink-dim);
  margin-top: 14px; display: flex; gap: 18px; flex-wrap: wrap;
}
.page-head__aside strong { color: var(--ink); font-weight: 600; }

/* ============================================================================
 * 5. .telos-card — card simples (sem glass forte, pra grids muitos itens)
 * ============================================================================ */
.telos-card {
  background: var(--paper-soft);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 20px;
  color: var(--ink);
  transition: background .18s, border-color .18s, transform .18s;
}
.telos-card:hover {
  background: rgba(15,8,6,.72); border-color: var(--line-mid);
  transform: translateY(-2px);
}

/* ============================================================================
 * 6. FORMS — telos-form, telos-input, telos-mood-chip, telos-slider-row
 * ============================================================================ */
.telos-form { display: flex; flex-direction: column; gap: 14px; }
.telos-form label { display: flex; flex-direction: column; gap: 6px; }
.telos-label {
  display: block; font-size: 13px;
  color: var(--ink-dim); font-weight: 500;
  letter-spacing: .01em;
}

.telos-input, .telos-textarea, .telos-select {
  width: 100%; min-height: 42px; padding: 11px 14px;
  border: 1px solid var(--line); border-radius: 10px;
  background: rgba(15,8,6,.55);
  color: var(--ink);
  font: 400 15px/1.4 var(--font-body);
  transition: border-color .15s, background .15s;
}
.telos-input:focus, .telos-textarea:focus, .telos-select:focus {
  outline: none; border-color: var(--accent);
  background: rgba(15,8,6,.72);
}
.telos-input::placeholder, .telos-textarea::placeholder { color: var(--ink-faint); }
.telos-textarea { min-height: 96px; resize: vertical; line-height: 1.5; }

.telos-mood-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.telos-mood-chip {
  padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--paper-soft); color: var(--ink);
  cursor: pointer; font: 600 14px/1.2 var(--font-body);
  display: inline-flex; align-items: center; gap: 6px;
  transition: background .15s, border-color .15s;
}
.telos-mood-chip:hover { border-color: var(--line-mid); }
.telos-mood-chip.is-selected, .telos-mood-chip[aria-pressed="true"] {
  background: linear-gradient(160deg, var(--accent-warm), var(--accent));
  color: #1a1208; border-color: transparent;
}

.telos-slider-row {
  display: grid; grid-template-columns: 140px 1fr 48px;
  gap: 10px; align-items: center; margin: 8px 0;
}
.telos-slider-row input[type="range"] { width: 100%; accent-color: var(--accent); }

/* ============================================================================
 * 7. KPIs — bloco de métrica numérica
 * ============================================================================ */
.telos-kpis {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
.telos-kpi {
  padding: 18px 20px;
  background: var(--paper-soft);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.telos-kpi__v {
  font-family: var(--font-display); font-size: 32px; font-weight: 700;
  font-variant-numeric: tabular-nums; line-height: 1.05;
  color: var(--ink);
}
.telos-kpi__l {
  font-size: 13px; color: var(--ink-dim);
  margin-top: 6px; line-height: 1.35;
}
.telos-kpi__src {
  font-size: 11px; color: var(--ink-faint);
  margin-top: 6px; font-style: italic;
}

/* ============================================================================
 * 8. Table, empty, badge, mascot, dash-top
 * ============================================================================ */
.telos-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.telos-table th, .telos-table td {
  text-align: left; padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}
.telos-table th {
  font-weight: 700; color: var(--ink-dim);
  font-size: 12.5px; letter-spacing: .04em; text-transform: uppercase;
}
.telos-table tr:hover td { background: rgba(212,168,87,.04); }

.telos-empty {
  text-align: center; padding: 56px 20px;
  color: var(--ink-dim);
}
.telos-empty h2 {
  font-family: var(--font-display); font-size: 24px; margin: 0 0 8px;
  color: var(--ink);
}

.telos-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  background: rgba(212,168,87,.10);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 12px; font-weight: 600; letter-spacing: .02em;
}
.telos-badge--accent {
  background: linear-gradient(135deg, var(--accent-warm), var(--accent));
  color: #1a1208; border-color: transparent;
}

.page-mascot {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  background: var(--paper-soft);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.page-mascot__img { width: 56px; height: 56px; object-fit: contain; border-radius: 12px; }
.page-mascot__label { font-size: 14px; color: var(--ink); max-width: 40ch; }

.dash-top {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 18px; flex-wrap: wrap; margin-bottom: 20px;
}
.dash-top__who {
  font-family: var(--font-display);
  font-size: clamp(24px, 3.2vmin, 32px); font-weight: 600;
  line-height: 1.1; color: var(--ink);
}

.toolbar {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
}

/* ============================================================================
 * 9. TOPBAR-NAV — nav inline na topbar (a topbar e brand vêm de styles.css)
 * ============================================================================ */
.topbar-nav { display: flex; gap: 2px; }
.topbar-nav a {
  padding: 7px 12px; border-radius: 8px;
  color: var(--surface-ink-soft);
  text-decoration: none; font-weight: 600; font-size: 14px;
  transition: background .14s, color .14s;
}
.topbar-nav a:hover {
  background: rgba(212,168,87,.14); color: var(--surface-ink);
  text-decoration: none;
}
.topbar-nav a.on,
.topbar-nav a[aria-current="page"] {
  background: rgba(212,168,87,.18); color: var(--accent-warm);
}
@media (max-width: 720px) { .topbar-nav { display: none; } }

/* ============================================================================
 * 10. HELPERS
 * ============================================================================ */
.is-hidden { display: none !important; }
.no-wrap   { white-space: nowrap; }
.tabular   { font-variant-numeric: tabular-nums; }

/* ============================================================================
 * 11. REDUCED MOTION
 * ============================================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
  }
}
