/* ==========================================================================
   Base — reset leve, tipografia, utilitários
   ========================================================================== */

@layer reset, base, components, pages;

@layer reset {
  *,
  *::before,
  *::after {
    box-sizing: border-box;
  }
  * {
    margin: 0;
  }
  html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--topbar-h) + 12px);
  }
  [hidden] {
    display: none !important;
  }
  img,
  svg,
  video {
    display: block;
    max-width: 100%;
  }
  img {
    height: auto;
  }
  button,
  input,
  textarea,
  select {
    font: inherit;
    color: inherit;
  }
  button {
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
  }
  a {
    color: inherit;
    text-decoration: none;
  }
  ul[role="list"],
  ol[role="list"] {
    list-style: none;
    padding: 0;
  }
}

@layer base {
  body {
    min-height: 100dvh;
    background: var(--fundo);
    color: var(--texto);
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
  }
  /* sem rodapé na página: reserva espaço para a barra inferior do celular */
  @media (max-width: 1023px) {
    body:not(:has(.footer, [data-footer])) {
      padding-bottom: calc(var(--tabbar-h) + var(--tabbar-gap) * 2 + env(safe-area-inset-bottom));
    }
  }

  ::selection {
    background: var(--salvia-clara);
  }

  :focus-visible {
    outline: 3px solid var(--terracota);
    outline-offset: 3px;
    border-radius: 6px;
  }

  /* Títulos: sans bold apertado, como a marca “conectar” */
  .display,
  h1,
  h2,
  h3 {
    font-weight: 700;
    letter-spacing: -0.035em;
    line-height: 1.02;
    text-wrap: balance;
  }
  .display {
    font-size: clamp(2.5rem, 1.6rem + 4.6vw, 5rem);
  }
  h2 {
    font-size: clamp(2rem, 1.35rem + 3vw, 3.5rem);
  }
  h3 {
    font-size: clamp(1.25rem, 1.1rem + 0.8vw, 1.6rem);
    letter-spacing: -0.025em;
    line-height: 1.12;
  }
  p {
    text-wrap: pretty;
  }

  /* A assinatura da marca: serifa itálica misturada ao sans bold */
  .serif,
  em.serif {
    font-family: var(--font-serif);
    font-style: italic;
    font-weight: 500;
    letter-spacing: -0.01em;
  }
  .serif--leve {
    font-weight: 300;
  }
  .serif--forte {
    font-weight: 600;
  }

  /* Rótulo de seção: caixa-alta espaçada, como os títulos do brandbook */
  .eyebrow {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--terracota-texto);
  }

  .lead {
    font-size: clamp(1.1rem, 1rem + 0.5vw, 1.35rem);
    line-height: 1.5;
  }
  .muted {
    color: var(--texto-suave);
  }
}

@layer pages {
  /* utilitários de layout */
  .container {
    width: 100%;
    max-width: calc(var(--largura-max) + var(--gutter) * 2);
    margin-inline: auto;
    padding-inline: var(--gutter);
  }
  .secao {
    padding-block: var(--secao);
  }
  .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
