/* ============================================================
   NEXGS · Design System · Tokens
   Fonte de verdade: Manual da Marca v1.0 · Abril 2026
   ============================================================ */

/* --------- FONTS (Google Fonts) ---------
   Plus Jakarta Sans · Inter · JetBrains Mono
   Todas gratuitas; importadas via Google Fonts.
   ------------------------------------------ */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* ===== CORES DE MARCA (primitivos) ===== */
  --nexgs-night:    #0A1628;  /* Wordmark, títulos, fundos institucionais */
  --nexgs-blue:     #0B5FFF;  /* CTAs, links, números em destaque */
  --nexgs-pulse:    #22D3EE;  /* Acento, IA, moments técnicos · uso moderado */

  /* ===== NEUTROS DE SISTEMA ===== */
  --white:    #FFFFFF;
  --fog:      #F7F9FC;   /* superfícies de seção */
  --mist:     #E1E7F0;   /* divisores, borders sutis */
  --slate:    #A8B4C8;   /* texto desabilitado, captions */
  --graphite: #5A6778;   /* texto secundário */
  --deep:     #273142;   /* texto em fundo claro (alternativo ao Night) */
  --night:    #0A1628;   /* mesmo que --nexgs-night */

  /* ===== SEMÂNTICOS · Cores ===== */
  --bg-canvas:        var(--white);
  --bg-surface:       var(--fog);
  --bg-raised:        var(--white);
  --bg-inverse:       var(--nexgs-night);
  --bg-muted:         var(--mist);

  --fg-primary:       var(--nexgs-night);   /* text-primary */
  --fg-secondary:     var(--graphite);      /* text-secondary */
  --fg-tertiary:      var(--slate);         /* captions, helper */
  --fg-on-dark:       var(--white);
  --fg-on-dark-dim:   rgba(255,255,255,0.72);
  --fg-on-dark-mute:  rgba(255,255,255,0.48);

  --border-subtle:    var(--mist);
  --border-default:   #CDD6E4;
  --border-strong:    var(--graphite);
  --border-inverse:   rgba(255,255,255,0.12);

  --accent:           var(--nexgs-blue);
  --accent-hover:     #0A54E6;              /* blue -8% */
  --accent-pressed:   #0847C2;              /* blue -16% */
  --accent-soft:      #E6EEFF;              /* blue bg soft */
  --accent-focus:     rgba(11,95,255,0.32); /* focus ring */

  --pulse:            var(--nexgs-pulse);
  --pulse-soft:       #D6F7FC;

  /* ===== SEMÂNTICOS · Estado (formulários) ===== */
  --state-success:    #12A150;
  --state-success-bg: #E6F7EE;
  --state-warning:    #C97A00;
  --state-warning-bg: #FFF5E0;
  --state-danger:     #D63B3B;
  --state-danger-bg:  #FDECEC;
  --state-info:       var(--nexgs-blue);
  --state-info-bg:    var(--accent-soft);

  /* ===== TIPOGRAFIA · Famílias ===== */
  --font-display: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-body:    "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* ===== TIPOGRAFIA · Pesos ===== */
  --fw-regular: 400;
  --fw-medium:  500;
  --fw-semi:    600;
  --fw-bold:    700;
  --fw-extra:   800;

  /* ===== TIPOGRAFIA · Escala (desktop-first, fluid clamp) ===== */
  --fs-display:   clamp(48px, 6vw, 88px);   /* H1 hero */
  --fs-h1:        clamp(40px, 4.8vw, 64px); /* H1 página */
  --fs-h2:        clamp(32px, 3.4vw, 48px);
  --fs-h3:        28px;
  --fs-h4:        22px;
  --fs-h5:        18px;
  --fs-h6:        16px;
  --fs-body-lg:   18px;
  --fs-body:      16px;
  --fs-body-sm:   14px;
  --fs-caption:   13px;
  --fs-eyebrow:   12px;   /* kicker / SRV-### tags */

  /* ===== TIPOGRAFIA · Line-heights ===== */
  --lh-tight:   1.04;   /* display */
  --lh-snug:    1.15;   /* headings */
  --lh-normal:  1.5;    /* body */
  --lh-relaxed: 1.65;   /* long-form */

  /* ===== TIPOGRAFIA · Letter-spacing ===== */
  --ls-wordmark: -0.045em; /* wordmark oficial */
  --ls-display:  -0.03em;
  --ls-heading:  -0.02em;
  --ls-body:     0;
  --ls-eyebrow:  0.16em;   /* tags SRV-###, kickers em caps */

  /* ===== ESPAÇAMENTO · Escala 4px (com 2px de ajuste) ===== */
  --space-0:   0;
  --space-1:   2px;
  --space-2:   4px;
  --space-3:   8px;
  --space-4:   12px;
  --space-5:   16px;
  --space-6:   20px;
  --space-7:   24px;
  --space-8:   32px;
  --space-9:   40px;
  --space-10:  48px;
  --space-11:  64px;
  --space-12:  80px;
  --space-13:  96px;
  --space-14:  120px;
  --space-15:  160px;

  /* ===== LAYOUT · Grid + containers ===== */
  --container-xs:   640px;
  --container-sm:   768px;
  --container-md:   1024px;
  --container-lg:   1200px;   /* site padrão */
  --container-xl:   1320px;
  --container-wide: 1440px;

  --gutter-mobile: 16px;
  --gutter-tablet: 24px;
  --gutter-desktop: 32px;

  --grid-cols-mobile:  4;
  --grid-cols-tablet:  8;
  --grid-cols-desktop: 12;

  /* ===== LAYOUT · Breakpoints (referência; CSS usa @media hardcoded) ===== */
  --bp-sm: 640px;
  --bp-md: 768px;
  --bp-lg: 1024px;
  --bp-xl: 1280px;

  /* ===== RAIOS ===== */
  --radius-none: 0;
  --radius-xs:   2px;    /* tags, badges mono */
  --radius-sm:   4px;    /* inputs, botões pequenos */
  --radius-md:   8px;    /* botões, cards pequenos */
  --radius-lg:   12px;   /* cards */
  --radius-xl:   16px;   /* cards hero, modals */
  --radius-2xl:  24px;   /* seções especiais */
  --radius-pill: 999px;  /* pills, badges */

  /* ===== ELEVAÇÃO · Sombras (sóbrias, curtas, engineering-first) ===== */
  --shadow-none:  none;
  --shadow-xs:    0 1px 2px rgba(10,22,40,0.06);
  --shadow-sm:    0 2px 4px rgba(10,22,40,0.06), 0 1px 2px rgba(10,22,40,0.04);
  --shadow-md:    0 6px 16px rgba(10,22,40,0.08), 0 2px 4px rgba(10,22,40,0.04);
  --shadow-lg:    0 12px 32px rgba(10,22,40,0.12), 0 4px 8px rgba(10,22,40,0.06);
  --shadow-xl:    0 24px 56px rgba(10,22,40,0.16), 0 8px 16px rgba(10,22,40,0.06);
  --shadow-focus: 0 0 0 3px var(--accent-focus);
  --shadow-inset: inset 0 0 0 1px var(--border-default);

  /* ===== MOTION ===== */
  --dur-instant: 80ms;
  --dur-fast:    140ms;
  --dur-base:    200ms;
  --dur-slow:    320ms;
  --dur-slower:  500ms;

  --ease-standard: cubic-bezier(0.2, 0.6, 0.2, 1);   /* default UI */
  --ease-entrance: cubic-bezier(0.16, 1, 0.3, 1);     /* enter */
  --ease-exit:     cubic-bezier(0.4, 0, 1, 1);        /* leave */
  --ease-linear:   linear;

  /* ===== Z-INDEX ===== */
  --z-base:     0;
  --z-raised:   1;
  --z-sticky:   100;
  --z-overlay:  800;
  --z-modal:    900;
  --z-toast:    1000;
}

