/* ==========================================================================
   Base: fontes, variáveis, reset, utilitários e animação de entrada
   ========================================================================== */

/* ---------- Fontes ---------- */

@font-face {
  font-family: "Bricolage Grotesque Variable";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url(../assets/fonts/bricolage-grotesque-latin-ext.woff2) format("woff2-variations");
  unicode-range: U+100-2BA, U+2BD-2C5, U+2C7-2CC, U+2CE-2D7, U+2DD-2FF, U+304, U+308, U+329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F,
    U+A720-A7FF;
}

@font-face {
  font-family: "Bricolage Grotesque Variable";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url(../assets/fonts/bricolage-grotesque-latin.woff2) format("woff2-variations");
  unicode-range: U+??, U+131, U+152-153, U+2BB-2BC, U+2C6, U+2DA, U+2DC, U+304, U+308, U+329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Fallbacks com métricas ajustadas para evitar "pulo" do layout enquanto a fonte carrega */
@font-face {
  font-family: "Bricolage Fallback";
  src: local(Arial), local(ArialMT);
  size-adjust: 104.75%;
  ascent-override: 88.79%;
  descent-override: 25.78%;
  line-gap-override: 0%;
}

@font-face {
  font-family: "Bricolage Fallback Android";
  src: local(Roboto), local(Roboto-Regular);
  size-adjust: 104.68%;
  ascent-override: 88.84%;
  descent-override: 25.79%;
  line-gap-override: 0%;
}

/* ---------- Variáveis ---------- */

:root {
  /* Cores */
  --c-ink: #000;
  --c-graphite: #101010;
  --c-graphite-2: #161616;
  --c-line: #242424;
  --c-line-strong: #3b3b3b;
  --c-pencil: #8f8f8f;
  --c-chalk: #c4c4c4;
  --c-paper: #f3f3f3;
  --c-white: #fff;
  --c-violet: 139 108 255; /* canais RGB, use como rgb(var(--c-violet) / .5) */

  /* Tipografia */
  --font-sans: "Bricolage Grotesque Variable", "Bricolage Fallback", "Bricolage Fallback Android",
    system-ui, -apple-system, "Segoe UI", sans-serif;
  --fs-xs: 0.8125rem;
  --fs-sm: 0.9375rem;
  --fs-base: clamp(1rem, 0.97rem + 0.15vw, 1.0625rem);
  --fs-lead: clamp(1.125rem, 1.06rem + 0.3vw, 1.3125rem);
  --fs-h3: clamp(1.25rem, 1.16rem + 0.42vw, 1.5rem);
  --fs-h2: clamp(2.125rem, 1.6rem + 2.3vw, 3.375rem);
  --lh-body: 1.6;

  /* Layout */
  --container: 75rem;
  --gutter: clamp(1.25rem, 0.8rem + 2.4vw, 2.5rem);
  --header-h: 4.25rem;
  --space-section: clamp(5rem, 3.6rem + 6vw, 9.5rem);

  /* Bordas arredondadas */
  --r-sm: 0.75rem;
  --r-md: 1.25rem;
  --r-lg: 2rem;
  --r-pill: 999px;

  /* Movimento */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.45, 0, 0.55, 1);
  --dur-fast: 0.16s;
  --dur: 0.28s;
  --dur-reveal: 0.72s;
  --reveal-shift: 1rem;
  --stagger: 90ms; /* atraso entre itens que aparecem juntos (lido pelo JS) */
}

/* ---------- Reset ---------- */

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

html {
  color-scheme: dark;
  background: var(--c-ink);
  scroll-padding-top: calc(var(--header-h) + 1rem);
  scrollbar-gutter: stable;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  min-height: 100dvh;
  background: var(--c-ink);
  color: var(--c-paper);
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

/* Garante que [hidden] vença o display:block acima (ex.: o sprite de ícones) */
[hidden] {
  display: none !important;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

h1,
h2,
h3 {
  font-weight: 620;
  line-height: 1.12;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

:focus-visible {
  outline: 2px solid var(--c-white);
  outline-offset: 3px;
}

main:focus {
  outline: none;
}

::selection {
  background: rgb(var(--c-violet) / 0.45);
  color: var(--c-white);
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

/* ---------- Utilitários ---------- */

.container {
  --gutter-x: max(var(--gutter), env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px));
  width: min(100% - 2 * var(--gutter-x), var(--container));
  margin-inline: auto;
}

.section {
  padding-top: var(--space-section);
}

.section-title {
  font-size: var(--fs-h2);
  line-height: 1.06;
  letter-spacing: -0.035em;
}

.lead {
  margin-top: 1.5rem;
  color: var(--c-chalk);
  font-size: var(--fs-lead);
  line-height: 1.55;
}

/* Linha com ícone de localização (hero, sobre, rodapé) */
.location {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--c-pencil);
  font-size: var(--fs-sm);
}

/* Ícones do sprite (<svg class="icon"><use href="#icon-..."></svg>) */
.icon {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  border: 0;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: max(0.75rem, env(safe-area-inset-left, 0px));
  z-index: 100;
  padding: 0.75rem 1.125rem;
  border-radius: var(--r-pill);
  background: var(--c-white);
  color: var(--c-ink);
  font-weight: 600;
  transform: translateY(-200%);
}

.skip-link:focus-visible {
  transform: none;
}

/* ---------- Animação de entrada ([data-reveal], controlada pelo js/main.js) ---------- */

@media (prefers-reduced-motion: no-preference) {
  [data-reveal-state] {
    transition:
      opacity var(--dur-reveal) var(--ease-out) var(--reveal-delay, 0s),
      translate calc(var(--dur-reveal) + 0.12s) var(--ease-out) var(--reveal-delay, 0s);
  }

  [data-reveal="up"][data-reveal-state="hidden"] {
    opacity: 0;
    translate: 0 var(--reveal-shift);
  }

  [data-reveal-state="hidden"]:focus-within {
    opacity: 1;
    translate: none;
    transition: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  ::before,
  ::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0s !important;
  }
}

@media print {
  [data-reveal-state] {
    opacity: 1 !important;
    translate: none !important;
    transition: none !important;
  }
}
