/* Jarvis documentation: the jarvisrd.com.do look (near-black, lime #C9F231, Inter), with a light theme. */
:root,
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b0d0c;
  --bg-2: #101312;
  --panel: #121514;
  --panel-2: #181c1a;
  --line: #262b25;
  --line-strong: #343b33;
  --text: #f3f4ee;
  --muted: #a3a89d;
  --faint: #6f756b;
  --lime: #c9f231;
  --lime-ink: #0b0d0c;
  --lime-soft: #c9f2311a;
  --link: #c9f231;
  --code-bg: #0f1210;
  --note: #60a5fa;
  --tip: #34d399;
  --warn: #fbbf24;
  --dots: #c9f23126;
}
[data-theme="light"] {
  color-scheme: light;
  --bg: #fafaf7;
  --bg-2: #f3f4ee;
  --panel: #ffffff;
  --panel-2: #f3f4ee;
  --line: #e3e5dc;
  --line-strong: #cfd3c5;
  --text: #121512;
  --muted: #555a50;
  --faint: #8a8f83;
  --lime: #c9f231;
  --lime-ink: #0b0d0c;
  --lime-soft: #c9f23140;
  --link: #4d6b00;
  --code-bg: #f3f4ee;
  --note: #2563eb;
  --tip: #059669;
  --warn: #b45309;
  --dots: #4d6b0014;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.7 Inter, -apple-system, "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  background-image: radial-gradient(var(--dots) 1px, transparent 1.2px);
  background-size: 18px 18px;
  background-attachment: fixed;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
::selection { background: var(--lime); color: var(--lime-ink); }

/* Top bar */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 16px;
  height: 64px; padding: 0 24px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 800; font-size: 19px; letter-spacing: -0.02em; }
.brand:hover { text-decoration: none; }
.brand-tag { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--lime-soft); color: var(--link); letter-spacing: 0.02em; }
.search-btn {
  flex: 0 1 380px; margin-left: 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  height: 38px; padding: 0 12px; border-radius: 10px;
  background: var(--panel); border: 1px solid var(--line); color: var(--faint);
  font: inherit; font-size: 14px; cursor: pointer; transition: border-color .15s;
}
.search-btn:hover { border-color: var(--line-strong); color: var(--muted); }
kbd { font: 500 11px "JetBrains Mono", monospace; padding: 2px 6px; border-radius: 6px; border: 1px solid var(--line); color: var(--faint); }
.top-links { margin-left: auto; display: flex; align-items: center; gap: 18px; font-size: 14px; }
.top-links a:not(.cta) { color: var(--muted); }
.top-links a:not(.cta):hover { color: var(--text); text-decoration: none; }
.cta {
  display: inline-flex; align-items: center; height: 38px; padding: 0 16px; border-radius: 10px;
  background: var(--lime); color: var(--lime-ink) !important; font-weight: 700;
  box-shadow: 0 0 0 1px #c9f23155, 0 8px 24px -10px var(--lime);
  transition: transform .15s, filter .15s;
}
.cta:hover { text-decoration: none; filter: brightness(1.05); transform: translateY(-1px); }
.icon-btn {
  display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px;
  background: var(--panel); border: 1px solid var(--line); color: var(--muted); cursor: pointer; font-size: 16px;
}
.icon-btn:hover { color: var(--text); border-color: var(--line-strong); }
[data-theme="dark"] .sun, [data-theme="light"] .moon { display: none; }
.menu-btn { display: none; }

/* Layout */
.layout { display: grid; grid-template-columns: 272px minmax(0, 1fr) 220px; max-width: 1440px; margin: 0 auto; }
.sidebar {
  position: sticky; top: 64px; height: calc(100vh - 64px); overflow-y: auto;
  padding: 28px 16px 24px 24px; border-right: 1px solid var(--line);
}
.nav-section { margin: 20px 0 6px 10px; font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); }
.nav-section:first-child { margin-top: 0; }
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar li a {
  display: block; padding: 6px 10px; border-radius: 8px; font-size: 14.5px; color: var(--muted);
  border-left: 2px solid transparent; transition: background .12s, color .12s;
}
.sidebar li a:hover { color: var(--text); background: var(--panel); text-decoration: none; }
.sidebar li a[aria-current="page"] { color: var(--text); background: var(--lime-soft); border-left-color: var(--lime); font-weight: 600; }
.support-card {
  display: flex; flex-direction: column; gap: 4px; margin: 28px 0 0; padding: 14px;
  border-radius: 14px; border: 1px solid var(--line); background: linear-gradient(160deg, var(--lime-soft), transparent 70%), var(--panel);
  color: var(--muted); font-size: 13px; line-height: 1.5;
}
.support-card strong { color: var(--text); font-size: 14px; }
.support-card:hover { border-color: var(--lime); text-decoration: none; }

