/* =============================================================
   RAVO COMPANY TECHNOLOGY — Design System
   Registro visual: engenharia, editorial, enterprise.
   Princípio estrutural: linha em vez de caixa. Composição em vez
   de componente. O card é exceção, nunca o padrão.
   ============================================================= */

/* ---------- Tipografia local ---------- */

@font-face { font-family:'Inter'; font-style:normal; font-weight:400; font-display:swap; src:url('../fonts/inter-400.woff2') format('woff2'); }
@font-face { font-family:'Inter'; font-style:normal; font-weight:500; font-display:swap; src:url('../fonts/inter-500.woff2') format('woff2'); }
@font-face { font-family:'Inter'; font-style:normal; font-weight:600; font-display:swap; src:url('../fonts/inter-600.woff2') format('woff2'); }
@font-face { font-family:'Inter'; font-style:normal; font-weight:700; font-display:swap; src:url('../fonts/inter-700.woff2') format('woff2'); }
@font-face { font-family:'Plex Mono'; font-style:normal; font-weight:400; font-display:swap; src:url('../fonts/plex-mono-400.woff2') format('woff2'); }
@font-face { font-family:'Plex Mono'; font-style:normal; font-weight:500; font-display:swap; src:url('../fonts/plex-mono-500.woff2') format('woff2'); }

:root {
  /* ---------- Superfícies ---------- */
  --paper: #F7F9FC;        /* fundo institucional */
  --surface: #FFFFFF;      /* elevação mínima */
  --surface-sunken: #F2F4F7;
  --ink: #0B1220;          /* texto primário */
  --ink-2: #475467;        /* texto secundário */
  --ink-3: #5A6472;        /* texto terciário */
  --ink-4: #667085;        /* anotação */

  /* ---------- Linhas ---------- */
  --line: #E4E7EC;         /* hairline padrão */
  --line-soft: #EEF1F5;
  --line-strong: #D0D5DD;

  /* ---------- Azul: identidade e dado ---------- */
  --blue: #155EEF;
  --blue-bright: #2563EB;
  --blue-deep: #0B1F44;
  --blue-wash: rgba(21, 94, 239, 0.06);
  --blue-line: rgba(21, 94, 239, 0.24);

  /* ---------- Escuro ---------- */
  --night: #070C16;
  --night-2: #0B1220;
  --night-line: rgba(255, 255, 255, 0.10);
  --night-line-soft: rgba(255, 255, 255, 0.06);
  --night-ink: rgba(255, 255, 255, 0.94);
  --night-ink-2: rgba(255, 255, 255, 0.58);
  --night-ink-3: rgba(255, 255, 255, 0.56);
  --blue-lift: #7EA9FF;

  /* ---------- Tipografia ---------- */
  --sans: 'Inter', system-ui, -apple-system, sans-serif;
  --mono: 'Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  /* ---------- Métrica ---------- */
  --shell: 1280px;
  --gutter: clamp(22px, 5vw, 64px);
  --bay: clamp(88px, 11vw, 168px);   /* respiro vertical de seção */

  /* ---------- Raio: contido, nunca amigável ---------- */
  --r-xs: 3px;
  --r-sm: 5px;
  --r-md: 8px;

  /* ---------- Movimento ---------- */
  --out: cubic-bezier(0.16, 1, 0.30, 1);
  --inout: cubic-bezier(0.65, 0, 0.35, 1);
  --t-fast: 180ms;
  --t-base: 380ms;
  --t-slow: 720ms;
}

/* ---------- Reset ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  color-scheme: light;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16.5px;
  line-height: 1.62;
  font-feature-settings: 'cv05' 1, 'ss03' 1, 'tnum' 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img, svg, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
::selection { background: var(--blue); color: #fff; }

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
  border-radius: var(--r-xs);
}

/* =============================================================
   TIPOGRAFIA
   Escala agressiva no display, tracking negativo proporcional
   ao tamanho. Corpo largo e calmo. Mono só onde há dado.
   ============================================================= */

h1, h2, h3, h4 { font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; }

.t-hero {
  font-size: clamp(40px, 5.9vw, 80px);
  line-height: 0.98;
  letter-spacing: -0.045em;
  font-weight: 600;
}

.t-display {
  font-size: clamp(31px, 4.1vw, 58px);
  line-height: 1.04;
  letter-spacing: -0.035em;
  font-weight: 600;
}

.t-title {
  font-size: clamp(22px, 2.4vw, 31px);
  line-height: 1.16;
  letter-spacing: -0.025em;
  font-weight: 600;
}

.t-sub {
  font-size: 18.5px;
  line-height: 1.2;
  letter-spacing: -0.015em;
  font-weight: 600;
}

