:root {
  color-scheme: light;
  --bg: #f7f8f5;
  --ink: #141512;
  --muted: #62685f;
  --line: #d9ded4;
  --panel: #ffffff;
  --green: #1e6f4a;
  --blue: #255c99;
  --gold: #d79a20;
  --code: #121614;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  line-height: 1.5;
}

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

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 24px;
}

.brand {
  font-size: 1.1rem;
  font-weight: 800;
}

nav {
  display: flex;
  gap: 22px;
  color: var(--muted);
  font-size: 0.95rem;
}

nav a:hover {
  color: var(--ink);
}

main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px 64px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.92fr);
  gap: 42px;
  align-items: center;
  min-height: 620px;
  padding: 48px 0 84px;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  max-width: 820px;
  margin: 0;
  font-size: clamp(3.1rem, 7vw, 6.8rem);
  line-height: 0.96;
  letter-spacing: 0;
}

h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.6rem);
  line-height: 1.03;
  letter-spacing: 0;
}

h3 {
  margin: 0 0 10px;
  font-size: 1.05rem;
}

.lede {
  max-width: 660px;
  margin: 28px 0 0;
  color: var(--muted);
  font-size: 1.18rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 750;
}

.button.primary {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

.button.secondary {
  background: transparent;
}

.terminal-panel {
  overflow: hidden;
  border: 1px solid #252b27;
  border-radius: 8px;
  background: var(--code);
  color: #e7f0e7;
  box-shadow: 0 24px 80px rgb(31 45 35 / 18%);
}

.terminal-bar {
  display: flex;
  gap: 8px;
  padding: 14px 16px;
  border-bottom: 1px solid rgb(255 255 255 / 10%);
}

.terminal-bar span {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--gold);
}

.terminal-bar span:nth-child(2) {
  background: var(--green);
}

.terminal-bar span:nth-child(3) {
  background: var(--blue);
}

pre {
  min-height: 250px;
  margin: 0;
  padding: 28px;
  overflow: auto;
  font-size: 0.95rem;
  line-height: 1.65;
}

code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.test-result {
  padding: 16px 28px 20px;
  border-top: 1px solid rgb(255 255 255 / 10%);
  color: #a7efc1;
  font-weight: 800;
}

.section {
  padding: 74px 0;
  border-top: 1px solid var(--line);
}

.section-heading {
  max-width: 760px;
  margin-bottom: 32px;
}

.track-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.track-grid article {
  min-height: 210px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.track-grid p,
.roadmap p {
  margin: 0;
  color: var(--muted);
}

.split {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 42px;
}

.problem-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.problem-list li {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 16px;
  align-items: center;
  min-height: 62px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  font-weight: 700;
}

.problem-list span {
  color: var(--blue);
  font-variant-numeric: tabular-nums;
}

.roadmap {
  max-width: 820px;
}

.roadmap p:last-child {
  margin-top: 18px;
  font-size: 1.12rem;
}

.page-hero {
  padding: 64px 0 54px;
}

.page-hero.compact h1 {
  max-width: 880px;
  font-size: clamp(3rem, 6vw, 5.6rem);
}

.problem-catalog {
  display: grid;
  gap: 8px;
}

.problem-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 150px 140px auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 18px;
}

.problem-toolbar label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
}

.problem-toolbar input,
.problem-toolbar select {
  width: 100%;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  font: inherit;
  font-size: 0.92rem;
  text-transform: none;
  padding: 0 12px;
}

.problem-count {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
  text-align: right;
}

.problem-table-head,
.problem-row {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 120px 90px 84px;
  gap: 16px;
  align-items: center;
}

.problem-table-head {
  padding: 0 16px 8px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.problem-row {
  min-height: 66px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.problem-row.ready:hover {
  border-color: var(--green);
  background: #fbfcfa;
}

.problem-row.locked {
  color: var(--muted);
}

.problem-main {
  min-width: 0;
}

.problem-main h2 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.2;
}

.problem-main p {
  overflow: hidden;
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.problem-row > span,
.problem-row > strong {
  font-size: 0.88rem;
}

.problem-row > strong {
  color: var(--blue);
  font-weight: 800;
}

.track-pill {
  color: var(--green);
  font-weight: 800;
}

.empty-state {
  margin: 18px 0 0;
  padding: 22px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.problem-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.64fr);
  gap: 42px;
  padding: 44px 0 72px;
}

.problem-statement h1 {
  font-size: clamp(3.2rem, 7vw, 6rem);
}

.back-link {
  display: inline-flex;
  margin-bottom: 28px;
  color: var(--blue);
  font-weight: 800;
}

.statement-block {
  padding: 34px 0;
  border-top: 1px solid var(--line);
}

.statement-block h2,
.checklist h2 {
  margin: 0 0 14px;
  font-size: 1.3rem;
}

.statement-block p {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
}

.code-block {
  min-height: auto;
  border: 1px solid #252b27;
  border-radius: 8px;
  background: var(--code);
  color: #e7f0e7;
}

.rule-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
}

.exercise-panel {
  position: sticky;
  top: 24px;
  align-self: start;
  display: grid;
  gap: 18px;
}

.exercise-panel .terminal-panel pre {
  min-height: 390px;
}

.checklist {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

@media (max-width: 980px) {
  .hero,
  .split,
  .problem-layout {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

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

  .problem-toolbar {
    grid-template-columns: 1fr 1fr;
  }

  .problem-count {
    text-align: left;
  }

  .exercise-panel {
    position: static;
  }
}

@media (max-width: 640px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 18px;
  }

  nav {
    width: 100%;
    justify-content: space-between;
    gap: 12px;
  }

  h1 {
    font-size: 3rem;
  }

  .hero {
    padding-top: 28px;
  }

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

  .problem-toolbar {
    grid-template-columns: 1fr;
  }

  .problem-table-head {
    display: none;
  }

  .problem-row {
    grid-template-columns: 1fr;
    gap: 6px;
    min-height: auto;
  }

  .problem-main p {
    white-space: normal;
  }

  pre {
    padding: 20px;
    font-size: 0.82rem;
  }
}
