/* =========================================================
   Reset, base tipográfica, layout e utilitários
   ========================================================= */
@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  * { margin: 0; }
  html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
  body { min-height: 100vh; line-height: 1.5; -webkit-font-smoothing: antialiased; }
  img, picture, video, svg { display: block; max-width: 100%; }
  input, button, textarea, select { font: inherit; color: inherit; }
  button { background: none; border: 0; padding: 0; cursor: pointer; }
  a { color: inherit; }
  ul, ol { padding: 0; list-style: none; }
  p, h1, h2, h3, h4 { overflow-wrap: break-word; }
  [hidden] { display: none !important; }

  /* Reduced motion: na camada mais cedo, o !important vence as demais */
  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.01ms !important;
      scroll-behavior: auto !important;
    }
  }
}

@layer base {
  html {
    scrollbar-gutter: stable;
    scroll-padding-top: var(--header-h);
    background: var(--bg);
  }
  @media (prefers-reduced-motion: no-preference) {
    html:not(.lenis) { scroll-behavior: smooth; }
  }

  body {
    font-family: var(--font-body);
    font-size: var(--fs-base);
    color: var(--text);
    background: var(--bg);
    overflow-x: clip;
  }

  h1, h2, h3, .h2, .h3 {
    font-family: var(--font-display);
    font-weight: 500;
    line-height: 1.04;
    letter-spacing: -0.02em;
    font-variation-settings: "opsz" 144;
    text-wrap: balance;
  }

  /* Sem itálico em nenhum lugar: a ênfase, quando existe, é só de cor (.hl) */
  em, i, cite { font-style: normal; }

  /* Máscaras do SplitText (títulos que sobem "de dentro da linha"): a área visível
     ganha folga para acentos (Á, Ç...) e perninhas (g, j, p, q, ç) sem mudar o layout.
     As máscaras de linha viram inline-block de largura total (o SplitText as cria com
     display:block inline), para que as margens negativas de linhas vizinhas não colapsem. */
  .split-line-mask { display: inline-block !important; width: 100%; vertical-align: top; }
  .split-line-mask, .split-word-mask {
    padding-block: 0.14em 0.26em;
    margin-block: -0.14em -0.26em;
  }

  ::selection { background: var(--c-pessego-300); color: var(--c-mata-900); }

  :focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 3px;
    box-shadow: 0 0 0 6px rgb(247 242 233 / 0.9);
    border-radius: 6px;
  }

  /* Lenis (copiado e ajustado: o iframe do mapa precisa continuar clicável) */
  html.lenis, html.lenis body { height: auto; }
  .lenis.lenis-smooth { scroll-behavior: auto !important; }
  .lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
  .lenis.lenis-stopped { overflow: clip; }
  .lenis.lenis-scrolling iframe { pointer-events: none; }
}

@layer layout {
  .container {
    width: 100%;
    max-width: calc(var(--container) + var(--gutter) * 2);
    margin-inline: auto;
    padding-inline: var(--gutter);
  }

  .section {
    position: relative;
    padding-block: var(--section-y);
  }
  .section--sand { background: var(--c-areia-200); }
  .section--sage { background: var(--c-salvia-100); }
  .section--dark {
    background: var(--c-mata-900);
    color: var(--c-linho-50);
    --text-muted: rgb(247 242 233 / 0.72);
    --line: rgb(247 242 233 / 0.16);
    --focus: var(--c-pessego-300);
  }

  .section-head {
    position: relative;
    display: grid;
    gap: 1.25rem;
    margin-bottom: clamp(2.5rem, 1.5rem + 3vw, 4.5rem);
  }
  .section-head .h2 { max-width: 16ch; }
  .section-head--center { justify-items: center; text-align: center; }
  .section-head--center .h2 { max-width: 20ch; }
  .section-head__aside {
    color: var(--text-muted);
    font-size: var(--fs-lead);
    line-height: 1.5;
    max-width: 34rem;
  }

  /* Celular/tablet: eyebrow e título das seções centralizados; subtítulo justificado
     (com hifenização pt-BR para não abrir buracos na coluna estreita) */
  @media (max-width: 1023.98px) {
    .section-head { justify-items: center; text-align: center; }
    .section-head .h2 { margin-inline: auto; }
    .section-head__aside { text-align: justify; -webkit-hyphens: auto; hyphens: auto; }
  }

  @media (min-width: 1024px) {
    .section-head--split {
      grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
      column-gap: clamp(2rem, 5vw, 6rem);
      align-items: end;
    }
  }
}

@layer utilities {
  .sr-only {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0);
    white-space: nowrap; border: 0;
  }
  .skip-link {
    position: fixed;
    top: 0.75rem; left: 0.75rem;
    z-index: 1000;
    padding: 0.75rem 1.25rem;
    border-radius: var(--r-pill);
    background: var(--btn-green);
    color: var(--c-linho-50);
    font-weight: 700;
    transform: translateY(-160%);
    transition: transform var(--dur-fast) var(--ease-out);
  }
  .skip-link:focus { transform: none; }

  .tiles-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

  /* Texto com versão abreviada no celular (ex.: rótulos de botão que não podem quebrar) */
  .txt-short { display: none; }
  @media (max-width: 1023.98px) {
    .txt-full { display: none; }
    .txt-short { display: inline; }
  }

  /* Dados pendentes do cliente: destacados para não passarem despercebidos */
  .todo {
    background: rgb(226 160 67 / 0.28);
    border-radius: 4px;
    padding: 0 0.25em;
    font-style: normal;
  }
}
