:root {
  --bg: #090c12;
  --bg-elev: #111622;
  --bg-code: #0b0f17;
  --border: #232c3d;
  --text: #e6edf3;
  --muted: #94a3b8;
  --accent: #f97316;
  --accent-2: #38bdf8;
  --green: #34d399;
  --radius: 12px;
  --font-sans: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', Consolas, monospace;

  /* Paleta de sintaxis */
  --tok-kw: #ff7b72;
  --tok-type: #79c0ff;
  --tok-str: #7ee787;
  --tok-attr: #f2cc60;
  --tok-comment: #6e7681;
  --tok-num: #d2a8ff;
  --tok-fn: #d2a8ff;
  --tok-op: #ffa657;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  background:
    radial-gradient(900px 420px at 15% -5%, rgba(249, 115, 22, 0.09), transparent 60%),
    radial-gradient(800px 380px at 85% 0%, rgba(56, 189, 248, 0.09), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.6;
}

a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }

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

/* Navbar */
.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(9, 12, 18, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text);
}
.brand-logo {
  height: 34px;
  width: auto;
  display: block;
}
.hero-logo {
  max-width: 340px;
  width: 82%;
  height: auto;
  margin: 0 auto 18px;
  display: block;
  filter: drop-shadow(0 8px 24px rgba(249, 115, 22, 0.2));
}
.brand-badge {
  background: linear-gradient(135deg, var(--accent), #fb923c);
  color: #090c12;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 800;
}
.nav-links {
  display: flex;
  gap: 22px;
  align-items: center;
}
.nav-links a {
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 500;
}
.nav-links a:hover, .nav-links a.active {
  color: var(--text);
  text-decoration: none;
}

/* Hero */
.hero {
  padding: 76px 0 48px;
  text-align: center;
}
.pill {
  display: inline-block;
  padding: 5px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(17, 22, 34, 0.85);
  color: var(--accent-2);
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 18px;
}
.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  line-height: 1.12;
  margin: 0 auto 18px;
  max-width: 840px;
  letter-spacing: -0.02em;
}
.hero h1 span {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p {
  color: var(--muted);
  font-size: 1.12rem;
  max-width: 720px;
  margin: 0 auto 30px;
}
.cta-row {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}
.btn {
  padding: 11px 22px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.btn-primary {
  background: var(--accent);
  color: #090c12;
  border-color: var(--accent);
}
.btn-primary:hover { opacity: 0.92; text-decoration: none; transform: translateY(-1px); }
.btn:hover { text-decoration: none; border-color: var(--accent-2); transform: translateY(-1px); }

/* Interactive Comparator */
.section { padding: 48px 0; }
.section-title {
  font-size: 1.7rem;
  margin: 0 0 8px;
}
.section-sub {
  color: var(--muted);
  margin: 0 0 24px;
}
.tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.tab-btn {
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--muted);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.88rem;
  transition: all 0.15s ease;
}
.tab-btn:hover { color: var(--text); border-color: #36435a; }
.tab-btn.active {
  background: rgba(56, 189, 248, 0.14);
  color: var(--accent-2);
  border-color: var(--accent-2);
}
.compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 860px) {
  .compare-grid { grid-template-columns: 1fr; }
}

.code-card {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
}
.code-card.card-fr { border-top: 2px solid var(--accent); }
.code-card.card-rs { border-top: 2px solid var(--green); }

.code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
  font-size: 0.84rem;
  color: var(--muted);
  font-family: var(--font-mono);
}
.code-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.tag-fr { color: var(--accent); font-weight: 700; }
.tag-rs { color: var(--green); font-weight: 700; }

.copy-btn {
  padding: 3px 9px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-code);
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}
.copy-btn:hover { color: var(--text); border-color: var(--accent-2); }
.copy-btn.copied { color: var(--green); border-color: var(--green); }

pre {
  margin: 0;
  padding: 16px 18px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.86rem;
  line-height: 1.62;
  color: #d8dee9;
}

/* Tokens de sintaxis */
.tok-kw { color: var(--tok-kw); font-weight: 600; }
.tok-type { color: var(--tok-type); }
.tok-str { color: var(--tok-str); }
.tok-attr { color: var(--tok-attr); }
.tok-comment { color: var(--tok-comment); font-style: italic; }
.tok-num { color: var(--tok-num); }
.tok-op { color: var(--tok-op); }

/* Feature cards */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
}
.card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  transition: border-color 0.15s ease;
}
.card:hover { border-color: #36435a; }
.card-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-2);
  background: rgba(56, 189, 248, 0.1);
  padding: 3px 8px;
  border-radius: 6px;
  margin-bottom: 10px;
}
.card h3 { margin: 0 0 8px; font-size: 1.08rem; }
.card p { margin: 0; color: var(--muted); font-size: 0.92rem; }

/* Quick Mapping Table */
.mapping-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  font-size: 0.92rem;
}
.mapping-table th, .mapping-table td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
.mapping-table th {
  background: var(--bg-code);
  color: var(--muted);
  font-weight: 600;
}
.mapping-table tr:last-child td { border-bottom: none; }
.mapping-table code {
  font-family: var(--font-mono);
  background: var(--bg-code);
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 0.86em;
}

