:root {
  --paper: #faf8f3;
  --card: #ffffff;
  --ink: #1f2328;
  --muted: #5d6470;
  --line: #e4e0d6;
  --accent: #0f766e;
  --accent-soft: #e3f2ef;
  --easy: #2e9d5b;
  --mid: #d99a1a;
  --adv: #d2483f;
  --code-bg: #f0ede4;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Hiragino Sans", "PingFang SC", "Malgun Gothic", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --wrap: 1080px;
  --gutter: clamp(16px, 4vw, 40px);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #15171a;
    --card: #1e2125;
    --ink: #eceae4;
    --muted: #a3a9b3;
    --line: #2f343a;
    --accent: #4fd1c0;
    --accent-soft: #173431;
    --code-bg: #262a2f;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.65 var(--body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: var(--accent); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 3px; }
code { font: 400 0.88em var(--mono); background: var(--code-bg); padding: 0.1em 0.35em; border-radius: 4px; overflow-wrap: anywhere; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 0.5em; text-wrap: balance; word-break: auto-phrase; }

.skip { position: absolute; left: -9999px; top: 8px; background: var(--accent); color: #fff; padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* header */
.top {
  max-width: var(--wrap); margin: 0 auto; padding: 18px var(--gutter);
  display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; font-weight: 700; font-size: 18px; }
.top nav { display: flex; align-items: center; gap: 8px 18px; flex-wrap: wrap; font-size: 15px; }
.top nav a { color: var(--muted); text-decoration: none; }
.top nav a:hover { color: var(--ink); }
.lang select { background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; font: inherit; font-size: 14px; }

/* sections */
main > section { max-width: var(--wrap); margin: 0 auto; padding: clamp(40px, 7vw, 72px) var(--gutter); }
main > section + section { border-top: 1px solid var(--line); }
h2 { font-size: clamp(24px, 3.4vw, 32px); }
.intro { color: var(--muted); max-width: 60ch; margin: 0 0 28px; }
.note { color: var(--muted); font-size: 15px; margin-top: 24px; }

/* hero */
.hero { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(28px, 5vw, 56px); align-items: center; }
.hero h1 { font-size: clamp(32px, 5.4vw, 52px); letter-spacing: -0.01em; }
.lede { font-size: clamp(17px, 2vw, 19px); color: var(--muted); max-width: 52ch; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 24px 0 16px; }
.ghost { padding: 10px 14px; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; color: var(--ink); font-size: 15px; white-space: nowrap; }
.ghost:hover { border-color: var(--accent); }
.agents { font-size: 14px; color: var(--muted); }

.cmd {
  display: flex; align-items: center; gap: 8px; max-width: 100%;
  background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 6px 6px 6px 12px;
}
.cmd code { background: none; padding: 0; font-size: 14px; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.copy {
  flex: none; font: 600 13px var(--body); color: #fff; background: var(--accent);
  border: 0; border-radius: 6px; padding: 7px 10px; cursor: pointer;
}
@media (prefers-color-scheme: dark) { .copy { color: #0d1b1a; } }
.copy.done { background: var(--easy); }

/* demo card */
.demo { margin: 0; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 20px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06); }
.card-title { font-weight: 700; margin: 0 0 4px; }
.legend { font-size: 13px; color: var(--muted); margin: 0 0 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.legend .dot { margin-left: 6px; }
.legend .dot:first-child { margin-left: 0; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; }
.dot.easy { background: var(--easy); }
.dot.mid { background: var(--mid); }
.dot.adv { background: var(--adv); }
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li + li { border-top: 1px dashed var(--line); }
.checklist label { display: flex; align-items: center; gap: 10px; padding: 9px 0; cursor: pointer; font-size: 15px; line-height: 1.4; }
.checklist input { width: 18px; height: 18px; accent-color: var(--accent); flex: none; margin: 0; }
.checklist label > span { flex: 1; min-width: 0; }
.checklist b { display: block; }
.checklist label > span > span { color: var(--muted); font-size: 14px; }
.checklist input:checked + span b { text-decoration: line-through; text-decoration-color: var(--muted); }
.progress { height: 6px; background: var(--code-bg); border-radius: 3px; margin: 12px 0 8px; overflow: hidden; }
.progress span { display: block; height: 100%; width: 20%; background: var(--accent); transition: width 0.3s ease; }
.card-hint { font-size: 13px; color: var(--muted); margin: 0; }
.demo figcaption { font-size: 14px; color: var(--muted); margin-top: 12px; text-align: center; }

/* compare */
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.pane { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 18px; }
.pane-title { font-weight: 700; font-size: 15px; margin: 0 0 14px; }
.pane.after .pane-title { color: var(--accent); }
.question { margin: 0 0 16px; font-size: 16px; }
.question span { color: var(--muted); }
.wall { margin: 0; font-size: 15px; line-height: 1.55; text-align: justify; hyphens: auto; color: var(--muted); }
.pane.after p { margin: 0 0 10px; font-size: 15px; }
.pane.after .a-answer { font-weight: 700; font-size: 16px; padding-left: 10px; border-left: 4px solid var(--accent); }
.mini-check { list-style: none; margin: 12px 0 0; padding: 10px 0 0; border-top: 1px dashed var(--line); font-size: 14px; }
.mini-check li { padding-left: 24px; position: relative; margin-bottom: 4px; }
.mini-check li::before { content: ""; position: absolute; left: 0; top: 4px; width: 12px; height: 12px; border: 2px solid var(--accent); border-radius: 3px; }
.mini-check li.done::before { background: var(--accent); }

/* how */
.parts { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; counter-reset: part; }
.parts li { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 18px; counter-increment: part; }
.parts li::before { content: counter(part); display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 14px; margin-bottom: 10px; }
.parts h3 { font-size: 17px; }
.parts p { margin: 0; color: var(--muted); font-size: 15px; }
.parts li:last-child { border-color: var(--accent); }

/* rules */
.rule-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 14px 28px; }
.rule-list li { padding-left: 16px; border-left: 3px solid var(--accent); }
.rule-list strong { display: block; }
.rule-list span { color: var(--muted); font-size: 15px; }

/* install */
.steps { list-style: none; padding: 0; margin: 0; counter-reset: step; display: grid; gap: 28px; }
.steps > li { counter-increment: step; position: relative; padding-left: 44px; }
.steps > li::before { content: counter(step); position: absolute; left: 0; top: -2px; width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 15px; }
@media (prefers-color-scheme: dark) { .steps > li::before { color: #0d1b1a; } }
.steps h3 { font-size: 18px; }
.steps p { color: var(--muted); font-size: 15px; margin: 10px 0 0; }
.steps .cmd + .cmd { margin-top: 8px; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 12px; }
.tabs button { font: 500 14px var(--body); color: var(--muted); background: transparent; border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; cursor: pointer; }
.tabs button[aria-selected="true"] { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }

/* footer */
.foot { max-width: var(--wrap); margin: 0 auto; padding: 32px var(--gutter) 48px; border-top: 1px solid var(--line); color: var(--muted); font-size: 15px; }
.foot p { margin: 0 0 6px; }
.small { font-size: 13px; }

/* responsive */
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; }
  .parts { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  body { font-size: 16px; }
  .compare, .parts, .rule-list { grid-template-columns: 1fr; }
  .top nav { gap: 6px 14px; }
  .steps > li { padding-left: 40px; }
  .cmd code { font-size: 13px; }
}
