/* Bayplan website. The tokens are the app's own (frontend/src/index.css): neutral greys in
   both themes, Container Orange as a fill only, the dark topbar grey as the brand colour. */
:root {
  --canvas: #ffffff;
  --surface: #ffffff;
  --surface-raised: #ffffff;
  --surface-hover: #f3f4f6;
  --border: #e5e7eb;
  --border-strong: #d1d5db;
  --fg: #1f2937;
  --fg-muted: #5f6b7a;
  --fg-subtle: #6b7280;
  --sidebar: #eef0f5;
  --sidebar-hover: #dde0e8;
  --primary: #4b5563;
  --primary-hover: #374151;
  --primary-contrast: #ffffff;
  --accent: #e8682a;
  --topbar: #2f2f2f;
  --topbar-surface: rgb(255 255 255 / 8%);
  --topbar-text: #ececec;
  --topbar-muted: #b0b0b0;
  --topbar-border: #444444;
  --success: #1f7a4d; --success-soft: #e8f7ee;
  --warning: #b45309; --warning-soft: #fef3c7;
  --danger: #b91c1c;  --danger-soft: #fee2e2;
  --neutral-soft: #f3f4f6;
  --term-bg: #252526; --term-surface: #2f2f31; --term-border: #3f3f42; --term-fg: #e4e4e4; --term-muted: #a6a6a6; --term-prompt: #4ade80; --term-error: #f87171;
  --radius-md: 0.375rem; --radius-lg: 0.625rem;
  --shadow-lg: 0 10px 30px rgb(17 24 39 / 16%);
  --font-sans: "Inter", system-ui, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", Consolas, monospace;
  --page: 1120px;
  color-scheme: light;
}
.dark {
  --canvas: #161616; --surface: #1e1e1e; --surface-raised: #262626; --surface-hover: #2a2a2a;
  --border: #333333; --border-strong: #4a4a4a;
  --fg: #ececec; --fg-muted: #a3a3a3; --fg-subtle: #8a8a8a;
  --sidebar: #1a1a1a; --sidebar-hover: #2a2a2a;
  --primary: #d4d4d4; --primary-hover: #e5e5e5; --primary-contrast: #161616;
  --accent: #f08a55;
  --topbar: #1e1e1e; --topbar-surface: rgb(255 255 255 / 6%); --topbar-text: #ececec; --topbar-muted: #a3a3a3; --topbar-border: #333333;
  --success: #4ade80; --success-soft: rgb(74 222 128 / 15%);
  --warning: #fbbf24; --warning-soft: rgb(251 191 36 / 15%);
  --danger: #f87171;  --danger-soft: rgb(248 113 113 / 15%);
  --neutral-soft: rgb(163 163 163 / 12%);
  --shadow-lg: 0 10px 30px rgb(0 0 0 / 50%);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation: none !important; transition: none !important; } }
