:root {
  color-scheme: dark;
  --bg: #0c0c0c;
  --bg-elevated: #141414;
  --bg-card: #1a1a1a;
  --text: #fafaf9;
  --text-secondary: #a8a29e;
  --text-muted: #78716c;
  --border: rgba(250, 250, 249, 0.08);
  --border-strong: rgba(250, 250, 249, 0.15);
  --accent: #dc2626;
  --accent-warm: #ea580c;
  --success: #16a34a;
  --warning: #ca8a04;
  --error: #dc2626;
  --font-serif: 'Instrument Serif', Georgia, serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --font-sans: 'Inter', system-ui, sans-serif;
}

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

html {
  scroll-behavior: smooth;
  background: var(--bg);
  font-size: 16px;
}

body {
  font-family: var(--font-mono);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

#bg-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.6;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background-image: linear-gradient(rgba(250, 250, 249, 0.015) 1px, transparent 1px), linear-gradient(90deg, rgba(250, 250, 249, 0.015) 1px, transparent 1px);
  background-size: 100px 100px;
}

/* ─── Container ───────────────────────────────────────────────── */
.container {
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 40px;
  position: relative;
}

@media (max-width: 768px) {
  .container {
    padding: 0 20px;
  }
}

/* ─── Navigation ────────────────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  mix-blend-mode: difference;
}

.nav-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 40px;
}

.logo {
  display: flex;
  align-items: baseline;
  gap: 0;
  text-decoration: none;
  color: var(--text);
}

.logo-text {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--text);
  text-transform: lowercase;
}

.logo-a {
  font-family: 'Inter', sans-serif;
  font-size: 24px;
  font-weight: 500;
  line-height: 1;
  color: var(--accent);
  display: inline-block;
  vertical-align: baseline;
  text-transform: uppercase;
  letter-spacing: 0;
}

.nav-links {
  display: flex;
  gap: 40px;
  align-items: center;
}

.nav-link {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.3s ease;
}

.nav-link:hover {
  color: var(--text);
}

.nav-auth {
  display: flex;
  gap: 16px;
  align-items: center;
}

/* ─── Buttons ───────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none;
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--text);
  transition: all 0.3s ease;
}

.btn:hover {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

.btn-primary {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

.btn-primary:hover {
  background: transparent;
  color: var(--text);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 11px;
}

.btn-lg {
  padding: 16px 32px;
  font-size: 13px;
}

.btn-full {
  width: 100%;
  justify-content: center;
}

.btn-secondary {
  border-color: var(--border);
  color: var(--text-secondary);
}

.btn-secondary:hover {
  border-color: var(--text-secondary);
  color: var(--text);
  background: transparent;
}

/* ─── Hero ────────────────────────────────────────────────────── */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 160px 0 100px;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 60%;
  height: 100%;
  background: linear-gradient(135deg, transparent 0%, rgba(220, 38, 38, 0.03) 100%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 900px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 48px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.badge-pulse {
  width: 8px;
  height: 8px;
  background: var(--accent);
  animation: blink 1.5s ease-in-out infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(3.5rem, 8vw, 7rem);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-bottom: 32px;
  color: var(--text);
}

.gradient-text {
  color: var(--text-secondary);
  font-style: italic;
}

.hero-subtitle {
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-secondary);
  max-width: 520px;
  margin-bottom: 48px;
}

.hero-cta {
  display: flex;
  gap: 16px;
  margin-bottom: 64px;
  flex-wrap: wrap;
}

.deploy-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 24px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 80px;
}

.deploy-banner .badge {
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.05em;
}

.deploy-banner .cmd {
  color: var(--text-secondary);
}

.hero-stats {
  display: flex;
  gap: 80px;
}

.stat {
  position: relative;
}

.stat::before {
  content: '';
  position: absolute;
  left: -24px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--border);
}

.stat:first-child::before {
  display: none;
}

.stat-value {
  font-family: var(--font-serif);
  font-size: 2.5rem;
  font-weight: 400;
  line-height: 1;
  color: var(--text);
  margin-bottom: 8px;
}

