/* ==========================================================================
   Corte Nobre · fundação
   Tokens herdados do design system da marca (paleta material + Fraunces/Work Sans).
   ========================================================================== */

:root {
  /* base material */
  --carbono: #17150F;
  --carbono-alt: #201D16;
  --carbono-fundo: #100E0A;
  --aco: #726F64;
  --osso: #EDE6D6;
  --osso-dim: #B9B2A1;
  --couro: #3D2A1C;
  --brasa: #B1531F;
  --prata: #C9C6BB;

  --brasa-hover: #C86227;
  --brasa-press: #94420F;
  --brasa-fosca: rgba(177, 83, 31, 0.14);

  --linha: rgba(201, 198, 187, 0.18);
  --linha-forte: rgba(201, 198, 187, 0.34);
  --linha-fraca: rgba(201, 198, 187, 0.09);

  --text-primary: var(--osso);
  --text-secondary: var(--osso-dim);
  --text-muted: var(--aco);

  /* tipografia */
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Work Sans", system-ui, -apple-system, "Helvetica Neue", sans-serif;

  --text-hero: clamp(44px, 9.2vw, 132px);
  --text-display: clamp(34px, 5.4vw, 68px);
  --text-secao: clamp(28px, 3.6vw, 44px);
  --text-titulo: clamp(21px, 2vw, 26px);
  --text-lead: clamp(17px, 1.35vw, 20px);
  --text-corpo: 17px;
  --text-caption: 14.5px;
  --text-legenda: 13px;

  /* espaço */
  --pagina: 1280px;
  --gutter: clamp(20px, 4.4vw, 56px);
  --secao: clamp(88px, 12vw, 180px);

  /* movimento */
  --fio: cubic-bezier(0.2, 0, 0.2, 1);
  --saida: cubic-bezier(0.16, 1, 0.3, 1);
  --rapido: 160ms;
  --base: 280ms;
  --lento: 620ms;

  --header-h: 72px;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--carbono);
  color: var(--text-primary);
  font: 400 var(--text-corpo)/1.6 var(--font-body);
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.trava { overflow: hidden; }
img, svg, video { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; padding: 0; }
h1, h2, h3, h4, p, figure, blockquote { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--brasa); color: var(--osso); }

:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 1px solid var(--prata);
  outline-offset: 3px;
}

/* ---------- tipografia ---------- */
.display {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: var(--text-display);
  line-height: 1.02;
  letter-spacing: -0.015em;
  text-wrap: balance;
}
.titulo-secao {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: var(--text-secao);
  line-height: 1.08;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.titulo {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--text-titulo);
  line-height: 1.2;
}
.lead {
  font-size: var(--text-lead);
  line-height: 1.6;
  color: var(--text-secondary);
  max-width: 56ch;
  text-wrap: pretty;
}
.corpo { color: var(--text-secondary); max-width: 62ch; text-wrap: pretty; }
.legenda { font-size: var(--text-legenda); line-height: 1.5; color: var(--text-muted); }

.kicker {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--aco);
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.kicker::before {
  content: "";
  width: 28px;
  height: 1px;
  background: var(--brasa);
  flex: none;
}
.kicker.sem-fio::before { display: none; }

.numero {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(38px, 5vw, 64px);
  line-height: 1;
  color: var(--linha-forte);
  font-variant-numeric: lining-nums;
}

/* ---------- layout ---------- */
.wrap {
  width: 100%;
  max-width: var(--pagina);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.secao { padding-block: var(--secao); position: relative; }
.regua { height: 1px; background: var(--linha); border: 0; margin: 0; }

/* ---------- grão ---------- */
.grao {
  position: fixed;
  inset: -20%;
  background-image: url("../assets/textura-grao.svg");
  background-size: 180px 180px;
  opacity: 0.055;
  pointer-events: none;
  z-index: 90;
  animation: grao-treme 6s steps(6) infinite;
}
@keyframes grao-treme {
  0%   { transform: translate(0, 0); }
  20%  { transform: translate(-3%, 2%); }
  40%  { transform: translate(2%, -3%); }
  60%  { transform: translate(-2%, -2%); }
  80%  { transform: translate(3%, 1%); }
  100% { transform: translate(0, 0); }
}

/* ---------- botões ---------- */
.btn {
  --btn-fg: var(--osso);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 13px 26px;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--btn-fg);
  border: 1px solid transparent;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  transition: color var(--rapido) var(--fio), border-color var(--rapido) var(--fio), background-color var(--rapido) var(--fio);
  cursor: pointer;
}
.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--brasa-hover);
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform var(--base) var(--saida);
  z-index: -1;
}
.btn:hover::after { transform: scaleY(1); }
.btn-primario { background: var(--brasa); }
.btn-secundario { border-color: var(--linha-forte); }
.btn-secundario:hover { border-color: transparent; }
.btn-ghost { padding: 10px 0; min-height: 40px; color: var(--text-secondary); }
.btn-ghost::after { display: none; }
.btn-ghost:hover { color: var(--osso); }
.btn[disabled] { opacity: 0.45; pointer-events: none; }
.btn-sm { min-height: 40px; padding: 10px 18px; font-size: 14px; }

/* link com fio que se desenha */
.link-fio {
  position: relative;
  display: inline-block;
  padding-bottom: 2px;
  color: var(--text-secondary);
  transition: color var(--rapido) var(--fio);
}
.link-fio::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: var(--brasa);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform var(--base) var(--saida);
}
.link-fio:hover { color: var(--osso); }
.link-fio:hover::after { transform: scaleX(1); transform-origin: left; }

/* ---------- reveal no scroll ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 760ms var(--saida), transform 760ms var(--saida);
  transition-delay: var(--atraso, 0ms);
}
[data-reveal].dentro { opacity: 1; transform: none; }

[data-reveal="fio"] {
  opacity: 1;
  transform: none;
  transform-origin: left;
  scale: 0 1;
  transition: scale 900ms var(--saida);
  transition-delay: var(--atraso, 0ms);
}
[data-reveal="fio"].dentro { scale: 1 1; }

[data-reveal="mascara"] { opacity: 1; transform: none; }
[data-reveal="mascara"] > span {
  display: block;
  transform: translateY(105%);
  transition: transform 1000ms var(--saida);
  transition-delay: var(--atraso, 0ms);
}
[data-reveal="mascara"].dentro > span { transform: none; }

.mascara { display: block; overflow: hidden; padding-top: 0.12em; margin-top: -0.12em; }

/* ---------- acessibilidade ---------- */
.so-leitor {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.pular {
  position: fixed; top: 8px; left: 8px; z-index: 200;
  background: var(--brasa); color: var(--osso);
  padding: 10px 16px; transform: translateY(-160%);
  transition: transform var(--base) var(--fio);
}
.pular:focus { transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
  [data-reveal] { opacity: 1 !important; transform: none !important; scale: none !important; }
  [data-reveal="mascara"] > span { transform: none !important; }
  .grao { animation: none; }
}
