/* ─── Reset & Base ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #f8fafc; --bg2: #f1f5f9; --bg3: #e2e8f0;
  --text: #0f172a; --text2: #475569; --text3: #94a3b8;
  --accent: #3b82f6; --accent2: #8b5cf6; --accent-grad: linear-gradient(135deg, #3b82f6, #8b5cf6);
  --border: #e2e8f0; --card: #ffffff; --card-hover: #f8fafc;
  --code-bg: #1e293b; --code-text: #e2e8f0;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-lg: 0 10px 25px rgba(0,0,0,.1);
}

.dark {
  --bg: #0f172a; --bg2: #1e293b; --bg3: #334155;
  --text: #f1f5f9; --text2: #94a3b8; --text3: #64748b;
  --border: #334155; --card: #1e293b; --card-hover: #334155;
  --shadow: 0 1px 3px rgba(0,0,0,.3); --shadow-lg: 0 10px 25px rgba(0,0,0,.4);
}

html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg); color: var(--text); line-height: 1.7; transition: background .3s, color .3s;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code { background: var(--bg3); padding: .15em .4em; border-radius: 4px; font-size: .9em; font-family: 'SF Mono', 'Fira Code', monospace; }
pre { background: var(--code-bg); color: var(--code-text); padding: 1.25rem; border-radius: .75rem; overflow-x: auto; font-size: .85em; line-height: 1.6; }
pre code { background: none; padding: 0; }

/* ─── Hero ──────────────────────────────────────────── */
header { background: var(--accent-grad); padding: 4rem 2rem; text-align: center; }
.hero-logo {
  width: 80px; height: 80px; border-radius: 1.25rem; background: rgba(255,255,255,.2);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 2.5rem; font-weight: 800; color: #fff; margin-bottom: 1rem; box-shadow: 0 8px 24px rgba(0,0,0,.2);
}
.hero-logo.small { width: 36px; height: 36px; font-size: 1.1rem; border-radius: .5rem; margin-bottom: 0; margin-right: .5rem; }
.hero h1 { color: #fff; font-size: 2.5rem; margin-bottom: .5rem; }
.hero-tagline { color: rgba(255,255,255,.85); font-size: 1.15rem; max-width: 600px; margin: 0 auto 1rem; }
.hero-version { color: rgba(255,255,255,.7); font-size: .95rem; font-family: monospace; margin-bottom: 1.5rem; }
.hero-buttons { display: flex; gap: .75rem; justify-content: center; flex-wrap: wrap; }

/* ─── Buttons ──────────────────────────────────────── */
.btn {
  display: inline-block; padding: .7rem 1.5rem; border-radius: .6rem; font-weight: 600;
  font-size: .95rem; transition: transform .15s, box-shadow .15s; cursor: pointer; border: none;
}
.btn:hover { transform: translateY(-2px); text-decoration: none; }
.btn-primary { background: #fff; color: #3b82f6; box-shadow: 0 4px 12px rgba(0,0,0,.15); }
.btn-primary:hover { box-shadow: 0 6px 18px rgba(0,0,0,.2); }
.btn-secondary { background: rgba(255,255,255,.2); color: #fff; border: 1px solid rgba(255,255,255,.3); }
.btn-secondary:hover { background: rgba(255,255,255,.3); }

/* ─── Nav ──────────────────────────────────────────── */
nav {
  position: sticky; top: 0; z-index: 100; background: var(--card);
  border-bottom: 1px solid var(--border); padding: .5rem 1.5rem;
  display: flex; gap: .25rem; align-items: center; overflow-x: auto;
  box-shadow: var(--shadow);
}
nav a {
  padding: .4rem .75rem; border-radius: .4rem; font-size: .85rem; font-weight: 500;
  color: var(--text2); white-space: nowrap; transition: background .15s, color .15s;
}
nav a:hover { background: var(--bg3); color: var(--text); text-decoration: none; }
.nav-spacer { flex: 1; }
#theme-toggle {
  background: var(--bg3); border: none; border-radius: .4rem; padding: .4rem .6rem;
  cursor: pointer; font-size: 1.1rem; transition: background .15s;
}

/* ─── Sections ─────────────────────────────────────── */
.section {
  max-width: 960px; margin: 0 auto; padding: 3rem 2rem;
}
.section h2 { font-size: 1.5rem; margin-bottom: 1rem; }
.section h2 span { color: var(--accent); }
.section h3 { font-size: 1.1rem; margin-bottom: .5rem; }
.section p { color: var(--text2); margin-bottom: .75rem; }

/* ─── Cards ────────────────────────────────────────── */
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.25rem; margin-top: 1.5rem; }
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: .75rem;
  padding: 1.5rem; box-shadow: var(--shadow); transition: background .15s, transform .15s;
}
.card:hover { background: var(--card-hover); transform: translateY(-2px); }
.card-icon { font-size: 2rem; margin-bottom: .5rem; }
.card h3 { margin-bottom: .4rem; }
.card p { font-size: .9rem; margin-bottom: .5rem; }
.card .btn { margin-top: .5rem; font-size: .85rem; padding: .5rem 1rem; }

