:root {
  --ink: #07131f;
  --ink-2: #0e2436;
  --foam: #e7f2f4;
  --muted: #8aa4b3;
  --line: rgba(231, 242, 244, 0.12);
  --mint: #3ddc97;
  --sky: #38bdf8;
  --amber: #f59e0b;
  --danger: #fb7185;
  --ok: #3ddc97;
  --font: "Manrope", system-ui, sans-serif;
  --display: "Syne", system-ui, sans-serif;
  --radius: 14px;
  --max: 1080px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  color: var(--foam);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(61, 220, 151, 0.18), transparent 55%),
    radial-gradient(900px 500px at 90% 0%, rgba(56, 189, 248, 0.16), transparent 50%),
    linear-gradient(165deg, #041018 0%, var(--ink) 40%, #0a1c2c 100%);
  background-attachment: fixed;
  line-height: 1.55;
}

a { color: var(--sky); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--mint); }

.bg-glow {
  position: fixed; inset: 0; pointer-events: none; z-index: -1;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cpath d='M0 80H160M80 0V160' stroke='%23e7f2f4' stroke-opacity='0.03'/%3E%3C/svg%3E");
  opacity: 0.9;
}

.site-header {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  animation: rise 0.7s ease both;
}

.brand {
  font-family: var(--display);
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--foam);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.nav { display: flex; align-items: center; gap: 1rem; font-size: 0.95rem; }
.nav a { color: var(--foam); text-decoration: none; opacity: 0.85; }
.nav a:hover { opacity: 1; color: var(--mint); }
.nav-user { color: var(--muted); }
.inline { display: inline; margin: 0; }
.linkish {
  background: none; border: none; color: var(--muted); font: inherit; cursor: pointer; padding: 0;
}
.linkish:hover { color: var(--mint); }

main { max-width: var(--max); margin: 0 auto; padding: 0 1.5rem 4rem; }

.site-footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.hero {
  min-height: calc(100vh - 6rem);
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 2rem;
  align-items: end;
  padding: 2rem 0 4rem;
  animation: rise 0.8s ease both;
}

.brand-mark {
  font-family: var(--display);
  font-size: clamp(3rem, 8vw, 5.5rem);
  font-weight: 700;
  margin: 0 0 0.4rem;
  letter-spacing: -0.04em;
  background: linear-gradient(120deg, var(--foam), var(--mint) 55%, var(--sky));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 0.95;
  animation: fade-in 1s ease both;
}

.hero h1, .path-hero h1, .section-top h1, .auth-panel h1, .lesson-head h1 {
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.12;
  margin: 0 0 1rem;
}

.hero h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); max-width: 14ch; }

.hero-sub, .muted { color: var(--muted); }
.hero-sub { font-size: 1.1rem; max-width: 36ch; margin: 0 0 1.75rem; }

.hero-cta { display: flex; flex-wrap: wrap; gap: 0.75rem; }

.hero-visual {
  min-height: 280px;
  border-radius: 28px 28px 8px 28px;
  background:
    linear-gradient(145deg, rgba(61,220,151,0.2), transparent 40%),
    linear-gradient(210deg, rgba(56,189,248,0.18), transparent 45%),
    linear-gradient(180deg, rgba(14,36,54,0.9), rgba(7,19,31,0.4));
  border: 1px solid var(--line);
  display: flex;
  align-items: flex-end;
  padding: 1.5rem;
  animation: floaty 7s ease-in-out infinite;
}

.path-ribbon {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  width: 100%;
}
.path-ribbon span {
  display: block;
  padding: 0.85rem 1rem;
  border-left: 3px solid var(--mint);
  background: rgba(7, 19, 31, 0.55);
  backdrop-filter: blur(6px);
  font-weight: 500;
}
.path-ribbon span:nth-child(2) { border-color: var(--sky); margin-left: 1rem; }
.path-ribbon span:nth-child(3) { border-color: var(--amber); margin-left: 2rem; }

