/*
 * ============================================================
 *  DESIGN SYSTEM — Trama (trama.work) — manual v3
 *  Tema claro: off-white, acento #B8F020, tipografia DM Serif / Sans / Mono
 * ============================================================
 *
 *  Mapa (manual): White #FFF · Off #F6F5F2 · g100 #EDECE8 · g200 #DDDBD4
 *  Texto g900 #1A1917 · g600 #5C5A55 · g400 #9E9B93
 *  Verde Green #B8F020 · Dark #6B9200 · ink #243200 · BG soft #EFF9D0
 *  Roxo: metadata apenas (#C4B3EE / #5236B8 / #EEEAFC)
 *  Dark UI (relatório): #151513 · #1E1E1C · borda #2E2E2C
 *
 *  EQUILÍBRIO 60 / 30 / 10 (páginas marketing claras):
 *    60% branco — #FFFFFF e #F6F5F2 (base, maior área, respiro)
 *    30% preto — texto #1A1917 + blocos escuros #151513 / #1E1E1C (tipografia, nav, secções dark)
 *    10% verde — #B8F020 e derivados (CTA, acentos pontuais; não diluir em grandes superfícies)
 *  Relatório HTML (tema escuro) não segue esta proporção literal — ver manual.
 *
 *  ANTI-PADRÕES:
 *    ✗  Não use cores hardcoded em HTML/CSS de páginas
 *    ✗  Não duplique tokens — crie aliases
 *    ✓  Só use variáveis --ds-* fora deste arquivo
 * ============================================================
 */

/* ── Imports de fonte — DM (manual de marca) ───────────────── */
@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=DM+Mono:ital,wght@0,400;0,500;1,400&display=swap');

