/* TriboTax — Design Tokens
   Concept: O Nó + Círculo. Argila dominante. Verde profundo e cobre pontuam.
   Voz editorial, material, humana. Sem slop. */

:root {
  /* ——— Base (argila/off-white) ——— */
  --clay-50:  #F6F1E8;  /* fundo principal — quente, calcário */
  --clay-100: #EFE7D8;  /* fundo alternado */
  --clay-200: #E3D7C2;  /* divisores suaves */
  --clay-300: #CBBBA0;  /* textura */
  --clay-400: #A89778;  /* marginália */

  /* ——— Verde profundo (resiliência, agro, juridicidade) ——— */
  --forest-900: #14251D;  /* quase preto verde */
  --forest-800: #1B3226;  /* fundo de seção âncora */
  --forest-700: #234032;
  --forest-600: #325647;
  --forest-500: #4A7360;
  --forest-200: #C8D4CC;

  /* ——— Ocre vermelho / terracota-bordô (acento menos óbvio que cobre) ——— */
  --copper-700: #5E1F1A;
  --copper-600: #7A2B22;
  --copper-500: #8F3A2E;  /* acento principal — terracota profunda */
  --copper-400: #A8594B;
  --copper-300: #C07D6E;
  --copper-200: #D9A99C;

  /* ——— Neutros tipográficos ——— */
  --ink-900: #121210;  /* texto principal em claro */
  --ink-700: #2A2A26;
  --ink-500: #55544E;
  --ink-300: #8C8A81;

  /* ——— Semânticos ——— */
  --bg: var(--clay-50);
  --bg-alt: var(--clay-100);
  --bg-deep: var(--forest-800);
  --bg-deeper: var(--forest-900);
  --fg: var(--ink-900);
  --fg-muted: var(--ink-500);
  --fg-faint: var(--ink-300);
  --fg-on-deep: #E7DEC9;
  --fg-on-deep-muted: #A7AE9E;
  --accent: var(--copper-500);
  --accent-dim: var(--copper-700);
  --rule: rgba(18,18,16,0.14);
  --rule-deep: rgba(231,222,201,0.16);

  /* ——— Tipografia ——— */
  --f-display: "Cormorant Garamond", "GT Sectra", Garamond, "Times New Roman", serif;
  --f-body:    "Inter Tight", Inter, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --f-mono:    "JetBrains Mono", "IBM Plex Mono", ui-monospace, Menlo, monospace;

  /* ——— Escala ——— */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px;
  --sp-5: 24px; --sp-6: 32px; --sp-7: 48px; --sp-8: 64px;
  --sp-9: 96px; --sp-10: 144px; --sp-11: 200px;

  --radius-s: 2px;
  --radius-m: 4px;

  --maxw: 1440px;
  --maxw-read: 720px;

  /* ——— Easing ——— */
  --ease-out-expo:  cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
  --ease-state:     0.25s ease;
}

/* ——— Reset leve ——— */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01", "cv11";
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; background: none; border: 0; cursor: pointer; color: inherit; }

/* ——— Grão de papel global, sutilíssimo ——— */
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  opacity: .35;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.08  0 0 0 0 0.08  0 0 0 0 0.07  0 0 0 0.06 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  z-index: 1;
}
body > * { position: relative; z-index: 2; }
body > header { z-index: 50; }

/* ——— Tipografia editorial ——— */
.h-display {
  font-family: var(--f-display);
  font-weight: 500;
  font-style: normal;
  letter-spacing: -0.015em;
  line-height: 1.02;
  color: var(--fg);
}
.h-italic { font-style: italic; font-weight: 400; }
.h-1 { font-size: clamp(56px, 7.2vw, 120px); }
.h-2 { font-size: clamp(40px, 4.6vw, 72px); line-height: 1.04; }
.h-3 { font-size: clamp(28px, 2.6vw, 44px); line-height: 1.1; }
.h-4 { font-size: clamp(22px, 1.8vw, 28px); line-height: 1.2; }

.eyebrow {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--fg-muted);
  display: inline-flex; align-items: center; gap: 10px;
}
.eyebrow::before {
  content: ""; width: 18px; height: 1px; background: currentColor; display: inline-block;
}
.on-deep .eyebrow { color: var(--copper-300); }
.on-deep { color: var(--fg-on-deep); }
.on-deep .fg-muted { color: var(--fg-on-deep-muted); }

