/* =========================================================================
   BASE — reset, design tokens, tipografia e utilitários
   Ju Tonini — Gestão e Produção Cultural
   ========================================================================= */

/* -------------------------------------------------------------------------
   1. Design tokens
   ---------------------------------------------------------------------- */
:root {
  /* Cores da marca -------------------------------------------------- */
  --cor-vermelho:        #cc0203;  /* extraída do logotipo oficial */
  --cor-vermelho-escuro: #9e0102;
  --cor-vermelho-claro:  #f24040;
  --cor-vermelho-tenue:  #fdeced;

  --cor-preto:    #0e0e0e;
  --cor-grafite:  #1a1a1a;
  --cor-branco:   #ffffff;

  /* Escala de cinzas ------------------------------------------------ */
  --cinza-900: #2b2b2b;
  --cinza-700: #4d4d4d;
  --cinza-500: #767676;
  --cinza-300: #d5d5d5;
  --cinza-200: #e6e6e6;
  --cinza-100: #f4f4f4;

  /* Papéis semânticos ----------------------------------------------- */
  --fundo:            var(--cor-branco);
  --fundo-alt:        var(--cinza-100);
  --fundo-escuro:     var(--cor-preto);
  --texto:            var(--cor-grafite);
  --texto-suave:      var(--cinza-700);
  --texto-tenue:      var(--cinza-500);
  --texto-invertido:  var(--cor-branco);
  --borda:            var(--cinza-200);

  /* Tipografia ------------------------------------------------------ */
  --fonte-display: "Playfair Display", Georgia, "Times New Roman", serif;
  --fonte-texto:   "Lato", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Escala fluida de tamanhos (clamp: mínimo → ideal → máximo) ------ */
  --texto-xs:   0.75rem;   /* 12px */
  --texto-sm:   0.875rem;  /* 14px */
  --texto-base: 1rem;      /* 16px */
  --texto-md:   clamp(1.0625rem, 0.25vw + 1rem, 1.125rem);
  --texto-lg:   clamp(1.125rem, 0.5vw + 1rem, 1.375rem);
  --texto-xl:   clamp(1.375rem, 1vw + 1rem, 1.75rem);
  --texto-2xl:  clamp(1.75rem, 2vw + 1rem, 2.5rem);
  --texto-3xl:  clamp(2.125rem, 3.2vw + 1rem, 3.75rem);

  /* Espaçamento ----------------------------------------------------- */
  --esp-2:  0.5rem;
  --esp-3:  0.75rem;
  --esp-4:  1rem;
  --esp-5:  1.5rem;
  --esp-6:  2rem;
  --esp-7:  3rem;
  --esp-8:  4rem;
  --esp-9:  6rem;

  /* Layout ---------------------------------------------------------- */
  --largura-container: 1200px;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --altura-cabecalho: 76px;

  /* Formas e sombras ------------------------------------------------ */
  --raio-sm: 6px;
  --raio-md: 12px;
  --raio-lg: 20px;
  --raio-pill: 999px;

  --sombra-sm: 0 1px 2px rgba(14, 14, 14, 0.06), 0 2px 8px rgba(14, 14, 14, 0.04);
  --sombra-md: 0 8px 24px rgba(14, 14, 14, 0.08), 0 2px 6px rgba(14, 14, 14, 0.04);
  --sombra-lg: 0 24px 60px rgba(14, 14, 14, 0.16), 0 6px 16px rgba(14, 14, 14, 0.06);

  /* Movimento ------------------------------------------------------- */
  --transicao-rapida: 160ms cubic-bezier(0.4, 0, 0.2, 1);
  --transicao:        260ms cubic-bezier(0.4, 0, 0.2, 1);
  --transicao-lenta:  600ms cubic-bezier(0.16, 1, 0.3, 1);

  /* Camadas --------------------------------------------------------- */
  --z-cabecalho: 100;
  --z-menu: 90;
}

/* -------------------------------------------------------------------------
   2. Reset
   ---------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--altura-cabecalho) + 1rem);
}

body {
  min-height: 100svh;
  background-color: var(--fundo);
  color: var(--texto);
  font-family: var(--fonte-texto);
  font-size: var(--texto-base);
  font-weight: 400;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img,
picture,
svg,
video {
  display: block;
  max-width: 100%;
  height: auto;
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: none;
  cursor: pointer;
}

ul[role="list"],
ol[role="list"] {
  list-style: none;
}

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

/* -------------------------------------------------------------------------
   3. Tipografia
   ---------------------------------------------------------------------- */
h1, h2, h3, h4 {
  font-family: var(--fonte-display);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

h1 { font-size: var(--texto-3xl); }
h2 { font-size: var(--texto-2xl); }
h3 { font-size: var(--texto-xl); }

p {
  text-wrap: pretty;
}

::selection {
  background-color: var(--cor-vermelho);
  color: var(--cor-branco);
}

/* -------------------------------------------------------------------------
   4. Acessibilidade
   ---------------------------------------------------------------------- */
:focus-visible {
  outline: 3px solid var(--cor-vermelho);
  outline-offset: 3px;
  border-radius: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -100%;
  left: var(--esp-4);
  z-index: 999;
  padding: var(--esp-3) var(--esp-5);
  background-color: var(--cor-vermelho);
  color: var(--cor-branco);
  font-size: var(--texto-sm);
  font-weight: 700;
  border-radius: 0 0 var(--raio-sm) var(--raio-sm);
  transition: top var(--transicao-rapida);
}

.skip-link:focus-visible {
  top: 0;
  outline-offset: -3px;
}

/* -------------------------------------------------------------------------
   5. Utilitários de layout
   ---------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--largura-container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Animação de entrada — ativada por JS (IntersectionObserver).
   Escopada em .js para que o conteúdo permaneça visível sem JavaScript. */
.js .reveal {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity var(--transicao-lenta),
    transform var(--transicao-lenta);
}

.js .reveal.is-visivel {
  opacity: 1;
  transform: none;
}

/* -------------------------------------------------------------------------
   6. Preferência por movimento reduzido
   ---------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .js .reveal {
    opacity: 1;
    transform: none;
  }
}