body { margin: 0; font-family: var(--font-sans); font-size: 16px; line-height: 1.55; color: var(--fg); background: var(--canvas); }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 2px; }
code, pre, kbd { font-family: var(--font-mono); font-size: 0.88em; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.015em; line-height: 1.15; text-wrap: balance; }
h2 { font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2rem); }
p { margin: 0; }
.wrap { width: min(var(--page), 100% - 2rem); margin-inline: auto; }
.wrap.wide { width: min(1240px, 100% - 2rem); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.logo-dark { display: none; } .dark .logo-dark { display: block; } .dark .logo-light { display: none; }

/* ---------- Header: the app's topbar, dark in both themes, lockup in white ---------- */
.site-header { position: sticky; top: 0; z-index: 10; background: var(--topbar); color: var(--topbar-text); border-bottom: 1px solid var(--topbar-border); }
.site-header .wrap { display: flex; align-items: center; gap: 1rem; height: 56px; }
.site-header :focus-visible { outline-color: var(--topbar-text); }
.brand { display: inline-flex; align-items: center; text-decoration: none; }
.brand img { height: 26px; width: auto; }
.site-header .logo-light { display: none; } .site-header .logo-dark { display: block; }
.site-nav { display: flex; gap: 0.25rem; font-size: 0.9rem; }
.site-nav a { text-decoration: none; color: var(--topbar-muted); padding: 0.4rem 0.6rem; border-radius: var(--radius-md); }
.site-nav a:hover { color: var(--topbar-text); background: var(--topbar-surface); }
.controls { margin-left: auto; display: flex; align-items: center; gap: 0.35rem; }
.lang select { font: inherit; font-size: 0.85rem; color: var(--topbar-text); background: var(--topbar); border: 1px solid var(--topbar-border); border-radius: var(--radius-md); padding: 0.35rem 0.5rem; cursor: pointer; }
.lang select:hover { background: var(--topbar-surface); }
.theme { width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; background: none; border: 0; border-radius: var(--radius-md); color: var(--topbar-muted); cursor: pointer; }
.theme:hover { background: var(--topbar-surface); color: var(--topbar-text); }
.theme svg { width: 16px; height: 16px; }
.theme .moon { display: none; } .dark .theme .moon { display: block; } .dark .theme .sun { display: none; }
.site-header .btn.ghost { color: var(--topbar-text); border-color: var(--topbar-border); padding: 0.4rem 0.75rem; font-size: 0.9rem; }
.site-header .btn.ghost:hover { background: var(--topbar-surface); border-color: var(--topbar-border); }

.btn { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.55rem 1rem; border-radius: var(--radius-md); font: inherit; font-weight: 500; font-size: 0.95rem; text-decoration: none; cursor: pointer; border: 1px solid var(--primary); background: var(--primary); color: var(--primary-contrast); transition: background-color 120ms ease; }
.btn:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn.ghost { background: transparent; color: var(--fg); border-color: var(--border-strong); }
.btn.ghost:hover { background: var(--surface-hover); }
.btn svg { width: 16px; height: 16px; }

/* ---------- Hero ---------- */
.hero { padding: clamp(3rem, 6vw, 5.5rem) 0 clamp(2rem, 4vw, 3rem); text-align: center; }
.hero h1 { font-size: clamp(2rem, 1.3rem + 2.2vw, 2.9rem); letter-spacing: -0.025em; line-height: 1.1; }
.hero .lede { margin: 1.1rem auto 0; font-size: 1.1rem; color: var(--fg-muted); max-width: 58ch; }
.hero .actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.8rem; }

/* ---------- Sections ---------- */
.section { padding: clamp(2.5rem, 5vw, 4.5rem) 0; border-top: 1px solid var(--border); }
.section .lede { color: var(--fg-muted); margin-top: 0.6rem; max-width: 64ch; }
.hint { margin-top: 0.8rem; font-size: 0.85rem; color: var(--fg-subtle); text-align: center; }

/* ---------- Explorer: a replica of the app shell ---------- */
.shell { margin-top: 1.8rem; border: 1px solid var(--border-strong); border-radius: var(--radius-lg); overflow: hidden; background: var(--surface); box-shadow: var(--shadow-lg); font-size: 14px; }
.shell-top { background: var(--topbar); color: var(--topbar-text); display: flex; align-items: center; gap: 0.9rem; padding: 0 1rem; height: 46px; }
.shell-top img { height: 20px; }
.pick { display: inline-flex; align-items: center; gap: 0.4rem; background: var(--topbar-surface); border-radius: 4px; padding: 0.25rem 0.6rem; font-size: 13px; white-space: nowrap; }
.pick small { color: var(--topbar-muted); }
.shell-top .right { margin-left: auto; display: flex; align-items: center; gap: 0.8rem; color: var(--topbar-muted); font-size: 12px; }
.shell-top kbd { border: 1px solid #555; border-radius: 3px; padding: 0 0.35rem; font-size: 11px; }
.avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--topbar-surface); color: var(--topbar-text); display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; }
.shell-body { display: grid; grid-template-columns: 230px minmax(0, 1fr); min-height: 560px; }
.shell-side { background: var(--sidebar); border-right: 1px solid var(--border); padding: 0.75rem 0; display: flex; flex-direction: column; min-height: 0; }
.side-search { margin: 0 0.75rem 0.5rem; padding: 0.4rem 0.6rem; font: inherit; font-size: 13px; color: var(--fg); background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-md); }
.side-nav { overflow-y: auto; max-height: 560px; }
.side-nav .grp { padding: 0.7rem 1rem 0.25rem; font-size: 11px; font-weight: 500; color: var(--fg-subtle); }
.side-nav .it { display: block; width: 100%; text-align: left; padding: 0.33rem 1rem 0.33rem calc(1rem - 3px); border: 0; border-left: 3px solid transparent; background: none; font: inherit; font-size: 13.5px; color: var(--fg-muted); cursor: pointer; }
.side-nav .it:hover { background: var(--sidebar-hover); color: var(--fg); }
.side-nav .it[aria-current="true"] { border-left-color: var(--accent); color: var(--fg); background: var(--sidebar-hover); font-weight: 500; }
.side-empty { padding: 0.5rem 1rem; font-size: 13px; color: var(--fg-subtle); }
.shell-main { padding: 1rem 1.25rem 1.25rem; min-width: 0; display: flex; flex-direction: column; }
.shell-main.swap > * { animation: fade 180ms ease-out; }
@keyframes fade { from { opacity: 0; transform: translateY(3px); } }
.crumb { font-size: 12px; color: var(--fg-subtle); }
.f-title { font-size: 20px; margin: 0.2rem 0 0.4rem; }
.f-desc { color: var(--fg-muted); max-width: 72ch; }
.f-mock { margin: 1rem 0; }
.f-bullets { margin: 0 0 1rem; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.6rem 1.2rem; font-size: 13.5px; color: var(--fg-muted); }
.f-bullets li { padding-left: 0.9rem; position: relative; }
.f-bullets li::before { content: ""; position: absolute; left: 0; top: 0.5em; width: 6px; height: 6px; border-radius: 1px; background: var(--accent); }
.f-nav { margin-top: auto; display: flex; align-items: center; gap: 0.6rem; font-size: 12px; color: var(--fg-subtle); }
.f-nav button { width: 30px; height: 30px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--fg); border-radius: var(--radius-md); cursor: pointer; font: inherit; }
.f-nav button:hover { background: var(--surface-hover); }

