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

:root {
  --bg: #0f1117;
  --bg-alt: #161821;
  --surface: #1e2028;
  --surface-hover: #262833;
  --border: #2a2d3a;
  --text: #e4e4e7;
  --text-muted: #9ca0b0;
  --text-dim: #6b7084;
  --primary: #6366f1;
  --primary-hover: #818cf8;
  --primary-dim: rgba(99, 102, 241, 0.12);
  --green: #22c55e;
  --green-dim: rgba(34, 197, 94, 0.12);
  --amber: #f59e0b;
  --amber-dim: rgba(245, 158, 11, 0.12);
  --red: #ef4444;
  --red-dim: rgba(239, 68, 68, 0.12);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-xs: 6px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --shadow: 0 4px 24px rgba(0,0,0,0.3);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.2);
}

html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container { max-width: 1140px; margin: 0 auto; padding: 0 24px; }

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

/* ===== Navigation ===== */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: rgba(15, 17, 23, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 18px; color: var(--text); text-decoration: none; }
.nav-links { display: flex; align-items: center; gap: 24px; }
.nav-links a { color: var(--text-muted); font-size: 14px; font-weight: 500; text-decoration: none; }
.nav-links a:hover { color: var(--text); }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 20px; border-radius: var(--radius-sm);
  font-weight: 600; font-size: 14px; border: none; cursor: pointer;
  transition: all 0.15s ease; text-decoration: none !important;
}
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.btn-ghost:hover { border-color: var(--text-dim); color: var(--text); }

/* ===== Hero ===== */
.hero {
  padding: 140px 0 80px;
  text-align: center;
  background: radial-gradient(ellipse at 50% 0%, rgba(99,102,241,0.08) 0%, transparent 70%);
}
.hero-badge {
  display: inline-block; padding: 6px 16px; border-radius: 999px;
  font-size: 13px; font-weight: 600; color: var(--primary-hover);
  background: var(--primary-dim); border: 1px solid rgba(99,102,241,0.2);
  margin-bottom: 24px;
}
.hero h1 { font-size: clamp(36px, 5vw, 56px); font-weight: 800; line-height: 1.1; margin-bottom: 20px; letter-spacing: -0.02em; }
.hero-sub { font-size: 18px; color: var(--text-muted); max-width: 560px; margin: 0 auto 48px; }
.hero-stats { display: flex; justify-content: center; gap: 64px; }
.stat { display: flex; flex-direction: column; align-items: center; }
.stat-num { font-size: 36px; font-weight: 800; color: var(--primary-hover); }
.stat-label { font-size: 13px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.05em; margin-top: 4px; }

/* ===== Sections ===== */
.section { padding: 80px 0; }
.section-alt { background: var(--bg-alt); }
.section-title { font-size: 32px; font-weight: 800; text-align: center; margin-bottom: 8px; letter-spacing: -0.01em; }
.section-sub { text-align: center; color: var(--text-muted); margin-bottom: 48px; font-size: 16px; }

/* ===== State Grid ===== */
.state-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.state-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px;
  cursor: pointer; transition: all 0.2s ease;
}
.state-card:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: var(--shadow); }
.state-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.state-code {
  font-size: 13px; font-weight: 700; padding: 4px 10px;
  border-radius: var(--radius-xs); background: var(--primary-dim); color: var(--primary-hover);
}
.state-name { font-size: 20px; font-weight: 700; margin-bottom: 12px; }
.state-meta { display: flex; flex-direction: column; gap: 8px; }
.state-meta-item {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--text-muted);
}
.state-meta-item .icon { width: 16px; text-align: center; }
.state-tag {
  display: inline-block; padding: 3px 8px; border-radius: var(--radius-xs);
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em;
}
.tag-green { background: var(--green-dim); color: var(--green); }
.tag-amber { background: var(--amber-dim); color: var(--amber); }
.tag-red { background: var(--red-dim); color: var(--red); }

/* ===== Modal ===== */
.modal-overlay {
  display: none; position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,0.6); backdrop-filter: blur(4px);
  align-items: flex-start; justify-content: center;
  padding: 80px 24px 24px; overflow-y: auto;
}
.modal-overlay.active { display: flex; }
.modal {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); max-width: 760px; width: 100%;
  padding: 32px; position: relative; box-shadow: var(--shadow);
}
.modal-close {
  position: absolute; top: 16px; right: 16px;
  background: none; border: none; color: var(--text-muted);
  font-size: 28px; cursor: pointer; line-height: 1;
}
.modal-close:hover { color: var(--text); }