/* ── Tokens ─────────────────────────────────────────────────── */
:root {

  /* ─── Colors — tema claro ─────────────────────────────────── */

  /* Backgrounds */
  --ds-bg:          #F6F5F2;
  --ds-bg-1:        #EDECE8;
  --ds-bg-2:        #FFFFFF;
  --ds-bg-3:        #FFFFFF;

  /* Surfaces (cartões sobre off-white) */
  --ds-surface:     rgba(26, 25, 23, 0.04);
  --ds-surface-2:   rgba(26, 25, 23, 0.07);
  --ds-surface-hover: rgba(26, 25, 23, 0.1);

  /* Borders */
  --ds-border:      #DDDBD4;
  --ds-border-2:    #C9C7C0;
  --ds-border-strong: #9E9B93;

  /* Text */
  --ds-text:        #1A1917;
  --ds-text-2:      #5C5A55;
  --ds-text-3:      #9E9B93;
  --ds-text-inv:    #FFFFFF;

  /* Accent — verde Trama */
  --ds-accent:      #B8F020;
  --ds-accent-dim:  rgba(184, 240, 32, 0.18);
  --ds-accent-text: #243200;

  /* Secondary accent — roxo metadata (labels, chips) */
  --ds-meta-purple:   #5236B8;
  --ds-meta-purple-bg: #EEEAFC;
  --ds-meta-purple-soft: #C4B3EE;

  /* Semantic */
  --ds-danger:      #C0392B;
  --ds-warning:     #D97706;
  --ds-success:     #6B9200;

  /* Dark panels (relatório / embeds) — alinhado ao manual */
  --ds-dark:        #151513;
  --ds-dark-2:      #1E1E1C;
  --ds-dark-border: #2E2E2C;

  /* Texto sobre faixa preta (ticker / bandas escuras) */
  --ds-text-on-dark:       #f6f5f2;
  --ds-text-on-dark-muted: #8a8884;

  /* Proporção-alvo 60 / 30 / 10 — auditoria visual (área ≈ por viewport em landing)
   * branco = light surfaces; preto = texto + secções dark; verde = acento apenas */
  --ds-balance-white:  0.6;
  --ds-balance-black:  0.3;
  --ds-balance-green:  0.1;

  /* Aliases semânticos para aplicar a regra em secções */
  --ds-balance-bg-major:   var(--ds-bg-2);   /* branco — maior peso */
  --ds-balance-bg-alt:     var(--ds-bg);     /* off — conta no 60% */
  --ds-balance-ink:        var(--ds-text);   /* preto tipográfico — 30% */
  --ds-balance-surface-dark: var(--ds-dark); /* preto painel — 30% */
  --ds-balance-accent-fill:  var(--ds-accent); /* verde — 10% */

  /* Marca d’água (logo.svg na raiz do site) — opacidade baixa, não compete com texto */
  --ds-watermark-opacity-light: 0.045; /* fundo claro: logo preto */
  --ds-watermark-opacity-dark:  0.09;  /* fundo escuro: logo invertido */

  /* Hero estático — grelha e marca (sobre branco) */
  --ds-hero-grid-line: rgba(26, 25, 23, 0.055);
  --ds-hero-mark-opacity: 0.042;

  /* ─── Typography ──────────────────────────────────────────── */

  --ds-font-display: 'DM Serif Display', Georgia, serif;
  --ds-font-body:    'DM Sans', system-ui, sans-serif;
  --ds-font-mono:    'DM Mono', ui-monospace, monospace;

  /* Scale — fluid via clamp() */
  --ds-text-2xs:  0.733rem; /* min 11px at 15px root — labels/microcopy */
  --ds-text-xs:   0.78rem;
  --ds-text-sm:   0.933rem; /* min ~14px body */
  --ds-text-base: 1rem;
  --ds-text-lg:   1.125rem;
  --ds-text-xl:   1.35rem;
  --ds-text-2xl:  1.7rem;
  --ds-text-3xl:  2.2rem;
  --ds-text-4xl:  3rem;
  --ds-text-hero: clamp(2.2rem, 4.2vw, 4.4rem);
  --ds-text-display: clamp(2.8rem, 6.5vw, 6.2rem);

  --ds-leading-tight:  1.1;
  --ds-leading-snug:   1.3;
  --ds-leading-base:   1.6;
  --ds-leading-loose:  1.85;

  --ds-tracking-tight: -0.03em;
  --ds-tracking-base:  -0.01em;
  --ds-tracking-wide:  0.06em;
  --ds-tracking-widest: 0.14em;

  /* ─── Spacing ──────────────────────────────────────────────── */

  --ds-sp-1:  4px;
  --ds-sp-2:  8px;
  --ds-sp-3:  12px;
  --ds-sp-4:  16px;
  --ds-sp-5:  20px;
  --ds-sp-6:  24px;
  --ds-sp-8:  32px;
  --ds-sp-10: 40px;
  --ds-sp-12: 48px;
  --ds-sp-16: 64px;
  --ds-sp-20: 80px;
  --ds-sp-24: 96px;
  --ds-sp-32: 128px;

  /* Section rhythm */
  --ds-section-y:   clamp(60px, 8vw, 110px);
  --ds-section-x:   clamp(20px, 4vw, 52px);
  --ds-max-width:   1200px;
  --ds-col-text:    680px;

  /* ─── Borders & Radius ─────────────────────────────────────── */

  --ds-radius-xs:   4px;
  --ds-radius-sm:   8px;
  --ds-radius-md:   14px;
  --ds-radius-lg:   24px;
  --ds-radius-xl:   36px;
  --ds-radius-full: 9999px;

  /* ─── Shadows ──────────────────────────────────────────────── */

  --ds-shadow-sm:  0 2px 10px rgba(26, 25, 23, 0.06);
  --ds-shadow-md:  0 8px 28px rgba(26, 25, 23, 0.1);
  --ds-shadow-lg:  0 24px 64px rgba(26, 25, 23, 0.12);
  --ds-shadow-accent: 0 0 36px rgba(184, 240, 32, 0.35);

  /* ─── Motion ───────────────────────────────────────────────── */

  --ds-ease-out:      cubic-bezier(0.16, 1, 0.3, 1);
  --ds-ease-in-out:   cubic-bezier(0.6, 0, 0.4, 1);
  --ds-ease-spring:   cubic-bezier(0.34, 1.56, 0.64, 1);

  --ds-dur-fast:    150ms;
  --ds-dur-base:    280ms;
  --ds-dur-slow:    550ms;
  --ds-dur-slower:  900ms;

  /* ─── Z-index scale ────────────────────────────────────────── */

  --ds-z-base:    1;
  --ds-z-raised:  10;
  --ds-z-overlay: 100;
  --ds-z-nav:     200;
  --ds-z-cursor:  9999;
}

/* ── Reset & Base ───────────────────────────────────────────── */

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