/* ============================================================
   Base · Reset mínimo + estilos semânticos
   ============================================================ */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-normal);
  color: var(--fg-primary);
  background: var(--bg-canvas);
  font-weight: var(--fw-regular);
}

/* ===== Hierarquia semântica ===== */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  color: var(--fg-primary);
  margin: 0 0 var(--space-5) 0;
  font-weight: var(--fw-bold);
  line-height: var(--lh-snug);
  letter-spacing: var(--ls-heading);
  text-wrap: balance;
}

h1 {
  font-size: var(--fs-h1);
  font-weight: var(--fw-extra);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-display);
}
h2 { font-size: var(--fs-h2); font-weight: var(--fw-bold); letter-spacing: var(--ls-display); }
h3 { font-size: var(--fs-h3); }
h4 { font-size: var(--fs-h4); }
h5 { font-size: var(--fs-h5); }
h6 { font-size: var(--fs-h6); letter-spacing: 0; }

/* Display utilitário (hero do site) */
.display {
  font-family: var(--font-display);
  font-size: var(--fs-display);
  font-weight: var(--fw-extra);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-display);
  color: var(--fg-primary);
}

p {
  margin: 0 0 var(--space-5) 0;
  line-height: var(--lh-relaxed);
  max-width: 68ch; /* line-length recomendado */
  text-wrap: pretty;
}

