/*
 * ═══════════════════════════════════════════════════════════════════
 *  PILOTO STUDIO — BASE / RESET / FUNDAMENTOS VISUAIS v2.0
 *  Consome os tokens de ds-tokens.css
 * ═══════════════════════════════════════════════════════════════════
 */

/* ─── IMPORTS DE TIPOGRAFIA ─────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Sora:wght@500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

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

html {
  color-scheme: dark;
  font-size: 14px;      /* Base 14px → 1rem = 14px */
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--fw-normal);
  line-height: var(--lh-base);
  color: var(--text-primary);
  background: var(--gradient-bg);
  background-attachment: fixed;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Grain texture muito sutil sobre tudo */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.92' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.035'/%3E%3C/svg%3E");
  background-size: 160px 160px;
  pointer-events: none;
  z-index: var(--z-below);
  opacity: 0.6;
}

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

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

ul, ol {
  list-style: none;
}

button {
  font-family: var(--font-sans);
  cursor: pointer;
  background: none;
  border: none;
}

input, select, textarea {
  font-family: var(--font-sans);
}

code, kbd, pre {
  font-family: var(--font-mono);
}

/* ─── SCROLLBAR CUSTOM ────────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-medium);
  border-radius: var(--radius-full);
  transition: background var(--transition);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--border-strong);
}

/* ─── SELEÇÃO DE TEXTO ────────────────────────────────────────────── */
::selection {
  background: var(--accent-soft);
  color: var(--text-primary);
}

/* ─── FOCO ACESSÍVEL ──────────────────────────────────────────────── */
:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
  border-radius: var(--radius-md);
}

/* ─────────────────────────────────────────────────────────────────────
 *  TIPOGRAFIA — HIERARQUIA
 * ─────────────────────────────────────────────────────────────────── */

/* Display / Headings */
.ds-display-1 {
  font-family: var(--font-display);
  font-size: var(--text-5xl);
  font-weight: var(--fw-bold);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-tight);
  color: var(--text-primary);
}

.ds-display-2 {
  font-family: var(--font-display);
  font-size: var(--text-4xl);
  font-weight: var(--fw-bold);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-snug);
  color: var(--text-primary);
}

.ds-heading-1 {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-snug);
  letter-spacing: var(--ls-snug);
  color: var(--text-primary);
}

.ds-heading-2 {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-snug);
  letter-spacing: var(--ls-snug);
  color: var(--text-primary);
}

.ds-heading-3 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-snug);
  letter-spacing: var(--ls-normal);
  color: var(--text-primary);
}

.ds-heading-4 {
  font-family: var(--font-sans);
  font-size: var(--text-lg);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-snug);
  letter-spacing: var(--ls-normal);
  color: var(--text-primary);
}

/* Body */
.ds-body-lg {
  font-size: var(--text-lg);
  font-weight: var(--fw-normal);
  line-height: var(--lh-relaxed);
  color: var(--text-secondary);
}

.ds-body-md {
  font-size: var(--text-base);
  font-weight: var(--fw-normal);
  line-height: var(--lh-base);
  color: var(--text-secondary);
}

.ds-body-sm {
  font-size: var(--text-sm);
  font-weight: var(--fw-normal);
  line-height: var(--lh-base);
  color: var(--text-secondary);
}

/* Labels e eyebrows */
.ds-label {
  font-size: var(--text-xs);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-widest);
  text-transform: uppercase;
  color: var(--text-muted);
}

.ds-eyebrow {
  font-size: var(--text-2xs);
  font-weight: var(--fw-black);
  letter-spacing: var(--ls-widest);
  text-transform: uppercase;
  color: var(--text-accent);
}

/* Caption / micro */
.ds-caption {
  font-size: var(--text-xs);
  font-weight: var(--fw-medium);
  color: var(--text-muted);
}

/* Mono */
.ds-mono {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
}

/* ─────────────────────────────────────────────────────────────────────
 *  UTILITÁRIOS — COR
 * ─────────────────────────────────────────────────────────────────── */

