:root {
  --bg: #f5f7fb;
  --bg-hero: #f9fafb;
  --bg-elevated: #ffffff;
  --bg-soft: #f5f7fb;
  --text-main: #111827;
  --text-body: #374151;
  --text-muted: #6b7280;
  --border-subtle: #e5e7eb;
  --shadow-soft: 0 8px 20px rgba(15, 23, 42, 0.04);
  --shadow-strong: 0 14px 35px rgba(37, 99, 235, 0.15);
  --primary: #0077ff;
  --primary-soft: #e0edff;
  --tag-bg: #e0edff;
  --tag-text: #2563eb;
  --footer-bg: #111827;
  --footer-text: #e5e7eb;
}

body.dark {
  --bg: #020617;
  --bg-hero: #020617;
  --bg-elevated: #020617;
  --bg-soft: #020617;
  --text-main: #e5e7eb;
  --text-body: #e5e7eb;
  --text-muted: #9ca3af;
  --border-subtle: #1f2937;
  --shadow-soft: 0 8px 20px rgba(15, 23, 42, 0.5);
  --shadow-strong: 0 14px 35px rgba(15, 23, 42, 0.9);
  --primary: #60a5fa;
  --primary-soft: #1d4ed8;
  --tag-bg: #1d4ed8;
  --tag-text: #e5e7eb;
  --footer-bg: #020617;
  --footer-text: #9ca3af;
}

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

body {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  background: var(--bg);
  color: var(--text-body);
}

/* LAYOUT UTILITIES */
.section {
  padding: 80px 24px;
}

.section-header {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 40px auto;
}

.section-header h2 {
  font-size: 28px;
  margin-bottom: 8px;
  color: var(--text-main);
}

.section-header p {
  color: var(--text-muted);
  font-size: 15px;
}

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

.card {
  background: var(--bg-elevated);
  border-radius: 12px;
  padding: 24px;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(148, 163, 184, 0.15);
}

/* HEADER / NAVBAR */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px 12px 20px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-braces {
  font-weight: 700;
  font-size: 22px;
  color: #4b5563;
}

body.dark .logo-braces {
  color: #e5e7eb;
}

.logo-text {
  display: flex;
  align-items: baseline;
  gap: 2px;
}

.logo-main {
  font-weight: 600;
  font-size: 19px;
  color: var(--text-main);
}

.logo-dot {
  font-weight: 600;
  font-size: 18px;
  color: var(--primary);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 14px;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-body);
  font-weight: 500;
}

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

.btn-nav {
  background: var(--primary);
  color: #ffffff !important;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
}

.hamburger {
  display: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-main);
  margin-left: 8px;
}

.theme-toggle {
  border: 1px solid var(--border-subtle);
  background: transparent;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 14px;
  cursor: pointer;
  color: var(--text-body);
  margin-left: auto;
  margin-right: 4px;
}

.theme-toggle:hover {
  background: rgba(148, 163, 184, 0.2);
}

.mobile-menu {
  display: none;
  position: absolute;
  top: 56px;
  left: 0;
  right: 0;
  background: var(--bg-elevated);
  padding: 12px 20px 16px 20px;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.12);
  flex-direction: column;
  gap: 10px;
}

.mobile-menu a {
  text-decoration: none;
  color: var(--text-main);
  font-size: 14px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.mobile-menu a:last-child {
  border-bottom: none;
}

.mobile-toggle {
  width: 100%;
  margin-top: 8px;
}

/* HERO */
.hero {
  padding: 80px 24px 72px 24px;
  background: var(--bg-hero);
}

.hero-inner {
  max-width: 780px;
  margin: 0 auto;
  text-align: center;
}

.hero-inner h1 {
  font-size: 40px;
  line-height: 1.2;
  margin-bottom: 12px;
  color: var(--text-main);
}

.hero-inner p {
  color: var(--text-body);
  font-size: 16px;
}

.hero-actions {
  margin-top: 24px;
  display: flex;
  justify-content: center;
  gap: 12px;
}

.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 20px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
}

.btn-secondary {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary-soft);
}

.hero-note {
  margin-top: 10px;
  font-size: 13px;
  color: var(--text-muted);
}

/* FEATURES */
.features {
  background: var(--bg-soft);
}

