:root {
  --bg: #ffffff;
  --bg-soft: #f5f5f7;
  --fg: #1d1d1f;
  --fg-soft: #6e6e73;
  --accent: #0a84ff;
  --accent-soft: #e5f0ff;
  --border: #d2d2d7;
  --max: 760px;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(0,0,0,.04), 0 8px 24px rgba(0,0,0,.06);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
          "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --bg-soft: #1c1c1e;
    --fg: #f5f5f7;
    --fg-soft: #98989d;
    --accent: #0a84ff;
    --accent-soft: #0a2a4d;
    --border: #38383a;
    --shadow: 0 1px 3px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.6);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.55;
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 20px; }

.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--accent); color: #fff; padding: 8px 12px; border-radius: 6px;
}
.skip:focus { left: 12px; top: 12px; z-index: 10; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 12px; padding-bottom: 12px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--fg); }
.brand-mark {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, #0a84ff, #5e5ce6);
  color: #fff; font-weight: 700;
  display: grid; place-items: center;
  font-family: var(--font);
  box-shadow: var(--shadow);
}
.brand-name { font-weight: 600; letter-spacing: -.01em; }
.site-nav a { color: var(--fg-soft); margin-left: 18px; text-decoration: none; font-size: 15px; }
.site-nav a:hover { color: var(--accent); }

/* Content */
.content { padding: 40px 20px 80px; }
.content h1 {
  font-size: 40px; line-height: 1.1; letter-spacing: -.02em;
  margin: 8px 0 16px; font-weight: 700;
}
.content h2 {
  font-size: 26px; line-height: 1.2; letter-spacing: -.015em;
  margin: 48px 0 12px; font-weight: 600;
  padding-top: 12px; border-top: 1px solid var(--border);
}
.content h2:first-of-type { border-top: 0; padding-top: 0; }
.content h3 {
  font-size: 19px; margin: 28px 0 8px; font-weight: 600;
}
.content p, .content li { color: var(--fg); }
.content a { color: var(--accent); text-decoration: none; }
.content a:hover { text-decoration: underline; }
.content ul, .content ol { padding-left: 24px; }
.content li { margin: 6px 0; }
.content code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 14px;
  background: var(--bg-soft);
  padding: 2px 6px;
  border-radius: 6px;
  border: 1px solid var(--border);
}
.content blockquote {
  margin: 16px 0;
  padding: 12px 16px;
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 6px;
  color: var(--fg);
}

/* Tables */
.content table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 15px;
}
.content th, .content td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.content th { background: var(--bg-soft); font-weight: 600; }

/* Language switcher */
.lang-switch {
  display: inline-flex; gap: 8px; margin-bottom: 24px;
  background: var(--bg-soft); padding: 4px;
  border-radius: 999px; border: 1px solid var(--border);
}
.lang-switch a {
  padding: 6px 14px; border-radius: 999px;
  font-size: 14px; font-weight: 500;
  color: var(--fg-soft); text-decoration: none;
}
.lang-switch a.active {
  background: var(--bg);
  color: var(--fg);
  box-shadow: var(--shadow);
}
section.lang-panel[hidden] { display: none !important; }
.site-nav a[aria-current="page"] { color: var(--accent); font-weight: 600; }

/* Hero (homepage) */
.hero {
  text-align: center; padding: 60px 20px 40px;
}
.hero h1 {
  font-size: 56px; line-height: 1.05; letter-spacing: -.03em;
  background: linear-gradient(135deg, #0a84ff, #5e5ce6 60%, #bf5af2);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero p.lead {
  font-size: 22px; color: var(--fg-soft); margin: 8px 0 28px;
}
.cta {
  display: inline-block;
  background: var(--accent); color: #fff !important;
  padding: 14px 28px; border-radius: 999px;
  font-weight: 600; font-size: 17px;
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: transform .15s ease;
}
.cta:hover { transform: translateY(-1px); text-decoration: none !important; }

.features {
  display: grid; gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin: 40px 0;
}
.feature {
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-soft);
}
.feature h3 { margin: 0 0 6px; font-size: 17px; }
.feature p { margin: 0; color: var(--fg-soft); font-size: 15px; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 40px;
  padding: 24px 0 60px;
  font-size: 14px;
  color: var(--fg-soft);
}
.site-footer p { margin: 4px 0; }
.site-footer a { color: var(--fg-soft); text-decoration: none; }
.site-footer a:hover { color: var(--accent); }
.site-footer .muted code { font-size: 13px; }

/* Mobile */
@media (max-width: 600px) {
  .hero h1 { font-size: 40px; }
  .hero p.lead { font-size: 18px; }
  .content h1 { font-size: 32px; }
  .content h2 { font-size: 22px; }
  .site-nav a { margin-left: 12px; font-size: 14px; }
}
