/* ==========================================================================
   Agrofutura — Design System
   Tokens, fontes, reset e utilitários base. Carregado antes de home.css.
   ========================================================================== */

/* ---------- Fontes (Caviar Dreams) ---------- */
@font-face {
  font-family: "Caviar Dreams";
  src: url("../fonts/CaviarDreams.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Caviar Dreams";
  src: url("../fonts/CaviarDreams_Italic.ttf") format("truetype");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Caviar Dreams";
  src: url("../fonts/CaviarDreams_Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Caviar Dreams";
  src: url("../fonts/CaviarDreams_BoldItalic.ttf") format("truetype");
  font-weight: 700;
  font-style: italic;
  font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  /* Cores da marca */
  --vinho:     #7F2A2D;
  --areia:     #E2E1CF;
  --creme:     #EFDEB8;
  --creme-claro: #FBF7EC; /* creme bem claro — quase branco, tom quente */
  --verde:     #406146;
  --verde-esc: #2F4A34;
  --verde-noite: #0E1A12; /* verde mais escuro — fundos dark */
  --preto:    #000000; /* preto puro */
  --cinza:    #555555; /* cinza escuro para textos de apoio */

  /* Papéis semânticos */
  --bg:           var(--areia);
  --text:         var(--preto);
  --text-soft:    var(--cinza);
  --text-on-dark: var(--creme);
  --action:       var(--verde);
  --action-grad:  linear-gradient(135deg, #406146 0%, #2F4A34 100%);

  /* Tipografia */
  --font: "Caviar Dreams", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Escala fluida (clamp: min, fluido, max) */
  --fs-h1:    clamp(2.75rem, 1.6rem + 4.6vw, 4.5rem);   /* 44–72px */
  --fs-h2:    clamp(2rem,  1.4rem + 2.4vw, 2.75rem);    /* 32–44px */
  --fs-h3:    clamp(1.4rem, 1.2rem + 0.9vw, 1.75rem);   /* ~22–28px */
  --fs-lead:  clamp(1.15rem, 1.05rem + 0.5vw, 1.375rem);/* ~18–22px */
  --fs-body:  clamp(1rem, 0.95rem + 0.25vw, 1.125rem);  /* 16–18px */
  --fs-label: 0.8125rem;                                 /* 13px */

  /* Espaçamento / ritmo */
  --space-section: clamp(5rem, 3rem + 8vw, 9rem);  /* respiro vertical de seção */
  --container:     1240px;
  --gutter:        clamp(1.25rem, 0.5rem + 3vw, 3rem);

  /* Detalhes */
  --radius:    14px;
  --radius-sm: 10px;
  --border:    1px solid rgba(127, 42, 45, 0.18); /* vinho tênue */
  --shadow:    0 18px 50px -24px rgba(0, 0, 0, 0.35);

  /* Movimento */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: 1.6;
  color: var(--text);
  background-color: var(--areia);
  background-image: linear-gradient(180deg, #E2E1CF 0%, #EFDEB8 100%);
  background-attachment: fixed;
  background-repeat: no-repeat;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
#main { flex: 1 0 auto; }
img, picture, video, canvas, svg { display: block; max-width: 100%; }
input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }

/* Lenis: html controlado pelo scroll suave */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

/* ---------- Tipografia base ---------- */
h1, h2, h3 {
  font-weight: 700;
  line-height: 1.08;
  color: var(--preto);          /* títulos sempre em carvão */
  text-wrap: balance;
}
h1 { font-size: var(--fs-h1); letter-spacing: -0.04em; }
h2 { font-size: var(--fs-h2); letter-spacing: -0.03em; }
h3 { font-size: var(--fs-h3); letter-spacing: -0.022em; }

.lead {
  font-size: var(--fs-lead);
  line-height: 1.55;
  color: var(--preto); /* lead em carvão: mais legível e com mais "peso" visual */
  max-width: 56ch;
}

/* Eyebrow / labels — caixa alta, tracking aberto */
.eyebrow,
.label {
  font-size: var(--fs-label);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--vinho);
}

/* Ênfase pontual no corpo (vinho — nunca em títulos) */
.text em,
.text .accent { font-style: normal; color: var(--vinho); }

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.section { padding-block: var(--space-section); background: #fff; }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  padding: 1.1em 3.4em; /* padding lateral generoso */
  border-radius: 0;      /* cantos retos */
  border: 1px solid transparent;
  transition: background-color 0.3s var(--ease), color 0.3s var(--ease), border-color 0.3s var(--ease);
}
.btn:hover { /* removida a subida do botão */ }

/* Versão compacta (header) */
.btn--sm {
  padding: 0.8em 2.6em;
  font-size: 0.8rem;
  border-radius: 0;
}

/* --- Sistema preto/branco --- */
/* Padrão (fundo branco): botão preto, texto branco */
.btn--primary {
  background: #000;
  color: #fff;
  border-color: #000;
}
.btn--primary:hover { 
  background: var(--verde); 
  color: #fff; 
  border-color: transparent; 
}

/* Contorno (fundo branco): branco c/ borda preta */
.btn--ghost {
  background: transparent;
  color: #000;
  border-color: #000;
}
.btn--ghost:hover { background: var(--verde); color: #fff; border-color: var(--verde); }

/* Sobre fundo escuro: inverte para branco */
.btn--on-dark.btn--primary {
  background: #fff;
  color: #000;
  border-color: #fff;
}
.btn--on-dark.btn--primary:hover { 
  background: var(--verde); 
  color: #fff; 
  border-color: transparent; 
}

.btn--on-dark.btn--ghost {
  background: transparent;
  color: #fff;
  border-color: #fff;
}
.btn--on-dark.btn--ghost:hover { background: var(--verde); color: #fff; border-color: var(--verde); }

/* ---------- Animações de entrada (reveal) ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}
[data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  [data-reveal] { opacity: 1; transform: none; }
}

/* ---------- Acessibilidade ---------- */
.screen-reader-text {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
:focus-visible { outline: 2px solid var(--verde); outline-offset: 3px; }