.lead {
  font-size: var(--fs-body-lg);
  line-height: var(--lh-relaxed);
  color: var(--fg-secondary);
  max-width: 64ch;
}

small, .caption {
  font-size: var(--fs-caption);
  color: var(--fg-tertiary);
  line-height: var(--lh-normal);
}

.eyebrow,
.kicker {
  font-family: var(--font-mono);
  font-size: var(--fs-eyebrow);
  font-weight: var(--fw-medium);
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
  color: var(--fg-secondary);
}

/* Código · JetBrains Mono · elemento de identidade, não só decoração */
code, kbd, samp, pre, .mono {
  font-family: var(--font-mono);
  font-size: 0.95em;
}

pre {
  background: var(--bg-inverse);
  color: var(--fg-on-dark);
  padding: var(--space-6);
  border-radius: var(--radius-md);
  overflow: auto;
  line-height: var(--lh-normal);
}

/* Links inline */
a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color var(--dur-fast) var(--ease-standard);
}
a:hover { color: var(--accent-hover); }
a:active { color: var(--accent-pressed); }
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}

/* Focus global · acessibilidade */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Seleção */
::selection {
  background: var(--nexgs-night);
  color: var(--white);
}

/* hr */
hr {
  border: 0;
  border-top: 1px solid var(--border-subtle);
  margin: var(--space-10) 0;
}

/* Imagens responsivas por padrão */
img, svg, video {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Wordmark utilitário · sempre respeita letter-spacing oficial */
.wordmark {
  font-family: var(--font-display);
  font-weight: var(--fw-extra);
  letter-spacing: var(--ls-wordmark);
  text-transform: lowercase;
  color: var(--nexgs-night);
}

/* SRV-### · código de serviço em tags técnicas */
.srv-tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--fs-eyebrow);
  font-weight: var(--fw-medium);
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
  color: var(--fg-secondary);
  padding: 4px 8px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xs);
  background: var(--bg-canvas);
}

/* Container padrão do site (1200px) */
.container {
  width: 100%;
  max-width: var(--container-lg);
  margin: 0 auto;
  padding-left: var(--gutter-mobile);
  padding-right: var(--gutter-mobile);
}
@media (min-width: 768px) {
  .container {
    padding-left: var(--gutter-tablet);
    padding-right: var(--gutter-tablet);
  }
}
@media (min-width: 1024px) {
  .container {
    padding-left: var(--gutter-desktop);
    padding-right: var(--gutter-desktop);
  }
}

/* Reduced motion · respeita preferência do usuário */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
