/* ============================================================
   MARÉ — Design Tokens
   Projeto Costão do Santinho · Data-Robotics
   Tom: Costeiro · Adulto · Continuísta
   ============================================================ */

:root {
  /* ---------- Paleta primária ---------- */
  --mare-deep:       #051F33;   /* abismo (fundo principal) */
  --mare-noite:      #0B3D5C;   /* azul-noite costeiro (primary) */
  --mare-mar:        #1B5E7E;   /* azul mar profundo */
  --mare-mist:       #6B7E8A;   /* névoa (texto secundário) */
  --mare-granito:    #2E3A40;   /* granito do costão */

  /* ---------- Paleta de acento ---------- */
  --mare-ambar:      #D9923C;   /* pôr-do-sol / areia molhada (accent) */
  --mare-coral:      #E15B4E;   /* alerta / urgência (PEC 6x1) */
  --mare-folha:      #3B6E4F;   /* mata atlântica (positivo/ESG) */
  --mare-pirita:     #C9A55C;   /* premium / tier Lendário */

  /* ---------- Paleta neutra ---------- */
  --mare-areia:      #F5EDE0;   /* areia clara (background secundário) */
  --mare-areia-2:    #EBE0CB;   /* areia média */
  --mare-foam:       #FFFFFF;
  --mare-bone:       #FAF7F1;
  --mare-charcoal:   #1A1F23;

  /* ---------- Tiers Costão Stars ---------- */
  --tier-mare:       #A9C5D4;   /* Maré (entrada) */
  --tier-costa:      #6896B0;   /* Costa */
  --tier-farol:      #D9923C;   /* Farol */
  --tier-sambaqui:   #8B5A2B;   /* Sambaqui */
  --tier-lendario:   #C9A55C;   /* Lendário */

  /* ---------- Tipografia ---------- */
  --font-display:   'Fraunces', 'Playfair Display', Georgia, serif;
  --font-body:      'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono:      'JetBrains Mono', 'SF Mono', Menlo, monospace;

  --fs-xs:    0.75rem;
  --fs-sm:    0.875rem;
  --fs-base:  1rem;
  --fs-md:    1.125rem;
  --fs-lg:    1.375rem;
  --fs-xl:    1.75rem;
  --fs-2xl:   2.25rem;
  --fs-3xl:   3rem;
  --fs-4xl:   4rem;
  --fs-hero:  clamp(2.75rem, 6vw, 5.5rem);

  --lh-tight: 1.1;
  --lh-snug:  1.25;
  --lh-base:  1.55;
  --lh-loose: 1.75;

  --tracking-tight: -0.025em;
  --tracking-base:  0;
  --tracking-wide:  0.08em;
  --tracking-caps:  0.16em;

  /* ---------- Espaçamento (8pt grid) ---------- */
  --s-1:  0.25rem;  /* 4 */
  --s-2:  0.5rem;   /* 8 */
  --s-3:  0.75rem;  /* 12 */
  --s-4:  1rem;     /* 16 */
  --s-5:  1.5rem;   /* 24 */
  --s-6:  2rem;     /* 32 */
  --s-7:  3rem;     /* 48 */
  --s-8:  4rem;     /* 64 */
  --s-9:  6rem;     /* 96 */
  --s-10: 8rem;     /* 128 */

  /* ---------- Bordas ---------- */
  --r-sm:   6px;
  --r-md:   12px;
  --r-lg:   20px;
  --r-xl:   32px;
  --r-pill: 999px;

  /* ---------- Sombras (orgânicas) ---------- */
  --sh-1: 0 1px 2px rgba(5, 31, 51, 0.04), 0 1px 3px rgba(5, 31, 51, 0.06);
  --sh-2: 0 4px 12px rgba(5, 31, 51, 0.06), 0 2px 4px rgba(5, 31, 51, 0.04);
  --sh-3: 0 12px 32px rgba(5, 31, 51, 0.08), 0 4px 8px rgba(5, 31, 51, 0.04);
  --sh-4: 0 24px 64px rgba(5, 31, 51, 0.12), 0 8px 16px rgba(5, 31, 51, 0.06);
  --sh-glow: 0 0 32px rgba(217, 146, 60, 0.25);

  /* ---------- Motion ---------- */
  --ease-oceanic: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-tide:    cubic-bezier(0.65, 0, 0.35, 1);
  --dur-quick:    180ms;
  --dur-base:     320ms;
  --dur-slow:     560ms;
  --dur-tide:     900ms;

  /* ---------- Layout ---------- */
  --container-narrow: 720px;
  --container-base:   1080px;
  --container-wide:   1280px;
  --container-full:   1440px;

  /* ---------- Z ---------- */
  --z-base:   1;
  --z-raised: 10;
  --z-nav:    100;
  --z-modal:  1000;
  --z-toast:  10000;
}