.home-block {
  padding: 3rem 0 1.5rem;
  border-top: 1px solid var(--line);
  animation: rise 0.8s ease both;
}
.home-block.alt {
  background: linear-gradient(180deg, rgba(14, 36, 54, 0.35), transparent);
  margin: 1.5rem -1.5rem 0;
  padding: 3rem 1.5rem 2rem;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.home-block h2 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  letter-spacing: -0.03em;
  margin: 0 0 0.65rem;
}
.block-lead {
  color: var(--muted);
  max-width: 52ch;
  margin: 0 0 1.75rem;
  font-size: 1.05rem;
}

.path-stages {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 1.25rem;
}
.path-stages li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.1rem;
  align-items: start;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--line);
}
.path-stages li:last-child { border-bottom: none; padding-bottom: 0; }
.stage-num {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.35rem;
  color: var(--mint);
  line-height: 1;
  padding-top: 0.2rem;
}
.path-stages h3 {
  margin: 0 0 0.35rem;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.15rem;
}
.path-stages p { margin: 0; color: var(--muted); max-width: 60ch; }

.feature-rows {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 1rem;
}
.feature-rows li {
  display: grid;
  grid-template-columns: 9rem 1fr;
  gap: 1rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line);
}
.feature-rows li:last-child { border-bottom: none; }
.feature-rows strong {
  font-family: var(--display);
  font-weight: 700;
  color: var(--foam);
}
.feature-rows span { color: var(--muted); }

.practice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem 2rem;
}
.practice-grid h3 {
  margin: 0 0 0.4rem;
  font-family: var(--display);
  font-weight: 700;
}
.practice-grid p { margin: 0; color: var(--muted); }

.cta-block { padding-bottom: 3rem; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.85rem 1.25rem;
  border-radius: 999px;
  border: none;
  background: linear-gradient(120deg, var(--mint), #2bb673);
  color: #042016;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.05); color: #042016; }
.btn-ghost {
  background: transparent;
  color: var(--foam);
  border: 1px solid var(--line);
}
.btn-ghost:hover { border-color: var(--mint); color: var(--mint); }
.btn-sm { padding: 0.45rem 0.9rem; font-size: 0.9rem; }
.btn-icon {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--line);
  color: var(--foam);
  border-radius: 8px;
  width: 2rem; height: 2rem;
  cursor: pointer;
}

.auth-panel {
  max-width: 420px;
  margin: 2rem auto;
  padding: 2rem 0;
  animation: rise 0.6s ease both;
}

.stack { display: grid; gap: 1rem; }
label { display: grid; gap: 0.4rem; font-size: 0.92rem; color: var(--muted); }
input[type="email"], input[type="password"], input[type="text"], select {
  width: 100%;
  padding: 0.85rem 0.95rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(7, 19, 31, 0.65);
  color: var(--foam);
  font: inherit;
}
input:focus, select:focus { outline: 2px solid rgba(61, 220, 151, 0.45); border-color: transparent; }

.flash {
  padding: 0.75rem 1rem;
  border-radius: 12px;
  margin: 0 0 1rem;
}
.flash-ok { background: rgba(61, 220, 151, 0.15); color: var(--ok); }
.flash-bad { background: rgba(251, 113, 133, 0.15); color: var(--danger); }

.path-hero, .section-top {
  padding: 1.5rem 0 2rem;
  animation: rise 0.6s ease both;
}
.eyebrow { color: var(--muted); text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.75rem; margin-bottom: 0.75rem; }
.eyebrow a { color: inherit; }

.progress-track {
  height: 8px;
  background: rgba(255,255,255,0.08);
  border-radius: 999px;
  overflow: hidden;
  margin: 1rem 0;
}
.progress-track i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--mint), var(--sky));
  border-radius: inherit;
  transition: width 0.6s ease;
}
.progress-track.sm { width: 140px; margin: 0.35rem 0 0; }

.sections { display: grid; gap: 0.85rem; }
.section-row {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  align-items: center;
  padding: 1.25rem 1.35rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent, var(--mint));
  background: linear-gradient(120deg, rgba(14,36,54,0.85), rgba(7,19,31,0.4));
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s ease, border-color 0.15s ease;
  animation: rise 0.5s ease both;
}
.section-row:hover { transform: translateX(4px); border-color: var(--accent); color: inherit; }
.section-row h2 { margin: 0 0 0.35rem; font-size: 1.25rem; font-family: var(--display); font-weight: 500; }
.section-row p { margin: 0; color: var(--muted); font-size: 0.95rem; }
.section-progress { text-align: right; }
.ticks { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 0.9rem; }
.tick-badge {
  display: inline-flex; width: 1.6rem; height: 1.6rem; align-items: center; justify-content: center;
  border-radius: 50%; background: rgba(61,220,151,0.2); color: var(--mint); margin-top: 0.4rem; font-size: 0.85rem;
}

