/* ezis — base: reset, elementos e utilitários de layout */

@layer base {
  *,
  *::before,
  *::after {
    box-sizing: border-box;
  }

  html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h) + var(--space-4));
  }

  @media (prefers-reduced-motion: reduce) {
    html {
      scroll-behavior: auto;
    }
  }

  body {
    margin: 0;
    min-width: 20rem;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: var(--text-body);
    font-weight: var(--weight-body);
    line-height: var(--leading-body);
    font-variant-numeric: tabular-nums;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
  }

  h1,
  h2,
  h3,
  h4,
  p,
  ul,
  ol,
  dl,
  dd,
  figure,
  blockquote {
    margin: 0;
  }

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

  h1,
  h2,
  h3,
  h4 {
    font-weight: var(--weight-title);
    line-height: var(--leading-heading);
    letter-spacing: var(--tracking-heading);
    text-wrap: balance;
  }

  p,
  li {
    text-wrap: pretty;
  }

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

  svg {
    overflow: visible;
  }

  a {
    color: inherit;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.2em;
  }

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

  button {
    cursor: pointer;
  }

  address {
    font-style: normal;
  }

  strong {
    font-weight: var(--weight-label);
  }

  sub,
  sup {
    font-size: 0.7em;
    line-height: 0;
  }

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

  ::selection {
    background: var(--brand-blue);
    color: var(--brand-white);
  }

  [hidden] {
    display: none !important;
  }

  /* ---- Layout ---- */
  .container {
    width: min(100% - 2 * var(--gutter), var(--container));
    margin-inline: auto;
  }

  .section {
    padding-block: var(--section-y);
    background: var(--bg);
    color: var(--text);
  }

  .section--surface {
    background: var(--surface);
    --text-muted: var(--text-muted-on-surface);
    --detail: var(--detail-on-surface);
  }

  .grid {
    display: grid;
    gap: var(--grid-gap);
  }

  @media (min-width: 40rem) {
    .grid--2,
    .grid--4 {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }
  }

  @media (min-width: 56rem) {
    .grid--3 {
      grid-template-columns: repeat(3, minmax(0, 1fr));
    }
  }

  @media (min-width: 68rem) {
    .grid--4 {
      grid-template-columns: repeat(4, minmax(0, 1fr));
    }
  }

  .stack > * + * {
    margin-top: var(--stack, var(--space-4));
  }

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

  /* ---- Entrada ao rolar: só com JS ativo ---- */
  .js .reveal {
    opacity: 0;
    transform: translateY(var(--reveal-shift));
    transition:
      opacity var(--dur-reveal) var(--ease),
      transform var(--dur-reveal) var(--ease);
    transition-delay: calc(var(--reveal-i, 0) * 80ms);
  }

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

  @media (prefers-reduced-motion: reduce) {
    .js .reveal {
      opacity: 1;
      transform: none;
      transition: none;
    }
  }

  @media print {
    .js .reveal {
      opacity: 1;
      transform: none;
    }
  }
}
