/* ============================================
   Base — reset, globais, foco, acessibilidade
   ============================================ */

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

@font-face {
  font-family: 'Space Grotesk';
  src: url('../fonts/space-grotesk.woff2') format('woff2');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Inter';
  src: url('../fonts/inter-latin.woff2') format('woff2');
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--ff-body);
  font-size: var(--fs-base);
  line-height: var(--lh-normal);
  color: var(--c-text);
  background: var(--c-bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

img {
  border: 0;
}

ul,
ol {
  list-style: none;
}

a {
  color: var(--c-cyan-soft);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease-soft);
}

a:hover {
  color: var(--c-text);
}

button {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

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

h1,
h2,
h3,
h4 {
  font-family: var(--ff-display);
  font-weight: var(--fw-bold);
  line-height: var(--lh-tight);
  letter-spacing: -0.02em;
  color: var(--c-text);
}

h1 {
  font-size: var(--fs-4xl);
}

h2 {
  font-size: 18px;
  margin-bottom: var(--sp-2);
}

h3 {
  font-size: var(--fs-xl);
}

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

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

:focus-visible {
  outline: 2px solid var(--c-cyan);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* === Skip link (primeiro elemento navegável) === */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: var(--z-float);
  padding: 0.75rem 1.25rem;
  background: var(--c-primary);
  color: #fff;
  font-weight: var(--fw-semibold);
  border-radius: var(--radius-sm);
  transition: top var(--dur-fast) var(--ease-soft);
}

.skip-link:focus {
  top: 1rem;
  color: #fff;
}

/* === Utilidades === */
.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;
}

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

.glass {
  background: var(--c-bg-glass);
  border: 1px solid var(--c-border);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

/* === Cursor custom (desktop, sem reduced motion) === */
.cursor-dot,
.cursor-ring {
  display: none;
  pointer-events: none;
  position: fixed;
  z-index: 200;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

@media (hover: hover) and (pointer: fine) {
  body:not(.touch) .cursor-dot {
    display: block;
    width: 6px;
    height: 6px;
    background: var(--c-cyan);
    box-shadow: 0 0 10px var(--c-cyan);
  }

  body:not(.touch) .cursor-ring {
    display: block;
    width: 36px;
    height: 36px;
    border: 1px solid rgba(34, 211, 238, 0.6);
    transition: width 0.2s var(--ease), height 0.2s var(--ease),
      border-color 0.2s var(--ease);
  }

  body:not(.touch) .cursor-ring.is-active {
    width: 60px;
    height: 60px;
    border-color: rgba(124, 77, 255, 0.8);
  }
}

/* === Reduced motion === */
@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;
  }

  .cursor-dot,
  .cursor-ring {
    display: none !important;
  }
}
