/* ==========================================================================
   css/base.css — Reset Moderno, Acessibilidade & Fundação Visual
   ========================================================================== */

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Integração Limpa com Lenis (sem scroll-behavior: smooth) */
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: hidden;
}

.lenis.lenis-scrolling iframe {
  pointer-events: none;
}

body {
  min-height: 100vh;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.65;
  overflow-x: hidden;
  position: relative;
}

/* Torchlight Háptico Sutil no Fundo */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: 
    radial-gradient(ellipse 60% 45% at 85% 15%, rgba(201, 155, 119, 0.07) 0%, transparent 60%),
    radial-gradient(ellipse 55% 50% at 15% 80%, rgba(234, 220, 211, 0.25) 0%, transparent 55%),
    radial-gradient(circle at var(--torch-x, 50%) var(--torch-y, 20%), rgba(201, 155, 119, 0.05) 0%, transparent 400px);
  pointer-events: none;
  z-index: 0;
}

/* Skip Link para Leitores de Tela e Teclado */
.skip-link {
  position: absolute;
  top: -120px;
  left: 1.5rem;
  z-index: 1000;
  padding: 0.75rem 1.25rem;
  background: var(--text-primary);
  color: var(--text-inverse);
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-medium);
  transition: transform var(--dur-fast) var(--ease-out);
}

.skip-link:focus {
  transform: translateY(130px);
  outline: 2px solid var(--accent-gold);
  outline-offset: 3px;
}

/* Tipografia Base */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.15;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

p {
  color: var(--text-secondary);
  text-wrap: pretty;
}

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

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

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

button {
  cursor: pointer;
}

ul, ol {
  list-style: none;
}

/* Foco Acessível Universal */
:focus-visible {
  outline: 2px solid var(--accent-gold);
  outline-offset: 3px;
  border-radius: var(--radius-xs);
}

/* Estados Iniciais sob JavaScript (Motion Fallback) */
.js [data-reveal="fade-up"] {
  opacity: 0;
}

.js [data-reveal="stagger"] > * {
  opacity: 0;
}

.js .line-mask {
  overflow: clip;
  display: block;
}

.js .line-mask > span {
  display: block;
  will-change: transform;
}

/* Respeito a Preferências de Movimento Reduzido */
@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;
  }

  body::before {
    display: none;
  }

  .js [data-reveal="fade-up"],
  .js [data-reveal="stagger"] > * {
    opacity: 1 !important;
    transform: none !important;
  }
}
