/* Roadmap tracker — self-contained styles. Fonts are served from ./fonts, nothing loads from a CDN.
   Theme borrowed from the finance tracker: warm page, ink borders, hard offset shadows, accent blocks. */
@font-face { font-family: "Archivo Black"; font-weight: 400; font-display: swap; src: url("fonts/archivo-black-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "DM Sans"; font-weight: 400; font-display: swap; src: url("fonts/dm-sans-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+2190-21FF; }
@font-face { font-family: "DM Sans"; font-weight: 500; font-display: swap; src: url("fonts/dm-sans-latin-500-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+2190-21FF; }
@font-face { font-family: "DM Sans"; font-weight: 700; font-display: swap; src: url("fonts/dm-sans-latin-700-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+2190-21FF; }
@font-face { font-family: "DM Sans"; font-weight: 400; font-display: swap; src: url("fonts/dm-sans-latin-ext-400-normal.woff2") format("woff2"); unicode-range: U+0100-02BA, U+20A0-20C0; }
@font-face { font-family: "DM Sans"; font-weight: 500; font-display: swap; src: url("fonts/dm-sans-latin-ext-500-normal.woff2") format("woff2"); unicode-range: U+0100-02BA, U+20A0-20C0; }
@font-face { font-family: "DM Sans"; font-weight: 700; font-display: swap; src: url("fonts/dm-sans-latin-ext-700-normal.woff2") format("woff2"); unicode-range: U+0100-02BA, U+20A0-20C0; }

:root {
  --page: #f6efd9; --surface: #fffaeb; --surface-2: #f4e9cc; --line: #e2d4b0;
  --ink: #111111; --text: #111111; --muted: #454545; --subtle: #5a5650;
  --link: #1557c0; --ok: #0c7066;
  --lime: #c8e832; --yellow: #f5b83c; --coral: #ff5b45; --cobalt: #7fb0ff; --teal: #3cbdb1; --lilac: #c4b1f7; --cream: #f6eedf;
  --display: "Archivo Black", "DM Sans", system-ui, sans-serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --page: #121110; --surface: #1c1b19; --surface-2: #272521; --line: #34312c;
  --ink: #f6eedf; --text: #f6eedf; --muted: #cfc7b8; --subtle: #b0a898;
  --link: #8ab6ff; --ok: #6ddbcf;
  color-scheme: dark;
}

/* Track accents. Accent fills always carry dark text, in both themes. */
.track-foundations { --tc: var(--lilac); }
.track-build { --tc: var(--cobalt); }
.track-run { --tc: var(--yellow); }
.track-platform { --tc: var(--teal); }
.track-internals { --tc: var(--coral); }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--page); color: var(--text); font-family: "DM Sans", system-ui, sans-serif; font-size: 15px; line-height: 1.5; font-variant-numeric: tabular-nums; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-align: left; }
a { color: var(--link); }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .87em; background: var(--surface-2); border: 1px solid var(--line); padding: 0 5px; border-radius: 5px; }
h1, h2, h3 { margin: 0; }
:focus-visible { outline: 3px solid var(--link); outline-offset: 2px; }

/* ── Header ──────────────────────────────────────────────── */
.header { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px; padding: 10px 20px; background: var(--page); border-bottom: 2.5px solid var(--ink); }
.logo { width: 34px; height: 34px; flex: none; display: grid; place-items: center; background: var(--lime); color: #111; border: 2.5px solid var(--ink); border-radius: 10px; box-shadow: 2px 2px 0 var(--ink); font-family: var(--display); font-size: 13px; text-decoration: none; }
.brand { font-family: var(--display); font-size: 18px; letter-spacing: -.01em; color: var(--text); text-decoration: none; white-space: nowrap; }
.header-progress { flex: 1; max-width: 300px; margin-left: auto; }
.header-progress-label { display: flex; justify-content: space-between; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 3px; }
.bar { height: 12px; background: var(--surface); border: 2px solid var(--ink); border-radius: 999px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--lime); border-right: 2px solid var(--ink); transition: width .3s; }
.bar > span[style*="width:0%"], .bar > span[style*="width: 0%"] { border-right: 0; }
.sync { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.sync::before { content: ""; width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--ink); background: var(--yellow); }
.sync-ok::before { background: var(--lime); }
.theme { display: inline-flex; gap: 2px; padding: 3px; border: 2px solid var(--ink); border-radius: 999px; box-shadow: 2px 2px 0 var(--ink); background: var(--surface); }
.theme button { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; }
.theme button svg { width: 16px; height: 16px; }
.theme .theme-on { background: var(--yellow); color: #111; }

/* ── Shell ───────────────────────────────────────────────── */
.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: calc(100vh - 58px); }
.sidebar { border-right: 2.5px solid var(--ink); padding: 14px 12px 30px; position: sticky; top: 58px; align-self: start; height: calc(100vh - 58px); overflow-y: auto; }
.nav { display: flex; align-items: center; gap: 10px; padding: 8px 10px; margin-bottom: 4px; border-radius: 10px; border: 2px solid transparent; color: var(--text); text-decoration: none; font-weight: 700; font-size: 14px; line-height: 1.25; }
.nav:hover { border-color: var(--ink); }
.nav-on { background: var(--yellow); color: #111; border-color: var(--ink); box-shadow: 3px 3px 0 var(--ink); }
.nav-num { flex: none; width: 24px; height: 24px; display: grid; place-items: center; border: 2px solid var(--ink); border-radius: 7px; background: var(--surface); color: var(--text); font-size: 12px; }
.nav-on .nav-num { background: #111; color: var(--yellow); border-color: #111; }
.nav-done .nav-num { background: var(--lime); color: #111; }
.nav-label { flex: 1; min-width: 0; }
.nav-count { font-size: 11.5px; font-weight: 500; color: var(--subtle); }
.nav-on .nav-count { color: #2b2b2b; }
.nav-sep { margin: 12px 10px 6px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.main { padding: 34px 40px 80px; max-width: 1080px; min-width: 0; }

/* ── Shared pieces ───────────────────────────────────────── */
.title { font-family: var(--display); font-size: 2.1rem; line-height: 1.1; letter-spacing: -.01em; }
.lead { color: var(--muted); max-width: 760px; margin: 8px 0 0; }
.kicker { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.card { background: var(--surface); border: 2.5px solid var(--ink); border-radius: 12px; box-shadow: 4px 4px 0 var(--ink); }
.clickable { display: block; width: 100%; color: inherit; text-decoration: none; cursor: pointer; transition: transform .08s, box-shadow .08s; }
.clickable:hover { transform: translate(-1px, -1px); box-shadow: 6px 6px 0 var(--ink); }
.pill { display: inline-flex; align-items: center; padding: 1px 10px; border-radius: 999px; border: 2px solid var(--ink); font-size: 12px; font-weight: 700; white-space: nowrap; color: #111; background: var(--cream); }
.pill-track { background: var(--tc); }
.pill-project { background: var(--lime); }
.pill-env { background: var(--surface); color: var(--text); font-weight: 500; }
.pills { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; background: var(--lime); color: #111; border: 2px solid var(--ink); border-radius: 10px; box-shadow: 3px 3px 0 var(--ink); font-weight: 700; font-size: 13px; text-decoration: none; transition: transform .08s, box-shadow .08s; }
.btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.btn:active { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--ink); }
.btn-ghost { background: var(--surface); color: var(--text); }
.btn svg { width: 14px; height: 14px; }
.section-title { font-family: var(--display); font-size: 1.25rem; margin: 34px 0 12px; }

/* ── Overview ────────────────────────────────────────────── */
.blocks { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-top: 26px; }
.block { border: 2.5px solid var(--ink); border-radius: 12px; box-shadow: 4px 4px 0 var(--ink); color: #111; padding: 14px 16px; }
.block .kicker { color: #2b2b2b; }
.block-big { font-family: var(--display); font-size: 1.9rem; line-height: 1.15; }
.block-sub { font-size: 12.5px; color: #2b2b2b; }
.b-lime { background: var(--lime); } .b-yellow { background: var(--yellow); } .b-coral { background: var(--coral); } .b-teal { background: var(--teal); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.next-card { padding: 14px 16px; border-top-width: 2.5px; }
.next-card .next-title { font-weight: 700; font-size: 15px; line-height: 1.3; margin: 6px 0 4px; }
.next-card .meta { font-size: 12.5px; color: var(--subtle); }
.stage-card { padding: 16px 18px; }
.stage-card h3 { font-family: var(--display); font-size: 1.15rem; margin: 4px 0 6px; }
.stage-card p { margin: 0 0 12px; font-size: 13.5px; color: var(--muted); }
.stage-card .meta { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--subtle); margin-top: 6px; }
.howto { padding: 14px 18px; margin-top: 34px; }
.howto summary { cursor: pointer; font-weight: 700; }
.howto ol { margin: 10px 0 2px; padding-left: 20px; color: var(--muted); }
.howto li { margin-bottom: 6px; }
.foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 40px; padding-top: 14px; border-top: 2px solid var(--line); font-size: 12.5px; color: var(--subtle); }
.link { color: var(--subtle); text-decoration: underline; font-size: 12.5px; }

/* ── Stage view ──────────────────────────────────────────── */
.outcome { margin-top: 16px; padding: 10px 14px; background: var(--surface-2); border: 2px solid var(--ink); border-radius: 10px; font-size: 14px; }
.controls { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 22px 0 16px; }
.toggle { display: inline-flex; border: 2px solid var(--ink); border-radius: 10px; box-shadow: 3px 3px 0 var(--ink); background: var(--surface); overflow: hidden; }
.toggle button { padding: 5px 11px; font-size: 13px; font-weight: 700; border-right: 2px solid var(--ink); }
.toggle button:last-child { border-right: 0; }
.toggle .toggle-on { background: var(--yellow); color: #111; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border: 2px solid var(--ink); border-radius: 999px; background: var(--surface); font-size: 12.5px; font-weight: 700; }
.chip::before { content: ""; width: 10px; height: 10px; border-radius: 3px; border: 2px solid var(--ink); background: var(--tc); }
.chip-on { background: var(--tc); color: #111; box-shadow: 2px 2px 0 var(--ink); }
.search { flex: 1; min-width: 200px; padding: 7px 12px; border: 2px solid var(--ink); border-radius: 10px; background: var(--surface); color: var(--text); font: inherit; font-size: 14px; }
.mods { display: flex; flex-direction: column; gap: 12px; }
.mod { display: flex; gap: 14px; align-items: flex-start; padding: 13px 16px; border-left: 12px solid var(--tc); }
.mod-status { flex: none; width: 22px; height: 22px; margin-top: 2px; border: 2.5px solid var(--ink); border-radius: 50%; background: var(--surface); position: relative; }
.st-doing .mod-status { background: var(--yellow); }
.st-done .mod-status { background: var(--lime); }
.st-done .mod-status::after { content: ""; position: absolute; left: 5px; top: 1px; width: 5px; height: 10px; border: solid #111; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); }
.mod-main { flex: 1; min-width: 0; }
.mod-title { display: block; font-weight: 700; font-size: 16px; line-height: 1.3; margin: 5px 0 2px; }
.mod-summary { display: block; font-size: 13.5px; color: var(--muted); }
.mod-side { flex: none; text-align: right; font-size: 12.5px; color: var(--subtle); min-width: 74px; }
.mod-side b { display: block; color: var(--text); font-size: 14px; }
.empty { color: var(--subtle); padding: 30px 0; }

/* ── Module page ─────────────────────────────────────────── */
.crumbs { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13px; font-weight: 700; margin-bottom: 14px; }
.crumbs a { color: var(--text); }
.crumbs span { color: var(--subtle); font-weight: 500; }
.module-head { padding: 20px 22px; border-top: 12px solid var(--tc); }
.module-head .title { font-size: 1.8rem; margin: 10px 0 8px; }
.module-head p { margin: 0 0 8px; max-width: 800px; }
.module-head .why { color: var(--muted); font-size: 14px; }
.module-actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-top: 14px; }
.needs { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 12px; font-size: 13px; }
.need { padding: 1px 10px; border: 2px solid var(--ink); border-radius: 999px; background: var(--surface); color: var(--text); text-decoration: none; font-size: 12.5px; font-weight: 700; }
.need.st-done { background: var(--lime); color: #111; }
.need:hover { box-shadow: 2px 2px 0 var(--ink); }
.status-done .toggle-on { background: var(--lime); }
.sec { margin-top: 24px; padding: 18px 22px; }
.sec-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.sec-head h2 { font-family: var(--display); font-size: 1.15rem; }
.sec-count { font-size: 12.5px; font-weight: 700; color: var(--subtle); }
.sec-tools { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.sec-hint { margin: 0 0 6px; font-size: 13px; color: var(--subtle); }
.sec-q { background: color-mix(in srgb, var(--lilac) 22%, var(--surface)); }
.sec-ex { background: color-mix(in srgb, var(--yellow) 20%, var(--surface)); }

/* Rows: only the box toggles. The text is ordinary selectable text. */
.items { list-style: none; margin: 0; padding: 0; }
.item { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-bottom: 2px solid var(--line); }
.item:last-child { border-bottom: 0; padding-bottom: 2px; }
.box { flex: none; width: 22px; height: 22px; margin-top: 1px; border: 2.5px solid var(--ink); border-radius: 6px; background: var(--surface); position: relative; }
.box:hover { box-shadow: 2px 2px 0 var(--ink); }
.item-on .box { background: var(--lime); }
.item-on .box::after { content: ""; position: absolute; left: 5px; top: 0; width: 5px; height: 11px; border: solid #111; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); }
.item-text { flex: 1; min-width: 0; user-select: text; cursor: text; }
.item-on .item-text > .t, .item-on .item-text > b { color: var(--subtle); text-decoration: line-through; text-decoration-thickness: 1.5px; }
.item-text b { font-size: 15px; }
.item-text .detail { display: block; color: var(--muted); font-size: 14px; margin-top: 3px; }
.item-tools { flex: none; display: flex; gap: 4px; opacity: .55; }
.item:hover .item-tools, .item-tools:focus-within { opacity: 1; }
.icon-btn { width: 28px; height: 28px; display: grid; place-items: center; border: 2px solid transparent; border-radius: 8px; color: var(--text); }
.icon-btn:hover { border-color: var(--ink); background: var(--surface); box-shadow: 2px 2px 0 var(--ink); }
.icon-btn svg { width: 15px; height: 15px; }
.res-kind { display: inline-block; min-width: 58px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--subtle); }
.res-note { display: block; color: var(--muted); font-size: 13.5px; }
.suggested { margin-top: 12px; font-size: 13px; color: var(--muted); }
.pager { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 30px; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--ink); color: var(--page); padding: 8px 14px; border-radius: 10px; font-size: 13px; font-weight: 700; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 60; }
.toast-on { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 880px) {
  .shell { display: block; }
  .sidebar { position: static; height: auto; display: flex; gap: 6px; overflow-x: auto; border-right: 0; border-bottom: 2.5px solid var(--ink); padding: 10px 12px; }
  .nav { flex: none; margin: 0; }
  .nav-count, .nav-sep { display: none; }
  .main { padding: 22px 16px 60px; }
  .title { font-size: 1.7rem; }
  .header { flex-wrap: wrap; padding: 10px 14px; }
  .header-progress { order: 5; flex-basis: 100%; max-width: none; margin: 0; }
  .sync { margin-left: auto; }
  .mod-side { display: none; }
  .sec, .module-head { padding: 14px; }
  .item-tools { opacity: 1; }
}
