:root {
  color-scheme: dark;
  --bg: #1b1c20;
  --bg-elevated: #26272c;
  --bg-elevated-2: #2f3036;
  --border: #3a3b41;
  --text: #e8e8ea;
  --text-muted: #9a9ba3;
  --accent: #6c8cff;
  --accent-soft: rgba(108, 140, 255, 0.14);
  --danger: #e5484d;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
}

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

a {
  color: var(--accent);
}

.container {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(27, 28, 32, 0.9);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
}

.site-header-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 12px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex: 0 0 auto;
}

.brand img {
  height: 28px;
  width: auto;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-left: 12px;
}

.main-nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
}

.main-nav a:hover {
  color: var(--text);
}

.nav-cta {
  display: none;
}

.header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-toggle {
  display: none;
  margin-left: auto;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}

.btn:hover {
  border-color: var(--accent);
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #12131a;
  font-weight: 600;
}

.btn-primary:hover {
  border-color: var(--accent);
  filter: brightness(1.08);
}

.btn-ghost {
  background: transparent;
}

/* ---------- language switcher ---------- */

.lang-switch {
  position: relative;
}

.lang-switch select {
  appearance: none;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  padding: 7px 28px 7px 12px;
  font-size: 13px;
  cursor: pointer;
}

.lang-switch::after {
  content: "";
  position: absolute;
  right: 10px;
  top: 50%;
  width: 6px;
  height: 6px;
  border: 1px solid var(--text-muted);
  border-width: 0 1px 1px 0;
  transform: translateY(-65%) rotate(45deg);
  pointer-events: none;
}

.lang-switch select:focus {
  outline: none;
  border-color: var(--accent);
}

/* ---------- hero ---------- */

.hero {
  padding: 72px 0 56px;
  text-align: center;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 22px;
}

.badge {
  font-size: 12px;
  color: var(--text-muted);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 12px;
}

.hero h1 {
  font-size: clamp(28px, 4.6vw, 46px);
  line-height: 1.15;
  margin: 0 auto 18px;
  max-width: 820px;
  font-weight: 700;
}

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

.hero-sub {
  font-size: clamp(15px, 1.8vw, 18px);
  color: var(--text-muted);
  max-width: 640px;
  margin: 0 auto 30px;
}

.hero-cta {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 48px;
}

.hero-shot {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-elevated);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  max-width: 980px;
  margin: 0 auto;
}

.hero-shot img {
  width: 100%;
}

/* ---------- section shell ---------- */

section {
  padding: 72px 0;
}

section.alt {
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-head {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 44px;
}

.section-kicker {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}

.section-head h2 {
  font-size: clamp(22px, 3vw, 32px);
  margin: 0 0 12px;
}

.section-head p {
  color: var(--text-muted);
  margin: 0;
}

/* ---------- feature grid ---------- */

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.feature-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 22px;
}

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

.feature-icon {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}

.feature-icon svg {
  width: 20px;
  height: 20px;
}

.feature-card h3 {
  font-size: 15px;
  margin: 0 0 8px;
}

.feature-card p {
  font-size: 13.5px;
  color: var(--text-muted);
  margin: 0;
}

/* ---------- screenshot gallery ---------- */

.gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.gallery-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg-elevated);
}

.gallery-item img {
  width: 100%;
  aspect-ratio: 16 / 11;
  object-fit: cover;
  object-position: top;
  border-bottom: 1px solid var(--border);
  background: #0e0e10;
}

.gallery-caption {
  padding: 12px 14px;
  font-size: 13px;
  color: var(--text-muted);
}

.gallery-caption strong {
  color: var(--text);
  display: block;
  font-size: 13.5px;
  margin-bottom: 2px;
}

/* ---------- architecture / local-first ---------- */

.local-first {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 40px;
  align-items: center;
}

.local-first-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.local-first-list li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.check {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  margin-top: 2px;
}

.local-first-list p {
  margin: 0;
  color: var(--text-muted);
  font-size: 13.5px;
}

.local-first-list strong {
  display: block;
  font-size: 14.5px;
  margin-bottom: 2px;
}

.code-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 20px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  color: var(--text-muted);
}

.code-card .cmd {
  color: var(--text);
}

.code-card .cmt {
  color: #6f7078;
}

.code-card-download {
  display: flex;
  width: fit-content;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ---------- languages strip ---------- */

.lang-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.lang-pill {
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 13px;
  color: var(--text-muted);
}

/* ---------- CTA / license ---------- */

.cta-box {
  text-align: center;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  border-radius: 14px;
  padding: 48px 32px;
}

.cta-box h2 {
  margin: 0 0 12px;
  font-size: clamp(20px, 2.6vw, 28px);
}

.cta-box p {
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto 26px;
}

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

/* ---------- footer ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px 0 40px;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
  font-size: 13px;
}

.footer-brand img {
  height: 20px;
}

.footer-links {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
}

.footer-links a:hover {
  color: var(--text);
}

.footer-note {
  color: #6f7078;
  font-size: 12px;
  margin-top: 18px;
}

/* ---------- responsive ---------- */

@media (max-width: 860px) {
  .feature-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .local-first {
    grid-template-columns: 1fr;
  }

  .gallery {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .main-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 12px 24px;
    gap: 12px;
    display: none;
  }

  .main-nav.open {
    display: flex;
  }

  .nav-toggle {
    display: flex;
  }

  .header-actions {
    margin-left: auto;
  }

  .header-cta {
    display: none;
  }

  .nav-cta {
    display: block;
    margin-top: 4px;
    color: var(--accent);
    font-weight: 600;
  }

  section {
    padding: 52px 0;
  }

  .hero {
    padding: 48px 0 40px;
  }
}

@media (max-width: 560px) {
  .feature-grid {
    grid-template-columns: 1fr;
  }
}