.stat-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ─── Terminal ──────────────────────────────────────────────────── */
.terminal-window {
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  margin-top: 80px;
  position: relative;
}

.terminal-window::before {
  content: '/// AGENTAUDIT v1.1.0 — REAL-TIME GUARDRAIL';
  position: absolute;
  top: -24px;
  left: 0;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.terminal-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
}

.terminal-dots {
  display: flex;
  gap: 8px;
}

.terminal-dots span {
  width: 10px;
  height: 10px;
  border: 1px solid var(--border-strong);
  background: transparent;
}

.terminal-dots span:first-child {
  background: var(--accent);
  border-color: var(--accent);
}

.terminal-title {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-left: auto;
}

.terminal-body {
  padding: 24px 20px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.8;
}

.terminal-line {
  display: flex;
  gap: 12px;
  align-items: baseline;
}

.terminal-line.output {
  padding-left: 24px;
  color: var(--text-secondary);
}

.terminal-line.code {
  padding-left: 24px;
  color: var(--text-muted);
}

.prompt {
  color: var(--accent);
  font-weight: 600;
}

.command {
  color: var(--text);
}

.success {
  color: var(--success);
}

.error {
  color: var(--error);
  font-weight: 600;
}

.code-kw {
  color: var(--accent-warm);
}

.code-str {
  color: var(--success);
}

.code-comment {
  color: var(--text-muted);
}

.cursor {
  display: inline-block;
  width: 8px;
  height: 16px;
  background: var(--accent);
  animation: blink 1s step-end infinite;
  vertical-align: middle;
}

/* ─── Demo Section ──────────────────────────────────────────────── */
.guardrail-demo {
  padding: 120px 0;
  position: relative;
}

.guardrail-demo::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--accent) 50%, transparent 100%);
}

.demo-header {
  margin-bottom: 40px;
}

.demo-presets {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
}

.demo-presets-label {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-right: 4px;
}

.demo-preset-btn {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 5px 12px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
  white-space: nowrap;
}

.demo-preset-btn:hover {
  border-color: var(--accent);
  color: var(--text);
  background: var(--bg-elevated);
}

.demo-preset-btn.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--bg-elevated);
}

.demo-header h2 {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 400;
  line-height: 1.1;
  margin-bottom: 16px;
}

.demo-header p {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-secondary);
  max-width: 500px;
}

.section-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 24px;
}

.demo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}

.demo-input,
.demo-output {
  background: var(--bg-elevated);
  padding: 32px;
}

.demo-input label {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.demo-input textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 16px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text);
  resize: vertical;
  min-height: 120px;
  outline: none;
}

.demo-input textarea:focus {
  border-color: var(--text-secondary);
}

.demo-input textarea::placeholder {
  color: var(--text-muted);
}

.demo-actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.demo-output-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  color: var(--text-muted);
  gap: 16px;
}

.demo-output-placeholder svg {
  opacity: 0.3;
}

.demo-legend {
  display: flex;
  gap: 32px;
  margin-top: 24px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

.demo-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 8px;
}

.demo-dot.allowed {
  background: var(--success);
}

.demo-dot.flagged {
  background: var(--warning);
}

.demo-dot.blocked {
  background: var(--error);
}

/* ─── Demo result panel ─────────────────────────────────────────── */
.demo-result {
  display: flex;
  flex-direction: column;
  gap: 16px;
  height: 100%;
}