html {
  font-size: 15px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: var(--ds-bg);
}

@media (max-width: 900px) {
  html {
    overflow-x: clip;
  }
}

body {
  background-color: transparent;
  color: var(--ds-text);
  font-family: var(--ds-font-body);
  font-size: var(--ds-text-base);
  line-height: var(--ds-leading-base);
  letter-spacing: var(--ds-tracking-base);
  position: relative;
}

/* Grain sutil (manual de marca) */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.022;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.72' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 220px;
}

img, video, svg { display: block; max-width: 100%; }

a { color: inherit; text-decoration: none; transition: color var(--ds-dur-fast); }

/* Body copy: links lift on hover */
body a:not(.ds-btn):not(.pc-link):not(.nav-logo):not(.nav-cta):not(.footer-logo):hover {
  color: var(--ds-text-2);
}

a:focus-visible:not(.ds-btn) {
  outline: 2px solid var(--ds-success);
  outline-offset: 2px;
}

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

/* ── Utility classes ────────────────────────────────────────── */

.ds-container {
  width: 100%;
  max-width: var(--ds-max-width);
  margin-inline: auto;
  padding-inline: var(--ds-section-x);
}

/* Wrapper que não gera caixa (filhos participam do grid pai) */
.ds-contents {
  display: contents;
}

.ds-section {
  padding-block: var(--ds-section-y);
  border-top: 1px solid var(--ds-border);
}

/*
 * Largura — evite max-width no <body> ou em “todo filho direto”.
 * Faixas full-bleed (.rec-banner, tickers), heros em grid e páginas tipo cinema
 * (/api/aguardando) precisam de 100% do viewport; o header já usa .nav-inner.
 * Padrão: .ds-container onde o bloco deve alinhar ao grid (1200px).
 * Texto longo solto: opt-in com .ds-prose-width (fluido em ch, não px fixo).
 */

/* Blocos de leitura: largura orgânica (limite em caracteres + margem da viewport) */
.ds-prose-width {
  max-width: min(72ch, calc(100vw - 2 * var(--ds-section-x)));
  margin-inline: auto;
}

.ds-prose-width--start {
  margin-inline: 0;
}

/* Divider */
.ds-hr {
  border: none;
  height: 1px;
  background: var(--ds-border);
  margin-block: var(--ds-sp-16);
}

/* Wordmark tipográfico — trama.work (manual de marca) */
.brand-wordmark {
  display: inline-flex;
  align-items: baseline;
  line-height: 1;
  user-select: none;
  font-family: var(--ds-font-display);
  font-weight: 400;
  letter-spacing: -0.03em;
}
.brand-wm-t {
  color: var(--ds-text);
}
.brand-wm-dot {
  /* Green Dark — contraste ≥ AA em texto ~16px+ sobre branco/off-white */
  color: var(--ds-success);
}
.brand-wm-work {
  font-style: italic;
  font-weight: 400;
  /* g600 — mais contraste que g400 (ex-wordmark em --ds-text-3) */
  color: var(--ds-text-2);
}

/* Labels estilo revista */
.ds-label {
  font-family: var(--ds-font-mono);
  font-size: var(--ds-text-2xs);
  letter-spacing: var(--ds-tracking-widest);
  text-transform: uppercase;
  color: var(--ds-text-3);
}

.ds-label--accent {
  color: var(--ds-accent);
}

/*
 * Frase de destaque no hero — borda + fundo suave (eco do ghost button),
 * sem hover, sem pointer: não compete com CTAs.
 */
.ds-hero-callout {
  display: block;
  margin: 0 auto var(--ds-sp-6);
  padding: 14px 20px;
  max-width: 42rem;
  font-size: clamp(0.9rem, 1.25vw, 1.05rem);
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: 0.01em;
  color: var(--ds-text);
  background: rgba(184, 240, 32, 0.08);
  border: 1px solid rgba(107, 146, 0, 0.35);
  border-radius: var(--ds-radius-md);
  cursor: default;
  user-select: text;
  box-sizing: border-box;
  text-align: center;
}

.ds-hero-callout--align-start {
  margin-left: 0;
  margin-right: 0;
  text-align: left;
}