.download-card { text-align: center; }
.download-card .card-icon { font-size: 2.5rem; }

/* ─── Features ─────────────────────────────────────── */
.feature-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: .5rem; }
.feature-item { display: flex; align-items: flex-start; gap: .5rem; padding: .35rem 0; }
.feature-check { color: #22c55e; font-weight: 700; font-size: 1.1rem; flex-shrink: 0; }
.note { background: #fef3c7; color: #92400e; border: 1px solid #fbbf24; padding: .75rem 1rem; border-radius: .5rem; font-size: .9rem; margin-top: 1rem; }
.dark .note { background: #422006; color: #fbbf24; border-color: #92400e; }

/* ─── Languages ────────────────────────────────────── */
.lang-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .75rem; margin: 1rem 0; }
.lang-item { background: var(--card); border: 1px solid var(--border); border-radius: .5rem; padding: .75rem 1rem; font-size: .95rem; text-align: center; }

/* ─── Shortcuts table ──────────────────────────────── */
.shortcuts-table { width: 100%; border-collapse: collapse; margin-top: 1rem; }
.shortcuts-table th, .shortcuts-table td { padding: .6rem 1rem; border: 1px solid var(--border); text-align: left; }
.shortcuts-table th { background: var(--bg2); font-weight: 600; }
kbd { background: var(--bg3); border: 1px solid var(--border); border-radius: 4px; padding: .15em .5em; font-family: monospace; font-size: .9em; }

/* ─── Structure grid ───────────────────────────────── */
.struct-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 1.5rem; margin-top: 1rem; }

/* ─── Changelog ────────────────────────────────────── */
#changelog-content article { background: var(--card); border: 1px solid var(--border); border-radius: .75rem; padding: 1.5rem; }
#changelog-content h3 { margin-top: 1rem; margin-bottom: .5rem; color: var(--accent); font-size: 1rem; font-family: monospace; }
#changelog-content h3:first-child { margin-top: 0; }
#changelog-content ul { padding-left: 1.25rem; color: var(--text2); }
#changelog-content li { margin-bottom: .3rem; font-size: .9rem; }

/* ─── Footer ───────────────────────────────────────── */
footer {
  background: var(--bg2); border-top: 1px solid var(--border); padding: 2rem; text-align: center; margin-top: 2rem;
}
.footer-content { max-width: 960px; margin: 0 auto; }
.footer-logo { display: flex; align-items: center; justify-content: center; gap: .5rem; margin-bottom: .75rem; font-weight: 700; font-size: 1.1rem; }
.footer-version { font-family: monospace; font-size: .85rem; color: var(--text3); margin-top: .5rem; }

/* ─── Responsive ───────────────────────────────────── */
@media (max-width: 640px) {
  header { padding: 2.5rem 1rem; }
  .hero h1 { font-size: 1.8rem; }
  .hero-tagline { font-size: 1rem; }
  .section { padding: 2rem 1rem; }
  .card-grid { grid-template-columns: 1fr; }
  .struct-grid { grid-template-columns: 1fr; }
}