/* Status bar — colour shifts with allowed / flagged / blocked */
.demo-status {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  border: 1px solid transparent;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.demo-status.allowed {
  background: rgba(22, 163, 74, 0.12);
  border-color: rgba(22, 163, 74, 0.35);
  color: #4ade80;
}
.demo-status.flagged {
  background: rgba(202, 138, 4, 0.12);
  border-color: rgba(202, 138, 4, 0.35);
  color: #fbbf24;
}
.demo-status.blocked {
  background: rgba(220, 38, 38, 0.12);
  border-color: rgba(220, 38, 38, 0.35);
  color: #f87171;
}

.demo-status-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}
.demo-status.allowed .demo-status-icon  { background: rgba(22, 163, 74, 0.25);  color: #4ade80; }
.demo-status.flagged .demo-status-icon  { background: rgba(202, 138, 4, 0.25);  color: #fbbf24; }
.demo-status.blocked .demo-status-icon  { background: rgba(220, 38, 38, 0.25);  color: #f87171; }

/* Violations list */
.demo-violations {
  font-size: 13px;
}
.demo-violations-title {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.demo-violations-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.demo-violations-list li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}
.demo-violations-list li svg {
  flex-shrink: 0;
  margin-top: 1px;
  color: var(--text-muted);
}

/* API preview box */
.demo-api-section {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}
.demo-api-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}
.demo-api-badge {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 10px;
  color: var(--text-secondary);
}
.demo-api-json {
  margin: 0;
  padding: 14px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--text-secondary);
  overflow-x: auto;
  max-height: 180px;
  overflow-y: auto;
}
.demo-api-actions {
  display: flex;
  gap: 10px;
  padding: 10px 14px;
  border-top: 1px solid var(--border);
}

/* Scanning spinner */
.demo-scanning {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  height: 100%;
  min-height: 120px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-muted);
}
.demo-scanning-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* ─── Trust / Logos ─────────────────────────────────────────────── */
.trust {
  padding: 80px 0;
  position: relative;
}

.trust::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--accent) 50%, transparent 100%);
}

.trust::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--accent) 50%, transparent 100%);
}

.trust-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 32px;
}

.trust-logos {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.trust-logo {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 8px 20px;
  transition: color 0.3s, border-color 0.3s;
}

.trust-logo:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

/* ─── Features ────────────────────────────────────────────────── */
.features {
  padding: 120px 0;
}

.section-header {
  margin-bottom: 80px;
  max-width: 600px;
}

.section-header h2 {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 400;
  line-height: 1.1;
  margin-bottom: 16px;
}

.section-header p {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-secondary);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}

.feature-card {
  background: var(--bg-elevated);
  padding: 48px 40px;
  position: relative;
  transition: background 0.3s ease;
}

.feature-card:hover {
  background: var(--bg-card);
}

.feature-card::before {
  content: attr(data-num);
  position: absolute;
  top: 24px;
  right: 24px;
  font-family: var(--font-serif);
  font-size: 48px;
  font-weight: 400;
  line-height: 1;
  color: var(--border-strong);
  opacity: 0.5;
}

.feature-icon {
  margin-bottom: 24px;
  color: var(--text-muted);
}

.feature-card h3 {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 400;
  line-height: 1.2;
  margin-bottom: 16px;
  color: var(--text);
}

.feature-card p {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.feature-link {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.3s;
}

.feature-link:hover {
  color: var(--text);
}

/* ─── Code Section ────────────────────────────────────────────── */
.code-section {
  padding: 120px 0;
  position: relative;
}

.code-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--accent) 50%, transparent 100%);
}

.code-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 80px;
  align-items: start;
}

.code-text h2 {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 400;
  line-height: 1.1;
  margin-bottom: 24px;
}

.code-text > p {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 40px;
}

.code-tabs {
  display: flex;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}

.code-tab {
  flex: 1;
  padding: 12px;
  background: var(--bg-elevated);
  border: none;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  transition: all 0.3s;
}

.code-tab:hover {
  color: var(--text);
}

.code-tab.active {
  background: var(--bg-card);
  color: var(--text);
}

.code-window {
  border: 1px solid var(--border);
  background: var(--bg-elevated);
}

.code-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
}

.code-dots {
  display: flex;
  gap: 8px;
}

.code-dots span {
  width: 10px;
  height: 10px;
  border: 1px solid var(--border-strong);
}

.code-dots span.code-dot-active {
  background: var(--accent);
  border-color: var(--accent);
}

.code-filename {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  margin-left: auto;
}

.code-content {
  padding: 24px 20px;
  overflow-x: auto;
  min-height: 420px;
}