.text-primary   { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted     { color: var(--text-muted); }
.text-disabled  { color: var(--text-disabled); }
.text-accent    { color: var(--accent); }
.text-brand     { color: var(--brand-bright); }
.text-success   { color: var(--success); }
.text-warning   { color: var(--warning); }
.text-danger    { color: var(--danger); }

/* ─────────────────────────────────────────────────────────────────────
 *  UTILITÁRIOS — FLEXBOX / GRID
 * ─────────────────────────────────────────────────────────────────── */

.flex          { display: flex; }
.flex-col      { display: flex; flex-direction: column; }
.flex-center   { display: flex; align-items: center; justify-content: center; }
.flex-between  { display: flex; align-items: center; justify-content: space-between; }
.flex-start    { display: flex; align-items: center; }
.flex-end      { display: flex; align-items: center; justify-content: flex-end; }
.flex-wrap     { flex-wrap: wrap; }
.flex-1        { flex: 1; }
.flex-shrink-0 { flex-shrink: 0; }
.items-start   { align-items: flex-start; }
.items-center  { align-items: center; }
.items-end     { align-items: flex-end; }

.grid    { display: grid; }
.inline  { display: inline; }

/* Gaps */
.gap-1  { gap: var(--space-1); }
.gap-2  { gap: var(--space-2); }
.gap-3  { gap: var(--space-3); }
.gap-4  { gap: var(--space-4); }
.gap-5  { gap: var(--space-5); }
.gap-6  { gap: var(--space-6); }
.gap-8  { gap: var(--space-8); }

/* ─────────────────────────────────────────────────────────────────────
 *  UTILITÁRIOS — ESPAÇAMENTO
 * ─────────────────────────────────────────────────────────────────── */

.mt-0  { margin-top: 0; }
.mt-2  { margin-top: var(--space-2); }
.mt-4  { margin-top: var(--space-4); }
.mt-6  { margin-top: var(--space-6); }
.mt-8  { margin-top: var(--space-8); }
.mb-0  { margin-bottom: 0; }
.mb-2  { margin-bottom: var(--space-2); }
.mb-4  { margin-bottom: var(--space-4); }
.mb-6  { margin-bottom: var(--space-6); }
.mb-8  { margin-bottom: var(--space-8); }

/* ─────────────────────────────────────────────────────────────────────
 *  UTILITÁRIOS — VISUAL
 * ─────────────────────────────────────────────────────────────────── */

.rounded-sm  { border-radius: var(--radius-sm); }
.rounded-md  { border-radius: var(--radius-md); }
.rounded-lg  { border-radius: var(--radius-lg); }
.rounded-xl  { border-radius: var(--radius-xl); }
.rounded-2xl { border-radius: var(--radius-2xl); }
.rounded-full { border-radius: var(--radius-full); }

.overflow-hidden  { overflow: hidden; }
.overflow-auto    { overflow: auto; }
.overflow-y-auto  { overflow-y: auto; }

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.opacity-0     { opacity: 0; }
.opacity-50    { opacity: 0.5; }
.opacity-75    { opacity: 0.75; }
.pointer-none  { pointer-events: none; }
.cursor-pointer { cursor: pointer; }
.select-none   { user-select: none; }

.w-full   { width: 100%; }
.h-full   { height: 100%; }
.min-w-0  { min-width: 0; }
.relative { position: relative; }
.absolute { position: absolute; }
.inset-0  { inset: 0; }

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

/* ─────────────────────────────────────────────────────────────────────
 *  GLASS SURFACE MIXIN (classes reutilizáveis)
 * ─────────────────────────────────────────────────────────────────── */

.glass {
  background: var(--surface-glass);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border: 1px solid var(--border);
}

.glass-md {
  background: var(--surface-glass-md);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--border);
}

.glass-dark {
  background: var(--surface-glass-dark);
  backdrop-filter: blur(32px) saturate(200%);
  -webkit-backdrop-filter: blur(32px) saturate(200%);
  border: 1px solid var(--border-light);
}

/* Linha separadora decorativa */
.separator {
  border: none;
  height: 1px;
  background: var(--gradient-separator);
  margin: var(--space-5) 0;
}

/* ─────────────────────────────────────────────────────────────────────
 *  KEYFRAMES DE ANIMAÇÃO
 * ─────────────────────────────────────────────────────────────────── */

@keyframes ds-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

@keyframes ds-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

@keyframes ds-fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes ds-fade-up {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes ds-scale-in {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes ds-slide-right {
  from { opacity: 0; transform: translateX(-8px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes ds-slide-left {
  from { opacity: 0; transform: translateX(8px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes ds-shimmer {
  0%   { background-position: -200% center; }
  100% { background-position: 200% center; }
}

@keyframes ds-glow-pulse {
  0%, 100% { box-shadow: 0 0 12px var(--accent-glow); }
  50%       { box-shadow: 0 0 24px var(--accent-glow), 0 0 48px rgba(79, 124, 255, 0.12); }
}

/* Classes de animação de entrada */
.animate-fade-in   { animation: ds-fade-in  var(--dur-slow) var(--ease-smooth) both; }
.animate-fade-up   { animation: ds-fade-up  var(--dur-slow) var(--ease-smooth) both; }
.animate-scale-in  { animation: ds-scale-in var(--dur-normal) var(--ease-spring) both; }
.animate-slide-right { animation: ds-slide-right var(--dur-normal) var(--ease-smooth) both; }

/* Delay de animação */
.delay-1 { animation-delay: 80ms; }
.delay-2 { animation-delay: 160ms; }
.delay-3 { animation-delay: 240ms; }
.delay-4 { animation-delay: 320ms; }
.delay-5 { animation-delay: 400ms; }
