:root {
  --bg-primary: #0a0a12;
  --bg-secondary: #10101f;
  --bg-card: #161628;
  --fg-primary: #e8e8f0;
  --fg-secondary: #8888a8;
  --fg-muted: #55556e;
  --accent-blue: #3b82f6;
  --accent-orange: #f97316;
  --accent-cyan: #22d3ee;
  --accent-glow: rgba(59, 130, 246, 0.15);
  --orange-glow: rgba(249, 115, 22, 0.12);
  --border: #1e1e38;
  --radius: 16px;
  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'DM Sans', sans-serif;
}

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

body {
  background: var(--bg-primary);
  color: var(--fg-primary);
  font-family: var(--font-body);
  line-height: 1.7;
  overflow-x: hidden;
}

/* ── Ambient Background ── */
.ambient-bg {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.ambient-bg .orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.3;
}
.ambient-bg .orb-1 {
  width: 600px; height: 600px;
  background: var(--accent-blue);
  top: -200px; left: -100px;
  animation: drift 20s ease-in-out infinite;
}
.ambient-bg .orb-2 {
  width: 500px; height: 500px;
  background: var(--accent-orange);
  bottom: -200px; right: -100px;
  animation: drift 25s ease-in-out infinite reverse;
}
.ambient-bg .orb-3 {
  width: 350px; height: 350px;
  background: var(--accent-cyan);
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  animation: pulse 15s ease-in-out infinite;
}

@keyframes drift {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(60px, 40px); }
}
@keyframes pulse {
  0%, 100% { opacity: 0.1; transform: translate(-50%, -50%) scale(1); }
  50% { opacity: 0.2; transform: translate(-50%, -50%) scale(1.2); }
}

/* ── Layout ── */
.page-content {
  position: relative;
  z-index: 1;
}

section {
  padding: 100px 24px;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
}

/* ── Hero ── */
.hero {
  min-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-top: 80px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: var(--accent-glow);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 100px;
  font-size: 0.85rem;
  color: var(--accent-blue);
  font-weight: 500;
  margin-bottom: 32px;
  letter-spacing: 0.02em;
}

.hero-badge .dot {
  width: 6px; height: 6px;
  background: var(--accent-blue);
  border-radius: 50%;
  animation: blink 2s ease-in-out infinite;
}

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

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 7vw, 5rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin-bottom: 24px;
  max-width: 800px;
}

.hero h1 .accent {
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero h1 .accent-warm {
  background: linear-gradient(135deg, var(--accent-orange), #fbbf24);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero .lede {
  font-size: clamp(1.05rem, 2.2vw, 1.25rem);
  color: var(--fg-secondary);
  max-width: 560px;
  margin: 0 auto 48px;
  line-height: 1.7;
}

.hero-stats {
  display: flex;
  gap: 48px;
  justify-content: center;
  flex-wrap: wrap;
}

.hero-stat {
  text-align: center;
}

.hero-stat .num {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--fg-primary);
}

.hero-stat .label {
  font-size: 0.85rem;
  color: var(--fg-muted);
  margin-top: 4px;
}

/* ── CTA Buttons ── */
.hero-ctas {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 56px;
}
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 15px 32px;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-cyan));
  color: #fff;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  border-radius: 12px;
  text-decoration: none;
  transition: opacity 0.2s, transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 20px rgba(59, 130, 246, 0.35);
}
.btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(59, 130, 246, 0.45);
}
.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 15px 28px;
  background: transparent;
  color: var(--fg-secondary);
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  border: 1px solid var(--border);
  border-radius: 12px;
  text-decoration: none;
  transition: border-color 0.2s, color 0.2s;
}
.btn-ghost:hover { border-color: var(--fg-secondary); color: var(--fg-primary); }

.closing-cta { margin-top: 40px; }

/* ── How It Works ── */
.how-it-works {
  background: var(--bg-secondary);
}

.section-label {
  font-family: var(--font-display);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent-orange);
  font-weight: 600;
  margin-bottom: 16px;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.5vw, 3rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}

.section-subtitle {
  font-size: 1.05rem;
  color: var(--fg-secondary);
  max-width: 560px;
  margin-bottom: 64px;
}

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

.step-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 28px;
  position: relative;
  transition: border-color 0.3s, transform 0.3s;
}

.step-card:hover {
  border-color: rgba(59, 130, 246, 0.4);
  transform: translateY(-4px);
}

.step-number {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 700;
  color: rgba(59, 130, 246, 0.12);
  line-height: 1;
  margin-bottom: 16px;
}

.step-card h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 10px;
}

.step-card p {
  font-size: 0.92rem;
  color: var(--fg-secondary);
  line-height: 1.65;
}

/* ── Bot Types ── */
.bot-types {
  background: var(--bg-primary);
}

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

.bot-chip {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 22px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: border-color 0.3s, background 0.3s;
}

