/* ==========================================================================
   BASE — reset, tipografia, ícones e utilitários mínimos
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: var(--space-24);
}

body {
  margin: 0;
  background-color: var(--bg-base);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--fs-md);
  line-height: var(--lh-normal);
  font-weight: var(--fw-regular);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
}

/* Fundo atmosférico: duas auroras fixas + grão sutil.
   Fica atrás de tudo e não intercepta cliques. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(60rem 40rem at 12% -10%, rgba(130, 87, 230, 0.22), transparent 60%),
    radial-gradient(48rem 36rem at 92% 8%, rgba(209, 45, 224, 0.16), transparent 62%),
    radial-gradient(52rem 40rem at 50% 108%, rgba(52, 216, 245, 0.1), transparent 60%);
}

body > * {
  position: relative;
  z-index: var(--z-base);
}

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

img {
  height: auto;
}

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

a {
  color: var(--cyan-400);
  text-decoration-color: rgba(52, 216, 245, 0.4);
  text-underline-offset: 3px;
  transition: color var(--dur-fast) var(--ease-out);
}

a:hover {
  color: var(--cyan-300);
}

:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: var(--radius-xs);
}

::selection {
  background: rgba(209, 45, 224, 0.4);
  color: #fff;
}

/* --------------------------------------------------------------------------
   TIPOGRAFIA
   -------------------------------------------------------------------------- */

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-family: var(--font-display);
  color: var(--text-hi);
  font-weight: var(--fw-bold);
  letter-spacing: var(--tracking-tight);
  line-height: var(--lh-snug);
}

p {
  margin: 0;
}

.t-display {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, var(--fs-6xl));
  font-weight: var(--fw-extrabold);
  line-height: var(--lh-tight);
  letter-spacing: var(--tracking-tighter);
  color: var(--text-hi);
}

.t-h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.5vw, var(--fs-4xl));
  font-weight: var(--fw-bold);
  line-height: var(--lh-snug);
  letter-spacing: var(--tracking-tight);
  color: var(--text-hi);
}

.t-h2 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, var(--fs-2xl));
  font-weight: var(--fw-bold);
  line-height: var(--lh-snug);
  letter-spacing: var(--tracking-tight);
  color: var(--text-hi);
}

.t-h3 {
  font-family: var(--font-display);
  font-size: var(--fs-xl);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-snug);
  color: var(--text-hi);
}

.t-body {
  font-size: var(--fs-md);
  line-height: var(--lh-relaxed);
  color: var(--text);
}

.t-body-lg {
  font-size: var(--fs-lg);
  line-height: var(--lh-relaxed);
  color: var(--text-mid);
}

.t-caption {
  font-size: var(--fs-2xs);
  line-height: var(--lh-normal);
  color: var(--text-low);
}

.t-label {
  font-family: var(--font-mono);
  font-size: var(--fs-3xs);
  font-weight: var(--fw-medium);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--text-low);
}

.t-code {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--cyan-300);
  background: var(--bg-sunken);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  padding: 0.1em 0.45em;
}

/* Gradiente de texto — usado só em palavra-chave de headline */
.t-gradient {
  background: linear-gradient(100deg, var(--cyan-300) 0%, var(--magenta-300) 55%, var(--violet-200) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.t-cyan { color: var(--cyan-400); }
.t-magenta { color: var(--magenta-400); }
.t-mid { color: var(--text-mid); }
.t-low { color: var(--text-low); }

/* --------------------------------------------------------------------------
   ÍCONES
   Sistema único: traço 1.5, extremidades arredondadas, grade 24, sem preenchimento.
   Uso: <svg class="icon"><use href="#i-check"></use></svg>
   -------------------------------------------------------------------------- */

.icon {
  width: 1.25em;
  height: 1.25em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: middle;
}

.icon--sm { width: 1em; height: 1em; }
.icon--lg { width: 1.75em; height: 1.75em; }
.icon--xl { width: 2.25em; height: 2.25em; stroke-width: 1.25; }

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

/* --------------------------------------------------------------------------
   UTILITÁRIOS
   -------------------------------------------------------------------------- */

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--space-6);
}

.stack > * + * { margin-top: var(--space-4); }
.stack-sm > * + * { margin-top: var(--space-2); }
.stack-lg > * + * { margin-top: var(--space-8); }

.row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

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

.no-scroll {
  overflow: hidden;
}

/* Revelação no scroll — ativada por components.js */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out);
}

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

/* Blocos decorativos pesados (auroras desfocadas, órbitas) param quando
   saem da tela. Ligado por [data-animate-in-view] em components.js. */
.is-idle,
.is-idle *,
.is-idle *::before,
.is-idle *::after {
  animation-play-state: paused !important;
}
