:root {
  --ink: #edf3eb;
  --muted: #a7b5ad;
  --paper: #0a0f0d;
  --panel: #141b17;
  --panel-strong: #1a241f;
  --field: #0f1512;
  --line: #29372f;
  --green: #82d3a4;
  --yellow: #d6b15d;
  --red: #e37668;
  --soft: #203127;
  --header: rgba(10, 15, 13, 0.88);
  --focus: rgba(130, 211, 164, 0.48);
  --notice-bg: #17221e;
  --notice-line: rgba(214, 177, 93, 0.42);
  --shadow: 0 22px 58px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--paper);
  color: var(--ink);
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--paper);
}

button,
input,
select,
textarea {
  font: inherit;
  letter-spacing: 0;
}

button,
a {
  touch-action: manipulation;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 14px;
  font-size: 5.4rem;
  line-height: 0.96;
}

h2 {
  margin-bottom: 10px;
  font-size: 2.55rem;
  line-height: 1.06;
}

h3 {
  margin-bottom: 10px;
  font-size: 1.05rem;
  line-height: 1.24;
}

p,
li {
  color: var(--muted);
  line-height: 1.58;
}

label {
  display: block;
  margin-bottom: 8px;
  font-weight: 720;
}

textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

textarea {
  min-height: 130px;
  padding: 12px;
  resize: vertical;
}

select {
  min-height: 44px;
  padding: 0 12px;
}

textarea::placeholder {
  color: #78867d;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: var(--header);
  backdrop-filter: blur(12px);
}

.brand {
  font-weight: 850;
  text-decoration: none;
}

.site-nav {
  display: flex;
  gap: 16px;
  align-items: center;
  font-weight: 720;
}

.site-nav a {
  text-decoration: none;
}

.site-nav a:hover {
  color: var(--green);
}

.hero-section {
  position: relative;
  min-height: 760px;
  display: grid;
  align-items: end;
  overflow: hidden;
  padding: 64px 28px 44px;
  border-bottom: 1px solid var(--line);
}

.hero-copy {
  position: relative;
  z-index: 2;
  max-width: 860px;
  text-shadow: 0 16px 46px rgba(0, 0, 0, 0.55);
}

.hero-copy .lede {
  max-width: 760px;
}

.hero-visual {
  position: absolute;
  inset: 0;
  opacity: 1;
  background:
    linear-gradient(90deg, rgba(130, 211, 164, 0.07) 1px, transparent 1px),
    linear-gradient(0deg, rgba(214, 177, 93, 0.06) 1px, transparent 1px),
    var(--paper);
  background-size: 54px 54px, 54px 54px, auto;
}

.visual-track {
  position: absolute;
  right: 32px;
  bottom: 28px;
  display: grid;
  gap: 10px;
  width: min(420px, 44vw);
}

.visual-track span,
.visual-board {
  border: 1px solid rgba(130, 211, 164, 0.20);
  border-radius: 8px;
  background: rgba(20, 27, 23, 0.88);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.visual-track span {
  min-height: 48px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  color: var(--ink);
  font-weight: 760;
}

.visual-board {
  position: absolute;
  top: 22%;
  right: 8%;
  display: grid;
  gap: 12px;
  width: min(460px, 42vw);
  padding: 22px;
}

.visual-row {
  height: 18px;
  border-radius: 999px;
  background: rgba(145, 170, 160, 0.34);
}

.visual-row.strong {
  width: 76%;
  background: rgba(130, 211, 164, 0.58);
}

.visual-row.short {
  width: 48%;
  background: rgba(214, 177, 93, 0.74);
}

.kicker {
  margin: 0 0 8px;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 820;
  text-transform: uppercase;
}

.lede {
  max-width: 820px;
  font-size: 1.12rem;
}

.hero-actions,
.button-row,
.control-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.hero-actions {
  margin: 28px 0 14px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 16px;
  border: 1px solid var(--green);
  border-radius: 8px;
  font-weight: 800;
  text-decoration: none;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

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

.button.primary {
  background: var(--green);
  color: #07100c;
}

.button.secondary {
  background: var(--panel-strong);
  color: var(--ink);
}

.button.danger {
  border-color: var(--red);
  background: var(--red);
  color: #160705;
}

.button.small {
  min-height: 40px;
  margin: 10px 0;
}

.fine-print,
.status-line {
  font-size: 0.92rem;
}

.band,
.split-section,
.text-page,
.course-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 54px 28px;
}

.band.subdued {
  max-width: none;
  margin: 0;
  padding-right: max(28px, calc((100vw - 1180px) / 2 + 28px));
  padding-left: max(28px, calc((100vw - 1180px) / 2 + 28px));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #101713;
}

.section-heading {
  max-width: 820px;
  margin-bottom: 24px;
}

.card-grid,
.lesson-grid,
.prompt-grid,
.assignment-list,
.two-column,
.lab-row,
.studio-layout {
  display: grid;
  gap: 16px;
}

.card-grid.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.card-grid.three,
.lesson-grid,
.prompt-grid,
.assignment-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.two-column,
.lab-row,
.studio-layout {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.split-section {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 36px;
  align-items: start;
}

.info-card,
.assignment-card,
.progress-panel,
.notice,
.safety-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0)),
    var(--panel);
  box-shadow: var(--shadow);
}