.code-content pre {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.8;
  color: var(--text-secondary);
  margin: 0;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* ─── Frameworks ────────────────────────────────────────────────── */
.frameworks {
  padding: 120px 0;
  position: relative;
}

.frameworks::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--accent) 50%, transparent 100%);
}

.framework-tabs-header {
  display: flex;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  margin-bottom: 0;
}

.fw-tab {
  flex: 1;
  padding: 16px;
  background: var(--bg-elevated);
  border: none;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  transition: all 0.3s;
}

.fw-tab:hover {
  color: var(--text);
}

.fw-tab.active {
  background: var(--bg-card);
  color: var(--text);
}

.framework-code {
  border: 1px solid var(--border);
  border-top: none;
  background: var(--bg-elevated);
  padding: 32px;
  overflow-x: auto;
}

.framework-code pre {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.8;
  color: var(--text-secondary);
}

.fw-content {
  display: none;
}

.fw-content.active {
  display: block;
}

.framework-note {
  margin-top: 24px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

.framework-note .badge {
  color: var(--accent);
  font-weight: 600;
  margin-right: 8px;
}

/* ─── Pricing ───────────────────────────────────────────────────── */
.pricing {
  padding: 120px 0;
  position: relative;
}

.pricing::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--accent) 50%, transparent 100%);
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  position: relative;
  z-index: 2;
}

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

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

.pricing-card {
  border: 1px solid var(--border);
  background: var(--bg-card);
  padding: 0;
  transition: border-color 0.3s, transform 0.3s;
  position: relative;
  display: flex;
  flex-direction: column;
}

.pricing-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--border);
  transition: background 0.3s;
}

.pricing-card:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.pricing-card.popular::before { background: var(--accent); }
.pricing-card.popular { border-color: rgba(220, 38, 38, 0.25); }

.pricing-card .card-top { padding: 28px 28px 0; display: flex; flex-direction: column; }
.pricing-card .badge-area { height: 22px; margin-bottom: 12px; }
.pricing-card h3 { font-family: var(--font-serif); font-size: 26px; font-weight: 400; margin-bottom: 4px; }
.pricing-card .price { font-size: 36px; font-weight: 300; font-family: var(--font-sans); letter-spacing: -1.5px; margin-bottom: 6px; line-height: 1; }
.pricing-card .price span { font-size: 14px; font-weight: 400; color: var(--text-muted); letter-spacing: 0; }
.pricing-card .price-note { font-size: 13px; color: var(--text-muted); margin-bottom: 20px; }

.pricing-card .card-divider { height: 1px; background: var(--border); margin: 0 28px; }

.pricing-card .card-body { padding: 20px 28px 28px; flex: 1; display: flex; flex-direction: column; }
.pricing-card .card-body ul { list-style: none; padding: 0; margin: 0 0 24px; flex: 1; }
.pricing-card .card-body li { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; color: var(--text-secondary); padding: 5px 0; }
.pricing-card .card-body li svg { flex-shrink: 0; margin-top: 2px; color: var(--success); }
.pricing-card .card-body li > span { flex: 1; display: flex; flex-direction: column; }

.pricing-card .card-body li.coming-soon { color: var(--text-muted); }
.pricing-card .card-body li.coming-soon svg { color: var(--text-muted); stroke-dasharray: 3 3; }

.pricing-card .popular-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  display: block;
}

/* ─── Rule Packs ──────────────────────────────────────────────── */
.rule-packs {
  padding: 120px 0;
  position: relative;
}

.rule-packs::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--accent) 50%, transparent 100%);
}

.packs-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}

.pack-card {
  background: var(--bg-elevated);
  padding: 40px 32px;
  transition: background 0.3s ease;
  display: flex;
  flex-direction: column;
  min-height: 320px;
}

.pack-card .btn {
  margin-top: auto;
  width: 100%;
  justify-content: center;
}

.pack-card:hover {
  background: var(--bg-card);
}

.pack-card h3 {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 400;
  margin-bottom: 20px;
}

