/* === Reset & Base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #fafafa;
  --surface: #ffffff;
  --text: #1a1a2e;
  --text-secondary: #555;
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --border: #e5e7eb;
  --code-bg: #1e293b;
  --code-text: #e2e8f0;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-lg: 0 4px 12px rgba(0,0,0,0.1);
}
html { scroll-behavior: smooth; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; color: var(--text); background: var(--bg); line-height: 1.6; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.container { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* === Nav === */
.nav { position: sticky; top: 0; z-index: 100; background: rgba(255,255,255,0.95); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.nav-inner { display: flex; align-items: center; height: 56px; gap: 32px; }
.logo { font-size: 1.2rem; font-weight: 700; color: var(--text); text-decoration: none; }
.accent { color: var(--accent); }
.nav-links { display: flex; align-items: center; gap: 24px; margin-left: auto; }
.nav-links a { color: var(--text-secondary); font-size: 0.9rem; font-weight: 500; text-decoration: none; }
.nav-links a:hover { color: var(--accent); }
.nav-toggle { display: none; background: none; border: none; font-size: 1.4rem; cursor: pointer; }

/* === Buttons === */
.btn { display: inline-block; padding: 10px 20px; border-radius: var(--radius); font-weight: 600; font-size: 0.9rem; text-decoration: none; transition: all 0.2s; cursor: pointer; border: none; }
.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: var(--accent-dark); text-decoration: none; }
.btn-outline { border: 1.5px solid var(--border); color: var(--text); background: white; }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.btn-sm { padding: 6px 14px; font-size: 0.82rem; }

/* === Hero === */
.hero { padding: 80px 0 60px; text-align: center; background: linear-gradient(180deg, #f0f5ff 0%, var(--bg) 100%); }
.hero h1 { font-size: 3rem; font-weight: 800; line-height: 1.15; letter-spacing: -0.02em; }
.hero-sub { max-width: 640px; margin: 20px auto 0; font-size: 1.15rem; color: var(--text-secondary); }
.hero-actions { display: flex; gap: 12px; justify-content: center; margin-top: 32px; }

/* === Stats === */
.stats { padding: 48px 0; border-bottom: 1px solid var(--border); }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; text-align: center; }
.stat-num { display: block; font-size: 2.2rem; font-weight: 800; color: var(--accent); }
.stat-label { font-size: 0.9rem; color: var(--text-secondary); }

/* === Features === */
.features { padding: 72px 0; }
.features h2, .code-example h2, .countries h2, .pricing h2 { font-size: 2rem; font-weight: 700; text-align: center; margin-bottom: 12px; }
.section-sub { text-align: center; color: var(--text-secondary); margin-bottom: 40px; font-size: 1.05rem; }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 40px; }
.feature-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; transition: box-shadow 0.2s; }
.feature-card:hover { box-shadow: var(--shadow-lg); }
.feature-icon { font-size: 2rem; margin-bottom: 12px; }
.feature-card h3 { font-size: 1.1rem; margin-bottom: 8px; }
.feature-card p { font-size: 0.9rem; color: var(--text-secondary); margin-bottom: 12px; }
.feature-tag { display: inline-block; background: #eff6ff; color: var(--accent); font-size: 0.78rem; font-weight: 600; padding: 3px 10px; border-radius: 20px; }

/* === Code Example === */
.code-example { padding: 72px 0; background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.code-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 40px; }
.code-block { background: var(--code-bg); border-radius: var(--radius); overflow: hidden; }
.code-header { padding: 10px 16px; background: rgba(255,255,255,0.06); font-size: 0.8rem; color: #94a3b8; font-weight: 600; border-bottom: 1px solid rgba(255,255,255,0.06); }
.code-block pre { padding: 16px; overflow-x: auto; }
.code-block code { color: var(--code-text); font-family: 'SF Mono', 'Fira Code', monospace; font-size: 0.82rem; line-height: 1.6; white-space: pre; }

/* === Countries === */
.countries { padding: 72px 0; }
.country-grid { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 32px; }
.country-tag { display: inline-flex; align-items: center; gap: 6px; background: var(--surface); border: 1px solid var(--border); padding: 8px 14px; border-radius: 24px; font-size: 0.88rem; font-weight: 500; }
.country-tag small { color: var(--accent); font-weight: 700; }
.more-tag { border-color: var(--accent); }
.more-tag a { font-weight: 600; }

/* === Pricing === */
.pricing { padding: 72px 0; background: var(--surface); border-top: 1px solid var(--border); }
.pricing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 40px; }
.price-card { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 32px; text-align: center; }
.price-card.featured { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); position: relative; }
.price-card.featured::before { content: "Most Popular"; position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: var(--accent); color: white; font-size: 0.72rem; font-weight: 700; padding: 3px 12px; border-radius: 20px; }
.price-card h3 { font-size: 1.2rem; margin-bottom: 8px; }
.price { font-size: 2.5rem; font-weight: 800; margin-bottom: 20px; }
.price span { font-size: 1rem; font-weight: 400; color: var(--text-secondary); }
.price-card ul { list-style: none; margin-bottom: 24px; }
.price-card li { padding: 6px 0; font-size: 0.9rem; color: var(--text-secondary); border-bottom: 1px solid var(--border); }
.price-card li:last-child { border-bottom: none; }
.price-card .btn { width: 100%; }

