/* ===========================================================================
   Jolt site — dark theme shared by the landing page and the docs.
   =========================================================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --yellow:  #FFDD00;
  --orange:  #FF5500;
  --red:     #FF0055;
  --surface: #161b22;
  --bg:      #0a0a12;
  --text:    #e2e4e9;
  --muted:   #8b8fa3;
  --border:  #21262d;
  --nav-h:   56px;
}

html { scroll-behavior: smooth; }

body {
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  padding-top: var(--nav-h);
}

a { color: var(--orange); }

/* ── Nav ─────────────────────────────────────────────────────────────────── */
.site-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  backdrop-filter: blur(12px);
  background: rgba(10,10,18,0.85);
  border-bottom: 1px solid var(--border);
}
.site-nav .inner {
  max-width: 1100px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; height: var(--nav-h);
}
.site-nav .brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.site-nav .brand-logo {
  height: 36px; width: auto;
  animation: pulse 3s ease-in-out infinite;
}
.site-nav .brand-name { font-weight: 700; font-size: 1.1rem; letter-spacing: -0.01em; color: var(--text); }
.site-nav .nav-cta { padding: 7px 16px; font-size: 0.85rem; border-radius: 8px; }
.site-nav .links { display: flex; gap: 26px; list-style: none; align-items: center; }
.site-nav .links a {
  color: var(--muted); text-decoration: none; font-size: 0.92rem; font-weight: 500;
  padding: 6px 2px; position: relative; transition: color .15s;
}
.site-nav .links a::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: var(--orange); transform: scaleX(0); transform-origin: left; transition: transform .15s;
}
.site-nav .links a:hover { color: var(--text); }
.site-nav .links a:hover::after { transform: scaleX(1); }
.site-nav .links li.selected a { color: var(--text); }
.site-nav .links li.selected a::after { transform: scaleX(1); }

/* ── Hero ────────────────────────────────────────────────────────────────── */
.hero {
  min-height: calc(100vh - var(--nav-h));
  display: flex; align-items: center;
  padding: 80px 24px;
  position: relative; overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse 60% 50% at 50% 40%, rgba(255,85,0,0.08), transparent 70%),
              radial-gradient(ellipse 80% 60% at 50% 50%, rgba(255,0,85,0.04), transparent 70%);
  pointer-events: none;
}
.hero-inner {
  position: relative; z-index: 1;
  width: 100%; max-width: 1100px; margin: 0 auto;
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 64px; align-items: center;
}
.hero h1 {
  font-size: clamp(2.5rem, 5vw, 3.75rem);
  font-weight: 800; letter-spacing: -0.03em;
  color: var(--text); line-height: 1.08;
}
.hero .tagline {
  font-size: clamp(1rem, 2vw, 1.2rem); color: var(--muted);
  max-width: 520px; margin-top: 16px;
}
.hero-points {
  list-style: none; margin-top: 26px;
}
.hero-points li {
  position: relative; padding-left: 26px; margin-bottom: 10px;
  color: var(--muted); font-size: 0.98rem;
}
.hero-points li::before {
  content: ''; position: absolute; left: 2px; top: 0.52em;
  width: 9px; height: 9px; border-radius: 2px; transform: rotate(45deg);
  background: linear-gradient(135deg, var(--yellow), var(--orange));
}
.hero-actions { margin-top: 32px; display: flex; gap: 14px; flex-wrap: wrap; }
@keyframes pulse {
  0%, 100% { filter: drop-shadow(0 0 10px rgba(255,85,0,0.35)) drop-shadow(0 0 20px rgba(255,0,85,0.25)); }
  50%      { filter: drop-shadow(0 0 16px rgba(255,85,0,0.55)) drop-shadow(0 0 28px rgba(255,0,85,0.35)); }
}

/* hero code panel */
.hero-code {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; overflow: hidden;
  box-shadow: 0 30px 60px rgba(0,0,0,0.45);
}
.hero-code-bar {
  display: flex; align-items: center; gap: 7px;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
}
.hero-code-bar .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--border); }
.hero-code-bar .dot:nth-child(1) { background: var(--yellow); }
.hero-code-bar .dot:nth-child(2) { background: var(--orange); }
.hero-code-bar .dot:nth-child(3) { background: var(--red); }
.hero-code-name {
  margin-left: auto; color: var(--muted); font-size: 0.78rem;
  font-family: 'SF Mono', 'Fira Code', ui-monospace, monospace;
}
.hero-code pre {
  margin: 0; border: 0; border-radius: 0; background: transparent;
  padding: 22px 24px; font-size: 0.9rem;
}