.t-lede {
  font-size: clamp(17px, 1.5vw, 20px);
  line-height: 1.62;
  letter-spacing: -0.011em;
  color: var(--ink-2);
}

.t-body { font-size: 16.5px; line-height: 1.7; color: var(--ink-2); }
.t-small { font-size: 14.5px; line-height: 1.62; color: var(--ink-3); }
.t-note { font-size: 13px; line-height: 1.55; color: var(--ink-4); }

/* Mono: rótulo técnico. Sempre caixa alta, sempre com tracking. */
.mono {
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.mono-num {
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--ink-4);
  font-variant-numeric: tabular-nums;
}

.blue { color: var(--blue); }
.measure { max-width: 62ch; }
.measure-tight { max-width: 48ch; }

/* =============================================================
   ESTRUTURA
   ============================================================= */

.shell {
  width: 100%;
  max-width: var(--shell);
  margin: 0 auto;
  padding-inline: var(--gutter);
}

.bay { padding-block: var(--bay); }
.bay-half { padding-block: calc(var(--bay) * 0.58); }

/* Régua: hairline com marca azul na origem. Motivo de projeto,
   usada para abrir seções no lugar de caixas. */
.rule {
  position: relative;
  height: 1px;
  background: var(--line);
  border: 0;
}

.rule::before {
  content: '';
  position: absolute;
  left: 0;
  top: -1px;
  width: 46px;
  height: 3px;
  background: var(--blue);
}

/* Cabeçalho de seção: rótulo mono, régua, título. */
.head { display: grid; gap: 22px; }

.head-label {
  display: flex;
  align-items: baseline;
  gap: 14px;
}

.head-label .idx {
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--blue);
}

/* =============================================================
   NAVEGAÇÃO
   ============================================================= */

.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 90;
  border-bottom: 1px solid transparent;
  transition: background var(--t-base) var(--out),
              border-color var(--t-base) var(--out),
              backdrop-filter var(--t-base) var(--out);
}

.nav.is-stuck {
  background: rgba(247, 249, 252, 0.82);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom-color: var(--line);
}

.nav-in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-weight: 600;
  font-size: 16.5px;
  letter-spacing: -0.02em;
}

.brand-mark { width: 17px; height: 17px; flex: none; }

.brand small {
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-4);
  padding-left: 10px;
  margin-left: 3px;
  border-left: 1px solid var(--line-strong);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 34px;
}

.nav-links a {
  font-size: 14.5px;
  color: var(--ink-2);
  transition: color var(--t-fast) var(--out);
}

.nav-links a:hover { color: var(--ink); }

.nav-toggle { display: none; width: 40px; height: 40px; margin-right: -8px; }
.nav-toggle span { display: block; width: 19px; height: 1.5px; background: var(--ink); margin: 4px auto; transition: transform var(--t-base) var(--out), opacity var(--t-fast); }
.nav-toggle.is-open span:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
.nav-toggle.is-open span:nth-child(2) { opacity: 0; }
.nav-toggle.is-open span:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }

.nav-drawer {
  position: fixed;
  inset: 68px 0 auto 0;
  z-index: 89;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  padding: 12px var(--gutter) 30px;
  display: none;
}

.nav-drawer.is-open { display: block; }
.nav-drawer a { display: block; padding: 15px 0; font-size: 19px; font-weight: 500; letter-spacing: -0.02em; border-bottom: 1px solid var(--line-soft); }
.nav-drawer .btn { margin-top: 22px; width: 100%; justify-content: center; }

/* =============================================================
   AÇÕES
   ============================================================= */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 44px;
  padding: 0 20px;
  border-radius: var(--r-sm);
  font-size: 14.5px;
  font-weight: 500;
  letter-spacing: -0.008em;
  white-space: nowrap;
  transition: background var(--t-fast) var(--out),
              color var(--t-fast) var(--out),
              border-color var(--t-fast) var(--out),
              transform var(--t-fast) var(--out);
}

.btn svg { width: 15px; height: 15px; transition: transform var(--t-base) var(--out); }
.btn:hover svg { transform: translateX(3px); }

.btn-solid { background: var(--ink); color: var(--paper); }
.btn-solid:hover { background: var(--blue); }

.btn-line { border: 1px solid var(--line-strong); color: var(--ink); }
.btn-line:hover { border-color: var(--ink); background: var(--surface); }

/* Link com sublinhado que cresce da origem. */
.link-u {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--ink);
  position: relative;
  padding-bottom: 3px;
}

.link-u::after {
  content: '';
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--t-base) var(--out);
}

.link-u:hover::after { transform: scaleX(1); }
.link-u svg { width: 14px; height: 14px; transition: transform var(--t-base) var(--out); }
.link-u:hover svg { transform: translateX(3px); }