.lede {
  font-size: clamp(17px, 1.15vw, 19px);
  line-height: 1.55;
  color: var(--ink-700);
  max-width: 56ch;
}
.on-deep .lede { color: var(--fg-on-deep-muted); }

.mono { font-family: var(--f-mono); font-size: 12px; letter-spacing: 0.04em; }
.small { font-size: 13px; color: var(--fg-muted); }

/* ——— Containers & grid ——— */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 56px);
}
.row { display: flex; gap: var(--sp-6); }
.grid { display: grid; gap: var(--sp-6); }
.grid-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.grid-5 { grid-template-columns: repeat(5, minmax(0,1fr)); }
@media (max-width: 860px) {
  .grid-2, .grid-3, .grid-4, .grid-5 { grid-template-columns: 1fr; }
}

/* ——— Regras horizontais ——— */
.rule { border-top: 1px solid var(--rule); }
.on-deep .rule { border-color: var(--rule-deep); }

/* ——— Botões ——— */
.btn {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 14px 22px;
  font-family: var(--f-body);
  font-size: 14px;
  letter-spacing: 0.02em;
  border-radius: var(--radius-s);
  transition: background .25s ease, color .25s ease, border-color .25s ease;
  cursor: pointer;
  border: 1px solid transparent;
}
.btn-primary {
  background: var(--forest-900); color: var(--clay-50);
}
.btn-primary:hover { background: var(--forest-700); }
.btn-ghost {
  background: transparent; color: var(--fg);
  border-color: var(--rule);
}
.btn-ghost:hover { border-color: var(--ink-700); }
.on-deep .btn-primary { background: var(--copper-500); color: #0D1711; }
.on-deep .btn-primary:hover { background: var(--copper-400); }
.on-deep .btn-ghost { color: var(--fg-on-deep); border-color: var(--rule-deep); }
.on-deep .btn-ghost:hover { border-color: var(--copper-400); }

.btn .arrow { width: 16px; height: 10px; }
.btn .arrow path { stroke: currentColor; fill: none; stroke-width: 1.4; }

/* ——— Nav ——— */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(246, 241, 232, 0.75);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid transparent;
  transition: background 0.4s var(--ease-out-quart), border-color 0.4s ease, box-shadow 0.4s ease;
}
.nav.scrolled {
  background: rgba(246, 241, 232, 0.97);
  backdrop-filter: blur(14px);
  border-bottom-color: var(--rule);
  box-shadow: 0 2px 24px rgba(18,18,16,0.05);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 72px;
}
.nav-left { display: flex; align-items: center; gap: 40px; }
.brand {
  font-family: var(--f-display);
  font-weight: 500;
  font-size: 22px;
  letter-spacing: 0.02em;
  display: inline-flex; align-items: baseline; gap: 10px;
}
.brand .dot { width: 6px; height: 6px; background: var(--copper-500); border-radius: 50%; display: inline-block; transform: translateY(-3px); }
.nav-links { display: flex; gap: 28px; font-size: 14px; color: var(--ink-700); align-items: center; }
.nav-links > a { position: relative; padding: 4px 0; }
.nav-links > a::after {
  content: ""; position: absolute; left: 0; bottom: 0;
  width: 0; height: 1px; background: var(--copper-500);
  transition: width .3s ease;
}
.nav-links > a:hover::after, .nav-links > a.active::after { width: 100%; }

