/* Layout: sticky top bar, single centered column (max 1120px); tool and option pages use a
   two-column split that stacks under 820px. Module addresses and coding paths render in mono. */
:root {
  --bg: #EDF0F3;
  --surface: #F9FAFB;
  --raised: #FFFFFF;
  --ink: #111821;
  --muted: #536070;
  --line: #D3D9E0;
  --accent: #1746D1;
  --accent-soft: #DCE5FB;
  --on-accent: #F4F7FF;
  --low: #1D7F47;
  --low-soft: #DDF1E5;
  --med: #9A6512;
  --med-soft: #F6EAD3;
  --high: #B63A26;
  --high-soft: #F8E0DA;
  --shot: #E2E7ED;
  --display: "Chakra Petch", "Arial Narrow", Arial, sans-serif;
  --body: "IBM Plex Sans", "Segoe UI", Arial, sans-serif;
  --mono: "IBM Plex Mono", Menlo, Consolas, monospace;
  --radius: 10px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0D1218; --surface: #141B24; --raised: #19222D; --ink: #E5EAF0; --muted: #9AA6B4;
    --line: #26313E; --accent: #6A93FF; --accent-soft: #1B2847; --on-accent: #0B1020;
    --low: #5CC98A; --low-soft: #15301F; --med: #E2AE55; --med-soft: #33270F; --high: #F07C66; --high-soft: #3A1B15;
    --shot: #1E2833; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0D1218; --surface: #141B24; --raised: #19222D; --ink: #E5EAF0; --muted: #9AA6B4;
  --line: #26313E; --accent: #6A93FF; --accent-soft: #1B2847; --on-accent: #0B1020;
  --low: #5CC98A; --low-soft: #15301F; --med: #E2AE55; --med-soft: #33270F; --high: #F07C66; --high-soft: #3A1B15;
  --shot: #1E2833; color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--body); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
a { color: var(--accent); }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--display); line-height: 1.1; text-wrap: balance; margin: 0; }
h1 { font-size: clamp(2.2rem, 6vw, 3.8rem); font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 600; }
h3 { font-size: 1.2rem; font-weight: 600; }
p { margin: 0; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.eyebrow { font: 600 0.75rem/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); }

