/* ─── Reset & Base ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #070709;
  --bg-card:   #0f0f12;
  --bg-card-2: #16161b;
  --rust:      #e8673a;
  --rust-dark: #c4522a;
  --python:    #4b8bbe;
  --green:     #3fb950;
  --text:      #e2e2e8;
  --muted:     #7a7a8c;
  --border:    #1e1e28;
  --border-2:  #2a2a38;
  --radius:    12px;
  --radius-sm: 8px;
  --glow:      rgba(232, 103, 58, 0.15);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

code, pre {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
}

a { color: var(--rust); text-decoration: none; }
a:hover { color: var(--rust-dark); }

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ─── Nav ───────────────────────────────────────────────────────── */
#nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(7, 7, 9, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  transition: background 0.3s;
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
  letter-spacing: -0.02em;
}
.logo-icon { font-size: 1.2rem; }

.nav-links {
  display: flex;
  list-style: none;
  align-items: center;
  gap: 32px;
}

.nav-links a {
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--text); }

.nav-gh {
  display: flex !important;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: 1px solid var(--border-2);
  border-radius: 6px;
  color: var(--text) !important;
  background: var(--bg-card);
  font-size: 0.8rem !important;
  transition: border-color 0.2s, background 0.2s !important;
}
.nav-gh:hover { border-color: var(--rust); background: var(--bg-card-2) !important; }

.nav-menu-btn { display: none; }

/* ─── Hero ──────────────────────────────────────────────────────── */
.hero {
  position: relative;
  overflow: clip; /* clip não afeta scroll, hidden cortava o terminal no mobile */
  padding: 130px 0 80px;
}

.hero-bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: 0.4;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black 0%, transparent 80%);
}

