/* ThinCoder — Design System */
/* "Correctness first. Honesty over saving face." */

* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0d1117;
  --bg-alt: #161b22;
  --bg-card: #1c2129;
  --border: #30363d;
  --fg: #e6edf3;
  --fg-muted: #8b949e;
  --accent: #58a6ff;
  --accent-alt: #79c0ff;
  --green: #3fb950;
  --orange: #d29922;
  --red: #f85149;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans SC', sans-serif;
  --font-mono: 'Cascadia Code', 'Fira Code', 'JetBrains Mono', 'Consolas', monospace;
  --radius: 8px;
  --max-w: 960px;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; transition: color .15s; }
a:hover { color: var(--accent-alt); }

a:focus-visible, .btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

img { max-width: 100%; display: block; }

h1, h2, h3, h4 { line-height: 1.3; font-weight: 700; }
h1 { font-size: 2.5rem; letter-spacing: -.02em; }
h2 { font-size: 1.75rem; margin: 48px 0 16px; }
h3 { font-size: 1.2rem; margin: 32px 0 8px; }
p { margin: 0 0 16px; color: var(--fg-muted); }

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: rgba(110,118,129,0.15);
  padding: 2px 6px;
  border-radius: 4px;
}

pre {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  overflow-x: auto;
  margin: 16px 0;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.6;
}

pre code { background: none; padding: 0; }

/* ─── Layout ──────────────────────────────── */

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

/* ─── Nav ──────────────────────────────────── */

nav {
  border-bottom: 1px solid var(--border);
  background: rgba(13,17,23,0.92);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

.nav-brand {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--fg);
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-brand .brand-icon {
  width: 28px;
  height: 28px;
  background: var(--accent);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  color: #fff;
}

.nav-links { display: flex; flex-wrap: wrap; gap: 24px; list-style: none; }
.nav-links a { color: var(--fg-muted); font-size: 0.9rem; font-weight: 500; }
.nav-links a:hover { color: var(--fg); }
.nav-links a.active { color: var(--fg); font-weight: 700; }
.version-date { color: var(--fg-muted); font-weight: 400; font-size: 0.8rem; margin-left: 8px; }

/* ─── Hero ─────────────────────────────────── */

.hero {
  text-align: center;
  padding: 100px 24px 80px;
  max-width: var(--max-w);
  margin: 0 auto;
}

.hero h1 {
  font-size: 3rem;
  letter-spacing: -.03em;
  margin-bottom: 20px;
}

.hero h1 .accent { color: var(--accent); }

.hero p {
  font-size: 1.2rem;
  color: var(--fg-muted);
  max-width: 640px;
  margin: 0 auto 36px;
}

.hero-buttons { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background .15s, transform .1s;
  text-decoration: none;
}

.btn:active { transform: scale(0.98); }

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-alt); color: #fff; }

.btn-secondary {
  background: var(--bg-card);
  color: var(--fg);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--border); color: var(--fg); }

/* ─── Features ─────────────────────────────── */

.section {
  padding: 80px 0;
}

.section-alt { background: var(--bg-alt); }

.section-title {
  text-align: center;
  font-size: 1.75rem;
  margin-bottom: 48px;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
}

/* Whole-card links (docs topic cards, index capability cards) */
a.feature-card {
  display: block;
  text-decoration: none;
  color: inherit;
  transition: border-color .2s;
}

a.feature-card:hover { border-color: var(--accent); }

.feature-card .icon {
  font-size: 1.6rem;
  margin-bottom: 12px;
  display: block;
}

.feature-card h3 { font-size: 1.05rem; margin: 0 0 8px; }
.feature-card p { font-size: 0.9rem; margin: 0; }
.feature-card p + p { margin-top: 8px; }

/* ─── CTA ───────────────────────────────────── */

.cta {
  text-align: center;
  padding: 80px 24px;
  background: linear-gradient(135deg, rgba(88,166,255,0.08), rgba(63,185,80,0.06));
}

.cta h2 { margin-top: 0; font-size: 2rem; }
.cta p { margin-bottom: 28px; }

/* ─── Page Header ───────────────────────────── */

.page-header {
  text-align: center;
  padding: 64px 24px 48px;
  max-width: var(--max-w);
  margin: 0 auto;
}

.page-header h1 { font-size: 2.2rem; margin-bottom: 12px; }
.page-header p { font-size: 1.05rem; }

/* ─── Content ────────────────────────────────── */

.content {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px 80px;
}

.how-it-works {
  text-align: center;
  max-width: 640px;
  margin: 0 auto;
}

.content .features-grid { margin-bottom: 40px; }

/* Section subtitle under h2 (features page) */
.h2-subtitle {
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 500;
  margin: -8px 0 16px;
}

.content ul, .content ol { margin: 0 0 16px 24px; color: var(--fg-muted); }
.content li { margin-bottom: 6px; }

/* ─── Download Cards ────────────────────────── */

.download-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-bottom: 48px;
}

.download-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px;
  text-align: center;
  transition: border-color .2s;
}

.download-card .icon { font-size: 2.5rem; margin-bottom: 16px; display: block; }
.download-card h3 { margin: 0 0 8px; font-size: 1.15rem; }
.download-card p { font-size: 0.9rem; margin: 0 0 20px; }

/* ─── Footer ────────────────────────────────── */

footer {
  border-top: 1px solid var(--border);
  padding: 32px 24px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--fg-muted);
}

footer a { color: var(--fg-muted); }
footer a:hover { color: var(--fg); }
footer .beian { margin-top: 8px; }

/* ─── Reduced motion ────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    transition-duration: 0s !important;
    animation-duration: 0s !important;
  }
}

/* ─── Responsive ────────────────────────────── */

@media (max-width: 640px) {
  .hero h1 { font-size: 2rem; }
  .hero p { font-size: 1rem; }
  .nav-links { gap: 14px; }
  .section { padding: 48px 0; }
}

/* ─── a11y ─────────────────────────────────── */
.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--accent); color: #fff;
  padding: 8px 16px; border-radius: 0 0 6px 0;
  z-index: 100; text-decoration: none;
}
.skip-link:focus { left: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