/* ---------- Tema escuro (default para hero) ---------- */
[data-theme="dark"] {
  --bg:        var(--mare-deep);
  --bg-2:      var(--mare-noite);
  --surface:   rgba(255, 255, 255, 0.04);
  --surface-2: rgba(255, 255, 255, 0.08);
  --text:      var(--mare-foam);
  --text-2:    rgba(255, 255, 255, 0.72);
  --text-3:    rgba(255, 255, 255, 0.5);
  --border:    rgba(255, 255, 255, 0.12);
  --accent:    var(--mare-ambar);
}

/* ---------- Tema claro (default para conteúdo) ---------- */
[data-theme="light"] {
  --bg:        var(--mare-bone);
  --bg-2:      var(--mare-areia);
  --surface:   var(--mare-foam);
  --surface-2: var(--mare-areia);
  --text:      var(--mare-deep);
  --text-2:    var(--mare-granito);
  --text-3:    var(--mare-mist);
  --border:    rgba(5, 31, 51, 0.10);
  --accent:    var(--mare-noite);
}

/* ---------- Reset enxuto ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: var(--lh-base);
  background: var(--bg, var(--mare-bone));
  color: var(--text, var(--mare-deep));
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: var(--lh-tight);
  letter-spacing: var(--tracking-tight);
  margin: 0;
}
p { margin: 0; }
a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  transition: opacity var(--dur-quick) var(--ease-oceanic);
}
a:hover { opacity: 0.7; }
button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

/* ---------- Tipografia helper ---------- */
.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--accent, var(--mare-ambar));
  font-weight: 500;
}
.display-1 { font-size: var(--fs-hero); }
.display-2 { font-size: var(--fs-4xl); }
.display-3 { font-size: var(--fs-3xl); }
.lead { font-size: var(--fs-lg); line-height: var(--lh-base); color: var(--text-2); }
.muted { color: var(--text-3); }

/* ---------- Containers ---------- */
.container        { max-width: var(--container-base);   margin-inline: auto; padding-inline: var(--s-5); }
.container-narrow { max-width: var(--container-narrow); margin-inline: auto; padding-inline: var(--s-5); }
.container-wide   { max-width: var(--container-wide);   margin-inline: auto; padding-inline: var(--s-5); }

/* ---------- Sections ---------- */
.section { padding-block: var(--s-9); }
.section-sm { padding-block: var(--s-7); }
.section-lg { padding-block: var(--s-10); }

/* ---------- Botão âncora ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-3) var(--s-5);
  border-radius: var(--r-pill);
  font-weight: 500;
  font-size: var(--fs-sm);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  transition: transform var(--dur-base) var(--ease-oceanic),
              box-shadow var(--dur-base) var(--ease-oceanic);
  border-bottom: none;
}
.btn:hover { transform: translateY(-2px); opacity: 1; }
.btn-primary {
  background: var(--mare-ambar);
  color: var(--mare-deep);
  box-shadow: var(--sh-2);
}
.btn-primary:hover { box-shadow: var(--sh-glow), var(--sh-3); }
.btn-ghost {
  background: transparent;
  border: 1px solid currentColor;
  color: inherit;
}

/* ---------- Card padrão ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s-6);
  transition: transform var(--dur-base) var(--ease-oceanic),
              box-shadow var(--dur-base) var(--ease-oceanic);
}
.card:hover { transform: translateY(-4px); box-shadow: var(--sh-3); }

/* ---------- Tag/pill ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-1) var(--s-3);
  border-radius: var(--r-pill);
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: var(--fs-xs);
  font-family: var(--font-mono);
  letter-spacing: var(--tracking-wide);
}

/* ---------- Divisor maritimo ---------- */
.divider-wave {
  height: 48px;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 48' preserveAspectRatio='none'><path d='M0,32 Q360,8 720,32 T1440,32 L1440,48 L0,48 Z' fill='%23051F33'/></svg>") center/cover no-repeat;
}

/* ---------- Animação base ---------- */
@keyframes tideRise {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes shimmer {
  0%, 100% { opacity: 0.6; }
  50%      { opacity: 1; }
}
.reveal { opacity: 0; animation: tideRise var(--dur-slow) var(--ease-oceanic) forwards; }
.reveal[data-delay="1"] { animation-delay: 80ms; }
.reveal[data-delay="2"] { animation-delay: 160ms; }
.reveal[data-delay="3"] { animation-delay: 240ms; }
.reveal[data-delay="4"] { animation-delay: 320ms; }

/* ---------- Tabela contábil padrão ---------- */
.table-contabil {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
}
.table-contabil th,
.table-contabil td {
  padding: var(--s-3) var(--s-4);
  text-align: right;
  border-bottom: 1px solid var(--border);
}
.table-contabil th:first-child,
.table-contabil td:first-child { text-align: left; }
.table-contabil th {
  font-family: var(--font-body);
  font-weight: 600;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  font-size: var(--fs-xs);
  color: var(--text-3);
}
.table-contabil .row-total {
  font-weight: 600;
  background: var(--surface-2);
}
.table-contabil .pos { color: var(--mare-folha); }
.table-contabil .neg { color: var(--mare-coral); }

/* ---------- Responsivo ---------- */
@media (max-width: 768px) {
  :root { --fs-hero: clamp(2rem, 8vw, 3.25rem); }
  .section { padding-block: var(--s-7); }
}