.pack-rules {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.pack-rules span {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 4px 10px;
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.pack-card > p {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 24px;
  flex: 1;
}

.pack-card .btn {
  width: 100%;
  justify-content: center;
}

/* ─── CTA ───────────────────────────────────────────────────────── */
.cta {
  padding: 160px 0;
  position: relative;
  overflow: hidden;
}

.cta::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--accent) 50%, transparent 100%);
}

.cta-content {
  max-width: 700px;
}

.cta-content h2 {
  font-family: var(--font-serif);
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 400;
  line-height: 1.1;
  margin-bottom: 24px;
}

.cta-content > p {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 40px;
}

.signup-note {
  margin-top: 24px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
}

/* ─── Footer ────────────────────────────────────────────────────── */
.footer {
  padding: 80px 0 40px;
  position: relative;
}

.footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--accent) 50%, transparent 100%);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 80px;
}

.footer-brand .logo {
  margin-bottom: 16px;
}

.footer-brand > p {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 300px;
}

.social-links {
  display: flex;
  gap: 16px;
  margin-top: 24px;
}

.social-links a {
  color: var(--text-muted);
  transition: color 0.3s;
}

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

.footer-links h4 {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.footer-links a {
  display: block;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 6px 0;
  transition: color 0.3s;
}

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

.footer-bottom {
  padding-top: 40px;
  position: relative;
  text-align: center;
}

.footer-bottom::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--accent) 50%, transparent 100%);
}

.footer-bottom p {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

.footer-legal {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin-bottom: 16px;
}

.footer-legal a {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.3s;
}

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

/* ─── Scroll-to-top ─────────────────────────────────────────────── */
#scroll-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  z-index: 500;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  color: var(--text-secondary);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, color 0.3s, border-color 0.3s;
}

#scroll-top.visible {
  opacity: 1;
  pointer-events: auto;
}

#scroll-top:hover {
  color: var(--text);
  border-color: var(--text);
}

/* ─── Legal pages ───────────────────────────────────────────────── */
.legal-page {
  padding-top: 100px;
  position: relative;
  z-index: 2;
}

.legal-hero {
  padding: 80px 0 48px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 48px;
}

.legal-hero h1 {
  font-family: var(--font-serif);
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 400;
  line-height: 1.1;
  margin-bottom: 16px;
}

