:root {
  color-scheme: dark;
  --bg: #090b0e;
  --panel: #10141a;
  --panel-soft: #0d1116;
  --line: #242b34;
  --line-bright: #35404c;
  --text: #f3f5f7;
  --muted: #9ba6b3;
  --accent: #77e6a1;
  --accent-soft: rgba(119, 230, 161, 0.1);
  --blue: #8bb8ff;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background:
    radial-gradient(circle at 72% -10%, rgba(119, 230, 161, 0.08), transparent 34rem),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

.wrap { width: min(1160px, calc(100% - 40px)); margin-inline: auto; }

.site-header {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.brand, .github-link, .back-link, .lab-nav a {
  text-decoration: none;
  font-weight: 650;
}

.brand { display: inline-flex; align-items: center; gap: 12px; letter-spacing: -0.02em; }

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(119, 230, 161, 0.45);
  background: var(--accent-soft);
  color: var(--accent);
  font: 700 12px/1 var(--mono);
  border-radius: 8px;
}

.github-link { color: var(--muted); font-size: 14px; transition: color .2s ease; }
.github-link:hover, .back-link:hover, .lab-nav a:hover, footer a:hover { color: var(--accent); }

.hero { padding: 112px 0 96px; }

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--accent);
  font: 700 12px/1.4 var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 5px rgba(119, 230, 161, .09), 0 0 18px rgba(119, 230, 161, .5);
}

.hero h1, .lab-intro h1 {
  max-width: 920px;
  margin: 24px 0;
  font-size: clamp(52px, 8vw, 96px);
  line-height: .98;
  letter-spacing: -.065em;
}

.hero h1 span { color: #7f8a96; }

.hero-copy {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
  font-size: clamp(18px, 2.1vw, 22px);
  line-height: 1.55;
}

.hero-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: 670px;
  margin-top: 56px;
  border-block: 1px solid var(--line);
}

.hero-meta div { padding: 22px 26px 22px 0; }
.hero-meta div + div { padding-left: 26px; border-left: 1px solid var(--line); }
.hero-meta strong { display: block; font: 600 26px/1 var(--mono); color: var(--text); }
.hero-meta span { display: block; margin-top: 8px; color: var(--muted); font-size: 13px; }

.labs-section { padding: 0 0 100px; }

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.section-heading span, .panel-heading, .section-heading > p {
  color: var(--muted);
  font: 600 11px/1.4 var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
}

.section-heading h2 { margin: 6px 0 0; font-size: 30px; letter-spacing: -.035em; }
.section-heading > p { margin: 0 0 6px; }

.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }

.lab-card {
  min-height: 325px;
  display: flex;
  flex-direction: column;
  padding: 30px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(16, 20, 26, .58);
  text-decoration: none;
  transition: background .2s ease, border-color .2s ease, transform .2s ease;
}

.lab-card:hover { position: relative; z-index: 1; background: var(--panel); border-color: var(--line-bright); transform: translateY(-2px); }
.card-number { color: #5f6a76; font: 600 12px/1 var(--mono); }
.lab-card h2 { margin: 44px 0 14px; font-size: 25px; line-height: 1.15; letter-spacing: -.035em; }
.lab-card p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.65; }
.card-link { margin-top: auto; padding-top: 32px; color: var(--accent); font: 650 13px/1.2 var(--mono); }

.lab-main { padding: 48px 0 84px; }
.back-link { display: inline-flex; gap: 10px; color: var(--muted); font-size: 14px; }
.lab-intro { padding: 76px 0 68px; border-bottom: 1px solid var(--line); }
.lab-intro h1 { margin: 22px 0 18px; font-size: clamp(46px, 7vw, 76px); }
.lab-intro > p { max-width: 820px; margin: 0; color: var(--muted); font-size: clamp(18px, 2vw, 22px); }

.command-section, .result-section { margin-top: 54px; }
.panel-heading { display: flex; justify-content: space-between; margin-bottom: 12px; }
.panel-heading span:first-child { color: var(--text); }

pre { margin: 0; font-family: var(--mono); }
.command, .raw-output {
  overflow-x: auto;
  border: 1px solid var(--line);
  background: #080a0d;
  color: #cbd4dc;
  font-size: 13px;
  line-height: 1.75;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.command { padding: 24px; border-left: 3px solid var(--accent); }
.raw-output { max-height: 70vh; padding: 30px; white-space: pre; overflow-wrap: normal; }

.rendered-output {
  padding: clamp(24px, 5vw, 56px);
  border: 1px solid var(--line);
  background: var(--panel-soft);
}

.rendered-output > :first-child { margin-top: 0; }
.rendered-output > :last-child { margin-bottom: 0; }
.rendered-output h1 { margin: 0 0 24px; font-size: clamp(28px, 4vw, 42px); line-height: 1.15; letter-spacing: -.04em; }
.rendered-output h2 { margin: 42px 0 16px; font-size: 22px; letter-spacing: -.025em; }
.rendered-output h3 { margin: 30px 0 12px; font-size: 17px; color: var(--blue); }
.rendered-output p, .rendered-output li { color: #bdc6cf; }
.rendered-output ul { padding-left: 22px; }
.rendered-output li + li { margin-top: 8px; }
.rendered-output code { color: var(--accent); font: .9em var(--mono); }
.rendered-output blockquote { margin: 32px 0 0; padding: 18px 22px; border-left: 3px solid var(--blue); background: rgba(139, 184, 255, .06); color: #b8c6d8; }
.table-scroll { overflow-x: auto; margin: 18px 0 30px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 13px 16px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
th { background: rgba(255,255,255,.025); color: var(--muted); font: 600 11px/1.3 var(--mono); letter-spacing: .05em; text-transform: uppercase; }
td { color: #c4ccd4; }
th:not(:first-child), td:not(:first-child) { text-align: right; }

.lab-nav { display: flex; justify-content: space-between; margin-top: 36px; padding-top: 30px; border-top: 1px solid var(--line); }
.lab-nav a { color: var(--muted); font-size: 14px; }

footer {
  min-height: 94px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-top: 1px solid var(--line);
  color: #6f7984;
  font-size: 13px;
}
footer a { color: var(--muted); text-decoration: none; }

@media (max-width: 900px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .hero { padding: 90px 0 80px; }
}

@media (max-width: 620px) {
  .wrap { width: min(100% - 28px, 1160px); }
  .site-header { min-height: 70px; }
  .github-link { font-size: 0; }
  .github-link span { font-size: 15px; }
  .hero { padding: 72px 0 64px; }
  .hero h1 { font-size: clamp(44px, 14vw, 64px); }
  .hero-meta { grid-template-columns: 1fr; }
  .hero-meta div { padding: 18px 0; }
  .hero-meta div + div { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); }
  .section-heading { align-items: start; flex-direction: column; }
  .card-grid { grid-template-columns: 1fr; }
  .lab-card { min-height: 280px; }
  .lab-intro { padding: 58px 0 50px; }
  .panel-heading span:last-child { display: none; }
  .rendered-output { padding: 24px 18px; }
  .raw-output { padding: 20px 16px; font-size: 12px; }
  .lab-nav, footer { align-items: flex-start; flex-direction: column; justify-content: center; }
  .lab-nav { gap: 16px; }
  footer { padding-block: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