.feature-card h3 {
  margin-bottom: 8px;
  font-size: 17px;
  color: var(--text-main);
}

.feature-card p {
  font-size: 14px;
  color: var(--text-body);
}

/* SAMPLES */
.samples {
  background: var(--bg-elevated);
}

.sample-card h3 {
  margin-bottom: 8px;
  font-size: 17px;
  color: var(--text-main);
}

.sample-card p {
  font-size: 14px;
  color: var(--text-body);
  margin-bottom: 10px;
}

.tag {
  display: inline-block;
  font-size: 12px;
  color: var(--tag-text);
  background: var(--tag-bg);
  padding: 4px 8px;
  border-radius: 999px;
}

/* AI SECTION */
.ai-section {
  background: var(--bg-hero);
}

.ai-box {
  max-width: 720px;
  margin: 0 auto;
  background: var(--bg-elevated);
  border-radius: 16px;
  padding: 20px;
  box-shadow: var(--shadow-soft);
}

.ai-box textarea {
  width: 100%;
  min-height: 130px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  padding: 10px 12px;
  font-family: inherit;
  font-size: 14px;
  resize: vertical;
  outline: none;
  background: transparent;
  color: var(--text-body);
}

.ai-box textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.2);
}

.ai-btn {
  width: 100%;
  margin-top: 12px;
}

.ai-note {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

/* VIEWER */
.viewer {
  background: var(--bg-elevated);
}

.viewer-layout {
  max-width: 1040px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1.3fr);
  gap: 24px;
}

.viewer-code {
  background: var(--bg-hero);
  border-radius: 14px;
  padding: 16px;
  border: 1px solid var(--border-subtle);
}

.viewer-code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.viewer-title {
  font-size: 14px;
  color: var(--text-muted);
}

.copy-btn {
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  padding: 4px 10px;
  font-size: 12px;
  background: transparent;
  cursor: pointer;
  color: var(--text-body);
}

.copy-btn:hover {
  background: rgba(148, 163, 184, 0.25);
}

.viewer-code pre {
  max-height: 260px;
  overflow: auto;
  font-size: 13px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
  color: var(--text-body);
}

.viewer-code code {
  white-space: pre;
}

.viewer-preview {
  background: var(--bg-hero);
  border-radius: 14px;
  padding: 24px;
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-card {
  max-width: 320px;
}

/* PRICING */
.pricing {
  background: var(--bg-soft);
}

.pricing-grid {
  max-width: 960px;
  margin: 0 auto;
}

.pricing-card h3 {
  font-size: 18px;
  margin-bottom: 6px;
  color: var(--text-main);
}

.price {
  font-size: 32px;
  color: var(--primary);
  font-weight: 700;
  margin: 10px 0 16px 0;
}

.pricing-card ul {
  list-style: none;
  margin-bottom: 18px;
}

.pricing-card li {
  font-size: 14px;
  color: var(--text-body);
  margin-bottom: 6px;
}

.pricing-card.highlight {
  border: 1px solid var(--primary-soft);
  box-shadow: var(--shadow-strong);
}

/* CONTACT */
.contact {
  background: var(--bg-hero);
  text-align: center;
}

.contact-line {
  font-size: 15px;
  color: var(--text-body);
}

.contact-line a {
  color: var(--primary);
  text-decoration: none;
}

/* FOOTER */
.footer {
  background: var(--footer-bg);
  color: var(--footer-text);
  padding: 18px 24px;
  text-align: center;
  font-size: 13px;
}

/* RESPONSIVE */
@media (max-width: 900px) {
  .hero-inner h1 {
    font-size: 34px;
  }
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
  }

  .hamburger {
    display: block;
  }

  .navbar {
    padding-inline: 12px;
  }

  .logo-main {
    font-size: 17px;
  }

  .logo-braces {
    font-size: 20px;
  }

  .theme-toggle {
    margin-right: 0;
  }

  .hero {
    padding-top: 64px;
    padding-bottom: 64px;
  }

  .hero-inner h1 {
    font-size: 28px;
  }

  .hero-inner p {
    font-size: 14px;
  }

  .section {
    padding: 64px 20px;
  }

  .viewer-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 480px) {
  .hero-actions {
    flex-direction: column;
  }
}