/* mock pieces */
.mock { border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); overflow: hidden; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-weight: 500; color: var(--fg-subtle); font-size: 11.5px; padding: 0.45rem 0.7rem; border-bottom: 1px solid var(--border); background: var(--surface-hover); white-space: nowrap; }
.tbl td { padding: 0.45rem 0.7rem; border-bottom: 1px solid var(--border); white-space: nowrap; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl td.mono { font-family: var(--font-mono); font-size: 12px; }
.chip { display: inline-block; padding: 0.05rem 0.5rem; border-radius: 999px; font-size: 11.5px; font-weight: 500; }
.chip.danger { background: var(--danger-soft); color: var(--danger); }
.chip.warning { background: var(--warning-soft); color: var(--warning); }
.chip.success { background: var(--success-soft); color: var(--success); }
.chip.neutral { background: var(--neutral-soft); color: var(--fg-muted); }
.counters { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.6rem; padding: 0.8rem; border-bottom: 1px solid var(--border); }
.counters div { border: 1px solid var(--border); border-radius: var(--radius-md); padding: 0.5rem 0.7rem; background: var(--surface-raised); }
.counters b { display: block; font-size: 18px; font-weight: 600; }
.counters span { color: var(--fg-subtle); font-size: 11px; }
.tm { margin: 0; padding: 0.9rem 1rem; background: var(--term-bg); color: var(--term-fg); font-size: 12.5px; line-height: 1.6; overflow-x: auto; }
.tm .p { color: var(--term-prompt); } .tm .c { color: var(--term-muted); } .tm .e { color: var(--term-error); }
.bar-ok { padding: 0.45rem 0.8rem; font-size: 12.5px; background: var(--success-soft); color: var(--success); border-top: 1px solid var(--border); }
.bars { padding: 0.9rem; display: grid; gap: 0.7rem; border-bottom: 1px solid var(--border); }
.bar { display: grid; grid-template-columns: 70px 1fr auto; align-items: center; gap: 0.8rem; font-size: 12.5px; }
.bar .track { position: relative; height: 10px; background: var(--neutral-soft); border-radius: 999px; overflow: hidden; }
.bar .res { position: absolute; inset: 0 auto 0 0; background: var(--border-strong); }
.bar .use { position: absolute; inset: 0 auto 0 0; background: var(--primary); }
.bar .val { color: var(--fg-subtle); white-space: nowrap; }
.obj { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; padding: 0.7rem 0.8rem; border-bottom: 1px solid var(--border); }
.obj code { font-size: 13px; }
.btns { margin-left: auto; display: flex; flex-wrap: wrap; gap: 0.35rem; }
.mbtn { font: inherit; font-size: 12.5px; padding: 0.3rem 0.6rem; border-radius: var(--radius-md); border: 1px solid var(--border-strong); background: var(--surface); color: var(--fg); }
.mbtn.danger { color: var(--danger); border-color: var(--danger); }
.form { margin: 0; padding: 0.8rem 1rem; display: grid; grid-template-columns: max-content 1fr; gap: 0.5rem 1.2rem; font-size: 13px; border-bottom: 1px solid var(--border); }
.form dt { color: var(--fg-subtle); } .form dd { margin: 0; font-family: var(--font-mono); font-size: 12.5px; overflow-wrap: anywhere; }
.form:last-child { border-bottom: 0; }
.palette { padding: 0.6rem; }
.pal-input { padding: 0.5rem 0.7rem; border: 1px solid var(--border-strong); border-radius: var(--radius-md); font-family: var(--font-mono); font-size: 13px; margin-bottom: 0.4rem; }
.pal-input .p { color: var(--fg-subtle); margin-right: 0.4rem; }
.pal-group { padding: 0.5rem 0.7rem 0.15rem; font-size: 11px; color: var(--fg-subtle); }
.pal-item { padding: 0.3rem 0.7rem; font-size: 13px; border-radius: var(--radius-md); }
.pal-item:first-of-type { background: var(--surface-hover); }
.explain { padding: 0.9rem 1rem; }
.explain .obj { padding: 0 0 0.6rem; border: 0; display: inline-block; }
.explain p { font-size: 13.5px; margin-top: 0.5rem; max-width: 70ch; }
.explain .sent { margin-top: 0.8rem; display: flex; flex-wrap: wrap; gap: 0.3rem; }
.graph { padding: 0.5rem; }
.graph svg { width: 100%; height: auto; }
.graph .edges path { fill: none; stroke: var(--border-strong); stroke-width: 1.5; marker-end: url(#ar); }
.graph .ar { fill: var(--border-strong); }
.graph .node rect { fill: var(--surface-raised); stroke: var(--border-strong); stroke-width: 1.5; }
.graph .node text { font-size: 11px; text-anchor: middle; fill: var(--fg); font-weight: 500; }
.graph .node text.sub { font-size: 9.5px; fill: var(--fg-subtle); font-family: var(--font-mono); font-weight: 400; }
.graph .node.warn rect { stroke: var(--warning); } .graph .node.bad rect { stroke: var(--danger); }

/* ---------- Install ---------- */
.tabs { display: flex; gap: 0.25rem; border-bottom: 1px solid var(--border); margin: 1.5rem 0 1.2rem; }
.tab { background: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; padding: 0.6rem 0.9rem; font: inherit; font-weight: 500; color: var(--fg-muted); cursor: pointer; }
.tab[aria-selected="true"] { color: var(--fg); border-bottom-color: var(--accent); }
.tab:hover { color: var(--fg); }
.panel[hidden] { display: none; }
.panel p { color: var(--fg-muted); margin-bottom: 1rem; }
.term { position: relative; background: var(--term-bg); color: var(--term-fg); border-radius: var(--radius-lg); padding: 1.1rem 1.3rem; overflow-x: auto; }
.term pre { margin: 0; font-size: 0.85rem; line-height: 1.6; }
.term .c { color: var(--term-muted); } .term .p { color: var(--term-prompt); user-select: none; }
.copy { position: absolute; top: 0.65rem; right: 0.65rem; background: var(--term-surface); border: 1px solid var(--term-border); color: var(--term-fg); border-radius: 4px; font: inherit; font-size: 0.78rem; padding: 0.25rem 0.55rem; cursor: pointer; }
.copy:hover { background: rgb(255 255 255 / 14%); }
.notes { margin-top: 1.4rem; font-size: 0.95rem; color: var(--fg-muted); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); padding: 2rem 0; font-size: 0.88rem; color: var(--fg-muted); }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 1rem 2.5rem; align-items: center; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 1.2rem; }
.site-footer nav a { text-decoration: none; }
.langs-footer { width: 100%; gap: 0.3rem 1rem; font-size: 0.82rem; }
.langs-footer a { color: var(--fg-subtle); }
.langs-footer a[aria-current="page"] { color: var(--fg); font-weight: 500; }
.site-footer .legal { margin-left: auto; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .shell-body { grid-template-columns: 200px minmax(0, 1fr); }
  .f-bullets { grid-template-columns: 1fr 1fr; }
  .counters { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 720px) {
  .site-nav, .gh span { display: none; }
  .shell-body { grid-template-columns: 1fr; min-height: 0; }
  .shell-side { border-right: 0; border-bottom: 1px solid var(--border); padding: 0.6rem 0; }
  .side-nav { max-height: 180px; }
  .shell-top .pick.ns, .shell-top kbd { display: none; }
  .f-bullets { grid-template-columns: 1fr; }
  .counters { grid-template-columns: 1fr 1fr; }
  .mock { overflow-x: auto; }
  .tbl { min-width: 520px; }
  .form { grid-template-columns: 1fr; gap: 0.1rem 0; } .form dd { margin-bottom: 0.5rem; }
  .site-footer .legal { margin-left: 0; }
}