/* Top bar */
.bar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 10; background: var(--bg); border-bottom: 1px solid var(--line); }
.bar-in { max-width: 1120px; margin: 0 auto; padding: 12px 16px; display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.logo-code { font: 600 0.8rem/1 var(--mono); background: var(--ink); color: var(--bg); padding: 6px 7px; border-radius: 4px; }
.logo-word { font: 700 1.35rem/1 var(--display); letter-spacing: 0.04em; }
.nav { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.nav a { text-decoration: none; color: var(--muted); font-weight: 500; padding: 8px 12px; border-radius: 6px; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); background: var(--surface); }
.toolpill { font: 500 0.8rem/1 var(--mono); border: 1px solid var(--line); border-radius: 999px; padding: 7px 12px; color: var(--muted); text-decoration: none; }
.toolpill b { color: var(--ink); }

main { max-width: 1120px; margin: 0 auto; padding-inline: 16px; padding-block: 40px 80px; display: flex; flex-direction: column; gap: 56px; }
section { display: flex; flex-direction: column; gap: 20px; min-width: 0; }

/* Hero */
.hero { gap: 16px; }
.hero p.lede { font-size: 1.15rem; color: var(--muted); max-width: 60ch; }
.steps { display: flex; gap: 8px; flex-wrap: wrap; font: 500 0.85rem/1 var(--mono); color: var(--muted); }
.steps span { border: 1px solid var(--line); padding: 7px 10px; border-radius: 6px; }
.steps span:first-child { border-color: var(--accent); color: var(--accent); }

/* Tool cards */
.tools { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.toolcard { display: flex; flex-direction: column; gap: 10px; padding: 22px; background: var(--raised); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--ink); transition: border-color .15s, transform .15s; }
.toolcard:hover { border-color: var(--accent); transform: translateY(-2px); }
.toolcard.is-current { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.toolcard .kind { font: 500 0.78rem/1.3 var(--mono); color: var(--muted); }
.toolcard h3 { font-size: 1.6rem; }
.toolcard p { color: var(--muted); font-size: 0.95rem; }
.toolcard .go { margin-top: auto; font-weight: 600; color: var(--accent); }

/* Lists of options */
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chip { font: 500 0.85rem/1 var(--body); border: 1px solid var(--line); background: var(--surface); color: var(--ink); padding: 8px 12px; border-radius: 999px; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.search { flex: 1 1 220px; min-width: 0; font: 400 0.95rem var(--body); padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--raised); color: var(--ink); }
.modgroup { display: flex; flex-direction: column; gap: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--raised); overflow: hidden; }
.modhead { display: flex; align-items: baseline; gap: 12px; padding: 12px 16px; background: var(--surface); border-bottom: 1px solid var(--line); }
.addr { font: 600 0.9rem/1 var(--mono); background: var(--ink); color: var(--bg); padding: 5px 7px; border-radius: 4px; }
.modhead .mname { font-weight: 600; }
.optrow { display: grid; grid-template-columns: 1fr auto auto; gap: 16px; align-items: center; padding: 14px 16px; border-top: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.optrow:first-of-type { border-top: none; }
.optrow:hover { background: var(--surface); }
.optrow .oname { font-weight: 600; }
.optrow .odesc { color: var(--muted); font-size: 0.9rem; }
.optrow .method { font: 500 0.8rem/1.2 var(--mono); color: var(--muted); text-align: right; }
@media (max-width: 640px) { .optrow { grid-template-columns: 1fr auto; } .optrow .method { display: none; } }
.empty { padding: 24px; border: 1px dashed var(--line); border-radius: var(--radius); color: var(--muted); }

.risk { font: 600 0.72rem/1 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; padding: 6px 8px; border-radius: 4px; white-space: nowrap; }
.risk.low { color: var(--low); background: var(--low-soft); }
.risk.medium { color: var(--med); background: var(--med-soft); }
.risk.high { color: var(--high); background: var(--high-soft); }

/* Tool page */
.split { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 32px; align-items: start; }
@media (max-width: 820px) { .split { grid-template-columns: 1fr; } }
.specs { display: flex; flex-direction: column; gap: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--raised); }
.specs div { display: flex; justify-content: space-between; gap: 16px; padding: 12px 16px; border-top: 1px solid var(--line); }
.specs div:first-child { border-top: none; }
.specs dt { color: var(--muted); }
.specs dd { margin: 0; text-align: right; font-weight: 500; }
.areas { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.area { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.area .aname { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.area p { color: var(--muted); font-size: 0.93rem; }

/* Screenshot frames */
.shot { margin: 0; aspect-ratio: 9 / 13; max-width: 100%; background: var(--shot); border-radius: 12px; border: 1px solid var(--line); overflow: hidden; display: grid; place-items: center; position: relative; }
.shot.wide { aspect-ratio: 16 / 10; }
.shot img { width: 100%; height: 100%; object-fit: contain; display: block; }
.shot .ph { display: flex; flex-direction: column; gap: 6px; align-items: center; text-align: center; padding: 16px; color: var(--muted); }
.shot .ph b { font: 600 0.8rem/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink); }
.shot .ph code { font: 0.75rem/1.3 var(--mono); word-break: break-all; }

/* Option page */
.crumbs { font: 0.85rem var(--mono); color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; }
.crumbs a { color: var(--muted); }
.ohead { display: flex; flex-direction: column; gap: 14px; }
.tags { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.tag { font: 500 0.8rem/1 var(--mono); border: 1px solid var(--line); padding: 6px 8px; border-radius: 4px; color: var(--muted); }
.big { font-size: 1.15rem; max-width: 62ch; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--raised); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 16px; border-top: 1px solid var(--line); }
th { font: 600 0.75rem/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); border-top: none; background: var(--surface); }
tr.is-current td { background: var(--accent-soft); }
tr.is-current td:first-child { font-weight: 600; }
.note { padding: 14px 16px; border-radius: var(--radius); background: var(--med-soft); color: var(--ink); border: 1px solid var(--line); }
.check { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.check li { display: flex; gap: 10px; }
.check li::before { content: "□"; font-family: var(--mono); color: var(--accent); }

/* Tutorials */
.tuts { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.tutcard { display: flex; flex-direction: column; gap: 10px; padding: 20px; background: var(--raised); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--ink); }
.tutcard:hover { border-color: var(--accent); }
.meter { display: inline-flex; gap: 3px; vertical-align: middle; }
.meter i { width: 14px; height: 6px; border-radius: 2px; background: var(--line); }
.meter i.on { background: var(--accent); }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.fact { padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--raised); display: flex; flex-direction: column; gap: 6px; }
.fact span { font: 600 0.72rem/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.stepslist { list-style: none; counter-reset: s; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0; border-left: 2px solid var(--line); }
.stepslist li { counter-increment: s; position: relative; padding: 0 0 22px 28px; display: flex; flex-direction: column; gap: 4px; }
.stepslist li::before { content: counter(s); position: absolute; left: -15px; top: -2px; width: 28px; height: 28px; border-radius: 50%; background: var(--ink); color: var(--bg); font: 600 0.8rem/28px var(--mono); text-align: center; }
.stepslist li b { font-size: 1.05rem; }
.stepslist li p { color: var(--muted); max-width: 64ch; }
ul.plain { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }

footer { border-top: 1px solid var(--line); }
footer .in { max-width: 1120px; margin: 0 auto; padding: 24px 16px 40px; color: var(--muted); font-size: 0.85rem; display: flex; flex-direction: column; gap: 6px; }
