/* REFERO, base visual (ver docs/STYLE.md). Tema escuro fixo. */
:root {
  --void: #000000;
  --hairline: #292d30;
  --white: #ffffff;
  --bone: #f0f0f0;
  --ash: #a1a4a5;
  --smoke: #abafb4;
  --iron: #6e727a;
  --charcoal: #464a4d;
  --iris: #9281f7;
  --iris-glow: #baa7ff;
  --iris-gradient: linear-gradient(to right bottom, #9281f7, #9a54dc);
  --blue: #3b9eff;
  --sky: #70b8ff;
  --green: #3ad389;
  --red: #ff9592;
  --amber: #ffca16;
  --lift: #0b0e14;

  --font-display: "Playfair Display", "Times New Roman", serif;
  --font-head: "Inter Tight", "Inter", system-ui, sans-serif;
  --font-body: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --r-sm: 6px;
  --r-card: 16px;
  --r-panel: 24px;
  --ease-out: cubic-bezier(.23, 1, .32, 1);
  --max: 1200px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
/* Elementos escondidos ficam escondidos, mesmo com display definido no CSS */
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* Superfícies: preto com leve gradação e fio de luz no topo (sem sombra) */
:root {
  --surface: linear-gradient(180deg, rgba(255, 255, 255, .035) 0%, rgba(255, 255, 255, 0) 55%), var(--void);
  --edge-light: inset 0 1px 0 rgba(255, 255, 255, .06);
  --dots: radial-gradient(rgba(255, 255, 255, .11) 1px, transparent 1.2px);
}

/* Granulado fixo e muito leve: tira o "preto de tela vazia" sem pesar na rolagem */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  opacity: .045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Linha divisória que some nas pontas */
.fade-rule {
  height: 1px;
  border: 0;
  margin: 0;
  background: linear-gradient(90deg, transparent, var(--hairline) 20%, var(--hairline) 80%, transparent);
}

body {
  margin: 0;
  background: var(--void);
  color: var(--bone);
  font: 400 16px/1.5 var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, p { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
::selection { background: rgba(146, 129, 247, .35); color: var(--white); }
:focus-visible { outline: 2px solid var(--iris-glow); outline-offset: 3px; }

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 24px; }
@media (max-width: 640px) { .container { padding: 0 16px; } }

.mono { font-family: var(--font-mono); }
.muted { color: var(--ash); }
.code-str { color: var(--iris); }
.ok { color: var(--green); }
.err { color: var(--red); }
.warn { color: var(--amber); }

/* Títulos */
.display {
  font: 400 clamp(46px, 8vw, 96px)/1 var(--font-display);
  letter-spacing: -.01em;
  color: var(--white);
  text-wrap: balance;
}
.heading {
  text-wrap: balance;
  font: 400 clamp(36px, 5.2vw, 56px)/1.08 var(--font-head);
  letter-spacing: -.05em;
  color: var(--white);
}
.subheading { font: 500 20px/1.3 var(--font-head); color: var(--white); letter-spacing: -.01em; }
.lead { font-size: 18px; line-height: 1.6; color: var(--ash); max-width: 60ch; }

/* Botões: sempre vazados */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 12px 16px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--white);
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color .15s var(--ease-out), background-color .15s var(--ease-out), transform .15s var(--ease-out);
}
.btn:hover { border-color: var(--white); }
.btn:active { transform: scale(.97); }
.btn[disabled], .btn[aria-disabled="true"] { color: var(--iron); border-color: var(--hairline); cursor: not-allowed; transform: none; }
.btn.lg { min-height: 48px; padding: 14px 20px; font-size: 15px; }
.btn.strong { border-color: var(--iron); }
.btn.strong:hover { border-color: var(--white); background: rgba(255, 255, 255, .04); }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--bone);
  font-size: 15px;
  transition: color .15s var(--ease-out);
}
.link-arrow i { transition: transform .15s var(--ease-out); }
.link-arrow:hover { color: var(--white); }
.link-arrow:hover i { transform: translateX(2px); }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border: 1px solid var(--hairline);
  border-radius: 9999px;
  color: var(--bone);
  font-size: 14px;
  transition: border-color .15s var(--ease-out);
}
.pill:hover { border-color: var(--iron); }
.pill i { color: var(--iris-glow); }