/* ——— Nav dropdown (desktop) ——— */
.nav-dropdown { position: relative; }
.nav-dropdown-toggle {
  background: transparent; border: none; padding: 4px 0; margin: 0;
  font: inherit; font-size: 14px; color: var(--ink-700);
  cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  position: relative;
}
.nav-dropdown-toggle::after {
  content: ""; position: absolute; left: 0; bottom: 0;
  width: 0; height: 1px; background: var(--copper-500);
  transition: width .3s ease;
}
.nav-dropdown:hover .nav-dropdown-toggle::after,
.nav-dropdown-toggle.active::after { width: 100%; }
.nav-chevron { transition: transform .25s ease; opacity: 0.5; }
.nav-dropdown:hover .nav-chevron { transform: rotate(180deg); opacity: 0.9; }
.nav-dropdown-menu {
  position: absolute; top: 100%; left: -14px;
  min-width: 260px;
  background: #F6F1E8;
  border: 1px solid rgba(20,37,29,0.12); border-radius: 10px;
  padding: 8px;
  margin-top: 10px;
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity .2s ease, transform .2s ease, visibility .2s;
  box-shadow: 0 16px 48px rgba(20,37,29,0.18), 0 2px 8px rgba(20,37,29,0.06);
  z-index: 200;
}
.nav-dropdown-menu::before {
  content: ""; position: absolute; top: -10px; left: 0; right: 0; height: 10px;
}
.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu {
  opacity: 1; visibility: visible; transform: translateY(0);
}
.nav-dropdown-menu a {
  display: block; padding: 10px 14px;
  font-size: 14px; color: var(--ink-700);
  border-radius: 6px;
  transition: background .15s ease, color .15s ease;
}
.nav-dropdown-menu a:hover { background: rgba(143,58,46,0.06); color: var(--copper-500); }
.nav-dropdown-menu a.active { color: var(--copper-500); }

.nav-right { display: flex; align-items: center; gap: 16px; }

/* ——— Nav hamburger ——— */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
  margin-right: -4px;
}
.nav-hamburger span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--ink-900);
  transform-origin: center;
  transition: transform 0.25s ease, opacity 0.2s ease;
}
.nav.open .nav-hamburger span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav.open .nav-hamburger span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav.open .nav-hamburger span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ——— Nav drawer (mobile dropdown) ——— */
.nav-drawer {
  display: none;
  flex-direction: column;
  background: rgba(246,241,232,0.97);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--rule);
}
.nav.open .nav-drawer { display: flex; }
.nav-drawer a:not(.btn) {
  display: block;
  padding: 15px clamp(20px, 4vw, 56px);
  font-size: 15px;
  color: var(--ink-700);
  border-bottom: 1px solid var(--rule);
}
.nav-drawer a.active:not(.btn) { color: var(--copper-500); }
.nav-drawer .drawer-group-label {
  display: block;
  padding: 18px clamp(20px,4vw,56px) 4px;
  font-family: var(--f-mono);
  font-size: 11px; letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-500);
  border-bottom: 1px solid var(--rule);
}
.nav-drawer a.drawer-sub:not(.btn) {
  padding-left: clamp(36px, 6vw, 72px);
  font-size: 14px;
}
.nav-drawer .nav-drawer-cta {
  margin: 20px clamp(20px, 4vw, 56px) 24px;
  align-self: flex-start;
  font-size: 14px;
}

/* ——— Nav mobile breakpoint ——— */
@media (max-width: 860px) {
  .nav-links { display: none; }
  .nav-right { display: none; }
  .nav-hamburger { display: flex; }
}

/* ——— Footer brand span reset on mobile ——— */
.footer-brand { grid-column: span 2; }
@media (max-width: 860px) { .footer-brand { grid-column: auto; } }

/* ——— Footer ——— */
.footer {
  background: var(--forest-900);
  color: var(--fg-on-deep);
  padding: var(--sp-10) 0 var(--sp-7);
  margin-top: var(--sp-10);
}
.footer a { color: var(--fg-on-deep); }
.footer .small { color: var(--fg-on-deep-muted); }

