/* ditto site: shared by index.html and guide.html */
:root {
  --bg: #fbfbfa;
  --surface: #ffffff;
  --surface-2: #f3f3f1;
  --text: #1c1d1f;
  --muted: #5d6066;
  --border: #e3e3df;
  --accent: #1f6feb;
  --accent-soft: #e8f0fd;
  --code-bg: #f5f5f3;
  --green: #1d8a4c;
  --green-bg: #e6f4ec;
  --yellow: #8a6100;
  --yellow-bg: #fdf3d8;
  --red: #b42318;
  --red-bg: #fde8e6;
  --radius: 10px;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111214;
    --surface: #17181b;
    --surface-2: #1e2024;
    --text: #e7e7e4;
    --muted: #a0a3a9;
    --border: #2b2d32;
    --accent: #6ea8fe;
    --accent-soft: #1b2a44;
    --code-bg: #1b1d21;
    --green: #5fd38d;
    --green-bg: #15301f;
    --yellow: #f2c14e;
    --yellow-bg: #33290f;
    --red: #ff8a80;
    --red-bg: #3a1714;
  }
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
/* no ligatures: commands are read and typed character by character (--, ==, ->) */
code, pre { font-family: var(--mono); font-size: 0.875em; font-variant-ligatures: none; }
:not(pre) > code {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 0.08em 0.35em;
  white-space: nowrap;
}

/* layout */
.wrap { max-width: 980px; margin: 0 auto; padding: 0 16px; }
header.top {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--border);
}
header.top .wrap { display: flex; align-items: center; gap: 24px; height: 56px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 650; color: var(--text); letter-spacing: -0.01em; }
.brand:hover { text-decoration: none; }
.brand .dots { display: inline-flex; gap: 4px; }
.brand .dots i { width: 11px; height: 11px; border-radius: 50%; background: var(--green); }
.brand .dots i:last-child { opacity: .45; }
nav.links { display: flex; gap: 18px; overflow-x: auto; scrollbar-width: none; flex: 1; }
nav.links::-webkit-scrollbar { display: none; }
nav.links a { color: var(--muted); font-size: 14px; white-space: nowrap; }
nav.links a:hover { color: var(--text); text-decoration: none; }
.gh { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--text); white-space: nowrap; }
.gh svg { width: 18px; height: 18px; fill: currentColor; }

section { padding: 56px 0 8px; }
h1, h2, h3 { letter-spacing: -0.02em; line-height: 1.25; }
h2 { font-size: 28px; margin: 0 0 8px; }
h2 + .lead { margin-top: 0; }
h3 { font-size: 19px; margin: 32px 0 8px; }
.lead { color: var(--muted); font-size: 17px; max-width: 70ch; }
p { max-width: 75ch; }

