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

:root {
  --primary: #4a90d9;
  --primary-dark: #3a7bc8;
  --primary-light: #6ba3e0;
  --accent: #f5a623;
  --bg: #ffffff;
  --bg-alt: #f8f9fa;
  --bg-card: #ffffff;
  --text: #1a1a2e;
  --text-secondary: #555770;
  --text-muted: #8e8ea0;
  --border: #e2e4e9;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.1), 0 12px 40px rgba(0, 0, 0, 0.06);
  --radius: 12px;
  --radius-sm: 8px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --max-width: 1120px;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1117;
    --bg-alt: #181a22;
    --bg-card: #1e2029;
    --text: #e4e4ed;
    --text-secondary: #a0a0b8;
    --text-muted: #6b6b80;
    --border: #2a2d3a;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.3), 0 4px 12px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.3), 0 12px 40px rgba(0, 0, 0, 0.25);
  }
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--primary-dark);
}

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

/* ── Typography ────────────────────────────────────── */
h1, h2, h3, h4 {
  font-weight: 700;
  line-height: 1.25;
  color: var(--text);
}

h1 { font-size: 2.75rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.125rem; }

p {
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ── Layout ────────────────────────────────────────── */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

section {
  padding: 5rem 0;
}

/* ── Navbar ────────────────────────────────────────── */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

@supports (backdrop-filter: blur(12px)) {
  .navbar {
    background: color-mix(in srgb, var(--bg) 85%, transparent);
  }
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--text);
}

.nav-brand svg {
  width: 28px;
  height: 28px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
}

.nav-links a {
  display: block;
  padding: 0.5rem 0.875rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
  background: var(--bg-alt);
}

.lang-toggle {
  display: flex;
  align-items: center;
  gap: 0;
  margin-left: 0.5rem;
  background: var(--bg-alt);
  border-radius: 999px;
  padding: 3px;
  border: 1px solid var(--border);
}

.lang-toggle button {
  background: none;
  border: none;
  padding: 0.3rem 0.65rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 999px;
  transition: all var(--transition);
  font-family: var(--font);
}

.lang-toggle button.active {
  background: var(--bg-card);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.nav-hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  color: var(--text);
}

.nav-hamburger svg {
  width: 24px;
  height: 24px;
}

/* ── Mobile Nav ────────────────────────────────────── */
@media (max-width: 768px) {
  .nav-hamburger {
    display: block;
  }

  .nav-menu {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.5rem;
    box-shadow: var(--shadow-lg);
  }

  .nav-menu.open {
    display: block;
  }

  .nav-links {
    flex-direction: column;
    gap: 0.25rem;
  }

  .nav-links a {
    padding: 0.75rem 1rem;
    width: 100%;
  }

  .lang-toggle {
    margin-left: 0;
    margin-top: 0.75rem;
    align-self: flex-start;
  }
}

/* ── Hero ──────────────────────────────────────────── */
.hero {
  padding-top: 10rem;
  padding-bottom: 6rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, color-mix(in srgb, var(--primary) 8%, transparent), transparent 70%);
  pointer-events: none;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1rem;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.hero-badge span {
  color: var(--primary);
}

.hero h1 {
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  margin-bottom: 1.25rem;
  letter-spacing: -0.02em;
}

.hero h1 .gradient {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 1.2rem;
  max-width: 600px;
  margin: 0 auto 2.5rem;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ── Buttons ───────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: var(--font);
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(74, 144, 217, 0.3);
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(74, 144, 217, 0.4);
  color: #fff;
}

.btn-secondary {
  background: var(--bg-alt);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--border);
  transform: translateY(-1px);
}

/* ── Features ──────────────────────────────────────── */
.features {
  background: var(--bg-alt);
}

.section-header {
  text-align: center;
  margin-bottom: 3.5rem;
}

.section-header h2 {
  margin-bottom: 0.75rem;
}

.section-header p {
  font-size: 1.1rem;
  max-width: 560px;
  margin: 0 auto;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

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

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

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  transition: all var(--transition);
}

.feature-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.feature-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  font-size: 1.5rem;
  background: color-mix(in srgb, var(--primary) 10%, transparent);
  color: var(--primary);
}

.feature-card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.feature-card p {
  font-size: 0.9rem;
}

/* ── Screenshots Carousel ──────────────────────────── */
.screenshots {
  text-align: center;
}