/* Badge */
.ds-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--ds-sp-2);
  padding: var(--ds-sp-1) var(--ds-sp-3);
  border: 1px solid var(--ds-border-2);
  border-radius: var(--ds-radius-full);
  font-family: var(--ds-font-mono);
  font-size: var(--ds-text-xs);
  color: var(--ds-text-2);
}

/* Botões */
.ds-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--ds-sp-2);
  padding: 14px 28px;
  border-radius: var(--ds-radius-full);
  font-family: var(--ds-font-body);
  font-size: var(--ds-text-sm);
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: transform var(--ds-dur-base) var(--ds-ease-out),
              box-shadow var(--ds-dur-base) var(--ds-ease-out),
              background var(--ds-dur-base) var(--ds-ease-out);
  white-space: nowrap;
}

.ds-btn--primary {
  background: var(--ds-accent);
  color: var(--ds-accent-text);
  font-weight: 600;
}

.ds-btn--primary:hover {
  transform: translateY(-1px);
  box-shadow: var(--ds-shadow-accent);
}

.ds-btn--ghost {
  background: transparent;
  color: var(--ds-text-2);
  border: 1px solid var(--ds-border-2);
}

.ds-btn--ghost:hover {
  background: var(--ds-surface-2);
  color: var(--ds-text);
  border-color: var(--ds-border-strong);
}

/* CTA sólido sobre faixa verde (10% — regra 60/30/10) */
.ds-btn--on-accent {
  background: var(--ds-accent-text);
  color: var(--ds-accent);
  font-weight: 600;
}
.ds-btn--on-accent:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
  box-shadow: 0 8px 24px rgba(36, 50, 0, 0.25);
}
.ds-btn--on-accent-ghost {
  background: transparent;
  color: var(--ds-accent-text);
  border: 1px solid rgba(36, 50, 0, 0.35);
}
.ds-btn--on-accent-ghost:hover {
  background: rgba(36, 50, 0, 0.08);
  transform: translateY(-1px);
}

.ds-btn:focus-visible {
  outline: 2px solid var(--ds-success);
  outline-offset: 3px;
}

@media (max-width: 480px) {
  .ds-btn {
    white-space: normal;
    text-align: center;
    line-height: var(--ds-leading-snug);
    padding: 12px 18px;
  }
}

/* Reveal animation — clip-path curtain lift */
.ds-reveal {
  clip-path: inset(0 0 100% 0);
  transition: clip-path var(--ds-dur-slower) var(--ds-ease-out);
}

.ds-reveal.is-visible {
  clip-path: inset(0 0 0% 0);
}

/* Fade up */
.ds-fade-up {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity var(--ds-dur-slow) var(--ds-ease-out),
              transform var(--ds-dur-slow) var(--ds-ease-out);
}

.ds-fade-up.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger delays */
.ds-delay-1 { transition-delay: 80ms; }
.ds-delay-2 { transition-delay: 160ms; }
.ds-delay-3 { transition-delay: 240ms; }
.ds-delay-4 { transition-delay: 320ms; }
.ds-delay-5 { transition-delay: 400ms; }

/* ── Marca d’água (logo.svg na raiz) — pai com position:relative ─ */
.ds-watermark-tile {
  position: relative;
  isolation: isolate;
}
.ds-watermark-tile::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: url('logo.svg');
  background-size: 150px 150px;
  background-repeat: repeat;
  opacity: var(--ds-watermark-opacity-light);
  mix-blend-mode: multiply;
}
.ds-watermark-tile > * {
  position: relative;
  z-index: 1;
}

/* ── Landing — miolo largura máxima (home + páginas marketing) ─ */
.home-measure {
  max-width: var(--ds-max-width);
  margin-inline: auto;
  width: 100%;
  box-sizing: border-box;
  padding-inline: var(--ds-section-x);
}

/* ── Faixa preta + ticker (home e páginas marketing) ───────── */
.ds-band-dark {
  background: var(--ds-dark);
  border-bottom: 1px solid var(--ds-dark-border);
  color: var(--ds-text-on-dark);
}