/* live REPL in the hero panel */
.hero-note {
  margin-top: 18px; color: var(--muted); font-size: 0.85rem; line-height: 1.5;
}
.hero-repl-out {
  padding: 18px 20px; min-height: 180px; max-height: 260px; overflow-y: auto;
  font-family: 'SF Mono', 'Fira Code', ui-monospace, monospace;
  font-size: 0.85rem; line-height: 1.55; white-space: pre-wrap; word-break: break-word;
}
.hero-repl-out .repl-in  { color: var(--muted); }
.hero-repl-out .repl-out { color: var(--text); margin-bottom: 6px; }
.hero-repl-out .repl-err { color: var(--red, #ff5f56); margin-bottom: 6px; }
.hero-repl-out .repl-stdout { color: var(--text); opacity: 0.8; }
.hero-repl-out .repl-hint {
  color: var(--muted); opacity: 0.7; font-size: 0.78rem; margin: 8px 0 2px;
}
.hero-repl-form {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 20px; border-top: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
}
.hero-repl-form .repl-prompt {
  color: var(--muted); font-family: 'SF Mono', 'Fira Code', ui-monospace, monospace;
  font-size: 0.85rem;
}
.hero-repl-form input {
  flex: 1; background: transparent; border: 0; outline: none;
  color: var(--text); font-family: 'SF Mono', 'Fira Code', ui-monospace, monospace;
  font-size: 0.85rem;
}
#jolt-repl-status {
  margin-left: 10px; font-size: 0.72rem; color: var(--muted);
  font-family: 'SF Mono', 'Fira Code', ui-monospace, monospace;
}
#jolt-repl-status.repl-ready { color: var(--green, #27c93f); }
#jolt-repl-status.repl-err   { color: var(--red, #ff5f56); }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-block; padding: 11px 22px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text); text-decoration: none; font-size: 0.95rem; font-weight: 600;
  transition: border-color .2s, transform .1s;
}
.btn:hover { border-color: rgba(255,85,0,0.5); }
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--orange);
  border-color: transparent; color: #fff;
}
.btn-primary:hover { background: #ff6a1a; border-color: transparent; }

/* ── Sections ────────────────────────────────────────────────────────────── */
section { padding: 80px 24px; }
section.surface { background: var(--surface); }
section .inner { max-width: 900px; margin: 0 auto; }
section h2 {
  font-size: 2rem; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 24px;
  color: var(--text);
  display: inline-block;
}
section h3 { font-size: 1.15rem; font-weight: 600; margin: 24px 0 8px; color: var(--text); }
section p, section li { color: var(--muted); }
section ul { padding-left: 20px; }
section li { margin-bottom: 6px; }
section .cta { margin-top: 24px; }

/* ── Feature grid ────────────────────────────────────────────────────────── */
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; }
.feat {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 12px; padding: 28px;
}
section.surface .feat { background: var(--bg); }
.feat .icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 52px; height: 52px; border-radius: 12px; margin-bottom: 16px;
  background: rgba(255,85,0,0.1);
  border: 1px solid rgba(255,85,0,0.22);
}
.feat .icon svg {
  width: 26px; height: 26px;
  stroke: var(--orange); fill: none;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.feat h4 { font-size: 1.05rem; font-weight: 600; margin-bottom: 6px; }
.feat p { font-size: 0.9rem; color: var(--muted); }

/* ── Code ────────────────────────────────────────────────────────────────── */
pre {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 18px 22px; overflow-x: auto;
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', ui-monospace, monospace;
  font-size: 0.875rem; line-height: 1.6; margin: 16px 0;
}
pre code { font-family: inherit; background: none; padding: 0; border: 0; color: inherit; }
code {
  font-family: 'SF Mono', 'Fira Code', ui-monospace, monospace;
  font-size: 0.875em; background: var(--surface);
  border: 1px solid var(--border); border-radius: 5px; padding: 1px 6px;
}
/* hand-authored highlighting on the landing page */
.syn-comment { color: #6e7681; }
.syn-str { color: #a5d6ff; }
.syn-kw { color: #ff7b72; }
.syn-fn { color: #d2a8ff; }
.syn-num { color: #79c0ff; }
.syn-op { color: #ff7b72; }

/* ── Tables ──────────────────────────────────────────────────────────────── */
.diff-table, .docs-main table { width: 100%; border-collapse: collapse; margin: 16px 0; }
.diff-table th, .diff-table td,
.docs-main th, .docs-main td {
  text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--border); font-size: 0.9rem;
}
.diff-table th, .docs-main th { color: var(--text); font-weight: 600; }
.diff-table td, .docs-main td { color: var(--muted); }
.diff-table td:first-child { color: var(--text); font-weight: 500; white-space: nowrap; }

/* ── Docs layout ─────────────────────────────────────────────────────────── */
.docs-layout {
  max-width: 1100px; margin: 0 auto; padding: 40px 24px 80px;
  display: grid; grid-template-columns: 240px 1fr; gap: 48px; align-items: start;
}
.docs-sidebar {
  position: sticky; top: calc(var(--nav-h) + 24px);
  align-self: start; font-size: 0.9rem;
}
.docs-sidebar h3 {
  font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--muted); margin-bottom: 12px;
}
.docs-sidebar ul { list-style: none; }
.docs-sidebar li { margin: 2px 0; }
.docs-sidebar a {
  display: block; padding: 6px 10px; border-radius: 7px;
  color: var(--muted); text-decoration: none; border-left: 2px solid transparent;
}
.docs-sidebar a:hover { color: var(--text); background: var(--surface); }
.docs-sidebar li.selected a { color: var(--text); border-left-color: var(--orange); background: var(--surface); }

/* ── Docs content (markdown) ─────────────────────────────────────────────── */
.docs-main { min-width: 0; }
.docs-main > h1 {
  font-size: 2.2rem; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 24px;
  color: var(--text);
}
.docs-main #content { color: var(--muted); }
.docs-main #content h1,
.docs-main #content h2,
.docs-main #content h3,
.docs-main #content h4 { color: var(--text); font-weight: 700; letter-spacing: -0.01em; }
.docs-main #content h2 { font-size: 1.6rem; margin: 40px 0 14px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.docs-main #content h3 { font-size: 1.25rem; margin: 28px 0 10px; }
.docs-main #content h4 { font-size: 1.05rem; margin: 22px 0 8px; }
.docs-main #content p { margin: 12px 0; }
.docs-main #content ul, .docs-main #content ol { margin: 12px 0; padding-left: 24px; }
.docs-main #content li { margin: 5px 0; }
.docs-main #content a { color: var(--orange); text-decoration: none; }
.docs-main #content a:hover { text-decoration: underline; }
.docs-main #content strong { color: var(--text); }
.docs-main #content blockquote {
  border-left: 3px solid var(--orange); margin: 16px 0; padding: 4px 18px;
  background: var(--surface); border-radius: 0 8px 8px 0; color: var(--muted);
}
.docs-main #content h1 a, .docs-main #content h2 a,
.docs-main #content h3 a, .docs-main #content h4 a { color: inherit; text-decoration: none; }

/* table of contents */
.toc {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 16px 22px; margin-bottom: 28px;
}
.toc h2 { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 8px; border: 0; padding: 0; }
.toc ol { list-style: none; padding-left: 0; margin: 0; }
.toc ol ol { padding-left: 18px; }
.toc li { margin: 3px 0; }
.toc a { color: var(--muted); text-decoration: none; font-size: 0.9rem; }
.toc a:hover { color: var(--orange); }

/* ── 404 ─────────────────────────────────────────────────────────────────── */
.notfound { text-align: center; padding: 140px 24px; }
.notfound h1 {
  font-size: 6rem; font-weight: 800;
  color: var(--text);
}
.notfound p { color: var(--muted); margin-top: 8px; }

/* ── Footer ──────────────────────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border); padding: 40px 24px;
  text-align: center; color: var(--muted); font-size: 0.85rem;
}
footer a { color: var(--orange); text-decoration: none; }
footer a:hover { text-decoration: underline; }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; gap: 48px; }
  .hero { text-align: center; }
  .hero .tagline, .hero-points { margin-left: auto; margin-right: auto; }
  .hero-points { text-align: left; max-width: 520px; }
  .hero-actions { justify-content: center; }
}
@media (max-width: 760px) {
  .site-nav .nav-cta { display: none; }
  .docs-layout { grid-template-columns: 1fr; gap: 24px; }
  .docs-sidebar { position: static; border-bottom: 1px solid var(--border); padding-bottom: 16px; }
  nav .links { gap: 16px; }
}
