/* ============================================================
   BASE — Variáveis, reset, tipografia e utilitários globais
   Portfólio premium · HTML + CSS + JS Vanilla
   ============================================================ */

:root {
  /* Cores */
  --bg: #0b0b14;
  --bg-alt: #0f0f1c;
  --bg-soft: #14142a;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-strong: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);

  --text: #eef0ff;
  --text-dim: #a0a3c0;
  --text-faint: #6d7090;

  --primary: #7c5cff;
  --primary-2: #22d3ee;
  --primary-3: #a78bfa;
  --gradient: linear-gradient(135deg, var(--primary) 0%, var(--primary-2) 100%);
  --success: #34d399;
  --warn: #fbbf24;
  --danger: #f87171;

  --glow-primary: 0 0 40px rgba(124, 92, 255, 0.35);
  --glow-cyan: 0 0 40px rgba(34, 211, 238, 0.25);

  /* Tipografia */
  --font-display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", monospace;

  /* Layout */
  --container: 1180px;
  --radius: 18px;
  --radius-lg: 26px;
  --radius-sm: 12px;

  /* Transições */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dur: 0.4s;

  /* Z-index */
  --z-cursor: 1000;
  --z-loader: 999;
  --z-nav: 900;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
  -webkit-text-size-adjust: 100%;
}

@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;
  }
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  overflow-x: hidden;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

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

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

ul,
ol {
  list-style: none;
}

button,
input,
textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

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

/* Esconde cursor nativo em telas precisas (desktop) */
@media (pointer: fine) {
  body.custom-cursor-active,
  body.custom-cursor-active * {
    cursor: none !important;
  }
}

/* ---------- Tipografia ---------- */
h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(1.9rem, 4vw, 2.9rem);
}

h3 {
  font-size: 1.25rem;
}

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

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

::selection {
  background: var(--primary);
  color: #fff;
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-track {
  background: var(--bg);
}
::-webkit-scrollbar-thumb {
  background: linear-gradient(var(--primary), var(--primary-2));
  border-radius: 8px;
  border: 2px solid var(--bg);
}

/* ---------- Utilitários ---------- */
.container {
  width: min(var(--container), 92%);
  margin-inline: auto;
}

.gradient-text {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.skip-link {
  position: fixed;
  top: -100px;
  left: 16px;
  z-index: var(--z-nav);
  background: var(--primary);
  color: #fff;
  padding: 10px 18px;
  border-radius: 10px;
  font-weight: 600;
  transition: top 0.3s var(--ease);
}
.skip-link:focus {
  top: 16px;
}

.section {
  padding: 110px 0;
  position: relative;
  z-index: 1;
}

.section-alt {
  background: var(--bg-alt);
  border-block: 1px solid var(--border);
}

.section-head {
  max-width: 640px;
  margin: 0 auto 64px;
  text-align: center;
}

.section-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--primary-3);
  background: rgba(124, 92, 255, 0.12);
  border: 1px solid rgba(124, 92, 255, 0.3);
  padding: 7px 16px;
  border-radius: 100px;
  margin-bottom: 18px;
}

.section-title {
  margin-bottom: 16px;
}

.section-sub {
  font-size: 1.05rem;
}

.section-more {
  text-align: center;
  margin-top: 52px;
}

.dot {
  color: var(--primary-2);
}

/* ---------- Background FX ---------- */
.bg-fx {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.bg-orbs {
  position: absolute;
  inset: 0;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.5;
}

.orb-1 {
  width: 520px;
  height: 520px;
  background: rgba(124, 92, 255, 0.28);
  top: -180px;
  left: -120px;
  animation: float-orb 18s ease-in-out infinite;
}

.orb-2 {
  width: 460px;
  height: 460px;
  background: rgba(34, 211, 238, 0.16);
  bottom: -160px;
  right: -120px;
  animation: float-orb 22s ease-in-out infinite reverse;
}

.orb-3 {
  width: 380px;
  height: 380px;
  background: rgba(167, 139, 250, 0.16);
  top: 42%;
  left: 55%;
  animation: float-orb 26s ease-in-out infinite;
}

@keyframes float-orb {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  33% {
    transform: translate(40px, -30px) scale(1.06);
  }
  66% {
    transform: translate(-30px, 26px) scale(0.96);
  }
}

.bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, #000 30%, transparent 75%);
  mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, #000 30%, transparent 75%);
}

.bg-noise {
  position: absolute;
  inset: 0;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
}

/* ---------- Scroll Reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(34px);
  transition:
    opacity 0.8s var(--ease),
    transform 0.8s var(--ease);
  transition-delay: var(--reveal-delay, 0s);
  will-change: opacity, transform;
}

.reveal[data-pos="left"] {
  transform: translateX(-40px);
}
.reveal[data-pos="right"] {
  transform: translateX(40px);
}
.reveal[data-pos="zoom"] {
  transform: scale(0.9);
}

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