.ds-site-ticker {
  border-bottom: 1px solid var(--ds-dark-border);
  background: var(--ds-dark);
  overflow: hidden;
  padding: 14px 0;
}
.ds-site-ticker__track {
  display: inline-block;
  font-family: var(--ds-font-mono);
  font-size: 8.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ds-text-on-dark-muted);
  white-space: nowrap;
  animation: ds-site-ticker-marquee 36s linear infinite;
}
@keyframes ds-site-ticker-marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ── CTA final — faixa verde (~10% acento), alinhada à home ─── */
.final-cta {
  padding: var(--ds-sp-24) 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--ds-sp-8);
  background: var(--ds-accent);
  color: var(--ds-accent-text);
  border-bottom: 1px solid rgba(36, 50, 0, 0.12);
  position: relative;
  overflow: hidden;
}
.final-cta::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image:
    linear-gradient(rgba(36, 50, 0, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(36, 50, 0, 0.06) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
}
.final-cta > * {
  position: relative;
  z-index: 1;
}
.final-cta .home-measure {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--ds-sp-8);
}
.final-cta .fc-title,
.final-cta .fc-big {
  font-family: var(--ds-font-display);
  font-size: var(--ds-text-hero);
  font-weight: 800;
  letter-spacing: var(--ds-tracking-tight);
  line-height: var(--ds-leading-tight);
  color: var(--ds-accent-text);
  max-width: min(40rem, 92vw);
  margin: 0;
}
.final-cta .fc-title em,
.final-cta .fc-big em {
  font-style: italic;
  color: rgba(36, 50, 0, 0.55);
}
.final-cta .fc-note {
  font-family: var(--ds-font-mono);
  font-size: 11px;
  color: rgba(36, 50, 0, 0.55);
  margin: 0;
}

@media (max-width: 480px) {
  .final-cta {
    padding: var(--ds-sp-16) 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ds-site-ticker__track {
    animation: none !important;
    padding-inline: var(--ds-section-x);
    white-space: normal;
    text-align: center;
    line-height: 1.6;
  }
}

/*
 * Hero marketing — gráficos ESTÁTICOS (grelha + blob + símbolo opcional).
 * Sem animação de fundo; use nos heros que não são a home animada.
 * Estrutura: <section class="hero ds-hero-visual"> + camadas + conteúdo com z-index relativo.
 */
.ds-hero-visual {
  position: relative;
  overflow: hidden;
  background: var(--ds-bg-2);
  isolation: isolate;
}

/* Colunas de conteúdo acima das camadas decorativas (split heroes) */
.hero.ds-hero-visual .hero-left,
.hero.ds-hero-visual .hero-right {
  position: relative;
  z-index: 1;
}

/* Hero que reutiliza .ds-section: evita borda superior + padding duplicado */
.hero.ds-hero-visual.ds-section {
  border-top: none;
  padding-block: unset;
}

.ds-hero-visual__grid {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--ds-hero-grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--ds-hero-grid-line) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 88% 78% at 24% 44%, transparent 0%, black 100%);
  -webkit-mask-image: radial-gradient(ellipse 88% 78% at 24% 44%, transparent 0%, black 100%);
}
.ds-hero-visual__blob {
  position: absolute;
  width: min(120vw, 460px);
  height: min(120vw, 460px);
  border-radius: 50%;
  background: var(--ds-accent);
  opacity: 0.075;
  mix-blend-mode: multiply;
  top: -14%;
  right: -7%;
  z-index: 0;
  pointer-events: none;
}
/* Blob alternativo — canto inferior esquerdo (ex.: radar forte à direita) */
.ds-hero-visual__blob--bl {
  top: auto;
  right: auto;
  bottom: -12%;
  left: -8%;
}
.ds-hero-visual__mark {
  position: absolute;
  width: min(44vmin, 300px);
  height: auto;
  right: 5%;
  bottom: 6%;
  opacity: var(--ds-hero-mark-opacity);
  filter: grayscale(1);
  z-index: 0;
  pointer-events: none;
}

/* ── Accessibility ──────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .ds-reveal, .ds-fade-up {
    clip-path: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
  .hero-eyebrow-dot {
    animation: none !important;
    opacity: 1;
    transform: none;
  }
  .ds-hero-visual__mark {
    opacity: calc(var(--ds-hero-mark-opacity) * 0.85);
  }
}

/* ── Scrollbar ──────────────────────────────────────────────── */

::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--ds-bg); }
::-webkit-scrollbar-thumb { background: var(--ds-border-strong); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: var(--ds-text-3); }

/* ── Selection ──────────────────────────────────────────────── */

::selection {
  background: var(--ds-accent);
  color: var(--ds-accent-text);
}
