/* ---- Tokens (dark default) ---- */
:root {
  --bg: #0e1320;
  --surface: #161c2b;
  --surface-2: #1e2637;
  --border: #2a344a;
  --text: #e6ebf4;
  --muted: #9aa6bd;
  --accent: #ffab40;
  --accent-ink: #241704;
  --accent-2: #6fb7ff;
  --public: #4cc76a;
  --radius: 14px;
  --maxw: 1100px;
  --shadow: 0 6px 24px rgba(0,0,0,.35);
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
:root[data-theme="light"] {
  --bg: #f6f8fc;
  --surface: #ffffff;
  --surface-2: #eef2f9;
  --border: #d7deeb;
  --text: #131824;
  --muted: #5b6678;
  --accent: #9c5800;
  --accent-ink: #fff6e9;
  --accent-2: #1d6fd6;
  --public: #158238;
  --shadow: 0 6px 20px rgba(20,30,60,.10);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: var(--mono); font-size: .92em; background: var(--surface-2); padding: .1em .4em; border-radius: 6px; }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; border-radius: 4px; }

.skip-link { position: absolute; left: -999px; top: 0; background: var(--accent); color: var(--accent-ink); padding: .6rem 1rem; z-index: 100; }
.skip-link:focus { left: 1rem; top: 1rem; }

/* ---- Header ---- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .7rem clamp(1rem, 4vw, 2rem);
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.brand { display: inline-flex; align-items: center; gap: .55rem; color: var(--text); font-weight: 700; }
.brand:hover { text-decoration: none; }
.brand__logo { border-radius: 8px; }
.site-nav { display: flex; align-items: center; gap: clamp(.6rem, 2vw, 1.4rem); flex-wrap: wrap; }
.site-nav > a { color: var(--muted); font-weight: 600; }
.site-nav > a:hover { color: var(--text); text-decoration: none; }
.theme-toggle { background: var(--surface-2); border: 1px solid var(--border); color: var(--text); border-radius: 10px; width: 40px; height: 36px; cursor: pointer; font-size: 1.05rem; line-height: 1; }
.theme-toggle:hover { border-color: var(--accent); }

/* ---- Layout ---- */
main { display: block; }
.section { max-width: var(--maxw); margin: 0 auto; padding: clamp(2.5rem, 6vw, 4.5rem) clamp(1rem, 4vw, 2rem) 0; }
.section__title { font-size: clamp(1.5rem, 3vw, 2rem); margin: 0 0 1.25rem; }
.section:last-of-type { padding-bottom: 3rem; }

/* ---- Hero ---- */
.hero {
  max-width: var(--maxw); margin: 0 auto;
  display: grid; grid-template-columns: 1.1fr .9fr; align-items: center; gap: clamp(1.5rem, 4vw, 3rem);
  padding: clamp(2rem, 6vw, 4rem) clamp(1rem, 4vw, 2rem);
}
.hero__eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .8rem; font-weight: 700; color: var(--accent); margin: 0 0 .5rem; }
.hero__title { font-size: clamp(2.6rem, 7vw, 4.4rem); line-height: 1.02; margin: 0 0 .6rem; letter-spacing: -.02em;
  background: linear-gradient(120deg, var(--text), var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero__tagline { font-size: clamp(1.05rem, 2.2vw, 1.3rem); color: var(--muted); margin: 0 0 1.5rem; max-width: 46ch; }
.hero__cta { display: flex; flex-wrap: wrap; gap: .75rem; margin-bottom: 1rem; }
.btn { display: inline-block; padding: .7rem 1.2rem; border-radius: 12px; font-weight: 700; border: 1px solid transparent; cursor: pointer; }
.btn:hover { text-decoration: none; }
.btn--primary { background: var(--accent); color: var(--accent-ink); }
.btn--primary:hover { filter: brightness(1.07); }
.btn--ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn--ghost:hover { border-color: var(--accent); }
.hero__sample { color: var(--muted); font-size: .95rem; }
.hero__media { display: flex; justify-content: center; }
.hero__img { width: 100%; max-width: 440px; height: auto; border-radius: 20px; box-shadow: var(--shadow); border: 1px solid var(--border); }

/* ---- Getting started ---- */
.getting-started__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }
.gs-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; }
.gs-card h3 { margin: 0 0 .5rem; font-size: 1.1rem; }
.gs-card p { margin: 0; color: var(--muted); }
.conventions { margin: 0; padding-left: 1.1rem; color: var(--muted); }
.conventions li { margin: .25rem 0; }
.conventions strong { color: var(--text); }

/* ---- Commands ---- */
.commands__intro { color: var(--muted); margin: -.5rem 0 1.5rem; }
.commands__toolbar { position: sticky; top: 58px; z-index: 20; display: flex; flex-wrap: wrap; gap: .75rem 1rem; align-items: center; padding: .75rem 0; background: var(--bg); }
.command-search { flex: 1 1 260px; min-width: 0; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 12px; padding: .65rem .9rem; font-size: 1rem; }
.command-search::placeholder { color: var(--muted); }
.command-search:focus-visible { border-color: var(--accent-2); }
.category-nav { display: flex; flex-wrap: wrap; gap: .4rem; }
.category-nav a { font-size: .85rem; color: var(--muted); border: 1px solid var(--border); border-radius: 999px; padding: .3rem .7rem; }
.category-nav a:hover { color: var(--text); border-color: var(--accent); text-decoration: none; }

.category { scroll-margin-top: 160px; margin-top: 2rem; }
.category__title { font-size: 1.25rem; margin: 0 0 1rem; padding-bottom: .5rem; border-bottom: 1px solid var(--border); }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }

.command-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.1rem; transition: transform .12s ease, border-color .12s ease, box-shadow .12s ease; }
.command-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); box-shadow: var(--shadow); }
.command-card__head { display: flex; align-items: flex-start; justify-content: space-between; gap: .5rem; margin-bottom: .4rem; }
.command-card__syntax { font-family: var(--mono); font-size: .95rem; font-weight: 700; color: var(--accent); margin: 0; line-height: 1.35; word-break: break-word; }
.command-card__syntax code { background: none; padding: 0; color: inherit; }
.command-card__desc { margin: 0; color: var(--muted); font-size: .95rem; overflow-wrap: anywhere; }
.command-card__desc code { font-size: .9em; }

.tag { flex: none; font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: .18rem .5rem; border-radius: 999px; border: 1px solid var(--border); color: var(--muted); }
.tag--public { color: var(--public); border-color: color-mix(in srgb, var(--public) 45%, var(--border)); }

.no-results { color: var(--muted); font-style: italic; padding: 1rem 0; }

/* ---- Footer ---- */
.site-footer { max-width: var(--maxw); margin: 3rem auto 0; padding: 2rem clamp(1rem, 4vw, 2rem); border-top: 1px solid var(--border); color: var(--muted); font-size: .9rem; }

/* ---- Responsive ---- */
@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; text-align: center; }
  .hero__tagline { margin-inline: auto; }
  .hero__cta { justify-content: center; }
  .hero__media { order: -1; }
  .hero__img { max-width: 300px; }
  .commands__toolbar { top: 56px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .command-card { transition: none; }
}