.bot-chip:hover {
  border-color: var(--accent-orange);
  background: var(--orange-glow);
}

.bot-chip .icon {
  font-size: 1.6rem;
  flex-shrink: 0;
}

.bot-chip .bot-info h4 {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 2px;
}

.bot-chip .bot-info span {
  font-size: 0.78rem;
  color: var(--fg-muted);
}

/* ── Tech Stack ── */
.tech-stack {
  background: var(--bg-secondary);
}

.tech-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 40px;
}

.tech-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 12px 22px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--fg-primary);
  transition: border-color 0.3s;
}

.tech-pill:hover {
  border-color: var(--accent-cyan);
}

.tech-pill .tech-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
}

.tech-dot.python { background: #3b82f6; }
.tech-dot.rlbot { background: #f97316; }
.tech-dot.rlgym { background: #22d3ee; }
.tech-dot.rocketsim { background: #a855f7; }
.tech-dot.ppo { background: #10b981; }

/* ── Safety ── */
.safety {
  background: var(--bg-primary);
}

.safety-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 48px;
}

.safety-item {
  display: flex;
  gap: 16px;
  padding: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.safety-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
  margin-top: 2px;
}

.safety-item h4 {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.safety-item p {
  font-size: 0.88rem;
  color: var(--fg-secondary);
  line-height: 1.6;
}

/* ── Closing ── */
.closing {
  text-align: center;
  padding: 120px 24px;
}

.closing h2 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.5vw, 3.2rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.closing p {
  font-size: 1.05rem;
  color: var(--fg-secondary);
  max-width: 520px;
  margin: 0 auto;
}

/* ── Footer ── */
footer {
  padding: 40px 24px;
  border-top: 1px solid var(--border);
  text-align: center;
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
}

.footer-note {
  font-size: 0.82rem;
  color: var(--fg-muted);
}

/* ════════════════════════════════════════════════
   Generator Page
   ════════════════════════════════════════════════ */

.gen-page { min-height: 100vh; }

/* Nav */
.gen-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 10, 18, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
}
.gen-nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--fg-primary);
  text-decoration: none;
}
.nav-back {
  font-size: 0.88rem;
  color: var(--fg-secondary);
  text-decoration: none;
  transition: color 0.2s;
}
.nav-back:hover { color: var(--accent-blue); }

/* Header */
.gen-header {
  padding: 72px 24px 48px;
  text-align: center;
}
.gen-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: var(--orange-glow);
  border: 1px solid rgba(249, 115, 22, 0.3);
  border-radius: 100px;
  font-size: 0.82rem;
  color: var(--accent-orange);
  font-weight: 500;
  margin-bottom: 24px;
  letter-spacing: 0.02em;
}
.gen-title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
}
.gen-subtitle {
  font-size: 1.05rem;
  color: var(--fg-secondary);
  max-width: 520px;
  margin: 0 auto;
}

/* Form section */
.gen-section { padding: 0 24px 100px; }

/* Step blocks */
.gen-step {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 40px;
  margin-bottom: 24px;
  transition: border-color 0.3s;
}
.gen-step:focus-within { border-color: rgba(59, 130, 246, 0.35); }

.step-label-row {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 28px;
}
.step-num {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--accent-orange);
  background: var(--orange-glow);
  border: 1px solid rgba(249, 115, 22, 0.3);
  border-radius: 6px;
  padding: 3px 9px;
}
.step-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
}
.step-hint {
  font-size: 0.88rem;
  color: var(--fg-secondary);
  margin-bottom: 20px;
}
.step-hint code {
  background: rgba(255,255,255,0.06);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.82rem;
}

/* Bot name input */
.name-field { max-width: 400px; }
.gen-input {
  width: 100%;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--fg-primary);
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  padding: 14px 18px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.gen-input:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}
.gen-input::placeholder { color: var(--fg-muted); font-weight: 400; }
.field-hint {
  font-size: 0.8rem;
  color: var(--fg-muted);
  margin-top: 8px;
}

/* Playstyle grid */
.playstyle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}
.ps-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px 18px 18px 18px;
  background: var(--bg-secondary);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
  user-select: none;
}
.ps-card:hover {
  border-color: rgba(59, 130, 246, 0.4);
  transform: translateY(-2px);
}
.ps-card.selected {
  border-color: var(--accent-blue);
  background: var(--accent-glow);
}
.ps-icon { font-size: 1.6rem; line-height: 1; margin-top: 2px; flex-shrink: 0; }
.ps-info { flex: 1; min-width: 0; }
.ps-name {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 4px;
}
.ps-desc { font-size: 0.77rem; color: var(--fg-secondary); line-height: 1.5; }
.ps-check {
  position: absolute;
  top: 10px; right: 10px;
  font-size: 0.75rem;
  color: var(--accent-blue);
  font-weight: 700;
  opacity: 0;
  transition: opacity 0.15s;
}
.ps-card.selected .ps-check { opacity: 1; }