/* hero */
.hero { padding: 72px 0 40px; }
.hero h1 { font-size: clamp(34px, 6vw, 52px); margin: 0 0 16px; letter-spacing: -0.035em; }
.hero h1 span { color: var(--muted); font-weight: 500; }
.hero p.lead { font-size: 19px; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 0; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: 8px; font-weight: 600; font-size: 15px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
}
.btn:hover { text-decoration: none; border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
@media (prefers-color-scheme: dark) { .btn.primary { color: #0b1220; } }
.meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.meta span { font-size: 13px; color: var(--muted); border: 1px solid var(--border); border-radius: 999px; padding: 2px 10px; background: var(--surface); }
.meta .central { display: inline-flex; border: 1px solid var(--accent); border-radius: 999px; overflow: hidden; font-size: 13px; }
.meta .central span { border: 0; border-radius: 0; padding: 2px 10px; background: var(--surface); color: var(--muted); }
.meta .central .ver { background: var(--accent-soft); color: var(--accent); font-weight: 600; font-variant-numeric: tabular-nums; }
.meta .central:hover { text-decoration: none; }
.meta .central:hover span:first-child { color: var(--text); }

/* verdict chips */
.chip { display: inline-block; font: 600 12px/1 var(--sans); letter-spacing: .04em; padding: 4px 8px; border-radius: 999px; vertical-align: 1px; }
.chip.green { color: var(--green); background: var(--green-bg); }
.chip.yellow { color: var(--yellow); background: var(--yellow-bg); }
.chip.red { color: var(--red); background: var(--red-bg); }

/* cards */
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin-top: 24px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 18px 14px; }
.card h4 { margin: 0 0 6px; font-size: 16px; }
.card p { margin: 0 0 6px; color: var(--muted); font-size: 15px; }
.card .num { font: 600 13px var(--mono); color: var(--accent); }

/* code */
.code { position: relative; margin: 14px 0 18px; }
.code pre {
  margin: 0; padding: 16px 18px; overflow-x: auto;
  background: var(--code-bg); border: 1px solid var(--border); border-radius: var(--radius);
  line-height: 1.55;
}
.code .label { position: absolute; top: -10px; left: 14px; font: 600 11px var(--sans); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); background: var(--bg); padding: 0 6px; }
.copy {
  position: absolute; top: 8px; right: 8px; font: 500 12px var(--sans);
  background: var(--surface); color: var(--muted); border: 1px solid var(--border); border-radius: 6px;
  padding: 4px 8px; cursor: pointer; opacity: 0; transition: opacity .15s;
}
.code:hover .copy, .copy:focus { opacity: 1; }
@media (hover: none) { .copy { opacity: 1; } }
.c { color: var(--muted); }

/* tabs */
.tabs { margin-top: 20px; }
.tablist { display: flex; gap: 4px; border-bottom: 1px solid var(--border); }
.tablist button {
  font: 600 14px var(--sans); color: var(--muted); background: none; border: 0;
  padding: 10px 14px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tablist button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
.tabpanel[hidden] { display: none; }
.tabpanel { padding-top: 8px; }

/* steps */
ol.steps { counter-reset: step; list-style: none; padding: 0; margin: 16px 0 0; }
ol.steps > li { counter-increment: step; position: relative; padding-left: 40px; margin-bottom: 8px; }
ol.steps > li::before {
  content: counter(step); position: absolute; left: 0; top: 2px;
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  font: 600 13px var(--sans); color: var(--accent); background: var(--accent-soft);
}

/* tables */
.table { overflow-x: auto; margin: 14px 0 20px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: 14.5px; }
th, td { text-align: left; padding: 9px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: var(--surface-2); font-weight: 600; }
tr:last-child td { border-bottom: 0; }
td code { white-space: nowrap; }
td.def { white-space: nowrap; color: var(--muted); font-family: var(--mono); font-size: 13px; }

/* scenarios */
details.scenario { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin: 12px 0; }
details.scenario > summary {
  list-style: none; cursor: pointer; padding: 16px 18px; display: flex; gap: 14px; align-items: baseline;
}
details.scenario > summary::-webkit-details-marker { display: none; }
details.scenario > summary::after { content: "+"; margin-left: auto; color: var(--muted); font-size: 20px; line-height: 1; }
details.scenario[open] > summary::after { content: "−"; }
details.scenario > summary strong { font-size: 16.5px; }
details.scenario > summary span { color: var(--muted); font-size: 14.5px; }
details.scenario .body { padding: 0 18px 8px; border-top: 1px solid var(--border); }
@media (max-width: 640px) { details.scenario > summary { flex-direction: column; gap: 2px; } details.scenario > summary::after { display: none; } }

.note { border-left: 3px solid var(--accent); background: var(--accent-soft); padding: 10px 14px; border-radius: 0 8px 8px 0; margin: 16px 0; font-size: 15px; }
.note p { margin: 0; }

footer { margin-top: 64px; padding: 28px 0 40px; border-top: 1px solid var(--border); color: var(--muted); font-size: 14px; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; }
