/* ============================================================
   ACERINA AMADOR — Base: reset, elements, utilities, a11y
   ============================================================ */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scrollbar-color: var(--surface-2) var(--obsidian);
}
/* Lenis owns scrolling when active; disable native smooth to avoid fighting it */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-text);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  font-synthesis: none;
}

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

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
ul, ol { list-style: none; padding: 0; }

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

/* --- Headings --- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: var(--lh-tight);
  letter-spacing: var(--track-display);
  text-transform: uppercase;
  text-wrap: balance;
}
h1 { font-size: var(--fs-hero); }
h2 { font-size: var(--fs-display); }
h3 { font-size: var(--fs-h3); }
p { text-wrap: pretty; }

/* --- Reusable utilities --- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container-wide { max-width: var(--maxw-wide); }
.section { padding-block: var(--space-section); position: relative; }

.eyebrow, .label {
  font-family: var(--font-text);
  font-size: var(--fs-label);
  font-weight: 600;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--muted);
}
.measure { max-width: var(--maxw-text); }
.lead { font-size: var(--fs-lead); line-height: var(--lh-snug); color: var(--bone-dim); }
.text-accent { color: var(--vermelho-bright); }

/* Section title with a small red mark */
.section-title { font-size: var(--fs-display); }
.mark::before {
  content: "";
  display: inline-block;
  width: 0.42em; height: 0.42em;
  margin-right: 0.5em;
  background: var(--vermelho);
  vertical-align: middle;
  transform: translateY(-0.08em);
}

/* --- Buttons / links --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  padding: 0.85em 1.5em;
  font-family: var(--font-text);
  font-weight: 600;
  font-size: var(--fs-sm);
  letter-spacing: 0.01em;
  border-radius: var(--r-pill);
  transition: background var(--dur-ui) var(--ease-out-quint),
              color var(--dur-ui) var(--ease-out-quint),
              transform var(--dur-ui) var(--ease-out-quint);
  will-change: transform;
}
.btn--primary { background: var(--vermelho); color: var(--vermelho-ink); }
.btn--primary:hover { background: var(--vermelho-bright); transform: translateY(-2px); }
.btn--ghost { border: 1px solid var(--hairline); color: var(--bone); }
.btn--ghost:hover { border-color: var(--vermelho-bright); color: var(--vermelho-bright); }

/* Animated underline link */
.link-underline {
  position: relative;
  color: var(--bone);
  padding-bottom: 2px;
  transition: color var(--dur-ui) var(--ease-out-quint);
}
.link-underline::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 1.5px;
  background: var(--vermelho-bright);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur-slow) var(--ease-out-expo);
}
.link-underline:hover { color: var(--vermelho-bright); }
.link-underline:hover::after { transform: scaleX(1); }

/* --- Accessibility --- */
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}
.skip-link {
  position: fixed;
  top: -100%;
  left: var(--gutter);
  z-index: var(--z-toast);
  background: var(--vermelho);
  color: var(--vermelho-ink);
  padding: 0.75em 1.25em;
  border-radius: 0 0 var(--r-md) var(--r-md);
  font-weight: 600;
  transition: top var(--dur-ui) var(--ease-out-quint);
}
.skip-link:focus { top: 0; }

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

/* --- Media treatment (duotone / cinematic) --- */
.media { position: relative; overflow: hidden; background: var(--obsidian-deep); }
.media img { width: 100%; height: 100%; object-fit: cover; }
.media--treat img {
  filter: grayscale(0.18) contrast(1.06) brightness(0.9) saturate(1.02);
}
.media--treat::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg,
      color-mix(in oklab, var(--scrim) 15%, transparent) 0%,
      color-mix(in oklab, var(--scrim) 5%, transparent) 40%,
      color-mix(in oklab, var(--vermelho-deep) 22%, transparent) 100%);
  mix-blend-mode: multiply;
  pointer-events: none;
}

/* --- Motion base: reveals enhance an already-visible default --- */
/* Content is fully visible without JS. JS (html.motion) applies from-states via GSAP. */
@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;
    scroll-behavior: auto !important;
  }
}