.page-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.55rem; }
.page-list li a {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.9rem;
  align-items: center;
  padding: 1rem 1.1rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: rgba(7,19,31,0.45);
  text-decoration: none;
  color: inherit;
  transition: background 0.15s ease;
}
.page-list li a:hover { background: rgba(14,36,54,0.9); color: inherit; }
.page-list li.done a { border-color: rgba(61,220,151,0.35); }
.tick { font-size: 1.1rem; color: var(--muted); width: 1.4rem; text-align: center; }
.page-list li.done .tick { color: var(--mint); }
.page-copy { display: grid; gap: 0.2rem; }
.page-copy strong { font-weight: 600; }
.page-copy em { font-style: normal; color: var(--muted); font-size: 0.9rem; }
.kind {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.lesson-shell { padding: 1rem 0 2rem; animation: rise 0.55s ease both; max-width: 760px; }
.lesson-head { margin-bottom: 1.25rem; }
.tick-inline { color: var(--mint); margin: 0.5rem 0 0; }
.lesson-body .lede { font-size: 1.15rem; color: #c5dbe6; }
.lesson-body h2 { font-family: var(--display); font-weight: 500; margin-top: 1.75rem; }
.lesson-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 1.5rem;
  font-size: 0.92rem;
}
.lesson-body th, .lesson-body td {
  border: 1px solid var(--line);
  padding: 0.55rem 0.7rem;
  text-align: left;
  vertical-align: top;
}
.lesson-body th {
  background: rgba(56, 189, 248, 0.12);
  color: var(--foam);
  font-weight: 600;
}
.lesson-body pre {
  overflow-x: auto;
  padding: 1rem 1.1rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.35);
  font-size: 0.88rem;
  line-height: 1.45;
}
.complete-bar { margin: 2rem 0; }

.activity {
  margin-top: 2rem;
  padding: 1.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(160deg, rgba(14,36,54,0.75), rgba(7,19,31,0.35));
}
.activity h2 { font-family: var(--display); font-weight: 500; margin-top: 0; }
.quiz-q, .classify-cat {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem;
  margin: 0;
}
.choice {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.45rem 0;
  color: var(--foam);
  cursor: pointer;
}
.match-row { margin-bottom: 0.5rem; }
.order-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.5rem; }
.order-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(0,0,0,0.2);
  cursor: grab;
}
.order-btns { display: flex; gap: 0.35rem; }
.hint { font-size: 0.9rem; }

.guided-lab { display: grid; gap: 1.25rem; }
.guide-steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.55rem;
}
.guide-steps li {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.75rem;
  align-items: start;
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(0,0,0,0.15);
  color: var(--muted);
}
.guide-steps li.current {
  border-color: rgba(61, 220, 151, 0.55);
  background: rgba(61, 220, 151, 0.08);
  color: var(--foam);
}
.guide-steps li.done {
  border-color: rgba(61, 220, 151, 0.25);
  opacity: 0.85;
}
.guide-num {
  font-family: var(--display);
  font-weight: 700;
  color: var(--mint);
}
.guide-check { color: var(--mint); font-weight: 700; min-width: 1rem; }
.guide-steps .hint-btn { display: inline-block; margin-left: 0.5rem; font-size: 0.85rem; }
.guided-term { min-height: 360px; }
.guided-lab .terminal { min-height: 360px; }