.modal h2 { font-size: 28px; font-weight: 800; margin-bottom: 4px; }
.modal .state-code-lg {
  display: inline-block; padding: 4px 12px; border-radius: var(--radius-xs);
  background: var(--primary-dim); color: var(--primary-hover);
  font-size: 14px; font-weight: 700; margin-bottom: 24px;
}
.modal-section { margin-bottom: 24px; }
.modal-section h3 {
  font-size: 14px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--text-dim); margin-bottom: 12px;
  padding-bottom: 8px; border-bottom: 1px solid var(--border);
}
.modal-section ul { list-style: none; padding: 0; }
.modal-section li {
  padding: 6px 0; font-size: 14px; color: var(--text-muted);
  border-bottom: 1px solid rgba(42,45,58,0.5);
  display: flex; align-items: flex-start; gap: 8px;
}
.modal-section li::before { content: '•'; color: var(--primary); font-weight: 700; flex-shrink: 0; }
.modal-section li:last-child { border-bottom: none; }

.modal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.modal-grid .info-block {
  background: var(--bg); border-radius: var(--radius-sm); padding: 16px;
}
.info-block-label { font-size: 12px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 4px; }
.info-block-value { font-size: 15px; font-weight: 600; }

.sales-row { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid rgba(42,45,58,0.5); }
.sales-row:last-child { border-bottom: none; }
.sales-channel { font-size: 14px; color: var(--text-muted); }
.sales-status { font-size: 13px; font-weight: 600; }
.sales-allowed { color: var(--green); }
.sales-blocked { color: var(--red); }

/* ===== Timeline ===== */
.timeline { max-width: 680px; margin: 0 auto; }
.timeline-item {
  display: flex; gap: 20px; padding: 20px 0;
  border-bottom: 1px solid var(--border);
}
.timeline-item:last-child { border-bottom: none; }
.timeline-dot {
  flex-shrink: 0; width: 40px; height: 40px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 18px; margin-top: 2px;
}
.dot-added { background: var(--green-dim); }
.dot-removed { background: var(--red-dim); }
.dot-modified { background: var(--amber-dim); }
.timeline-body { flex: 1; }
.timeline-state {
  font-size: 13px; font-weight: 700; color: var(--primary-hover);
  text-transform: uppercase; letter-spacing: 0.04em;
}
.timeline-summary { font-size: 15px; margin-top: 4px; }
.timeline-date { font-size: 13px; color: var(--text-dim); margin-top: 6px; }
.timeline-empty {
  text-align: center; padding: 48px 24px;
  color: var(--text-dim); font-size: 15px;
}

/* ===== Signup ===== */
.signup-card {
  background: linear-gradient(135deg, rgba(99,102,241,0.08), rgba(99,102,241,0.02));
  border: 1px solid rgba(99,102,241,0.2);
  border-radius: var(--radius); padding: 48px; text-align: center;
}
.signup-content { max-width: 520px; margin: 0 auto; }
.signup-content h2 { font-size: 28px; font-weight: 800; margin-bottom: 12px; }
.signup-content p { color: var(--text-muted); margin-bottom: 32px; }

.signup-form .form-row { display: flex; gap: 12px; margin-bottom: 16px; }
.input {
  flex: 1; padding: 12px 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--bg);
  color: var(--text); font-size: 15px; font-family: var(--font);
  outline: none; transition: border-color 0.15s;
}
.input:focus { border-color: var(--primary); }
.input::placeholder { color: var(--text-dim); }

.form-states {
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: center;
  margin-bottom: 24px;
}
.state-check {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: var(--radius-xs);
  background: var(--surface); border: 1px solid var(--border);
  cursor: pointer; font-size: 13px; color: var(--text-muted);
  transition: all 0.15s;
}
.state-check:has(input:checked) { border-color: var(--primary); color: var(--primary-hover); background: var(--primary-dim); }
.state-check input { display: none; }

.subscribe-msg { margin-top: 16px; font-size: 14px; font-weight: 600; }
.subscribe-msg.success { color: var(--green); }
.subscribe-msg.error { color: var(--red); }

/* ===== Footer ===== */
.footer { padding: 40px 0; border-top: 1px solid var(--border); }
.footer-inner { display: flex; align-items: center; justify-content: space-between; }
.footer-brand { font-weight: 700; font-size: 16px; }
.footer-text { font-size: 13px; color: var(--text-dim); }

/* ===== Utilities ===== */
.loading { text-align: center; padding: 48px; color: var(--text-dim); }

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .hero-stats { gap: 32px; }
  .stat-num { font-size: 28px; }
  .modal-grid { grid-template-columns: 1fr; }
  .signup-form .form-row { flex-direction: column; }
  .footer-inner { flex-direction: column; gap: 12px; text-align: center; }
  .nav-links a:not(.btn) { display: none; }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 28px; }
  .hero-stats { flex-direction: column; gap: 16px; }
  .state-grid { grid-template-columns: 1fr; }
}