/* ——— Marginália técnica (estilo nota-de-rodapé editorial) ——— */
.margin-note {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

/* ——— Numeração romana/editorial ——— */
.numeral {
  font-family: var(--f-display);
  font-style: italic;
  color: var(--copper-500);
  font-size: 22px;
  line-height: 1;
}

/* ——— Seções ——— */
section { padding: clamp(80px, 10vw, 140px) 0; position: relative; }
section.tight { padding: clamp(48px, 6vw, 88px) 0; }

/* ——— Selo em cobre (circulo com sombra radial) ——— */
.seal {
  width: 96px; height: 96px; border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, #EFC9A8, var(--copper-500) 55%, var(--copper-700) 100%);
  box-shadow:
    inset 0 0 0 1px rgba(0,0,0,0.15),
    inset 0 -20px 40px rgba(0,0,0,0.25),
    inset 0 10px 20px rgba(255,230,200,0.4),
    0 12px 30px rgba(138,75,42,0.2);
  display: grid; place-items: center;
  font-family: var(--f-display);
  font-style: italic;
  color: #2A1710;
  font-size: 28px;
}

/* ——— Uppercase tracking block ——— */
.kicker {
  font-family: var(--f-body);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

/* ——— Sutil hover em cards ——— */
.card-move { transition: transform .4s cubic-bezier(.2,.7,.2,1); }
.card-move:hover { transform: translateY(-3px); }

/* ——— CTA button enhanced hover ——— */
.btn-primary { transition: background .25s ease, transform .3s var(--ease-out-quart), box-shadow .3s ease; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(20,37,29,0.18); }
.btn-primary:active { transform: translateY(0); }

/* ——— Entry reveal ——— */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .8s var(--ease-out-expo), transform .8s var(--ease-out-expo); }
.reveal.in { opacity: 1; transform: none; }

/* ——— Hero LP stagger entrance ——— */
@keyframes tt-fade-up {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: translateY(0); }
}
.hero-lp .eyebrow   { animation: tt-fade-up .7s var(--ease-out-expo)  50ms both; }
.hero-lp h1         { animation: tt-fade-up .75s var(--ease-out-expo) 160ms both; }
.hero-lp .hero-cta  { animation: tt-fade-up .7s var(--ease-out-expo)  300ms both; }
.hero-lp .lede      { animation: tt-fade-up .7s var(--ease-out-expo)  390ms both; }
.hero-lp .hero-meta { animation: tt-fade-up .7s var(--ease-out-expo)  500ms both; }
.hero-lp .hero-badges { animation: tt-fade-up .7s var(--ease-out-expo) 300ms both; }

/* ——— Stat counter (count-up) ——— */
.count-up { display: inline-block; }

/* ——— Hero background symbol parallax ——— */
.hero-bg-symbol, .hero-bg-year {
  will-change: transform;
  transition: none;
}

/* ——— Utilitários ——— */
.flow > * + * { margin-top: 1em; }
.center { text-align: center; }
.muted { color: var(--fg-muted); }
.accent { color: var(--copper-500); }
.forest { color: var(--forest-800); }
.italic { font-style: italic; }
.spacer-sm { height: var(--sp-5); }
.spacer-md { height: var(--sp-7); }
.spacer-lg { height: var(--sp-9); }

/* ——— Mobile global polish ——— */
@media (max-width: 600px) {
  /* Prevent buttons overflowing on very small screens */
  .buttons { flex-direction: column; align-items: center; }
  .buttons .btn { width: 100%; justify-content: center; max-width: 360px; }

  /* Tighten section spacing */
  section { padding: clamp(48px, 9vw, 80px) 0; }
  section.tight { padding: clamp(32px, 7vw, 56px) 0; }

  /* Reduce footer top gap */
  .footer { padding-top: var(--sp-8); margin-top: var(--sp-8); }
}

/* ——— LP Hero base (páginas de serviço) ——— */
.hero .container { position: relative; z-index: 1; }
.hero h1 { margin: 20px 0 0; }
.hero h1 em { font-style: italic; color: var(--copper-500); }
.hero .lede { margin-top: 32px; }
.hero-bg-symbol {
  position: absolute; right: clamp(-20px,-2vw,20px); top: 40px;
  font-family: var(--f-display); font-style: italic; font-weight: 300;
  font-size: clamp(240px,28vw,480px); line-height: 1;
  color: rgba(143,58,46,0.05); user-select: none; pointer-events: none; z-index: 0;
}
.hero-meta {
  margin-top: var(--sp-8); display: grid; grid-template-columns: repeat(3,1fr);
  gap: var(--sp-5); border-top: 1px solid var(--rule); padding-top: var(--sp-5);
}
@media (max-width:640px) { .hero-meta { grid-template-columns: 1fr 1fr; } }
.hero-meta .stat .num {
  font-family: var(--f-display); font-size: clamp(32px,3.2vw,48px);
  line-height: 1; color: var(--forest-900); letter-spacing: -0.02em;
}
.hero-meta .stat .lbl {
  font-family: var(--f-mono); font-size: 11px;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--fg-muted); margin-top: 6px;
}

/* ——— Acessibilidade: respeitar prefers-reduced-motion ——— */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  .card-move:hover { transform: none; }
}