/* =============================================================
   SUPERFÍCIE ESCURA
   Usada para ritmo narrativo, não para decorar.
   ============================================================= */

.night {
  position: relative;
  isolation: isolate;
  background: var(--night);
  color: var(--night-ink);
}

.night .t-lede, .night .t-body { color: var(--night-ink-2); }
.night .t-small, .night .t-note { color: var(--night-ink-3); }
.night .mono { color: var(--night-ink-3); }
.night .mono-num { color: var(--night-ink-3); }
.night .rule { background: var(--night-line); }
.night .head-label .idx { color: var(--blue-lift); }
.night .btn-solid { background: var(--paper); color: var(--ink); }
.night .btn-solid:hover { background: var(--blue-bright); color: #fff; }
.night .btn-line { border-color: rgba(255,255,255,0.22); color: var(--night-ink); }
.night .btn-line:hover { border-color: rgba(255,255,255,0.55); background: rgba(255,255,255,0.05); }
.night .link-u { color: var(--night-ink); }

/* Malha técnica: assinatura de esquema, não textura decorativa. */
.mesh {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  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: 72px 72px;
  mask-image: radial-gradient(ellipse 78% 62% at 50% 38%, #000 20%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 78% 62% at 50% 38%, #000 20%, transparent 100%);
}

.mesh--light {
  background-image:
    linear-gradient(rgba(11,18,32,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(11,18,32,0.035) 1px, transparent 1px);
}

/* =============================================================
   ESQUEMÁTICO — primitivas de diagrama
   ============================================================= */

.schema { width: 100%; height: auto; overflow: visible; }

.s-line { stroke: var(--line-strong); stroke-width: 1; fill: none; }
.night .s-line { stroke: rgba(255,255,255,0.14); }

.s-node { fill: var(--surface); stroke: var(--line-strong); stroke-width: 1; }
.night .s-node { fill: #0E1626; stroke: rgba(255,255,255,0.16); }

.s-label {
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  fill: var(--ink-3);
}

.night .s-label { fill: var(--night-ink-3); }

/* Fluxo de dado: traço tracejado em deslocamento contínuo. */
.s-flow {
  stroke: var(--blue);
  stroke-width: 1.4;
  fill: none;
  stroke-dasharray: 3 11;
  stroke-linecap: round;
  animation: flow 1.5s linear infinite;
}

.night .s-flow { stroke: var(--blue-lift); }

@keyframes flow { to { stroke-dashoffset: -28; } }

.s-pulse { animation: pulse 3.2s var(--inout) infinite; transform-box: fill-box; transform-origin: center; }
@keyframes pulse { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }

/* =============================================================
   REVELAÇÃO NO SCROLL
   ============================================================= */

.rise { opacity: 0; transform: translateY(18px); transition: opacity var(--t-slow) var(--out), transform var(--t-slow) var(--out); }
.rise.in { opacity: 1; transform: none; }
.rise-d1 { transition-delay: 90ms; }
.rise-d2 { transition-delay: 180ms; }
.rise-d3 { transition-delay: 270ms; }
.rise-d4 { transition-delay: 360ms; }

/* Traço que se desenha ao entrar em cena. */
.draw { stroke-dasharray: var(--len, 1000); stroke-dashoffset: var(--len, 1000); transition: stroke-dashoffset 1.6s var(--out); }
.in .draw, .draw.in { stroke-dashoffset: 0; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .rise { opacity: 1; transform: none; transition: none; }
  .s-flow, .s-pulse { animation: none; }
  .draw { stroke-dashoffset: 0; transition: none; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

@media (scripting: none) {
  .rise { opacity: 1; transform: none; }
}

/* =============================================================
   CURSOR
   Ponto discreto, só em ponteiro fino. Nunca em toque.
   ============================================================= */

.cursor {
  position: fixed;
  top: 0; left: 0;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--blue);
  pointer-events: none;
  z-index: 200;
  opacity: 0;
  transform: translate(-50%, -50%);
  transition: opacity var(--t-base), width var(--t-base) var(--out), height var(--t-base) var(--out), background var(--t-base);
  will-change: transform;
}

.cursor.on { opacity: 1; }
.cursor.hot { width: 34px; height: 34px; background: var(--blue-wash); border: 1px solid var(--blue-line); }

@media (hover: none), (pointer: coarse) { .cursor { display: none; } }

/* =============================================================
   RESPONSIVO
   ============================================================= */

@media (max-width: 900px) {
  .nav-links { display: none; }
  .nav-toggle { display: block; }
  .brand small { display: none; }
  /* O CTA já existe dentro da gaveta: no header ele disputa espaço
     com a marca e o botão de menu. */
  .nav-in > .btn { display: none; }
}
