:root {
  --fg: #16181d;
  --muted: #5b6270;
  --bg: #ffffff;
  --soft: #f4f6fa;
  --line: #e3e7ee;
  --brand: #0a7d55;
  --brand-ink: #ffffff;
  --code-bg: #0f172a;
  --code-fg: #e2e8f0;
  --radius: 10px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --fg: #e8eaef; --muted: #a3aab8; --bg: #111317; --soft: #1a1d23; --line: #2a2f38; --brand: #34c28c; --brand-ink: #062b1d; }
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--fg); background: var(--bg); }
a { color: var(--brand); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; background: var(--bg); padding: 8px 12px; z-index: 10; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

header.site { border-bottom: 1px solid var(--line); }
header.site .wrap { display: flex; align-items: center; gap: 24px; min-height: 64px; flex-wrap: wrap; }
.logo { font-weight: 700; font-size: 18px; color: var(--fg); text-decoration: none; }
nav.main { display: flex; gap: 18px; margin-left: auto; flex-wrap: wrap; }
nav.main a { color: var(--fg); text-decoration: none; font-weight: 500; padding: 6px 0; }
nav.main a[aria-current="page"] { color: var(--brand); border-bottom: 2px solid var(--brand); }

.hero { padding-top: 72px; padding-bottom: 48px; }
.hero h1, .hero p.lead { overflow-wrap: anywhere; }
.hero h1 { font-size: clamp(32px, 5vw, 52px); line-height: 1.1; margin: 0 0 16px; letter-spacing: -0.02em; }
.hero p.lead { font-size: 20px; color: var(--muted); max-width: 680px; margin: 0 0 28px; }
.btns { display: flex; gap: 12px; flex-wrap: wrap; }
.btn { display: inline-block; padding: 12px 20px; border-radius: 8px; font-weight: 600; text-decoration: none; border: 1px solid var(--brand); background: var(--brand); color: var(--brand-ink); cursor: pointer; font-size: 16px; min-height: 44px; }
.btn.secondary { background: transparent; color: var(--brand); }
.btn.small { padding: 6px 12px; font-size: 14px; min-height: 36px; }

section { padding: 48px 0; }
section.soft { background: var(--soft); }
h2 { font-size: 28px; margin: 0 0 12px; letter-spacing: -0.01em; }
h3 { font-size: 18px; margin: 0 0 6px; }
.sub { color: var(--muted); max-width: 720px; margin: 0 0 28px; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.card { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.card p { margin: 0; color: var(--muted); font-size: 15px; }
.tag { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--soft); border: 1px solid var(--line); color: var(--muted); margin-bottom: 8px; }

.try { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 16px; }
.try .btn.small[aria-pressed="true"] { background: var(--brand); color: var(--brand-ink); }
.note { font-size: 14px; color: var(--muted); }
.callout { border-left: 4px solid var(--brand); background: var(--soft); padding: 12px 16px; border-radius: 0 var(--radius) var(--radius) 0; }

pre, code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 14px; }
pre { background: var(--code-bg); color: var(--code-fg); padding: 16px; border-radius: var(--radius); overflow-x: auto; line-height: 1.5; }
:not(pre) > code { background: var(--soft); border: 1px solid var(--line); padding: 1px 5px; border-radius: 4px; }
table { border-collapse: collapse; width: 100%; font-size: 15px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 600; }

/* generator */
.gen > * { min-width: 0; }
.gen { display: grid; grid-template-columns: minmax(300px, 420px) minmax(0, 1fr); gap: 24px; align-items: start; padding: 32px 0 64px; }
@media (max-width: 860px) { .gen { grid-template-columns: 1fr; } }
.gen form fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin: 0 0 14px; }
.gen legend { font-weight: 600; padding: 0 6px; }
.field { display: block; margin: 8px 0; }
.field > span { display: block; font-size: 14px; font-weight: 500; margin-bottom: 4px; }
.field small { display: block; color: var(--muted); font-size: 13px; margin-top: 3px; }
.gen input[type="text"], .gen input[type="url"], .gen select { width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--fg); font: inherit; min-height: 40px; }
.gen input[type="color"] { width: 56px; height: 36px; border: 1px solid var(--line); border-radius: 6px; background: none; }
.check { display: flex; gap: 8px; align-items: flex-start; margin: 6px 0; font-size: 15px; }
.check input { margin-top: 5px; }
.cat { border-top: 1px solid var(--line); padding-top: 8px; margin-top: 8px; }
.preview-box { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--soft); }
.preview-bar { display: flex; gap: 8px; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--line); flex-wrap: wrap; font-size: 14px; }
.preview-bar select { width: auto; min-height: 32px; }
iframe.preview { width: 100%; height: 460px; border: 0; display: block; background: #fff; }
.out { margin-top: 20px; }
.out pre { max-height: 420px; }
.copy-row { display: flex; justify-content: space-between; align-items: center; margin: 16px 0 6px; gap: 12px; }
.copy-row h3 { margin: 0; }

footer.site { border-top: 1px solid var(--line); padding: 28px 0; color: var(--muted); font-size: 14px; }
footer.site .wrap { display: flex; gap: 20px; flex-wrap: wrap; justify-content: space-between; }

.docs { display: grid; grid-template-columns: 220px 1fr; gap: 32px; padding: 32px 0 64px; }
@media (max-width: 860px) { .docs { grid-template-columns: 1fr; } .docs nav.toc { position: static; } }
.docs nav.toc { position: sticky; top: 16px; align-self: start; font-size: 15px; }
.docs nav.toc a { display: block; padding: 4px 0; color: var(--fg); text-decoration: none; }
.docs article h2 { margin-top: 36px; padding-top: 8px; }
.docs article h2:first-child { margin-top: 0; }