.screenshot-track {
  display: flex;
  gap: 1.5rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding: 1rem 0 2rem;
  scrollbar-width: none;
}

.screenshot-track::-webkit-scrollbar {
  display: none;
}

.screenshot-item {
  flex: 0 0 280px;
  scroll-snap-align: center;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  background: var(--bg-card);
  transition: transform var(--transition);
}

.screenshot-item:hover {
  transform: scale(1.02);
}

.screenshot-placeholder {
  height: 500px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  background: var(--bg-alt);
}

.screenshot-placeholder svg {
  width: 48px;
  height: 48px;
  opacity: 0.4;
}

/* ── Open Source ────────────────────────────────────── */
.open-source {
  background: var(--bg-alt);
}

.oss-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 3rem;
  text-align: center;
  max-width: 640px;
  margin: 0 auto;
}

.oss-card h2 {
  margin-bottom: 1rem;
}

.oss-card p {
  margin-bottom: 2rem;
  font-size: 1.05rem;
}

.oss-links {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ── Footer ────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  padding: 3rem 0 2rem;
  background: var(--bg-alt);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2.5rem;
}

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

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

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 0.75rem;
}

.footer-brand svg {
  width: 24px;
  height: 24px;
}

.footer-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  max-width: 300px;
}

.footer-col h4 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.footer-col ul {
  list-style: none;
}

.footer-col li {
  margin-bottom: 0.4rem;
}

.footer-col a {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

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

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-muted);
}

@media (max-width: 560px) {
  .footer-bottom {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }
}

/* ── Legal Pages (Privacy, Terms) ──────────────────── */
.legal {
  padding-top: 8rem;
  padding-bottom: 5rem;
}

.legal-content {
  max-width: 720px;
  margin: 0 auto;
}

.legal-content h1 {
  font-size: 2.25rem;
  margin-bottom: 0.5rem;
}

.legal-meta {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.legal-content h2 {
  font-size: 1.35rem;
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
}

.legal-content h3 {
  font-size: 1.1rem;
  margin-top: 1.75rem;
  margin-bottom: 0.5rem;
}

.legal-content p {
  margin-bottom: 1rem;
}

.legal-content ul,
.legal-content ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
  color: var(--text-secondary);
}

.legal-content li {
  margin-bottom: 0.4rem;
  line-height: 1.7;
}

.legal-content strong {
  color: var(--text);
  font-weight: 600;
}

/* ── Contact Page ──────────────────────────────────── */
.contact {
  padding-top: 8rem;
  padding-bottom: 5rem;
}

.contact-header {
  text-align: center;
  margin-bottom: 3rem;
}

.contact-header h1 {
  font-size: 2.25rem;
  margin-bottom: 0.75rem;
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  max-width: 900px;
  margin: 0 auto;
}

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

.contact-form-card,
.contact-channels {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
}

.contact-form-card h2,
.contact-channels h2 {
  font-size: 1.2rem;
  margin-bottom: 1.25rem;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.65rem 0.875rem;
  font-size: 0.9rem;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition);
  outline: none;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 15%, transparent);
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
}

.form-submit {
  width: 100%;
  justify-content: center;
}

.form-status {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  display: none;
}

.form-status.success {
  display: block;
  background: color-mix(in srgb, #22c55e 10%, transparent);
  color: #16a34a;
  border: 1px solid color-mix(in srgb, #22c55e 25%, transparent);
}

.form-status.error {
  display: block;
  background: color-mix(in srgb, #ef4444 10%, transparent);
  color: #dc2626;
  border: 1px solid color-mix(in srgb, #ef4444 25%, transparent);
}

.channel-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.channel-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  transition: all var(--transition);
}

.channel-item:hover {
  background: var(--bg-alt);
}

.channel-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--primary) 10%, transparent);
  color: var(--primary);
  flex-shrink: 0;
}

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

.channel-text h3 {
  font-size: 0.95rem;
  margin-bottom: 0.2rem;
}

.channel-text p {
  font-size: 0.8rem;
  margin: 0;
}

/* ── Utilities ─────────────────────────────────────── */
[data-lang] {
  display: none;
}

[data-lang].active {
  display: revert;
}

/* For inline text nodes that share a parent */
.i18n-block { display: none; }
.i18n-block.active { display: block; }
.i18n-inline { display: none; }
.i18n-inline.active { display: inline; }

/* Accessibility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Scrollbar (Webkit) */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}