/* === Footer === */
.footer { padding: 48px 0 0; border-top: 1px solid var(--border); }
.footer-inner { display: flex; justify-content: space-between; gap: 40px; }
.footer-brand p { color: var(--text-secondary); font-size: 0.9rem; margin-top: 8px; }
.footer-links { display: flex; gap: 60px; }
.footer-links h4 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-secondary); margin-bottom: 12px; }
.footer-links a { display: block; color: var(--text-secondary); font-size: 0.88rem; margin-bottom: 8px; text-decoration: none; }
.footer-links a:hover { color: var(--accent); }
.footer-bottom { padding: 24px 0; margin-top: 32px; border-top: 1px solid var(--border); }
.footer-bottom p { font-size: 0.82rem; color: var(--text-secondary); }

/* === Docs page === */
.page-header { padding: 48px 0 32px; background: linear-gradient(180deg, #f0f5ff 0%, var(--bg) 100%); }
.page-header h1 { font-size: 2.2rem; font-weight: 800; }
.page-header p { color: var(--text-secondary); margin-top: 8px; }
.docs-layout { display: grid; grid-template-columns: 220px 1fr; gap: 40px; padding: 40px 0 80px; }
.docs-sidebar { position: sticky; top: 72px; align-self: start; }
.docs-sidebar a { display: block; padding: 6px 12px; font-size: 0.88rem; color: var(--text-secondary); border-left: 2px solid transparent; margin-bottom: 2px; border-radius: 0 4px 4px 0; text-decoration: none; }
.docs-sidebar a:hover, .docs-sidebar a.active { color: var(--accent); border-left-color: var(--accent); background: #eff6ff; }
.docs-content h2 { font-size: 1.5rem; font-weight: 700; margin: 32px 0 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.docs-content h2:first-child { border-top: none; margin-top: 0; }
.docs-content h3 { font-size: 1.15rem; margin: 24px 0 12px; }
.docs-content p { margin-bottom: 16px; color: var(--text-secondary); }
.docs-content code { background: #f1f5f9; padding: 2px 6px; border-radius: 4px; font-size: 0.88rem; }
.docs-content pre { background: var(--code-bg); color: var(--code-text); padding: 16px; border-radius: var(--radius); overflow-x: auto; margin-bottom: 20px; }
.docs-content pre code { background: none; padding: 0; color: inherit; }
.endpoint-badge { display: inline-block; font-size: 0.75rem; font-weight: 700; padding: 2px 8px; border-radius: 4px; margin-right: 8px; }
.get { background: #dcfce7; color: #166534; }
table { width: 100%; border-collapse: collapse; margin-bottom: 20px; font-size: 0.9rem; }
th { text-align: left; padding: 10px 12px; background: #f8fafc; border-bottom: 2px solid var(--border); font-weight: 600; }
td { padding: 10px 12px; border-bottom: 1px solid var(--border); }

/* === Catalog page === */
.catalog-controls { display: flex; gap: 12px; margin-bottom: 24px; flex-wrap: wrap; }
.catalog-controls input, .catalog-controls select { padding: 8px 14px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 0.9rem; background: white; }
.catalog-controls input { flex: 1; min-width: 200px; }
.catalog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.product-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; transition: box-shadow 0.2s; }
.product-card:hover { box-shadow: var(--shadow-lg); }
.product-card h3 { font-size: 1rem; margin-bottom: 6px; }
.product-card p { font-size: 0.84rem; color: var(--text-secondary); margin-bottom: 10px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-meta { display: flex; gap: 8px; flex-wrap: wrap; }
.product-meta span { font-size: 0.75rem; padding: 2px 8px; border-radius: 12px; font-weight: 600; }
.meta-country { background: #eff6ff; color: var(--accent); }
.meta-category { background: #f0fdf4; color: #166534; }
.meta-records { background: #fef3c7; color: #92400e; }
.catalog-summary { margin-bottom: 16px; font-size: 0.9rem; color: var(--text-secondary); }

/* === Playground === */
.playground-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; padding: 40px 0 80px; }
.play-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.play-panel h3 { font-size: 1rem; margin-bottom: 16px; font-weight: 700; }
.play-field { margin-bottom: 14px; }
.play-field label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 4px; color: var(--text-secondary); }
.play-field input, .play-field select { width: 100%; padding: 8px 12px; border: 1px solid var(--border); border-radius: 6px; font-size: 0.9rem; }
.play-result { background: var(--code-bg); color: var(--code-text); border-radius: var(--radius); padding: 16px; min-height: 300px; overflow: auto; font-family: 'SF Mono', monospace; font-size: 0.82rem; white-space: pre-wrap; }
.play-status { margin-bottom: 12px; font-size: 0.85rem; }
.play-status .ok { color: #22c55e; font-weight: 600; }
.play-status .err { color: #ef4444; font-weight: 600; }

/* === Mobile === */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-links.open { display: flex; flex-direction: column; position: absolute; top: 56px; left: 0; right: 0; background: white; border-bottom: 1px solid var(--border); padding: 16px 24px; gap: 12px; }
  .nav-toggle { display: block; margin-left: auto; }
  .hero h1 { font-size: 2rem; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .feature-grid { grid-template-columns: 1fr; }
  .code-tabs { grid-template-columns: 1fr; }
  .pricing-grid { grid-template-columns: 1fr; }
  .docs-layout { grid-template-columns: 1fr; }
  .docs-sidebar { position: static; }
  .playground-layout { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; }
  .footer-links { flex-direction: column; gap: 24px; }
}