.info-card,
.assignment-card,
.notice,
.safety-box {
  padding: 18px;
}

.info-card p,
.assignment-card p,
.notice p {
  margin-bottom: 0;
}

.number-list {
  margin: 0;
  padding-left: 24px;
}

.number-list li + li,
.check-list li + li {
  margin-top: 8px;
}

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

.check-list li::marker {
  color: var(--green);
}

.check-list.no li::marker {
  color: var(--red);
}

.notice {
  border-color: var(--notice-line);
  background: var(--notice-bg);
}

.strong-notice {
  margin-bottom: 22px;
}

.link-list {
  display: grid;
  gap: 10px;
}

.link-list a {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  font-weight: 780;
  text-decoration: none;
}

.site-footer {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 24px 28px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.course-shell {
  max-width: 1240px;
}

.course-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 24px;
  align-items: end;
  margin-bottom: 22px;
}

.course-top h1 {
  max-width: 840px;
}

.progress-panel {
  min-height: 128px;
  padding: 18px;
}

.progress-panel span {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
}

#progressText {
  display: block;
  margin: 8px 0 12px;
  font-size: 2rem;
}

.progress-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #24322a;
}

.progress-track span {
  display: block;
  width: 0%;
  height: 100%;
  background: var(--green);
  transition: width 180ms ease;
}

.tabs {
  position: sticky;
  top: 68px;
  z-index: 8;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin: 0 -28px 26px;
  padding: 12px 28px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--header);
  backdrop-filter: blur(12px);
}

.tab {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  font-weight: 780;
}

.tab.active {
  border-color: var(--green);
  background: var(--soft);
}

.panel {
  display: none;
}

.panel.active {
  display: block;
}

.checkline {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  min-height: 34px;
  margin: 10px 0 0;
  color: var(--ink);
  font-weight: 680;
  line-height: 1.42;
}

.checkline input {
  flex: 0 0 auto;
  width: 19px;
  height: 19px;
  margin-top: 1px;
  accent-color: var(--green);
}

.token-output {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 44px;
  margin-top: 8px;
}

.token {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 8px;
  background: var(--soft);
  font-weight: 720;
}

.bars {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.bar-row {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) 44px;
  gap: 10px;
  align-items: center;
  color: var(--muted);
}

.bar-row strong {
  color: var(--ink);
}

.bar-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #24322a;
}

.bar-track span {
  display: block;
  height: 100%;
  background: var(--yellow);
}

.prompt-card {
  min-height: 140px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  text-align: left;
  box-shadow: var(--shadow);
}

.prompt-card span {
  display: block;
  margin-bottom: 12px;
  color: var(--green);
  font-size: 0.82rem;
  font-weight: 820;
  text-transform: uppercase;
}

.prompt-card strong {
  display: block;
  font-size: 1.08rem;
  line-height: 1.25;
}

.safety-box {
  align-self: start;
  background: #191f19;
}

.control-panel {
  margin-top: 18px;
}

.print-actions {
  margin: 20px 0;
}

@media print {
  :root {
    --ink: #17201b;
    --muted: #53615a;
    --paper: #ffffff;
    --panel: #ffffff;
    --panel-strong: #f6f7f2;
    --field: #ffffff;
    --line: #d8ded4;
    --green: #197a55;
    --yellow: #b98917;
    --red: #b1423c;
    --soft: #e8f0ea;
    --notice-bg: #f7f4e8;
    --notice-line: #d6b15d;
    --shadow: none;
  }

  html {
    color-scheme: light;
  }

  .site-header,
  .site-footer,
  .print-actions {
    display: none;
  }

  body {
    background: #fff;
  }

  .text-page {
    max-width: none;
    padding: 0;
  }

  .info-card,
  .notice {
    box-shadow: none;
    break-inside: avoid;
  }
}

@media (max-width: 920px) {
  h1 {
    font-size: 3.2rem;
  }

  h2 {
    font-size: 2rem;
  }

  .site-header {
    position: static;
    align-items: flex-start;
    flex-direction: column;
    height: auto;
    padding: 16px 20px;
  }

  .site-nav {
    flex-wrap: wrap;
    gap: 10px 14px;
  }

  .hero-section {
    min-height: 690px;
    padding: 46px 20px 32px;
  }

  .visual-board {
    top: 12%;
    right: 20px;
    width: 74vw;
  }

  .visual-track {
    right: 20px;
    width: 72vw;
  }

  .band,
  .split-section,
  .text-page,
  .course-shell {
    padding: 38px 20px;
  }

  .split-section,
  .course-top,
  .two-column,
  .lab-row,
  .studio-layout,
  .card-grid.four,
  .card-grid.three,
  .lesson-grid,
  .prompt-grid,
  .assignment-list {
    grid-template-columns: 1fr;
  }

  .tabs {
    top: 0;
    margin-right: -20px;
    margin-left: -20px;
    padding-right: 20px;
    padding-left: 20px;
  }

  .site-footer {
    flex-direction: column;
    padding: 22px 20px;
  }
}

@media (max-width: 520px) {
  h1 {
    font-size: 2.55rem;
  }

  h2 {
    font-size: 1.72rem;
  }

  .hero-actions,
  .button-row,
  .control-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .button {
    width: 100%;
  }

  .bar-row {
    grid-template-columns: 82px minmax(0, 1fr) 38px;
    font-size: 0.92rem;
  }
}