.legal-hero .last-updated {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.legal-content {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 40px 120px;
}

.legal-content h2 {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 400;
  margin: 48px 0 20px;
  color: var(--text);
}

.legal-content h3 {
  font-family: var(--font-sans);
  font-size: 18px;
  font-weight: 600;
  margin: 32px 0 12px;
  color: var(--text);
}

.legal-content p,
.legal-content li {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.legal-content ul {
  margin: 16px 0 24px 24px;
}

.legal-content ul li {
  margin-bottom: 8px;
}

.legal-content a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.legal-content a:hover {
  color: var(--accent);
}

.legal-content .contact-box {
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  padding: 24px;
  border-radius: 8px;
  margin: 32px 0;
}

.legal-content .contact-box p {
  margin-bottom: 0;
  font-family: var(--font-mono);
  font-size: 13px;
}

.legal-toc {
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  padding: 24px;
  border-radius: 8px;
  margin-bottom: 48px;
}

.legal-toc h2 {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 16px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.legal-toc ul {
  margin: 0;
  padding-left: 0;
  list-style: none;
}

.legal-toc li {
  margin-bottom: 8px;
}

.legal-toc a {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  text-decoration: none;
}

.legal-toc a:hover {
  color: var(--text);
}

/* ─── Animations ────────────────────────────────────────────────── */
.animate-in {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUp 0.8s ease forwards;
}

.animate-in[data-delay="100"] { animation-delay: 0.1s; }
.animate-in[data-delay="200"] { animation-delay: 0.2s; }
.animate-in[data-delay="300"] { animation-delay: 0.3s; }
.animate-in[data-delay="350"] { animation-delay: 0.35s; }
.animate-in[data-delay="400"] { animation-delay: 0.4s; }
.animate-in[data-delay="500"] { animation-delay: 0.5s; }

@keyframes fadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ─── Scrollbar ─────────────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--border-strong);
}

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

::selection {
  background: var(--accent);
  color: var(--text);
}

/* ─── Glitch Badge Effect ───────────────────────────────────────── */
.hero-badge {
  position: relative;
}

.hero-badge::before {
  content: attr(data-text);
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  opacity:0;
}

.badge-text {
  position: relative;
  animation: glitchText 5s ease-in-out infinite;
}

@keyframes glitchText {
  0%, 90%, 100% {
    transform: translate(0);
    opacity: 1;
  }
  92% {
    transform: translate(-2px, 1px);
    opacity: 0.8;
  }
  94% {
    transform: translate(2px, -1px);
    opacity: 0.9;
  }
  96% {
    transform: translate(-1px, 0);
    opacity: 1;
  }
}

::selection {
  background: var(--accent);
  color: var(--text);
}

/* ─── Responsive ────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .features-grid,
  .packs-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .pricing-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .code-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .legal-page .legal-content {
    padding: 120px 20px 80px;
  }
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
  }
  
  .hero {
    padding: 120px 0 60px;
  }
  
  .hero-stats {
    gap: 40px;
  }
  
  .features-grid,
  .packs-grid,
  .pricing-grid {
    grid-template-columns: 1fr;
  }
  
  .demo-grid {
    grid-template-columns: 1fr;
  }
  
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  
  .hero-cta {
    flex-direction: column;
  }
  
  .btn-lg {
    width: 100%;
    justify-content: center;
  }
}

/* ─── Auth Modal ──────────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}
.modal-overlay.active {
  display: flex;
}
.modal-box {
  background: #0f1117;
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: 16px;
  padding: 40px;
  width: 100%;
  max-width: 420px;
  position: relative;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
}
.modal-close {
  position: absolute;
  top: 16px;
  right: 20px;
  background: none;
  border: none;
  color: var(--text-muted, #78716c);
  font-size: 24px;
  line-height: 1;
  padding: 0;
}
.modal-close:hover { color: #fff; }
.modal-logo {
  font-weight: 800;
  font-size: 20px;
  color: #dc2626;
  letter-spacing: -0.5px;
  margin-bottom: 24px;
}
.modal-tabs {
  display: flex;
  gap: 4px;
  background: rgba(255,255,255,0.05);
  border-radius: 8px;
  padding: 4px;
  margin-bottom: 28px;
}
.modal-tab {
  flex: 1;
  padding: 8px;
  border: none;
  background: none;
  color: var(--text-muted, #78716c);
  font-size: 14px;
  font-weight: 500;
  border-radius: 6px;
  transition: all 0.2s;
}
.modal-tab.active {
  background: rgba(255,255,255,0.1);
  color: #fff;
}
.form-group {
  margin-bottom: 16px;
}
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #a1a1aa;
  margin-bottom: 6px;
}
.form-group input {
  width: 100%;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(148,163,184,0.15);
  border-radius: 8px;
  padding: 10px 14px;
  color: #fff;
  font-size: 14px;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.2s;
}
.form-group input:focus {
  border-color: #dc2626;
}
.form-group input::placeholder { color: #52525b; }
.form-error {
  color: #dc2626;
  font-size: 13px;
  min-height: 18px;
  margin: 0 0 12px;
}
.form-note {
  text-align: center;
  font-size: 12px;
  color: #52525b;
  margin-top: 12px;
}
.btn-full { width: 100%; justify-content: center; }
.hidden { display: none !important; }

/* ─── Toast ───────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #1c1c1e;
  border: 1px solid rgba(148,163,184,0.2);
  color: #fff;
  padding: 12px 24px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  z-index: 2000;
  pointer-events: none;
  white-space: nowrap;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.toast.success { border-color: #22c55e; color: #22c55e; }
.toast.error   { border-color: #dc2626; color: #dc2626; }