.content { min-width: 0; padding: 40px 56px 64px; }
article { max-width: 760px; }
.eyebrow { margin: 0 0 6px; font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--link); }
h1 { margin: 0 0 12px; font-size: 40px; line-height: 1.12; letter-spacing: -0.035em; font-weight: 800; }
h2 { margin: 48px 0 12px; font-size: 25px; letter-spacing: -0.02em; font-weight: 700; padding-top: 8px; border-top: 1px solid var(--line); }
h3 { margin: 30px 0 8px; font-size: 19px; font-weight: 700; letter-spacing: -0.01em; }
h1 + p { font-size: 18.5px; color: var(--muted); }
.anchor { float: left; margin-left: -1.1em; padding-right: .3em; color: var(--faint); opacity: 0; font-weight: 400; }
h2:hover .anchor, h3:hover .anchor { opacity: 1; text-decoration: none; }
p, li { color: color-mix(in srgb, var(--text) 88%, var(--muted)); }
strong { color: var(--text); font-weight: 650; }
ul, ol { padding-left: 1.3em; }
li { margin: 6px 0; }
li::marker { color: var(--link); }
hr { border: 0; border-top: 1px solid var(--line); margin: 40px 0; }
code { font: 500 0.86em "JetBrains Mono", monospace; padding: .15em .45em; border-radius: 6px; background: var(--code-bg); border: 1px solid var(--line); }
pre { padding: 16px 18px; border-radius: 12px; background: var(--code-bg); border: 1px solid var(--line); overflow-x: auto; }
pre code { padding: 0; border: 0; background: none; font-size: 13.5px; }
table { width: 100%; border-collapse: separate; border-spacing: 0; margin: 20px 0; font-size: 14.5px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
th { text-align: left; background: var(--panel-2); font-weight: 650; color: var(--text); }
th, td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
blockquote { margin: 20px 0; padding: 2px 18px; border-left: 3px solid var(--line-strong); color: var(--muted); }

.callout { margin: 22px 0; padding: 14px 18px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); border-left-width: 3px; }
.callout p { margin: 6px 0; }
.callout-title { margin: 0 0 2px !important; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.callout-nota { border-left-color: var(--note); } .callout-nota .callout-title { color: var(--note); }
.callout-consejo { border-left-color: var(--tip); } .callout-consejo .callout-title { color: var(--tip); }
.callout-importante { border-left-color: var(--warn); } .callout-importante .callout-title { color: var(--warn); }

/* Cards grid on the home page: a list whose items start with a bold link. */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin: 22px 0; padding: 0; list-style: none; }
.cards li { margin: 0; }
.cards a {
  display: block; height: 100%; padding: 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel);
  color: var(--muted); font-size: 14px; line-height: 1.5; transition: border-color .15s, transform .15s;
}
.cards a strong { display: block; margin-bottom: 4px; color: var(--text); font-size: 15.5px; }
.cards a:hover { border-color: var(--lime); transform: translateY(-2px); text-decoration: none; }

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 56px; }
.pager a { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); color: var(--text); font-weight: 600; }
.pager a span { font-size: 12px; font-weight: 500; color: var(--faint); }
.pager a:hover { border-color: var(--lime); text-decoration: none; }
.pager .next { text-align: right; grid-column: 2; }

.toc { position: sticky; top: 64px; height: calc(100vh - 64px); overflow-y: auto; padding: 40px 24px 24px 8px; font-size: 13px; }
.toc p { margin: 0 0 10px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.toc li { margin: 0; }
.toc li a { display: block; padding: 4px 0 4px 12px; color: var(--muted); }
.toc li.d3 a { padding-left: 24px; }
.toc li a:hover { color: var(--text); text-decoration: none; }

.footer { max-width: 760px; margin-top: 56px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 13px; color: var(--faint); }

/* Search */
.search { position: fixed; inset: 0; z-index: 50; display: flex; justify-content: center; padding: 12vh 16px 0; background: #000a; backdrop-filter: blur(6px); }
.search[hidden] { display: none; }
.search-box { width: min(640px, 100%); max-height: 70vh; display: flex; flex-direction: column; border-radius: 16px; border: 1px solid var(--line-strong); background: var(--panel); box-shadow: 0 30px 80px -20px #000; overflow: hidden; }
.search-box input { width: 100%; height: 56px; padding: 0 20px; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--text); font: inherit; font-size: 17px; outline: none; }
.search-box ul { list-style: none; margin: 0; padding: 8px; overflow-y: auto; }
.search-box li a { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 10px; color: var(--text); }
.search-box li a:hover { background: var(--lime-soft); text-decoration: none; }
.search-box li span { font-size: 11px; color: var(--link); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.search-box li em { font-style: normal; font-size: 13px; color: var(--muted); }
.search-box .empty { padding: 16px; color: var(--muted); }

.wa-float {
  position: fixed; right: 22px; bottom: 22px; z-index: 40; display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%;
  background: var(--lime); color: var(--lime-ink); box-shadow: 0 0 0 6px #c9f2311f, 0 14px 30px -10px var(--lime); transition: transform .15s;
}
.wa-float:hover { transform: scale(1.06); text-decoration: none; }

@media (max-width: 1180px) { .layout { grid-template-columns: 250px minmax(0, 1fr); } .toc { display: none; } }
@media (max-width: 820px) {
  .layout { grid-template-columns: 1fr; }
  .menu-btn { display: inline-grid; }
  .search-btn span { display: none; }
  .search-btn { flex: 0 0 auto; margin-left: auto; width: 38px; padding: 0; justify-content: center; }
  .search-btn::before { content: "⌕"; font-size: 18px; color: var(--muted); }
  .search-btn kbd, .top-links a:not(.cta) { display: none; }
  .top-links { margin-left: 8px; gap: 8px; }
  .sidebar { position: fixed; top: 64px; left: 0; z-index: 25; width: 290px; background: var(--bg); transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: none; box-shadow: 20px 0 60px #0008; }
  .content { padding: 28px 18px 72px; }
  h1 { font-size: 32px; }
  .topbar { padding: 0 14px; gap: 10px; }
  .brand-tag { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