.hero-glow {
  position: absolute;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 400px;
  background: radial-gradient(ellipse, rgba(232, 103, 58, 0.12) 0%, transparent 70%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.badge-row {
  display: flex;
  gap: 8px;
  margin-bottom: 28px;
  flex-wrap: wrap;
  justify-content: center;
}

.badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 999px;
  letter-spacing: 0.03em;
}
.badge-rust  { background: rgba(232, 103, 58, 0.15); color: var(--rust); border: 1px solid rgba(232, 103, 58, 0.3); }
.badge-py    { background: rgba(75, 139, 190, 0.15); color: var(--python); border: 1px solid rgba(75, 139, 190, 0.3); }
.badge-new   { background: rgba(63, 185, 80, 0.1);  color: var(--green); border: 1px solid rgba(63, 185, 80, 0.3); }
.badge-pypi  { background: rgba(75, 139, 190, 0.1); color: #6ab0e4; border: 1px solid rgba(75, 139, 190, 0.3); transition: background 0.2s; }
.badge-pypi:hover { background: rgba(75, 139, 190, 0.25); }

.hero-title {
  font-size: clamp(2.4rem, 5vw, 4rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
}

.gradient-text {
  background: linear-gradient(135deg, var(--rust) 0%, #f7a46e 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  font-size: 1.1rem;
  color: var(--muted);
  max-width: 560px;
  margin-bottom: 32px;
  line-height: 1.7;
}
.hero-sub strong { color: var(--text); }

/* Install box */
.install-box {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  padding: 12px 18px;
  margin-bottom: 28px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.95rem;
}
.install-prefix { color: var(--green); }
.install-box code { color: var(--text); }

.copy-btn {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 2px;
  display: flex;
  align-items: center;
  transition: color 0.2s;
}
.copy-btn:hover { color: var(--rust); }

/* CTA buttons */
.hero-actions { display: flex; gap: 12px; margin-bottom: 52px; flex-wrap: wrap; justify-content: center; }

.btn-primary {
  padding: 12px 28px;
  background: var(--rust);
  color: #fff;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  transition: background 0.2s, transform 0.15s;
}
.btn-primary:hover { background: var(--rust-dark); color: #fff; transform: translateY(-1px); }

.btn-ghost {
  padding: 12px 28px;
  border: 1px solid var(--border-2);
  color: var(--text);
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  transition: border-color 0.2s, background 0.2s;
}
.btn-ghost:hover { border-color: var(--rust); background: rgba(232, 103, 58, 0.05); color: var(--text); }

/* Terminal */
.terminal {
  width: 100%;
  max-width: 640px;
  background: #0c0c10;
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0,0,0,0.5), 0 0 0 1px var(--border);
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
}
.dot { width: 12px; height: 12px; border-radius: 50%; }
.dot-red    { background: #ff5f57; }
.dot-yellow { background: #febc2e; }
.dot-green  { background: #28c840; }
.terminal-title { margin-left: auto; font-size: 0.75rem; color: var(--muted); font-family: 'JetBrains Mono', monospace; }

.terminal-body {
  padding: 20px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  line-height: 1.9;
}
.term-line { display: flex; align-items: flex-start; gap: 4px; }
.term-prompt { color: var(--green); flex-shrink: 0; }
.term-code { color: #c9d1d9; }
.term-out { color: var(--muted); padding-left: 4px; }
.hl-num { color: #79c0ff; }
.term-cursor { color: var(--rust); animation: blink 1.2s infinite; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

/* ─── Stats bar ─────────────────────────────────────────────────── */
.stats-bar {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
}
.stats-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 24px;
  flex-wrap: wrap;
}
.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 40px;
}
.stat-num { font-size: 1.8rem; font-weight: 800; color: var(--rust); letter-spacing: -0.03em; }
.stat-label { font-size: 0.75rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; margin-top: 2px; }
.stat-div { width: 1px; height: 40px; background: var(--border-2); }

/* ─── Sections ──────────────────────────────────────────────────── */
.section { padding: 96px 0; overflow: hidden; }
.section-dark { background: var(--bg-card); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

.section-header {
  text-align: center;
  margin-bottom: 56px;
}
.section-header h2 {
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}
.section-header p { color: var(--muted); font-size: 1.05rem; }

/* ─── Features grid ─────────────────────────────────────────────── */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: border-color 0.2s, transform 0.2s, background 0.2s;
}
.feature-card:hover {
  border-color: var(--rust);
  background: var(--bg-card-2);
  transform: translateY(-2px);
}
.feature-icon { font-size: 1.8rem; margin-bottom: 14px; }
.feature-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: 8px; }
.feature-card p { font-size: 0.875rem; color: var(--muted); line-height: 1.65; }
.feature-card code { font-size: 0.8rem; color: var(--rust); background: rgba(232,103,58,0.1); padding: 1px 5px; border-radius: 3px; }

/* ─── Tabs & Code ───────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px;
  width: fit-content;
}

.tab {
  padding: 8px 20px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  background: transparent;
  color: var(--muted);
  transition: all 0.2s;
  font-family: 'Inter', sans-serif;
}
.tab.active { background: var(--rust); color: #fff; }
.tab:hover:not(.active) { color: var(--text); background: var(--bg-card); }

.tab-content { display: none; }
.tab-content.active { display: block; }

.code-block {
  background: #0d0d10;
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  overflow: hidden;
}
.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
}
.code-lang { font-size: 0.75rem; color: var(--muted); font-family: 'JetBrains Mono', monospace; }
.code-copy {
  font-size: 0.75rem;
  color: var(--muted);
  background: none;
  border: 1px solid var(--border-2);
  border-radius: 4px;
  padding: 3px 10px;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: all 0.2s;
}
.code-copy:hover { color: var(--text); border-color: var(--rust); }

pre {
  padding: 22px;
  overflow-x: auto;
  font-size: 0.875rem;
  line-height: 1.75;
  max-width: 100%;
  box-sizing: border-box;
}

/* Syntax highlighting */
.kw   { color: #ff7b72; }
.str  { color: #a5d6ff; }
.fn   { color: #d2a8ff; }
.cm   { color: #5a5a72; font-style: italic; }
.op   { color: var(--muted); }
.num  { color: #79c0ff; }
.at   { color: #ffa657; }
/* Prometheus */
.pm-help   { color: #5a5a72; font-style: italic; }
.pm-type   { color: #5a5a72; font-style: italic; }
.pm-metric { color: var(--rust); }

/* ─── Prometheus layout ─────────────────────────────────────────── */
.prometheus-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 40px;
  align-items: start;
  min-width: 0; /* impede que o grid estoure o container pai */
}

.prometheus-output {
  min-width: 0; /* célula do grid não pode crescer além do container */
  overflow: hidden;
}

.prometheus-output .code-block {
  max-width: 100%;
  overflow: hidden;
}

.prometheus-output pre {
  overflow-x: auto;
  max-width: 100%;
  white-space: pre;
  word-break: normal;
}

.metric-group { margin-bottom: 28px; }
.metric-group h4 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 10px;
}
.metric-list { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.metric-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.metric-list code { font-size: 0.78rem; color: var(--rust); }
.metric-type {
  font-size: 0.65rem;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(75, 139, 190, 0.1);
  color: var(--python);
  border: 1px solid rgba(75, 139, 190, 0.2);
  white-space: nowrap;
}

/* ─── Architecture ──────────────────────────────────────────────── */
.arch {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 32px;
  flex-wrap: wrap;
  gap: 8px;
}

.arch-box {
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  padding: 20px 24px;
  min-width: 150px;
  text-align: center;
}
.arch-py     { border-color: rgba(75, 139, 190, 0.4); background: rgba(75, 139, 190, 0.05); }
.arch-mid    { border-color: var(--border-2); background: var(--bg-card); }
.arch-rust   { border-color: rgba(232, 103, 58, 0.5); background: rgba(232, 103, 58, 0.05); }
.arch-out    { border-color: rgba(63, 185, 80, 0.4); background: rgba(63, 185, 80, 0.05); }

.arch-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 10px;
}
.arch-items { display: flex; flex-direction: column; gap: 5px; }
.arch-items span {
  font-size: 0.78rem;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text);
  background: var(--bg);
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid var(--border);
}

.arch-arrow {
  font-size: 1.5rem;
  color: var(--rust);
  padding: 0 8px;
}

.arch-note {
  text-align: center;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.7;
}
.arch-note code { color: var(--rust); font-size: 0.82rem; }
.arch-note strong { color: var(--text); }

/* ─── Install section ───────────────────────────────────────────── */
.install-section { text-align: center; }

.install-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  max-width: 760px;
  margin: 0 auto 36px;
}

.install-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: left;
}
.install-card h4 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 10px;
}
.install-cmd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--bg);
  border: 1px solid var(--border-2);
  border-radius: 6px;
  padding: 8px 12px;
}
.install-cmd code { font-size: 0.78rem; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.install-cmd button {
  flex-shrink: 0;
  font-size: 0.7rem;
  color: var(--muted);
  background: none;
  border: 1px solid var(--border-2);
  border-radius: 4px;
  padding: 3px 8px;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: all 0.2s;
}
.install-cmd button:hover { color: var(--text); border-color: var(--rust); }

.requires {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 0.8rem;
  color: var(--muted);
}

/* ─── Footer ────────────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
  background: var(--bg-card);
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}
.footer-left { display: flex; flex-direction: column; gap: 4px; }
.footer-logo { font-weight: 700; font-size: 0.9rem; }
.footer-copy { font-size: 0.75rem; color: var(--muted); }
.footer-links { display: flex; gap: 24px; }
.footer-links a { font-size: 0.85rem; color: var(--muted); transition: color 0.2s; }
.footer-links a:hover { color: var(--rust); }

/* ─── Toast ─────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  background: var(--green);
  color: #000;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: 6px;
  opacity: 0;
  transform: translateY(8px);
  transition: all 0.25s;
  pointer-events: none;
  z-index: 999;
}
.toast.show { opacity: 1; transform: translateY(0); }

/* ─── Responsive — tablet ───────────────────────────────────────── */
@media (max-width: 900px) {
  .features-grid         { grid-template-columns: repeat(2, 1fr); }
  .prometheus-layout     { grid-template-columns: 1fr; }
  .arch                  { flex-direction: column; align-items: stretch; }
  .arch-arrow            { transform: rotate(90deg); text-align: center; }
  .arch-box              { min-width: unset; }
  .install-options       { grid-template-columns: 1fr; }
}

/* ─── Responsive — mobile ───────────────────────────────────────── */
@media (max-width: 640px) {

  /* Nav */
  .nav-links  { display: none; }
  .nav-inner  { padding: 0 16px; }
  .nav-logo   { font-size: 0.9rem; }

  /* Hero */
  .hero         { padding: 88px 0 48px; overflow: visible; }
  .hero-glow    { width: 320px; height: 240px; }
  .hero-title   { font-size: 2rem; letter-spacing: -0.02em; }
  .hero-sub     { font-size: 0.95rem; padding: 0 4px; }
  .hero-actions { gap: 10px; }
  .btn-primary,
  .btn-ghost    { padding: 11px 20px; font-size: 0.85rem; }

  /* Badges */
  .badge-row    { gap: 6px; margin-bottom: 20px; }
  .badge        { font-size: 0.7rem; padding: 3px 10px; }

  /* Install box */
  .install-box  {
    padding: 10px 14px;
    font-size: 0.82rem;
    margin-bottom: 22px;
    flex-wrap: nowrap;
    overflow: hidden;
  }
  .install-box code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  /* Terminal */
  .terminal          { max-width: 100%; margin: 0; }
  .terminal-body     { padding: 14px; font-size: 0.75rem; line-height: 1.75; }
  .term-line         { flex-wrap: nowrap; overflow: hidden; }
  .term-out          { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .term-hide-mobile  { display: none; }

  /* Stats bar */
  .stats-inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    padding: 20px 16px;
  }
  .stat        { padding: 0; }
  .stat-num    { font-size: 1.5rem; }
  .stat-div    { display: none; }

  /* Sections */
  .section         { padding: 56px 0; }
  .section-header  { margin-bottom: 36px; }
  .section-header h2 { font-size: 1.6rem; }

  /* Features */
  .features-grid { grid-template-columns: 1fr; gap: 12px; }
  .feature-card  { padding: 20px; }

  /* Tabs */
  .tabs      { width: 100%; justify-content: stretch; }
  .tab       { flex: 1; padding: 8px 10px; font-size: 0.78rem; text-align: center; }

  /* Code blocks */
  pre              { padding: 14px; font-size: 0.72rem; line-height: 1.6; overflow-x: auto; max-width: 100%; }
  .code-block      { overflow: hidden; max-width: 100%; }
  .code-header     { padding: 8px 14px; }

  /* Prometheus output — scroll horizontal contido */
  .prometheus-output .code-block { overflow-x: auto; }
  .prometheus-output pre         { min-width: 0; }

  /* Prometheus — esconde o bloco de código bruto no mobile,
     mantém apenas a lista de métricas que é legível em tela pequena */
  .prometheus-layout  { grid-template-columns: 1fr; gap: 0; }
  .prometheus-output  { display: none; }
  .prometheus-desc    { width: 100%; }
  .metric-group       { margin-bottom: 20px; }
  .metric-list        { gap: 8px; }
  .metric-list li     { padding: 8px 12px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 6px; }
  .metric-list code   { font-size: 0.78rem; }

  /* Architecture — full width stack on mobile */
  .arch        { flex-direction: column; align-items: stretch; gap: 4px; }
  .arch-box    { padding: 16px; min-width: unset; width: 100%; }
  .arch-label  { font-size: 0.65rem; margin-bottom: 8px; }
  .arch-items  { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 6px; }
  .arch-items span { font-size: 0.75rem; padding: 4px 10px; }
  .arch-arrow  { font-size: 1.1rem; padding: 0; text-align: center; transform: rotate(90deg); }
  .arch-note   { font-size: 0.78rem; padding: 0 4px; }

  /* Install section */
  .install-options  { grid-template-columns: 1fr; max-width: 100%; gap: 12px; }
  .install-card     { padding: 16px; }
  .install-cmd code { font-size: 0.72rem; }
  .requires         { flex-direction: column; gap: 6px; text-align: center; }

  /* Footer */
  .footer-inner   { flex-direction: column; align-items: flex-start; gap: 20px; }
  .footer-links   { flex-wrap: wrap; gap: 16px; }
  .footer-links a { font-size: 0.8rem; }

  /* Container padding */
  .container { padding: 0 16px; }
}