/* Sliders */
.sliders-grid { display: flex; flex-direction: column; gap: 32px; max-width: 600px; }
.slider-row {}
.slider-labels {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  margin-bottom: 10px;
  font-size: 0.82rem;
  color: var(--fg-secondary);
}
.slider-label-left { text-align: left; }
.slider-center-label { text-align: center; font-weight: 600; color: var(--fg-primary); }
.slider-label-right { text-align: right; }
.slider-val {
  display: inline-block;
  min-width: 28px;
  text-align: center;
  color: var(--accent-cyan);
  font-family: var(--font-display);
  font-size: 1rem;
}
.gen-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  outline: none;
  cursor: pointer;
  transition: background 0.2s;
}
.gen-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px; height: 20px;
  background: var(--accent-blue);
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
  transition: box-shadow 0.2s;
}
.gen-slider::-webkit-slider-thumb:hover {
  box-shadow: 0 0 0 6px rgba(59, 130, 246, 0.25);
}
.gen-slider::-moz-range-thumb {
  width: 20px; height: 20px;
  background: var(--accent-blue);
  border: none;
  border-radius: 50%;
}

/* Mechanics grid */
.mechanics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.mech-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 18px;
  background: var(--bg-secondary);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  user-select: none;
}
.mech-card:hover { border-color: rgba(34, 211, 238, 0.4); }
.mech-card.selected {
  border-color: var(--accent-cyan);
  background: rgba(34, 211, 238, 0.06);
}
.mech-icon { font-size: 1.4rem; margin-top: 2px; flex-shrink: 0; }
.mech-info { flex: 1; min-width: 0; }
.mech-name {
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 600;
  margin-bottom: 3px;
}
.mech-desc { font-size: 0.77rem; color: var(--fg-secondary); line-height: 1.5; }
.mech-check {
  position: absolute;
  top: 10px; right: 10px;
  font-size: 0.72rem;
  color: var(--accent-cyan);
  font-weight: 700;
  opacity: 0;
  transition: opacity 0.15s;
}
.mech-card.selected .mech-check { opacity: 1; }

/* Preview */
.preview-step { background: var(--bg-secondary); border-color: rgba(59, 130, 246, 0.2); }
.preview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 28px;
}
.preview-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
}
.preview-heading {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--fg-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.file-tree {
  list-style: none;
  font-size: 0.8rem;
  color: var(--fg-secondary);
  font-family: 'Courier New', monospace;
  line-height: 1.8;
}
.file-tree li::before { content: '📄 '; }
.file-tree .tree-more { color: var(--fg-muted); font-style: italic; }
.file-tree .tree-more::before { content: ''; }

.summary-dl {}
.dl-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}
.dl-row:last-child { border-bottom: none; }
.dl-row dt { font-size: 0.82rem; color: var(--fg-secondary); flex-shrink: 0; }
.dl-row dd {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--fg-primary);
  text-align: right;
  word-break: break-all;
}

/* Format toggle */
.format-row {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 28px;
}
.format-label { font-size: 0.88rem; color: var(--fg-secondary); }
.format-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  color: var(--fg-primary);
}
.format-toggle input { accent-color: var(--accent-blue); width: 16px; height: 16px; cursor: pointer; }

/* Error */
.gen-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.4);
  border-radius: 10px;
  padding: 14px 18px;
  font-size: 0.9rem;
  color: #f87171;
  margin-bottom: 20px;
}

/* Generate button */
.gen-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  max-width: 340px;
  padding: 16px 32px;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-cyan));
  color: #fff;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 20px rgba(59, 130, 246, 0.35);
}
.gen-btn:hover:not(:disabled) {
  opacity: 0.92;
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(59, 130, 246, 0.45);
}
.gen-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-spinner { display: flex; align-items: center; gap: 10px; }
.spinner-ring {
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Responsive ── */
@media (max-width: 768px) {
  section { padding: 72px 20px; }
  .hero { min-height: 80vh; padding-top: 60px; }
  .hero-stats { gap: 32px; }
  .steps-grid { grid-template-columns: 1fr; }
  .bot-grid { grid-template-columns: 1fr 1fr; }
  .safety-grid { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; text-align: center; }
  /* Generator */
  .gen-step { padding: 24px 20px; }
  .preview-grid { grid-template-columns: 1fr; }
  .playstyle-grid { grid-template-columns: 1fr 1fr; }
  .mechanics-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .bot-grid { grid-template-columns: 1fr; }
  .hero-stats { flex-direction: column; gap: 20px; }
  .tech-pills { justify-content: center; }
  /* Generator */
  .playstyle-grid { grid-template-columns: 1fr; }
  .mechanics-grid { grid-template-columns: 1fr; }
  .gen-btn { max-width: 100%; }
  .format-row { flex-wrap: wrap; gap: 12px; }
}