/* =========================================================================
   Reset enxuto + tipografia base
   ========================================================================= */

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

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

html.lenis,
html.lenis body {
  height: auto;
}

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.65;
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  /* Espaço para a barra do player fixo não cobrir o fim do rodapé. */
  padding-bottom: calc(var(--player-h) + 1rem);
  transition: background-color var(--dur) var(--ease-out), color var(--dur) var(--ease-out);
}

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

img {
  height: auto;
}

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

button {
  background: none;
  border: 0;
  cursor: pointer;
}

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

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

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

h1 {
  font-size: var(--step-4);
  text-transform: uppercase;
}
h2 {
  font-size: var(--step-3);
  text-transform: uppercase;
}
h3 {
  font-size: var(--step-2);
}
h4 {
  font-size: var(--step-1);
}

p {
  text-wrap: pretty;
}

::selection {
  background: var(--accent);
  color: var(--accent-ink);
}

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

.skip-link {
  position: fixed;
  top: -100px;
  left: var(--space-s);
  z-index: var(--z-overlay);
  padding: 0.7rem 1.2rem;
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--font-cond);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-radius: var(--radius-s);
  transition: top var(--dur) var(--ease-out);
}

.skip-link:focus-visible {
  top: var(--space-s);
}

/* ------------------------------------------------------------- utilitários */

.container {
  width: min(100% - 2.5rem, var(--container));
  margin-inline: auto;
}

.container--narrow {
  width: min(100% - 2.5rem, var(--container-narrow));
  margin-inline: auto;
}

.section {
  position: relative;
  padding-block: clamp(4rem, 9vw, var(--space-3xl));
}

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

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-cond);
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--accent);
}

.eyebrow::before {
  content: '';
  width: 34px;
  height: 1px;
  background: currentColor;
  opacity: 0.7;
}

.lede {
  font-size: var(--step-1);
  color: var(--text-dim);
  max-width: 62ch;
}

.text-dim {
  color: var(--text-dim);
}

/* --------------------------------------------------------------- fundo ---- */

.bg-stack {
  position: fixed;
  inset: 0;
  z-index: var(--z-bg);
  pointer-events: none;
}

.bg-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.bg-grain {
  position: absolute;
  inset: -50%;
  opacity: var(--grain-opacity);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain-shift 8s steps(6) infinite;
}

@keyframes grain-shift {
  0% { transform: translate(0, 0); }
  20% { transform: translate(-3%, 2%); }
  40% { transform: translate(2%, -3%); }
  60% { transform: translate(-2%, -2%); }
  80% { transform: translate(3%, 1%); }
  100% { transform: translate(0, 0); }
}

.bg-vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 80% at 50% 0%, transparent 40%, var(--bg) 100%),
    radial-gradient(90% 60% at 50% 110%, transparent 30%, var(--bg) 100%);
}

.main {
  position: relative;
  z-index: var(--z-content);
}

/* ------------------------------------------------------ conteúdo rico ----- */

.rich {
  font-size: var(--step-0);
  line-height: 1.78;
  color: var(--text-dim);
}

.rich > * + * {
  margin-top: 1.1em;
}

.rich h1,
.rich h2,
.rich h3,
.rich h4 {
  color: var(--text);
  margin-top: 1.8em;
  text-transform: none;
}

.rich h2 {
  font-size: var(--step-2);
}

.rich h3 {
  font-size: var(--step-1);
}

.rich strong {
  color: var(--text);
  font-weight: 600;
}

.rich a {
  color: var(--accent-alt);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color var(--dur-fast) var(--ease-out);
}

.rich a:hover {
  color: var(--accent);
}

.rich img,
.rich video,
.rich iframe {
  width: 100%;
  border-radius: var(--radius-m);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-m);
}

.rich iframe {
  aspect-ratio: 16 / 9;
  height: auto;
}

.rich blockquote {
  position: relative;
  padding: 0.2rem 0 0.2rem 1.6rem;
  border-left: 2px solid var(--accent);
  font-family: var(--font-cond);
  font-size: var(--step-1);
  color: var(--text);
  font-style: italic;
}

.rich ul,
.rich ol {
  padding-left: 1.4rem;
}

.rich ul li {
  list-style: none;
  position: relative;
  padding-left: 0.2rem;
}

.rich ul li::before {
  content: '';
  position: absolute;
  left: -1rem;
  top: 0.72em;
  width: 6px;
  height: 6px;
  background: var(--accent);
  transform: rotate(45deg);
}

.rich ol {
  list-style: decimal;
}

.rich ol li::marker {
  color: var(--accent);
  font-family: var(--font-display);
}

.rich li + li {
  margin-top: 0.4em;
}

.rich pre {
  padding: 1rem 1.2rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  overflow-x: auto;
  font-size: 0.9em;
}

.rich hr {
  border: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line-strong), transparent);
  margin-block: 2.4em;
}

.rich table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--step--1);
}

.rich th,
.rich td {
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--line);
  text-align: left;
}

.rich .ql-align-center { text-align: center; }
.rich .ql-align-right { text-align: right; }
.rich .ql-align-justify { text-align: justify; }

/* ----------------------------------------------- preferência de movimento */

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .bg-grain {
    animation: none;
  }
}
