* {
  box-sizing: border-box;
}

:root {
  --bg: #08111f;
  --bg2: #0c1728;
  --panel: #121d30;
  --panel2: #0f1726;
  --border: #24324d;
  --text: #e8eef7;
  --muted: #98a8be;
  --green: #39ff14;
  --blue: #5ba7ff;
  --red: #ff6363;
  --yellow: #ffd166;
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.3);
  --radius: 18px;
  --container: 1200px;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top right, rgba(91, 167, 255, 0.1), transparent 30%),
    linear-gradient(180deg, #07111d 0%, #0c1525 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  width: min(var(--container), calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(12px);
  background: rgba(7, 13, 24, 0.82);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 76px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  font-size: 2rem;
}

.brand h1 {
  margin: 0;
  font-size: 1.35rem;
  color: var(--green);
}

.brand p {
  margin: 4px 0 0;
  font-size: 0.92rem;
  color: var(--muted);
}

.nav-links {
  display: flex;
  gap: 20px;
  color: var(--muted);
  font-size: 0.96rem;
}

.nav-links a:hover,
.footer-links a:hover,
.text-link:hover {
  color: white;
}

.hero {
  padding: 72px 0 34px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 28px;
  align-items: center;
}

.badge,
.eyebrow,
.track-tag {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: bold;
}

.badge,
.eyebrow {
  background: rgba(57, 255, 20, 0.08);
  border: 1px solid rgba(57, 255, 20, 0.18);
  color: #d7ffd1;
  margin-bottom: 16px;
}

.hero-copy h2 {
  margin: 0 0 16px;
  font-size: clamp(2.2rem, 5vw, 4rem);
  line-height: 1.08;
}

.hero-text {
  margin: 0;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.8;
  max-width: 700px;
}

.hero-actions,
.challenge-actions,
.quiz-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 26px;
  flex-wrap: wrap;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 28px;
}

.stat-card,
.feature-card,
.track-card,
.about-card,
.mission-card,
.preview-window,
.terminal-panel,
.guide-card,
.challenge-card,
.quiz-card {
  background: rgba(15, 24, 40, 0.88);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.stat-card,
.feature-card,
.track-card,
.about-card,
.mission-card,
.guide-card,
.challenge-card,
.quiz-card {
  padding: 22px;
}

.stat-card strong {
  display: block;
  margin-bottom: 8px;
}

.stat-card span,
.feature-card p,
.track-card p,
.about-card p,
.mission-card p,
.guide-card p,
.challenge-card p,
.quiz-card p,
.small,
.next-list li,
.guide-meta,
.guide-example,
.quiz-status {
  color: var(--muted);
  line-height: 1.75;
}

.preview-window {
  overflow: hidden;
}

.window-bar,
.panel-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  background: var(--panel2);
  border-bottom: 1px solid var(--border);
}

.window-title,
.panel-title {
  margin-left: 8px;
  color: var(--muted);
  font-size: 0.93rem;
}

.preview-body {
  padding: 22px;
  background: #0d1117;
  min-height: 260px;
  font-family: Consolas, Monaco, monospace;
  line-height: 1.9;
  color: #c9d1d9;
}

.prompt {
  color: #7ee787;
}

.success {
  color: #39ff14;
  font-weight: bold;
}

.section {
  padding: 34px 0 44px;
}

.alt-section {
  background: linear-gradient(180deg, rgba(255,255,255,0.015), rgba(255,255,255,0));
}

.section-heading {
  text-align: center;
  max-width: 760px;
  margin: 0 auto 28px;
}

.section-heading h3 {
  margin: 0 0 12px;
  font-size: clamp(1.7rem, 3vw, 2.5rem);
}

.section-heading p {
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
}

.feature-grid,
.track-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.about-grid,
.challenge-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.about-grid {
  grid-template-columns: 1fr 1fr;
}

.track-tag {
  background: rgba(57, 255, 20, 0.1);
  border: 1px solid rgba(57, 255, 20, 0.18);
  color: #d5ffd6;
  width: fit-content;
  margin-bottom: 12px;
}

.track-tag.muted {
  background: rgba(91, 167, 255, 0.08);
  border-color: rgba(91, 167, 255, 0.16);
  color: #d9eaff;
}

.track-card.active {
  border-color: rgba(57, 255, 20, 0.25);
}

.track-card.locked-track {
  opacity: 0.72;
}

.workspace {
  display: grid;
  grid-template-columns: 1.35fr 390px;
  gap: 20px;
  align-items: start;
}

#terminalWrap {
  width: 100%;
  min-height: 620px;
  background: #0d1117;
  color: #c9d1d9;
  font-family: Consolas, Monaco, monospace;
  padding: 14px;
  display: flex;
  flex-direction: column;
}

#terminalOutput {
  flex: 1;
  overflow-y: auto;
  white-space: pre-wrap;
  line-height: 1.7;
}

.terminal-line {
  margin-bottom: 4px;
}

.terminal-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  border-top: 1px solid rgba(255,255,255,0.06);
  padding-top: 12px;
  margin-top: 12px;
}