.c-challenge { display: grid; gap: 0.75rem; }
.c-editor-wrap textarea, #c-stdin, .c-challenge textarea {
  width: 100%;
  min-height: 280px;
  font-family: ui-monospace, "Cascadia Code", Menlo, Consolas, monospace;
  font-size: 0.9rem;
  line-height: 1.45;
  padding: 0.9rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #050b12;
  color: #d7e6ef;
  resize: vertical;
}
#c-stdin { min-height: 72px; }
.c-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.c-output {
  margin: 0;
  min-height: 120px;
  padding: 0.9rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(0,0,0,0.35);
  white-space: pre-wrap;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.88rem;
  color: #c5dbe6;
}
.open-lab .c-editor-wrap textarea { min-height: 360px; }

.pager {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  font-size: 0.95rem;
}

.lab-page { padding: 0.5rem 0 2rem; animation: rise 0.55s ease both; }
.lab-head {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  align-items: flex-end;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}
.lab-head h1 { margin-bottom: 0.5rem; }
.lab-shell-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.lab-tab {
  font: inherit;
  font-weight: 600;
  padding: 0.55rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.lab-tab.active {
  color: #042016;
  background: linear-gradient(120deg, var(--mint), #2bb673);
  border-color: transparent;
}
.lab-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(240px, 0.7fr);
  gap: 1.25rem;
  align-items: start;
}
.terminal {
  border-radius: 16px;
  border: 1px solid var(--line);
  overflow: hidden;
  background: #050b12;
  box-shadow: 0 20px 50px rgba(0,0,0,0.35);
  min-height: 480px;
  display: flex;
  flex-direction: column;
}
.terminal-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.9rem;
  background: #0c1622;
  border-bottom: 1px solid var(--line);
}
.term-dots::before {
  content: "";
  display: inline-block;
  width: 10px; height: 10px; border-radius: 50%;
  background: #fb7185;
  box-shadow: 16px 0 0 #f59e0b, 32px 0 0 #3ddc97;
}
.term-title { color: var(--muted); font-size: 0.85rem; margin-left: 2rem; }
.terminal-body {
  flex: 1;
  padding: 0.85rem 1rem 1rem;
  overflow: auto;
  font-family: ui-monospace, "Cascadia Code", "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.92rem;
  line-height: 1.45;
  color: #d7e6ef;
}
.term-line { margin: 0 0 0.15rem; white-space: pre-wrap; word-break: break-word; font: inherit; }
.term-line.cmd { color: #9fd7ff; }
.term-line.err { color: #fb7185; }
.term-line.muted { color: var(--muted); }
.term-input-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.55rem;
  align-items: center;
  margin-top: 0.35rem;
}
.term-prompt {
  color: var(--mint);
  font-weight: 600;
  white-space: nowrap;
}
#term-input {
  border: none;
  background: transparent;
  color: #e7f2f4;
  font: inherit;
  padding: 0.2rem 0;
  outline: none;
  width: 100%;
  border-radius: 0;
}
.lab-guide {
  padding: 1.1rem 1.2rem;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(14, 36, 54, 0.55);
}
.lab-guide h2 {
  font-family: var(--display);
  font-weight: 700;
  margin: 0 0 0.85rem;
  font-size: 1.2rem;
}
.lab-guide h3 { margin: 0 0 0.5rem; font-size: 0.95rem; color: var(--mint); }
.lab-guide ol { margin: 0 0 1rem; padding-left: 1.1rem; color: var(--muted); }
.lab-guide li { margin: 0.35rem 0; }
.lab-guide code {
  color: var(--foam);
  background: rgba(255,255,255,0.06);
  padding: 0.05em 0.3em;
  border-radius: 5px;
  font-size: 0.88em;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
@keyframes fade-in {
  from { opacity: 0; filter: blur(6px); }
  to { opacity: 1; filter: none; }
}
@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@media (max-width: 800px) {
  .hero { grid-template-columns: 1fr; min-height: auto; align-items: start; }
  .hero-visual { min-height: 200px; }
  .section-row { flex-direction: column; align-items: flex-start; }
  .section-progress { text-align: left; width: 100%; }
  .progress-track.sm { width: 100%; }
  .feature-rows li { grid-template-columns: 1fr; gap: 0.25rem; }
  .practice-grid { grid-template-columns: 1fr; }
  .home-block.alt { margin-left: -1.5rem; margin-right: -1.5rem; }
  .lab-layout { grid-template-columns: 1fr; }
  .terminal { min-height: 380px; }
}
