/* ============================================================
   DESIGN TOKENS
   ============================================================ */
:root {
  --bg:          #0f0c29;
  --surface:     #1a1035;
  --surface-2:   #13102b;
  --accent:      #7c6fff;
  --text:        #ffffff;
  --text-muted:  #9ca3af;
  --border:      #302b63;
  --accent-10:  rgba(124, 111, 255, 0.1);
  --accent-18:  rgba(124, 111, 255, 0.18);
  --bg-95:      rgba(15, 12, 41, 0.95);
  --font:        'Inter', system-ui, sans-serif;
  --radius:      8px;
  --max-w:       1100px;
}

/* ============================================================
   RESET
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.6;
}
a { color: inherit; text-decoration: none; }

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

/* ============================================================
   TYPOGRAPHY
   ============================================================ */
h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
}
h2 {
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 700;
  line-height: 1.2;
}
h3 { font-size: 1.1rem; font-weight: 600; }
p { color: var(--text-muted); }

/* ============================================================
   LAYOUT
   ============================================================ */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }
section { padding: 80px 24px; }

.badge {
  display: inline-block;
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: opacity 0.15s, transform 0.15s;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { opacity: 0.85; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--accent); color: white; }
.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--text); }
.btn-sm { padding: 7px 16px; font-size: 0.8rem; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

/* ============================================================
   NAV
   ============================================================ */
#nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 0 24px;
  transition: background 0.3s, border-color 0.3s;
  border-bottom: 1px solid transparent;
}
#nav.scrolled {
  background: var(--bg-95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-color: var(--border);
}
.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  color: var(--accent);
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: 0.15em;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
}
.nav-links a:not(.btn) {
  color: var(--text-muted);
  font-size: 0.875rem;
  transition: color 0.15s;
}
.nav-links a:not(.btn):hover { color: var(--text); }

/* ============================================================
   HERO
   ============================================================ */
#hero {
  padding-top: 140px;
  padding-bottom: 80px;
  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, var(--accent-18) 0%, transparent 65%);
  pointer-events: none;
}
#hero h1 {
  max-width: 17ch;
  margin-left: auto;
  margin-right: auto;
}
.hero-sub {
  max-width: 520px;
  margin: 16px auto 32px;
  font-size: 1.1rem;
  line-height: 1.7;
}
.hero-ctas {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ============================================================
   STATS
   ============================================================ */
#stats {
  padding: 36px 24px;
  background: var(--surface-2);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.stats-grid {
  display: flex;
  justify-content: center;
  gap: 64px;
  text-align: center;
  flex-wrap: wrap;
}
.stat-value {
  display: block;
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--accent);
}
.stat-label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ============================================================
   USE CASES
   ============================================================ */
#use-cases { text-align: center; }
#use-cases h2 { margin-bottom: 40px; }
.use-cases-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  max-width: 800px;
  margin: 0 auto;
}
.use-case-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.2s;
  text-align: left;
}
.use-case-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
}
.use-icon { font-size: 1.8rem; display: block; margin-bottom: 12px; }
.use-case-card h3 { margin-bottom: 6px; }
.use-case-card p { font-size: 0.85rem; }

/* ============================================================
   HOW IT WORKS
   ============================================================ */