#terminalPrompt {
  color: #7ee787;
  white-space: nowrap;
}

#terminalInput {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #c9d1d9;
  font: inherit;
}

.mission-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.progress-stat {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
  color: var(--muted);
}

.progress-stat strong {
  color: white;
}

.status-card {
  border-left: 4px solid var(--green);
}

.badge-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.badge-pill {
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: bold;
}

.badge-pill.locked {
  background: #24324d;
  color: #9fb0c7;
}

.badge-pill.unlocked {
  background: rgba(57, 255, 20, 0.14);
  color: #d8ffd5;
  border: 1px solid rgba(57, 255, 20, 0.2);
}

.big-value {
  font-size: 2rem;
  font-weight: bold;
  color: white;
  margin: 0;
}

.quiz-options {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.quiz-option {
  width: 100%;
  text-align: left;
  background: rgba(255,255,255,0.03);
  color: var(--text);
  border: 1px solid var(--border);
}

.quiz-option.correct {
  background: rgba(57, 255, 20, 0.14);
  border-color: rgba(57, 255, 20, 0.22);
}

.quiz-option.wrong {
  background: rgba(255, 99, 99, 0.14);
  border-color: rgba(255, 99, 99, 0.22);
}

.guide-search-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 22px;
}

.guide-search {
  width: min(680px, 100%);
  border: 1px solid var(--border);
  background: rgba(15, 24, 40, 0.88);
  color: var(--text);
  border-radius: 14px;
  padding: 14px 16px;
  font-size: 1rem;
  outline: none;
}

.guide-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.guide-card h4,
.challenge-card h4,
.quiz-card h4 {
  margin-top: 0;
  margin-bottom: 8px;
}

.guide-syntax {
  font-family: Consolas, Monaco, monospace;
  background: #0d1117;
  color: #d9e6f7;
  padding: 10px 12px;
  border-radius: 10px;
  margin: 12px 0;
  display: block;
}

.guide-example {
  font-family: Consolas, Monaco, monospace;
  background: rgba(255,255,255,0.03);
  padding: 10px 12px;
  border-radius: 10px;
  margin-top: 10px;
}

.next-list {
  margin: 0;
  padding-left: 20px;
}

.site-footer {
  border-top: 1px solid rgba(255,255,255,0.05);
  margin-top: 20px;
  padding: 24px 0 30px;
}

.footer-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.footer-wrap p {
  margin: 6px 0 0;
  color: var(--muted);
}

.footer-links {
  display: flex;
  gap: 18px;
  color: var(--muted);
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.red { background: var(--red); }
.yellow { background: var(--yellow); }
.green { background: #34d399; }

button,
.text-link {
  font: inherit;
}

button {
  border: none;
  border-radius: 12px;
  padding: 12px 18px;
  font-weight: bold;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

button:hover {
  transform: translateY(-1px);
  opacity: 0.96;
}

button:not(.secondary):not(.danger):not(.quiz-option) {
  background: var(--green);
  color: #061108;
}

button.secondary {
  background: #22314b;
  color: var(--text);
}

button.danger {
  background: #a52e2e;
  color: white;
}

.text-link {
  color: var(--muted);
  font-weight: bold;
}

/* ── Copy button row on guide cards ── */
.guide-example-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
}

.guide-example-row .guide-example {
  margin-top: 0;
  flex: 1;
}

.copy-cmd-btn {
  padding: 6px 12px;
  font-size: 0.78rem;
  border-radius: 8px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Track grid — 4 cols wraps to 2 rows for 8 tracks ── */
.track-grid {
  grid-template-columns: repeat(4, 1fr);
}

/* ── Animated terminal cursor in hero ── */
.typing-cmd::after {
  content: "▋";
  animation: blink 0.8s step-end infinite;
  color: #39ff14;
}

@keyframes blink {
  50% { opacity: 0; }
}

/* ── Share button ── */
.share-btn {
  background: #22314b;
  color: var(--text);
  border: 1px solid rgba(91,167,255,0.25);
  padding: 10px 18px;
  border-radius: 12px;
  font-weight: bold;
  cursor: pointer;
  font-size: 0.9rem;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.share-btn:hover {
  transform: translateY(-1px);
  opacity: 0.9;
}

@media (max-width: 1100px) {
  .hero-grid,
  .workspace,
  .feature-grid,
  .track-grid,
  .about-grid,
  .guide-grid,
  .challenge-grid {
    grid-template-columns: 1fr;
  }

  .hero-stats {
    grid-template-columns: 1fr;
  }

  .nav-links {
    display: none;
  }
}

@media (max-width: 760px) {
  .hero {
    padding-top: 42px;
  }

  .nav {
    flex-wrap: wrap;
    justify-content: center;
    padding: 12px 0;
  }

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

  .section {
    padding: 26px 0 34px;
  }

  #terminalWrap {
    min-height: 480px;
  }

  .footer-wrap {
    flex-direction: column;
    text-align: center;
  }

  .footer-links {
    justify-content: center;
    flex-wrap: wrap;
  }
}
