/* Design tokens */
:root {
    --bg: #f5f7fa; --surface: #fff; --text: #1b2330; --muted: #5a6575;
    --line: #dde3ec; --accent: #1f6feb; --accent-soft: #e6f0ff;
    --req: #d9480f; --res: #2b8a3e; --code-bg: #eef1f6;
    --radius: 12px; --font: "Segoe UI", system-ui, -apple-system, sans-serif;
    --mono: ui-monospace, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
    :root { --bg: #11161d; --surface: #1a212b; --text: #e8edf4; --muted: #9aa6b6;
        --line: #2b3441; --accent: #5aa2ff; --accent-soft: #1d2b42; --code-bg: #232c38;
        --req: #ff9966; --res: #6fcf84; }
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 70px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; animation: none !important; } }
body { margin: 0; font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.6; }
a { color: var(--accent); }
code { font-family: var(--mono); background: var(--code-bg); padding: 1px 6px; border-radius: 4px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
h1 { font-size: clamp(2.2rem, 6vw, 3.6rem); margin: 0 0 8px; letter-spacing: -0.02em; }
h2 { font-size: 1.8rem; margin: 0 0 12px; }
h3 { margin: 0 0 10px; }
p { max-width: 70ch; }

/* Navigation */
.nav { position: sticky; top: 0; z-index: 10; display: flex; flex-wrap: wrap; align-items: center;
    justify-content: space-between; gap: 8px; padding: 10px 24px; background: var(--surface); border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; text-decoration: none; color: var(--text); }
.nav nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav nav a { padding: 6px 10px; border-radius: 8px; text-decoration: none; color: var(--muted); font-size: 0.92rem; }
.nav nav a:hover { background: var(--accent-soft); color: var(--accent); }
.menu-btn { display: none; font-size: 1.4rem; background: none; border: 1px solid var(--line); color: var(--text); border-radius: 8px; padding: 2px 10px; cursor: pointer; }
@media (max-width: 800px) {
    .menu-btn { display: block; }
    .nav nav { display: none; width: 100%; flex-direction: column; }
    .nav nav.open { display: flex; }
}

/* Layout */
main { max-width: 960px; margin: auto; padding: 0 20px; }
.section { padding: 48px 0 8px; }
.hero { text-align: center; padding: 64px 0 24px; }
.subtitle { color: var(--muted); font-size: 1.2rem; margin: 0 auto 28px; }
.muted { color: var(--muted); }
.footer { text-align: center; color: var(--muted); padding: 40px 20px; }

/* Hero flow */
.flow-line { list-style: none; display: inline-flex; flex-direction: column; align-items: center; padding: 0; margin: 0 0 28px; gap: 2px; font-weight: 600; }
.flow-line .arrow { color: var(--muted); line-height: 1; }
.flow-line .tag { font-size: 0.8rem; padding: 2px 12px; border-radius: 99px; }
.req { color: var(--req); border: 1px solid var(--req); }
.res { color: var(--res); border: 1px solid var(--res); }

/* Components */
.btn, button { font: inherit; padding: 12px 20px; border: none; border-radius: 8px; background: var(--accent); color: #fff; cursor: pointer; text-decoration: none; display: inline-block; transition: transform .15s, opacity .15s; }
.btn:hover, button:hover { opacity: .88; transform: translateY(-1px); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 12px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin: 16px 0; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.mini { background: var(--surface); border-left: 4px solid var(--accent); padding: 12px 14px; border-radius: 6px; }
.badge { font-size: 0.75rem; background: var(--res); color: #fff; padding: 3px 10px; border-radius: 99px; vertical-align: middle; }
label { display: block; font-weight: 600; margin-bottom: 8px; }
input { font: inherit; padding: 12px; width: 220px; max-width: 100%; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); }
.inline-form button { margin-left: 8px; }
.quick { margin-top: 12px; display: flex; gap: 6px; flex-wrap: wrap; }
.quick button, .tabs button { background: var(--accent-soft); color: var(--accent); padding: 6px 12px; font-size: 0.9rem; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 12px 0; }
.tabs button.active { background: var(--accent); color: #fff; }
.error { color: #c92a2a; font-weight: 600; margin: 10px 0 0; }
details { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; margin: 10px 0; }
summary { cursor: pointer; font-weight: 600; }

/* Playground */
.code-box { background: var(--code-bg); padding: 16px; border-radius: 8px; font-family: var(--mono); overflow-wrap: anywhere; }
.code-box img { max-width: 100%; height: auto; border-radius: 8px; margin-top: 10px; }
.server { background: var(--accent-soft); color: var(--accent); font-weight: 700; padding: 16px; border-radius: 8px; text-align: center; }
.down { text-align: center; color: var(--muted); font-size: 1.4rem; line-height: 1; margin: 2px 0 8px; }
dl { margin: 0; } dt { font-weight: 700; font-family: var(--mono); margin-top: 10px; } dd { margin: 2px 0 0; color: var(--muted); }

/* Visualizer + restaurant flow */
.row-flow { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 16px 0; }
.step { background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius); padding: 14px 18px; text-align: center; display: flex; flex-direction: column; transition: border-color .3s, background .3s; }
.step small { color: var(--muted); }
.row-flow > span { color: var(--muted); font-weight: 700; transition: color .3s; }
.step.on { border-color: var(--accent); background: var(--accent-soft); }
.vz-arrow.on { color: var(--accent); }

/* Status explorer */
.code-card { text-align: left; background: var(--surface); color: var(--text); border: 1px solid var(--line); }
.code-card b { font-size: 1.4rem; display: block; }
.c1 { border-top: 4px solid #6c757d; } .c2 { border-top: 4px solid var(--res); }
.c3 { border-top: 4px solid #e8a317; } .c4 { border-top: 4px solid var(--req); } .c5 { border-top: 4px solid #c92a2a; }
.detail p { margin: 6px 0; }

/* JSON */
.json { background: #0f1722; color: #dbe4f0; padding: 18px; border-radius: var(--radius); font-family: var(--mono); overflow-x: auto; }
.json .k { color: #7cc4ff; } .json .s { color: #9be08a; } .json .n { color: #ffb86b; } .json .p { color: #aab6c5; }
p .k { color: var(--accent); font-weight: 700; } p .s { color: var(--res); font-weight: 700; } p .n { color: var(--req); font-weight: 700; }

/* Roadmap */
.roadmap { list-style: none; padding: 0; display: grid; gap: 8px; }
.roadmap li { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 12px 16px; display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.roadmap li.here { border-color: var(--res); background: var(--accent-soft); }