#how-it-works {
  background: var(--surface-2);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  text-align: center;
}
#how-it-works h2 { margin-bottom: 48px; }
.steps {
  display: flex;
  flex-direction: column;
  gap: 28px;
  max-width: 540px;
  margin: 0 auto;
  text-align: left;
}
.step { display: flex; gap: 20px; align-items: flex-start; }
.step-num {
  flex-shrink: 0;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  font-weight: 700;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.step h3 { margin-bottom: 4px; }

/* ============================================================
   QUIZ / GET STARTED SECTION
   ============================================================ */
#get-started {
  text-align: center;
  background: linear-gradient(160deg, var(--surface) 0%, var(--bg) 100%);
}
#get-started h2 { margin-bottom: 12px; }
.section-sub {
  max-width: 480px;
  margin: 0 auto 40px;
  font-size: 1rem;
}
#quiz {
  max-width: 520px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px;
  text-align: left;
}
.quiz-step.hidden { display: none; }
.quiz-question {
  color: var(--text);
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 20px;
}
.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}
.quiz-opt {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  padding: 12px 16px;
  font-family: var(--font);
  font-size: 0.9rem;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.quiz-opt:hover { border-color: var(--accent); color: var(--text); }
.quiz-opt.selected {
  border-color: var(--accent);
  background: var(--accent-10);
  color: var(--text);
}
.quiz-fields {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}
.quiz-input {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 12px 16px;
  font-family: var(--font);
  font-size: 0.9rem;
  width: 100%;
  transition: border-color 0.15s;
}
.quiz-input::placeholder { color: var(--text-muted); }
.quiz-input:focus { border-color: var(--accent); }
.quiz-input:focus:not(:focus-visible) { outline: none; }
.quiz-thanks-heading {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
}
.quiz-thanks-heading + p { margin-bottom: 20px; }

/* ============================================================
   FOOTER
   ============================================================ */
footer {
  background: var(--surface-2);
  border-top: 1px solid var(--border);
  padding: 24px;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.footer-copy { font-size: 0.8rem; color: var(--text-muted); }
.footer-copy a { color: var(--text-muted); text-decoration: underline; }
.footer-copy a:hover { color: var(--text); }

/* ============================================================
   SCROLL ANIMATIONS
   ============================================================ */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-in.visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .fade-in { opacity: 1; transform: none; transition: none; }
}

/* ============================================================
   FAQ
   ============================================================ */
#faq { background: var(--surface-2); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
#faq h2 { margin-bottom: 40px; text-align: center; }
.faq-list { max-width: 720px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s;
}
.faq-item[open] { border-color: var(--accent); }
.faq-item summary {
  padding: 18px 20px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '+';
  color: var(--accent);
  font-size: 1.4rem;
  font-weight: 300;
  flex-shrink: 0;
  margin-left: 16px;
  transition: transform 0.2s;
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item p {
  padding: 0 20px 18px;
  font-size: 0.9rem;
  line-height: 1.7;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 640px) {
  .nav-links a:not(.btn) { display: none; }
  .stats-grid { gap: 32px; }
  section { padding: 60px 20px; }
  #hero { padding-top: 100px; padding-bottom: 60px; }
  .hero-ctas { flex-direction: column; align-items: center; }
  #quiz { padding: 24px 20px; }
}

/* ============================================================
   BLOG INDEX
   ============================================================ */
.blog-header {
  padding-top: 140px;
  padding-bottom: 60px;
  text-align: center;
}
.blog-header h1 { margin-bottom: 12px; }
.blog-header p { font-size: 1.1rem; }

.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px 80px;
}
.blog-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color 0.2s, transform 0.2s;
  text-decoration: none;
}
.blog-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
}
.blog-card h2 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.4;
}
.blog-card p {
  font-size: 0.875rem;
  flex: 1;
  color: var(--text-muted);
}
.blog-card__meta {
  font-size: 0.78rem;
  color: var(--text-muted);
}
.blog-card__link {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--accent);
  align-self: flex-start;
}

/* ============================================================
   ARTICLE PAGES
   ============================================================ */
.article-wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 120px 24px 80px;
}
.article-breadcrumb {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 32px;
}
.article-breadcrumb a { color: var(--text-muted); }
.article-breadcrumb a:hover { color: var(--text); }
.article-header { margin-bottom: 40px; }
.article-header h1 { margin-bottom: 12px; }
.article-byline {
  font-size: 0.82rem;
  color: var(--text-muted);
}
.article-body h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  margin: 36px 0 12px;
}
.article-body h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin: 24px 0 8px;
}
.article-body p {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.8;
  margin-bottom: 16px;
}
.article-body ul, .article-body ol {
  padding-left: 20px;
  margin-bottom: 16px;
}
.article-body li {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.8;
  margin-bottom: 6px;
}
.article-body strong { color: var(--text); font-weight: 600; }
.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 24px;
  font-size: 0.875rem;
}
.article-body th, .article-body td {
  text-align: left;
  padding: 10px 14px;
  border: 1px solid var(--border);
}
.article-body th {
  background: var(--surface-2);
  color: var(--text);
  font-weight: 600;
}
.article-body td { color: var(--text-muted); }
.article-cta {
  margin-top: 56px;
  padding: 32px;
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: 12px;
  text-align: center;
}
.article-cta h3 {
  font-size: 1.2rem;
  color: var(--text);
  margin-bottom: 8px;
}
.article-cta p { margin-bottom: 20px; }

@media (max-width: 640px) {
  .blog-header { padding-top: 100px; }
  .article-wrap { padding: 90px 20px 60px; }
  .article-body table { font-size: 0.78rem; }
  .article-body th, .article-body td { padding: 8px 10px; }
}
