:root {
  --bg: #0a0d11;
  --panel: #0f1318;
  --panel-2: #161c23;
  --border: #28333f;
  --text: #dce8f0;
  --muted: #7f91a3;
  --accent: #aaff00;
  --accent-2: #ff4d6d;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Space Mono", monospace;
  background: radial-gradient(circle at 90% -10%, #0f1822 0%, var(--bg) 45%);
  color: var(--text);
  line-height: 1.6;
}

.layout {
  width: min(1280px, 96vw);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 1.25rem;
  padding: 1rem 0;
}

.sidebar {
  position: sticky;
  top: 1rem;
  align-self: start;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  padding: 1rem;
}

.content {
  min-width: 0;
}

.brand {
  display: inline-block;
  text-decoration: none;
  color: var(--accent);
  font-weight: 800;
  letter-spacing: 1.2px;
  font-size: 1.25rem;
  font-family: "Syne", sans-serif;
}

.sidebar-note {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0.45rem 0 1rem;
}

.side-nav {
  display: grid;
  gap: 0.35rem;
}

.side-nav a {
  text-decoration: none;
  color: var(--muted);
  border: 1px solid transparent;
  border-radius: 2px;
  padding: 0.42rem 0.55rem;
  font-size: 0.88rem;
}

.side-nav a:hover {
  border-color: var(--border);
  color: var(--text);
  background: rgba(170, 255, 0, 0.06);
}

.nav-folder {
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 0.25rem;
  margin: 0.15rem 0;
  background: rgba(170, 255, 0, 0.04);
}

.nav-folder summary {
  cursor: pointer;
  color: var(--text);
  font-size: 0.88rem;
  padding: 0.28rem 0.35rem;
}

.nav-folder-content {
  display: grid;
  gap: 0.2rem;
  margin-top: 0.2rem;
  padding-left: 0.25rem;
}

.sidebar-links {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.sidebar-links a {
  text-decoration: none;
  color: var(--muted);
  font-size: 0.88rem;
}

.sidebar-links a:hover {
  color: var(--accent);
}

.hero {
  margin-top: 0;
}

.eyebrow {
  color: var(--accent-2);
  font-family: "Space Mono", monospace;
  font-size: 0.85rem;
}

h1 {
  margin: 0.3rem 0 0;
  font-size: clamp(2rem, 6vw, 3.3rem);
  line-height: 1.1;
  font-family: "Syne", sans-serif;
}

h2,
h3 {
  font-family: "Syne", sans-serif;
}

.subtitle {
  margin-top: 1rem;
  color: var(--muted);
  max-width: 800px;
}

.hero-actions {
  margin-top: 1.4rem;
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.btn {
  text-decoration: none;
  border: 1px solid var(--border);
  color: var(--text);
  background: var(--panel);
  border-radius: 2px;
  padding: 0.65rem 1rem;
  font-weight: 600;
  font-family: "Space Mono", monospace;
  text-transform: uppercase;
  font-size: 0.78rem;
  letter-spacing: 1px;
}

.btn-primary {
  background: var(--accent);
  color: #10180a;
  border-color: var(--accent);
}

.section {
  margin: 0 0 1.1rem;
  padding: 1.4rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
}

.section h2 {
  margin-top: 0;
  margin-bottom: 0.6rem;
}

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

.highlights {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.9rem;
  margin-top: 1rem;
}

.highlights article {
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 0.9rem;
  background: rgba(170, 255, 0, 0.04);
}

.highlights h3 {
  margin: 0;
  font-size: 1rem;
}

.highlights p {
  margin: 0.5rem 0 0;
  color: var(--muted);
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
}

.section-head p {
  color: var(--muted);
  margin: 0;
}

.competition-card {
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 1rem;
  background: rgba(170, 255, 0, 0.04);
  margin-top: 1rem;
}

.competition-card h3 {
  margin: 0;
}

.list-links {
  margin-top: 0.8rem;
  display: grid;
  gap: 0.5rem;
}

.challenge-link {
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 0.55rem 0.7rem;
  text-decoration: none;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  background: var(--panel);
}

.sidebar-link,
.sidebar-challenge-link {
  display: block;
  padding: 0.45rem 0.55rem;
  color: var(--muted);
  text-decoration: none;
  border-left: 2px solid transparent;
  font-size: 0.82rem;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.sidebar-link:hover,
.sidebar-challenge-link:hover {
  color: var(--accent);
  border-left-color: var(--accent);
  background: rgba(170, 255, 0, 0.08);
}

.sidebar-link.challenge-link-current,
.sidebar-challenge-link.challenge-link-current {
  color: var(--accent);
  border-left-color: var(--accent);
}

.challenge-link:hover {
  border-color: var(--accent);
}

.challenge-link-current {
  border-color: var(--accent);
  background: rgba(170, 255, 0, 0.08);
}

.link-meta {
  color: var(--muted);
  font-size: 0.75rem;
}

.card {
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 1rem;
  background: var(--panel);
}

.card h3 {
  margin: 0;
  font-size: 1.05rem;
}

.meta {
  margin-top: 0.45rem;
  color: var(--muted);
  font-size: 0.88rem;
  font-family: "Space Mono", monospace;
}

.card p {
  margin: 0.7rem 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.card-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chip {
  text-decoration: none;
  border: 1px solid var(--border);
  color: var(--accent);
  padding: 0.32rem 0.6rem;
  border-radius: 2px;
  font-size: 0.8rem;
}

.chip:hover {
  border-color: var(--accent);
}

.teaching-points {
  margin: 0.8rem 0 0;
  color: var(--muted);
}

.teaching-points li {
  margin: 0.4rem 0;
}

.cert-grid {
  margin-top: 0.9rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.9rem;
}

.cert-card {
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 0.95rem;
  background: rgba(170, 255, 0, 0.04);
}

.cert-card h3 {
  margin: 0;
  font-size: 1rem;
}

.cert-card p {
  margin: 0.55rem 0 0;
}

.badge-c2 {
  display: inline-block;
  padding: 0.28rem 0.65rem;
  border-radius: 2px;
  border: 1px solid rgba(170, 255, 0, 0.45);
  background: rgba(170, 255, 0, 0.12);
  color: #d6ff9f;
  font-weight: 800;
  letter-spacing: 0.25px;
}

.cert-card a {
  color: var(--accent);
}

.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 1.3rem;
  color: var(--muted);
}

.site-footer p {
  margin: 0;
  padding: 1rem 0 0.4rem;
}

.back-link {
  display: inline-block;
  margin-bottom: 0.8rem;
  text-decoration: none;
  color: var(--accent);
}

.challenge-page-header h1 {
  margin-top: 0;
  margin-bottom: 0.6rem;
}

.challenge-page-header p {
  max-width: 900px;
}

.code-section {
  margin-top: 1rem;
  border: 1px solid #26313c;
  border-radius: 8px;
  overflow: hidden;
  background: #10151c;
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.45);
}

.code-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.55rem 0.9rem;
  border-bottom: 1px solid #26313c;
  background: linear-gradient(180deg, #1b222b, #171d26);
  position: relative;
}

.code-section-header::before {
  content: "";
  width: 42px;
  height: 10px;
  background-image: radial-gradient(circle, #ff6b63 0 4px, transparent 4px), radial-gradient(circle, #f7c65b 0 4px, transparent 4px), radial-gradient(circle, #47cf73 0 4px, transparent 4px);
  background-size: 10px 10px, 10px 10px, 10px 10px;
  background-position: left center, center center, right center;
  background-repeat: no-repeat;
  flex-shrink: 0;
}

.code-section-title {
  font-weight: 700;
  color: #f3f7fb;
  letter-spacing: 0.3px;
}

.code-section-path {
  color: #7f91a3;
  font-size: 0.72rem;
  overflow-wrap: anywhere;
  text-align: right;
}

.code-block {
  margin: 0;
  padding: 1rem 0;
  overflow-x: auto;
  font-family: "Space Mono", monospace;
  font-size: 0.86rem;
  line-height: 1.65;
  background: #12171f;
}

.code-block code {
  display: block;
  min-width: max-content;
}

.code-line {
  display: block;
  position: relative;
  white-space: pre;
  padding: 0 1rem 0 3.5rem;
  color: #dbe5ef;
}

.code-line::before {
  content: attr(data-ln);
  position: absolute;
  left: 0;
  width: 2.7rem;
  text-align: right;
  color: #5a6b7e;
  padding-right: 0.75rem;
  border-right: 1px solid #26313c;
}

.error-note {
  color: #ffc2b5;
  background: rgba(255, 77, 109, 0.12);
}

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

  .sidebar {
    position: static;
  }

  .side-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .side-nav {
    grid-template-columns: 1fr;
  }
}