.card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-card);
  box-shadow: var(--edge-light);
  padding: 32px;
}
@media (max-width: 640px) { .card { padding: 24px; } }

/* Janela de terminal */
.term {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-card);
  box-shadow: var(--edge-light);
  overflow: hidden;
  font: 400 13px/1.7 var(--font-mono);
  font-variant-ligatures: none;
  color: var(--bone);
}
.term-bar {
  background: rgba(255, 255, 255, .02);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--hairline);
  color: var(--iron);
  font-size: 12px;
}
.term-bar .dots { display: flex; gap: 6px; margin-right: 8px; }
.term-bar .dots span { width: 8px; height: 8px; border-radius: 50%; background: var(--charcoal); }
.term-body { padding: 18px 20px 22px; white-space: pre-wrap; word-break: break-word; }
.term-body .prompt { color: var(--iron); }

/* Indicador de status */
.status { display: inline-flex; align-items: center; gap: 8px; font: 400 12px/1.4 var(--font-mono); color: var(--ash); }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.status.ok::before { background: var(--green); }
.status.err::before { background: var(--red); }
.status.warn::before { background: var(--amber); }

/* Campos */
.field { display: grid; gap: 8px; }
.field > span { font-size: 14px; font-weight: 500; color: var(--bone); }
.field small { font-size: 12px; color: var(--ash); }
.input, textarea.input {
  width: 100%;
  min-height: 44px;
  padding: 12px 14px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-sm);
  background: var(--void);
  color: var(--bone);
  font-size: 15px;
  line-height: 1.55;
  transition: border-color .15s var(--ease-out);
}
.input::placeholder { color: var(--iron); }
.input:hover { border-color: var(--charcoal); }
.input:focus { outline: none; border-color: var(--iris); }
textarea.input { resize: vertical; }

/* Ícone com o único fundo colorido permitido */
.icon-box {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--iris-gradient);
  color: var(--white);
  font-size: 20px;
  box-shadow: rgba(176, 199, 217, .145) 0 0 0 1px;
}

/* Navegação */
.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(0, 0, 0, .85);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
}
.nav { border-bottom: 1px solid transparent; transition: border-color .2s var(--ease-out); }
.nav.scrolled { border-bottom-color: var(--hairline); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; height: 64px; }
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font: 600 15px/1 var(--font-mono);
  letter-spacing: .18em;
  color: var(--white);
}
.wordmark .mark {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-sm);
  font-size: 13px;
  letter-spacing: 0;
}
.mark-img { display: block; width: auto; height: 26px; }
.nav-links { display: flex; align-items: center; gap: 28px; font-size: 14px; color: var(--bone); }
.nav-links a { transition: color .15s var(--ease-out); }
.nav-links a:hover { color: var(--white); }
@media (max-width: 760px) { .nav-links .hide-sm { display: none; } }

.footer { padding: 40px 0 48px; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 14px; color: var(--ash); }
.footer-links { display: flex; gap: 20px; }
.footer-links a:hover { color: var(--bone); }

.skip { position: absolute; left: 16px; top: -60px; z-index: 100; padding: 10px 14px; border: 1px solid var(--white); border-radius: var(--r-sm); background: var(--void); color: var(--white); }
.skip:focus { top: 12px; }

/* Entrada contida (fade + slide) */
@media (prefers-reduced-motion: no-preference) {
  .rise { opacity: 0; transform: translateY(14px); animation: rise .7s var(--ease-out) forwards; animation-delay: calc(var(--i, 0) * 90ms); }
  .reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease-out), transform .7s var(--ease-out); }
  .reveal.in { opacity: 1; transform: none; }
}
@keyframes rise { to { opacity: 1; transform: none; } }

/* Celular: a tela não escorrega para o lado, não dá zoom ao tocar duas vezes nem ao focar um campo,
   e as entradas só aparecem (sem deslizar) */
html, body { overflow-x: clip; max-width: 100%; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; touch-action: manipulation; }
body { overscroll-behavior-x: none; -webkit-tap-highlight-color: transparent; }
img, svg, video, canvas { max-width: 100%; }
@media (max-width: 760px) {
  input, select, textarea { font-size: 16px !important; }
  .rise, .reveal { transform: none !important; }
  @keyframes rise { to { opacity: 1; } }
}