/* Docs Layout */
.docs-layout {
  display: grid;
  grid-template-columns: 270px 1fr;
  gap: 28px;
  padding: 28px 0 64px;
}
@media (max-width: 860px) {
  .docs-layout { grid-template-columns: 1fr; }
}
.sidebar {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  height: fit-content;
  position: sticky;
  top: 84px;
}
.sidebar h4 {
  margin: 0 0 12px;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.doc-nav-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  margin-bottom: 4px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.9rem;
}
.doc-nav-item:hover { background: rgba(255,255,255,0.04); color: var(--text); }
.doc-nav-item.active {
  background: rgba(249, 115, 22, 0.14);
  color: var(--accent);
  font-weight: 600;
}
.doc-content {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 32px;
  min-width: 0;
}
.doc-content h1 { margin-top: 0; font-size: 1.9rem; border-bottom: 1px solid var(--border); padding-bottom: 10px; }
.doc-content h2 { margin-top: 28px; font-size: 1.35rem; color: var(--accent-2); }
.doc-content h3 { margin-top: 20px; font-size: 1.1rem; }
.doc-content code {
  font-family: var(--font-mono);
  background: var(--bg-code);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.86em;
  color: var(--tok-type);
}
.doc-content pre code { background: transparent; padding: 0; color: inherit; }
.doc-code-wrap {
  margin: 14px 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg-code);
}
.doc-code-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 12px;
  background: rgba(17, 22, 34, 0.9);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--muted);
}
.doc-content blockquote {
  margin: 14px 0;
  padding: 10px 16px;
  border-left: 3px solid var(--accent);
  background: rgba(249, 115, 22, 0.08);
  border-radius: 0 8px 8px 0;
  color: var(--text);
}
.doc-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 0.9rem;
}
.doc-content th, .doc-content td {
  border: 1px solid var(--border);
  padding: 8px 12px;
  text-align: left;
}
.doc-content th { background: var(--bg-code); }
.check-done { color: var(--green); font-weight: 700; margin-right: 6px; }
.check-todo { color: var(--muted); font-weight: 700; margin-right: 6px; }
.footer {
  border-top: 1px solid var(--border);
  padding: 28px 0;
  color: var(--muted);
  font-size: 0.88rem;
  text-align: center;
}

/* Responsive & Portal Enhancements */
.nav-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.nav-cta {
  color: var(--accent) !important;
  font-weight: 600;
}
.icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
}
.icon-btn:hover { border-color: var(--accent-2); }
.mobile-only, .tablet-only { display: none; }

.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius);
}

.sidebar {
  max-height: calc(100vh - 104px);
  display: flex;
  flex-direction: column;
}
.sidebar-head { margin-bottom: 10px; }
.sidebar-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.sidebar-title-row h4 { margin: 0; }
.count-pill {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.14);
  color: var(--accent-2);
}
.sidebar-search {
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-code);
  color: var(--text);
  font-size: 0.86rem;
  outline: none;
}
.sidebar-search:focus { border-color: var(--accent-2); }
.sidebar-list {
  overflow-y: auto;
  padding-right: 4px;
}
.doc-main { min-width: 0; }
.doc-pager {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
}
.pager-btn {
  flex: 1;
  max-width: 48%;
  padding: 12px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s;
}
.pager-btn:hover { border-color: var(--accent-2); }
.pager-btn.next { text-align: right; margin-left: auto; }
.pager-label {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 2px;
}
.pager-title {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.docs-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 25;
}
.docs-backdrop.open { display: block; }

@media (max-width: 960px) {
  .tablet-only { display: inline-flex; }
  .docs-layout {
    grid-template-columns: 1fr;
    padding: 18px 0 48px;
  }
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(320px, 86vw);
    max-height: 100vh;
    z-index: 30;
    border-radius: 0;
    transform: translateX(-105%);
    transition: transform 0.2s ease;
  }
  .sidebar.open { transform: translateX(0); }
}

@media (max-width: 720px) {
  .container { padding: 0 16px; }
  .mobile-only { display: inline-flex; }
  .nav-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 4px;
    padding: 12px 16px 16px;
    background: rgba(9, 12, 18, 0.98);
    border-bottom: 1px solid var(--border);
  }
  .nav-links.open { display: flex; }
  .nav-links a {
    padding: 8px 6px;
    display: block;
  }
  .doc-content { padding: 20px 16px; }
  .doc-pager { flex-direction: column; }
  .pager-btn { max-width: 100%; }
}

/* Highlight banner for global CLI installation */
.install-callout {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 22px;
  padding: 18px 22px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.16), rgba(56, 189, 248, 0.10));
  border: 1px solid rgba(249, 115, 22, 0.65);
  border-left: 5px solid var(--accent);
  box-shadow: 0 8px 28px rgba(249, 115, 22, 0.12);
}
.install-callout-info {
  flex: 1 1 280px;
}
.install-callout-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--accent);
  color: #090c12;
  margin-bottom: 8px;
}
.install-callout-info p {
  margin: 0;
  color: var(--text);
  font-size: 0.96rem;
}
.install-cmd {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  background: #090c12;
  border: 1px solid rgba(249, 115, 22, 0.5);
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: #fde68a;
}
.card.card-highlight {
  border-color: rgba(249, 115, 22, 0.65);
  background: linear-gradient(180deg, rgba(249, 115, 22, 0.09), var(--bg-elev));
}

