/* The LeanUI site (examples/Site.lean). */
:root {
  --bg: #fbfbfd; --surface: #ffffff; --ink: #17181c; --muted: #5d6270; --line: #e4e6eb;
  --accent: #3c5bd8; --accent-ink: #ffffff; --accent-soft: #e9edfc; --code: #f4f5f8;
  --leanui: #3c5bd8; --vanilla: #b9bfcc; --warn: #b5402e;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111317; --surface: #181b21; --ink: #e9ebf0; --muted: #9aa1ae; --line: #2a2f38;
    --accent: #8ea4ff; --accent-ink: #0d1020; --accent-soft: #1f2640; --code: #1d2027;
    --leanui: #8ea4ff; --vanilla: #4b5263; --warn: #ef8a78;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.9em; }
.site { min-height: 100vh; display: flex; flex-direction: column; }
.site > main { flex: 1; width: 100%; max-width: 1040px; margin: 0 auto; padding: 24px 16px 56px; }

/* header */
.site-header { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px max(16px, calc((100% - 1040px) / 2 + 16px)); background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.brand { font-size: 20px; font-weight: 650; letter-spacing: -0.02em; color: var(--ink); text-decoration: none; }
.brand b { color: var(--accent); font-weight: 750; }
.site-header nav { display: flex; gap: 4px; flex-wrap: wrap; }
.site-header nav a { padding: 6px 12px; border-radius: 999px; color: var(--muted); text-decoration: none; font-size: 15px; }
.site-header nav a:hover { color: var(--ink); background: var(--code); }
.site-header nav a.active { color: var(--ink); background: var(--accent-soft); }
.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; text-align: center; padding: 18px 16px; }
.site-footer p { margin: 0; }

/* home */
.hero { padding: 40px 0 24px; max-width: 760px; }
.hero h1 { font-size: clamp(34px, 6vw, 56px); line-height: 1.08; letter-spacing: -0.03em; margin: 0 0 16px; }
.lead { font-size: 19px; color: var(--muted); margin: 0 0 24px; }
.cta { display: flex; gap: 10px; flex-wrap: wrap; }
.button { display: inline-block; padding: 10px 18px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none; font-weight: 550; }
.button:hover { border-color: var(--accent); }
.button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.try { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 20px; margin: 24px 0 40px; align-items: stretch; }
@media (max-width: 760px) { .try { grid-template-columns: 1fr; } }
.code pre { margin: 0; height: 100%; padding: 18px; background: var(--code); border: 1px solid var(--line); border-radius: 14px; overflow-x: auto; line-height: 1.5; }
.live { padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.caption { margin: 0 0 8px; color: var(--muted); font-size: 14px; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.feature { padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.feature h3 { margin: 0 0 6px; font-size: 17px; }
.feature p { margin: 0; color: var(--muted); font-size: 15px; }

/* the counter example (examples/Counter.lean) */
main.counter h1 { font-size: 18px; margin: 0 0 10px; letter-spacing: 0; }
.counter p { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 8px 0; }
.counter button { font: inherit; min-width: 40px; padding: 6px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--code); color: var(--ink); cursor: pointer; }
.counter button:hover { border-color: var(--accent); }
.counter output { display: inline-block; min-width: 3ch; text-align: center; font-size: 22px; font-weight: 650; font-variant-numeric: tabular-nums; }
.counter output.neg { color: var(--warn); }
.counter input { font: inherit; width: 8em; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); }

/* examples */
.examples h1, .benchmarks h1, .not-found h1 { font-size: 34px; letter-spacing: -0.02em; margin: 8px 0 16px; }
.example { margin: 0 0 32px; padding: 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.example h2 { margin: 0 0 6px; font-size: 22px; }
.example > p { color: var(--muted); margin: 0 0 14px; max-width: 70ch; }

/* benchmarks */
.benchmarks > p, .benchmarks > div > p { max-width: 75ch; color: var(--muted); }
.legend { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.swatch { display: inline-block; width: 14px; height: 14px; border-radius: 3px; }
.swatch.leanui { background: var(--leanui); } .swatch.vanilla { background: var(--vanilla); margin-left: 12px; }
.chart { width: 100%; height: auto; max-width: 840px; display: block; margin: 8px 0 24px; }
.chart .label { font-size: 13px; fill: var(--ink); }
.chart .value { font-size: 11px; fill: var(--ink); }
.chart .value.muted { fill: var(--muted); }
.chart .bar-leanui { fill: var(--leanui); } .chart .bar-vanilla { fill: var(--vanilla); }
.ratios { border-collapse: collapse; width: 100%; max-width: 840px; font-size: 14px; font-variant-numeric: tabular-nums; }
.ratios th, .ratios td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--line); }
.ratios th { color: var(--muted); font-weight: 600; }
.note { font-size: 13px; }
.loading { color: var(--muted); }
.error { color: var(--warn); }

/* TodoMVC, scoped to its example (examples/todomvc.html has the standalone page) */
.todo-demo { --t-card: var(--surface); --t-line: var(--line); --t-muted: var(--muted); --t-accent: #b83f45; --t-done: #b5b5b5; --t-ok: #3a9e6e; max-width: 550px; margin: 0 auto; }
.todo-demo button { margin: 0; padding: 0; border: 0; background: none; font: inherit; color: inherit; cursor: pointer; }
.todo-demo .todoapp { background: var(--t-card); margin: 90px 0 24px; position: relative; box-shadow: 0 2px 4px rgba(0,0,0,.15), 0 20px 40px rgba(0,0,0,.08); border-radius: 6px; }
.todo-demo .todoapp h1 { position: absolute; top: -78px; width: 100%; margin: 0; text-align: center; font-size: 56px; font-weight: 200; color: var(--t-accent); opacity: .85; }
.todo-demo .new-todo, .todo-demo .edit { width: 100%; font: inherit; font-size: 20px; color: inherit; border: 0; outline: none; background: transparent; }
.todo-demo .new-todo { padding: 14px 16px 14px 56px; height: 58px; }
.todo-demo .new-todo::placeholder { font-style: italic; color: var(--t-muted); }
.todo-demo .main { position: relative; border-top: 1px solid var(--t-line); }
.todo-demo .toggle-all { position: absolute; opacity: 0; width: 1px; height: 1px; }
.todo-demo .toggle-all + label { position: absolute; top: -58px; left: 0; width: 50px; height: 58px; display: flex; align-items: center; justify-content: center; font-size: 0; cursor: pointer; }
.todo-demo .toggle-all + label::before { content: "❯"; font-size: 20px; color: var(--t-muted); transform: rotate(90deg); }
.todo-demo .toggle-all:checked + label::before { color: var(--ink); }
.todo-demo .todo-list { margin: 0; padding: 0; list-style: none; }
.todo-demo .todo-list li { position: relative; font-size: 20px; border-bottom: 1px solid var(--t-line); }
.todo-demo .todo-list li .view { display: flex; align-items: center; }
.todo-demo .todo-list li .toggle { appearance: none; -webkit-appearance: none; width: 26px; height: 26px; margin: 0 12px 0 13px; border: 1px solid var(--t-done); border-radius: 50%; flex: none; cursor: pointer; }
.todo-demo .todo-list li .toggle:checked { border-color: var(--t-ok); background: radial-gradient(circle, var(--t-ok) 0 4px, transparent 5px); }
.todo-demo .todo-list li label { flex: 1; padding: 13px 13px 13px 4px; word-break: break-all; }
.todo-demo .todo-list li.completed label { color: var(--t-done); text-decoration: line-through; }
.todo-demo .todo-list li .destroy { width: 36px; height: 36px; margin-right: 8px; font-size: 26px; color: var(--t-accent); opacity: 0; }
.todo-demo .todo-list li .destroy::after { content: "×"; }
.todo-demo .todo-list li:hover .destroy, .todo-demo .todo-list li .destroy:focus { opacity: .8; }
.todo-demo .todo-list li.editing .view { display: none; }
.todo-demo .todo-list li .edit { display: block; padding: 10px 14px; margin-left: 40px; width: calc(100% - 40px); border: 1px solid var(--t-muted); }
.todo-demo .footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; padding: 10px 15px; color: var(--t-muted); font-size: 14px; border-top: 1px solid var(--t-line); }
.todo-demo .filters { display: flex; gap: 4px; margin: 0; padding: 0; list-style: none; }
.todo-demo .filters a { color: inherit; text-decoration: none; padding: 3px 7px; border: 1px solid transparent; border-radius: 3px; }
.todo-demo .filters a.selected { border-color: var(--t-accent); color: var(--ink); }
.todo-demo .info { color: var(--t-muted); font-size: 11px; text-align: center; }
.todo-demo .info p { margin: 3px 0; }
