:root {
  --bg: #f4f1ea;
  --surface: #fffdf8;
  --surface-2: #ebe6db;
  --text: #24221e;
  --muted: #625d53;
  --line: #d6cfc0;
  --accent: #b5651d;
  --accent-text: #ffffff;
  --good: #4f7a3a;
  --bad: #a3362b;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1b1a18;
    --surface: #242320;
    --surface-2: #2e2c28;
    --text: #e9e4d8;
    --muted: #a8a194;
    --line: #3d3a34;
    --accent: #e08a3c;
    --accent-text: #1b1a18;
    --good: #79a85f;
    --bad: #d0594b;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.wrap { max-width: 980px; margin: 0 auto; padding: 0 20px; }

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

h1, h2, h3 { line-height: 1.2; }
h1 { font-size: clamp(2rem, 5vw, 2.8rem); margin: 0.2em 0 0.4em; }
h2 { font-size: 1.7rem; margin: 0 0 0.6em; padding-top: 0.4em; }
h3 { font-size: 1.15rem; margin: 1.8em 0 0.5em; }

code {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 0.88em;
  background: var(--surface-2);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

/* Hero */
.hero { background: var(--surface); border-bottom: 1px solid var(--line); padding: 48px 0 40px; }
.hero .wrap > div { max-width: 680px; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.8rem; color: var(--accent); font-weight: 600; margin: 0; }
.lede { font-size: 1.1rem; color: var(--muted); margin: 0 0 1.4em; }
.buttons { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; }
.btn {
  display: inline-block; padding: 10px 18px; border-radius: 6px;
  border: 1px solid var(--line); background: var(--surface-2);
  color: var(--text); text-decoration: none; font-weight: 600;
}
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn:hover { filter: brightness(1.08); }

/* Top bar: mod name and section tabs */
.topbar { position: sticky; top: 0; z-index: 5; background: var(--bg); border-bottom: 1px solid var(--line); }
/* The tabs sit next to the name, or on their own row when they don't fit. */
.topbar .wrap { display: flex; flex-wrap: wrap; align-items: center; column-gap: 28px; }
.brand { font-weight: 700; color: var(--text); text-decoration: none; white-space: nowrap; padding: 12px 0; }
.tabs { display: flex; flex-shrink: 0; max-width: 100%; gap: 22px; overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
.tabs a { color: var(--muted); text-decoration: none; font-size: 0.95rem; padding: 13px 0 11px; border-bottom: 2px solid transparent; }
.tabs a:hover { color: var(--accent); }
.tabs a.on { color: var(--text); border-bottom-color: var(--accent); }

main section { padding: 44px 0 8px; scroll-margin-top: 56px; }
main section + section { border-top: 1px solid var(--line); }

.caption, .note { color: var(--muted); font-size: 0.93rem; }

.steps li { margin-bottom: 0.4em; }

.rules dt { font-weight: 700; margin-top: 0.8em; }
.rules dd { margin: 0.2em 0 0 0; padding-left: 14px; border-left: 3px solid var(--accent); }
.rules dd.good { border-left-color: var(--good); }
.rules dd.bad { border-left-color: var(--bad); }

/* Tables */
table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 0.94rem; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--surface-2); font-weight: 600; }
td.num, th.num { font-variant-numeric: tabular-nums; }

footer { margin-top: 48px; padding: 24px 0 40px; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.9rem; }

@media (max-width: 720px) {
  body { font-size: 16px; }
  .wrap { padding: 0 16px; }
  .hero { padding: 32px 0; }
  .brand { padding-bottom: 2px; }
  .tabs { width: 100%; }
  table { display: block; overflow-x: auto; }
}

/* ---------- other Bamba mods (footer) ---------- */
.other-mods { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.other-mods-title { margin: 0 0 6px; font-weight: 600; }
.other-mods ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.footer .other-mods ul { justify-content: center; }
.other-mods li { margin: 0; }
.other-mods .ws { color: var(--muted); font-size: 0.9em; margin-left: 4px; }
