/* Shared styles for Billriz Condor's project demos */
:root {
  --bg: #f5f7fa;
  --surface: #ffffff;
  --ink: #0b1b2e;
  --muted: #4a5a6e;
  --faint: #8391a3;
  --line: #dde3ea;
  --grid: #e9edf2;
  --accent: #0a4a8f;
  --accent-soft: #eaf1fa;
  --warm: #0a4a8f;
  --band: #0b1f3a;
  --band-ink: #ffffff;
  --band-muted: #b6c3d6;
  --band-accent: #7fb2ff;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05);
  /* chart series: validated categorical order (light) */
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100;
  --s5: #e87ba4; --s6: #008300; --s7: #4a3aa7; --s8: #e34948;
  --seq-lo: #cde2fb; --seq-hi: #104281;
  --code-bg: #f3f6f9; --code-kw: #7a3ec8; --code-str: #1a7f4b; --code-com: #7d8a99; --code-num: #b5530f; --code-fn: #0a4a8f;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a111c; --surface: #111a27; --ink: #e6ebf2; --muted: #9aa8ba; --faint: #6f7d90;
    --line: #223044; --grid: #1a2535; --accent: #6aa8f0; --accent-soft: #14233a; --warm: #6aa8f0;
    --band: #0d1a2e; --band-muted: #9fb0c8;
    --shadow: none;
    --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500;
    --s5: #d55181; --s6: #008300; --s7: #9085e9; --s8: #e66767;
    --seq-lo: #1a2940; --seq-hi: #86b6ef;
    --code-bg: #0c1420; --code-kw: #c4a5ff; --code-str: #8fd6ae; --code-com: #6f7d90; --code-num: #f0a868; --code-fn: #86b6ef;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0a111c; --surface: #111a27; --ink: #e6ebf2; --muted: #9aa8ba; --faint: #6f7d90;
  --line: #223044; --grid: #1a2535; --accent: #6aa8f0; --accent-soft: #14233a; --warm: #6aa8f0;
  --band: #0d1a2e; --band-muted: #9fb0c8;
  --shadow: none;
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500;
  --s5: #d55181; --s6: #008300; --s7: #9085e9; --s8: #e66767;
  --seq-lo: #1a2940; --seq-hi: #86b6ef;
  --code-bg: #0c1420; --code-kw: #c4a5ff; --code-str: #8fd6ae; --code-com: #6f7d90; --code-num: #f0a868; --code-fn: #86b6ef;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 16px/1.6 "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
h1, h2, h3 { font-family: inherit; font-weight: 600; line-height: 1.2; margin: 0; letter-spacing: -.015em; }

/* top bar (sits on the navy band) */
.topbar { position: sticky; top: 0; z-index: 10; background: var(--band); border-bottom: 1px solid rgba(255,255,255,.08); }
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; height: 58px; gap: 12px; }
.topbar a { color: #c9d4e3; text-decoration: none; font-size: 14px; font-weight: 500; }
.topbar a:hover { color: #fff; }
.topbar .right { display: flex; align-items: center; gap: 20px; }
.theme-btn { background: none; border: 1px solid rgba(255,255,255,.22); color: #c9d4e3; border-radius: 6px; width: 32px; height: 32px; cursor: pointer; }
.theme-btn:hover { color: #fff; border-color: rgba(255,255,255,.4); }

/* hero band */
.hero-band { background: var(--band); color: var(--band-ink); }
.hero { padding-top: 56px; padding-bottom: 88px; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin: 0 0 14px; }
.hero-band .eyebrow { color: var(--band-accent); }
.hero h1 { font-size: clamp(30px, 4.4vw, 46px); max-width: 22ch; font-weight: 600; }
.hero .lede { font-size: clamp(16px, 1.8vw, 18px); color: var(--band-muted); max-width: 66ch; margin: 18px 0 22px; }
.hero .lede b { color: #fff; font-weight: 600; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 22px; font-size: 14px; color: var(--band-muted); }
.meta b { color: #fff; font-weight: 600; }
.btns { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 10px 18px; border-radius: 6px; font-weight: 500; font-size: 14px; text-decoration: none; border: 1px solid var(--line); color: var(--ink); background: var(--surface); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.hero-band .btn { background: transparent; color: #fff; border-color: rgba(255,255,255,.3); }
.hero-band .btn:hover { border-color: rgba(255,255,255,.6); }
.hero-band .btn.primary { background: #fff; color: #0b1f3a; border-color: #fff; }

/* stat tiles (overlap the band) */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0; margin: -44px 0 0; position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgba(11, 31, 58, .08); overflow: hidden; }
.stat { background: var(--surface); padding: 20px 22px; border-right: 1px solid var(--line); }
.stat:last-child { border-right: 0; }
.stat .label { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.stat .value { font-size: 28px; font-weight: 600; letter-spacing: -.02em; line-height: 1.2; margin-top: 6px; }
.stat .sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
/* stat tiles used inside cards */
.card .stat, .kv .stat, .profile .stat { border: 1px solid var(--line); border-radius: 6px; }

/* sections */
section { padding: 48px 0 8px; }
.sec-head { margin-bottom: 20px; }
.sec-head h2 { font-size: clamp(22px, 2.8vw, 28px); }
.sec-head p { color: var(--muted); margin: 8px 0 0; max-width: 72ch; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 24px; box-shadow: var(--shadow); }
.card + .card { margin-top: 18px; }
.card h3 { font-size: 16px; font-weight: 600; letter-spacing: 0; }
.card .note { font-size: 13px; color: var(--muted); margin: 4px 0 0; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 18px; }
.grid2 .card + .card { margin-top: 0; }
.chart-box { position: relative; height: 320px; margin-top: 14px; }
.chart-box.tall { height: 400px; }
.chart-box.short { height: 240px; }

/* controls */
.controls { display: flex; flex-wrap: wrap; gap: 14px 22px; align-items: end; margin-top: 12px; }
.control { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); min-width: 180px; flex: 1; }
.control output { color: var(--ink); font-weight: 600; font-size: 14px; }
.control input[type=range] { width: 100%; accent-color: var(--accent); }
select { font: inherit; font-size: 14px; padding: 8px 10px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.seg button { font: inherit; font-size: 13px; padding: 7px 14px; border: 0; background: var(--surface); color: var(--muted); cursor: pointer; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button[aria-pressed="true"] { background: var(--accent); color: #fff; font-weight: 600; }

/* legend */
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--muted); margin-top: 10px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }

/* findings */
.findings { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.finding { background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--accent); border-radius: 6px; padding: 16px 18px; }
.finding b { display: block; margin-bottom: 4px; }
.finding span { color: var(--muted); font-size: 14.5px; }

/* tables */
.table-wrap { overflow-x: auto; margin-top: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; font-size: 12px; letter-spacing: .03em; text-transform: uppercase; background: var(--bg); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
details { margin-top: 12px; font-size: 14px; }
details summary { cursor: pointer; color: var(--accent); font-weight: 500; }

/* code */
.code { background: var(--code-bg); border: 1px solid var(--line); border-radius: 6px; overflow: auto; max-height: 520px; margin-top: 14px; }
.code pre { margin: 0; padding: 16px 18px; font: 13px/1.6 "IBM Plex Mono", ui-monospace, SFMono-Regular, Consolas, monospace; color: var(--ink); }
.code .kw { color: var(--code-kw); } .code .str { color: var(--code-str); } .code .com { color: var(--code-com); font-style: italic; }
.code .num { color: var(--code-num); } .code .fn { color: var(--code-fn); }
.code-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 14px; }
.code-head code { font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 13px; background: var(--accent-soft); padding: 3px 8px; border-radius: 4px; }

footer { padding: 32px 0 44px; color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); margin-top: 48px; background: var(--surface); }
footer p { margin: 4px 0; }

@media (max-width: 560px) {
  .wrap { padding: 0 16px; }
  .hero { padding-top: 36px; padding-bottom: 72px; }
  .card { padding: 16px; }
  .chart-box { height: 280px; }
  .topbar .hide-sm { display: none; }
  .stat { border-right: 0; border-bottom: 1px solid var(--line); }
  .stat:last-child { border-bottom: 0; }
  .stat .value { font-size: 24px; }
  .flow .arrow { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
