:root {
  --page: #f3f6f7;
  --paper: #ffffff;
  --ink: #151515;
  --muted: #5e6469;
  --line: #d9dee2;
  --black: #0d0f10;
  --coral: #e9544f;
  --jade: #169b8f;
  --sun: #e7b938;
  --blue: #2f67d8;
  --green: #3d8b47;
  --shadow: 0 18px 42px rgba(18, 24, 28, 0.14);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  overflow-x: hidden;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  background-image:
    linear-gradient(rgba(21, 21, 21, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(21, 21, 21, 0.045) 1px, transparent 1px);
  background-size: 44px 44px;
}

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

img {
  display: block;
  max-width: 100%;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
  padding: 12px clamp(18px, 5vw, 72px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(13, 15, 16, 0.86);
  color: #fff;
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
}

.brand-mark {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: var(--radius);
  background: var(--coral);
  color: #fff;
}

.topnav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.topnav a {
  padding: 8px 10px;
  border-radius: var(--radius);
  color: rgba(255, 255, 255, 0.82);
  font-size: 14px;
}

.topnav a:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.topnav a[aria-current="page"] {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.intro-shell {
  position: relative;
  display: grid;
  min-height: calc(100vh - 68px);
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  align-items: end;
  gap: 28px;
  overflow: hidden;
  padding: clamp(42px, 8vh, 78px) clamp(18px, 5vw, 72px);
  color: #fff;
}

.intro-image {
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(90deg, rgba(13, 15, 16, 0.92), rgba(13, 15, 16, 0.58) 52%, rgba(13, 15, 16, 0.78)),
    url("https://images.unsplash.com/photo-1518005020951-eccb494ad742?auto=format&fit=crop&w=1800&q=80") center / cover;
  transform: scale(1.02);
}

.intro-shell::after {
  position: absolute;
  right: 5vw;
  bottom: 28px;
  width: min(380px, 70vw);
  height: 2px;
  content: "";
  background: linear-gradient(90deg, var(--coral), var(--sun), var(--jade), var(--blue));
}

.intro-content {
  max-width: 830px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--coral);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.intro-content .eyebrow,
.intro-content h1,
.intro-content p {
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.32);
}

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

h1 {
  max-width: 13em;
  margin: 0;
  font-size: 76px;
  line-height: 0.98;
  letter-spacing: 0;
}

h2 {
  margin: 0;
  font-size: 46px;
  line-height: 1.08;
  letter-spacing: 0;
}

h3 {
  margin: 0;
  font-size: 20px;
  line-height: 1.25;
  letter-spacing: 0;
}

.intro-copy {
  max-width: 690px;
  margin: 22px 0 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 18px;
  line-height: 1.85;
}

.intro-actions,
.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    background-color 180ms ease;
}

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

.button.primary {
  background: var(--coral);
  color: #fff;
  box-shadow: 8px 8px 0 rgba(255, 255, 255, 0.22);
}

.button.secondary {
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
}

.status-panel {
  display: grid;
  gap: 12px;
  align-self: end;
  width: 100%;
}

.status-panel div {
  display: grid;
  gap: 5px;
  min-height: 82px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: var(--radius);
  background: rgba(13, 15, 16, 0.56);
  backdrop-filter: blur(14px);
}

.status-label {
  color: rgba(255, 255, 255, 0.68);
  font-size: 13px;
}

.workspace-section,
.detail-section,
.lab-section,
.notes-section {
  padding: 82px clamp(18px, 5vw, 72px);
}

.section-heading {
  display: grid;
  max-width: 820px;
  gap: 14px;
}

.section-heading p:not(.eyebrow),
.notes-header p,
.detail-copy p,
.lab-item p,
.note-item p,
.card-body p {
  color: var(--muted);
  line-height: 1.75;
}

.workspace-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 34px 0 22px;
}

.chip {
  min-height: 38px;
  padding: 8px 14px;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.chip.is-active {
  background: var(--ink);
  color: #fff;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.workspace-card {
  position: relative;
  display: grid;
  min-height: 420px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: 0 1px 0 rgba(18, 24, 28, 0.08);
  cursor: pointer;
  transform: perspective(900px) rotateX(0) rotateY(0) translateY(0);
  transition:
    transform 220ms ease,
    box-shadow 220ms ease,
    border-color 220ms ease,
    opacity 180ms ease;
}

.workspace-card.is-featured {
  box-shadow: 8px 8px 0 rgba(233, 84, 79, 0.22);
}

.workspace-card:hover,
.workspace-card:focus-visible {
  border-color: var(--ink);
  box-shadow: var(--shadow);
  outline: none;
  transform: perspective(900px) rotateX(var(--tilt-x, 0)) rotateY(var(--tilt-y, 0)) translateY(-6px);
}

.workspace-card.is-active {
  border-color: var(--ink);
  box-shadow: 8px 8px 0 rgba(233, 84, 79, 0.22);
}

.workspace-card:focus-visible {
  outline: 3px solid rgba(47, 103, 216, 0.46);
  outline-offset: 3px;
}

.workspace-card.is-hidden {
  display: none;
}

.workspace-card img {
  width: 100%;
  height: 190px;
  object-fit: cover;
  filter: saturate(0.92) contrast(1.02);
}

.open-cue {
  position: absolute;
  top: 14px;
  right: 14px;
  padding: 7px 9px;
  border-radius: var(--radius);
  background: rgba(13, 15, 16, 0.78);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  opacity: 0;
  transform: translateY(-4px);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.workspace-card:hover .open-cue,
.workspace-card:focus-visible .open-cue {
  opacity: 1;
  transform: translateY(0);
}

.card-body {
  display: grid;
  gap: 12px;
  align-content: start;
  padding: 18px;
}

.card-tag {
  width: max-content;
  padding: 5px 8px;
  border-radius: var(--radius);
  background: #eef3f3;
  color: var(--jade);
  font-size: 12px;
  font-weight: 900;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.card-meta span {
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 13px;
}

.detail-section {
  background: var(--black);
  color: #fff;
}

.page-hero {
  position: relative;
  display: grid;
  min-height: 540px;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  align-items: end;
  gap: 28px;
  overflow: hidden;
  padding: 82px clamp(18px, 5vw, 72px);
  color: #fff;
}

.page-hero::before {
  position: absolute;
  inset: 0;
  z-index: -2;
  content: "";
  background:
    linear-gradient(90deg, rgba(13, 15, 16, 0.93), rgba(13, 15, 16, 0.62) 58%, rgba(13, 15, 16, 0.82)),
    url("https://images.unsplash.com/photo-1518005020951-eccb494ad742?auto=format&fit=crop&w=1800&q=80") center / cover;
}

.agent-page .page-hero::before {
  background:
    linear-gradient(90deg, rgba(13, 15, 16, 0.94), rgba(13, 15, 16, 0.64) 58%, rgba(13, 15, 16, 0.82)),
    url("https://images.unsplash.com/photo-1515879218367-8466d910aaa4?auto=format&fit=crop&w=1800&q=80") center / cover;
}

.homepage-page .page-hero::before {
  background:
    linear-gradient(90deg, rgba(13, 15, 16, 0.94), rgba(13, 15, 16, 0.62) 58%, rgba(13, 15, 16, 0.82)),
    url("https://images.unsplash.com/photo-1516321318423-f06f85e504b3?auto=format&fit=crop&w=1800&q=80") center / cover;
}

.notes-page .page-hero::before {
  background:
    linear-gradient(90deg, rgba(13, 15, 16, 0.94), rgba(13, 15, 16, 0.64) 58%, rgba(13, 15, 16, 0.82)),
    url("https://images.unsplash.com/photo-1455390582262-044cdead277a?auto=format&fit=crop&w=1800&q=80") center / cover;
}

.notes-page .page-hero {
  grid-template-columns: minmax(0, 1fr);
  min-height: 440px;
}

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

.notes-page .topic-card {
  align-content: start;
  min-height: 220px;
  box-shadow: 6px 6px 0 rgba(18, 24, 28, 0.08);
}

.toolbox-page .page-hero::before {
  background:
    linear-gradient(90deg, rgba(13, 15, 16, 0.94), rgba(13, 15, 16, 0.64) 58%, rgba(13, 15, 16, 0.82)),
    url("https://images.unsplash.com/photo-1555066931-4365d14bab8c?auto=format&fit=crop&w=1800&q=80") center / cover;
}

.page-hero-copy {
  max-width: 820px;
}

.page-hero-copy h1 {
  margin-bottom: 22px;
}

.page-hero-copy p:not(.eyebrow) {
  max-width: 720px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 18px;
  line-height: 1.85;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.32);
}

.back-link {
  display: inline-flex;
  margin-bottom: 22px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: var(--radius);
  color: rgba(255, 255, 255, 0.8);
  font-weight: 800;
}

.back-link:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.page-status {
  align-self: end;
}

.page-section {
  padding: 82px clamp(18px, 5vw, 72px);
}

.compact-hero {
  min-height: 460px;
}

.light-section {
  background: #fff;
}

.route-layout {
  margin-top: 32px;
}

.focus-stack {
  display: grid;
  gap: 14px;
}

.focus-card,
.topic-card {
  display: grid;
  gap: 12px;
  min-height: 172px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}

.focus-card p,
.topic-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
}

.role-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 32px;
}

.topic-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-top: 32px;
}

.index-overview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-top: 32px;
}

.index-overview-card {
  display: grid;
  gap: 12px;
  min-height: 170px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}

.index-overview-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
}

.knowledge-item-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-top: 24px;
}

.knowledge-item-card {
  display: grid;
  gap: 10px;
  min-height: 188px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.knowledge-item-card:hover,
.knowledge-item-card:focus-visible {
  border-color: var(--ink);
  box-shadow: var(--shadow);
  outline: none;
  transform: translateY(-3px);
}

.knowledge-item-tag {
  width: max-content;
  padding: 5px 8px;
  border-radius: var(--radius);
  background: #eef3f3;
  color: var(--jade);
  font-size: 12px;
  font-weight: 900;
}

.knowledge-item-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.knowledge-item-card .card-meta {
  margin-top: auto;
}

.knowledge-loading,
.knowledge-error {
  display: grid;
  gap: 12px;
  min-height: 180px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  grid-column: 1 / -1;
}

.knowledge-error {
  box-shadow: 6px 6px 0 rgba(233, 84, 79, 0.12);
}

.knowledge-loading p,
.knowledge-error p {
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
}

.progress-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 32px;
}

.progress-summary article,
.knowledge-columns article {
  display: grid;
  gap: 12px;
  min-height: 210px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}

.progress-summary article {
  box-shadow: 6px 6px 0 rgba(22, 155, 143, 0.12);
}

.progress-summary span {
  display: inline-grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: var(--radius);
  background: var(--ink);
  color: #fff;
  font-weight: 900;
}

.progress-summary p,
.knowledge-columns p,
.evolution-steps p,
.code-path p {
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
}

.evolution-steps {
  display: grid;
  gap: 14px;
  margin: 34px 0 0;
  padding: 0;
  list-style: none;
}

.evolution-steps li {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}

.evolution-steps li > span {
  display: grid;
  min-height: 54px;
  place-items: center;
  border-radius: var(--radius);
  background: var(--black);
  color: #fff;
  font-weight: 900;
}

.evolution-steps h3 {
  margin-bottom: 8px;
}

.evolution-steps strong {
  display: inline-flex;
  width: max-content;
  margin-top: 12px;
  padding: 6px 9px;
  border-radius: var(--radius);
  background: #eef3f3;
  color: var(--jade);
  font-size: 13px;
}

.evolution-steps .is-done > span {
  background: var(--jade);
}

.evolution-steps .is-current {
  border-color: rgba(231, 185, 56, 0.9);
  box-shadow: inset 5px 0 0 var(--sun);
}

.evolution-steps .is-current > span {
  background: var(--sun);
  color: var(--ink);
}

.code-path {
  display: grid;
  gap: 18px;
  margin-top: 32px;
}

.code-command {
  display: grid;
  gap: 10px;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius);
  background: var(--black);
  color: #fff;
}

.code-command span {
  color: rgba(255, 255, 255, 0.66);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.code-command code {
  overflow-wrap: anywhere;
  color: #fff;
  font: 700 16px/1.7 "Cascadia Code", "Consolas", monospace;
}

.code-path ol {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: codepath;
}

.code-path li {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  min-height: 96px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}

.code-path li::before {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: var(--radius);
  background: var(--coral);
  color: #fff;
  content: counter(codepath);
  counter-increment: codepath;
  font-weight: 900;
}

.code-path strong {
  display: block;
  margin-bottom: 6px;
  font-family: "Cascadia Code", "Consolas", monospace;
  overflow-wrap: anywhere;
}

.knowledge-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 32px;
}

.knowledge-columns article:nth-child(1) {
  box-shadow: 6px 6px 0 rgba(233, 84, 79, 0.12);
}

.knowledge-columns article:nth-child(2) {
  box-shadow: 6px 6px 0 rgba(47, 103, 216, 0.12);
}

.knowledge-columns article:nth-child(3) {
  box-shadow: 6px 6px 0 rgba(231, 185, 56, 0.16);
}

.knowledge-columns ul {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.knowledge-columns li {
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  line-height: 1.55;
}

.knowledge-columns a,
.topic-card[href] {
  transition:
    color 180ms ease,
    border-color 180ms ease,
    transform 180ms ease,
    box-shadow 180ms ease;
}

.knowledge-columns a {
  display: block;
}

.knowledge-columns a:hover,
.knowledge-columns a:focus-visible {
  color: var(--ink);
  outline: none;
}

.knowledge-columns li:has(a:hover),
.knowledge-columns li:has(a:focus-visible) {
  border-color: var(--ink);
  background: #f8fbfb;
}

.topic-card[href]:hover,
.topic-card[href]:focus-visible {
  border-color: var(--ink);
  box-shadow: var(--shadow);
  outline: none;
  transform: translateY(-3px);
}

.knowledge-index {
  display: grid;
  grid-template-columns: minmax(0, 0.62fr) minmax(0, 1fr);
  gap: 18px;
  margin-top: 32px;
}

.knowledge-index article {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}

.knowledge-index ol {
  display: grid;
  gap: 8px;
  margin: 16px 0 0;
  padding-left: 24px;
}

.knowledge-index a {
  color: var(--muted);
  line-height: 1.65;
}

.knowledge-index a:hover,
.knowledge-index a:focus-visible {
  color: var(--coral);
  outline: none;
}

.knowledge-detail-list {
  display: grid;
  gap: 26px;
  margin-top: 34px;
}

.knowledge-article {
  display: grid;
  gap: 14px;
  padding: clamp(18px, 4vw, 32px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  scroll-margin-top: 92px;
}

.knowledge-article > * {
  min-width: 0;
}

.article-label {
  width: max-content;
  padding: 6px 9px;
  border-radius: var(--radius);
  background: #eef3f3;
  color: var(--jade);
  font-size: 13px;
  font-weight: 900;
}

.knowledge-article h1 {
  max-width: none;
  margin: 0;
  color: var(--ink);
  font-size: 38px;
  line-height: 1.12;
}

.knowledge-article h2 {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 28px;
}

.knowledge-article h3 {
  margin-top: 10px;
  font-size: 21px;
}

.knowledge-article p,
.knowledge-article li {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.85;
}

.knowledge-article ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 22px;
}

.knowledge-article pre {
  overflow-x: auto;
  max-width: 100%;
  margin: 4px 0;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--black);
  color: #fff;
}

.knowledge-article code {
  border-radius: 5px;
  background: #eef3f3;
  color: var(--ink);
  font-family: "Cascadia Code", "Consolas", monospace;
  font-size: 0.92em;
  overflow-wrap: anywhere;
  white-space: normal;
}

.knowledge-article pre code {
  background: transparent;
  color: inherit;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.inline-link {
  color: var(--blue);
  font-weight: 800;
}

.back-to-index {
  width: max-content;
  margin-top: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  font-weight: 800;
}

.back-to-index:hover,
.back-to-index:focus-visible {
  border-color: var(--ink);
  color: var(--ink);
  outline: none;
}

.rule-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-top: 28px;
}

.rule-strip span {
  display: grid;
  min-height: 86px;
  place-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  font-weight: 900;
  text-align: center;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.78fr) minmax(320px, 1.22fr);
  gap: 34px;
  align-items: start;
}

.detail-copy {
  position: sticky;
  top: 94px;
}

.detail-copy p {
  color: rgba(255, 255, 255, 0.74);
}

.route-board {
  display: grid;
  gap: 18px;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius);
  background:
    linear-gradient(rgba(255, 255, 255, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.055) 1px, transparent 1px),
    #151819;
  background-size: 32px 32px;
}

.route-topline {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: rgba(255, 255, 255, 0.74);
  font-weight: 800;
}

.progress-track {
  height: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.1);
}

.progress-track span {
  display: block;
  width: 40%;
  height: 100%;
  border-radius: var(--radius);
  background: linear-gradient(90deg, var(--coral), var(--sun), var(--jade));
  transition: width 420ms ease;
}

.timeline {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: phase;
}

.timeline li {
  position: relative;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 12px;
  min-height: 94px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.06);
}

.timeline li::before {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  content: counter(phase);
  counter-increment: phase;
  font-weight: 900;
}

.timeline h3 {
  margin-bottom: 6px;
  font-size: 17px;
}

.timeline p {
  margin: 0;
  color: rgba(255, 255, 255, 0.68);
  line-height: 1.7;
}

.timeline .is-done::before {
  background: var(--jade);
  color: #fff;
}

.timeline .is-current {
  border-color: rgba(231, 185, 56, 0.85);
  box-shadow: inset 4px 0 0 var(--sun);
}

.knowledge-panel {
  display: grid;
  gap: 12px;
}

.knowledge-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.knowledge-list span {
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.82);
}

.lab-section {
  background: #fff;
}

.lab-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 32px;
}

.lab-item {
  display: block;
  min-height: 230px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}

.lab-item.is-wide {
  max-width: 560px;
}

.lab-number {
  display: inline-grid;
  width: 42px;
  height: 42px;
  place-items: center;
  margin-bottom: 26px;
  border-radius: var(--radius);
  background: var(--sun);
  font-weight: 900;
}

.lab-item:nth-child(2) .lab-number {
  background: var(--jade);
  color: #fff;
}

.lab-item:nth-child(3) .lab-number {
  background: var(--blue);
  color: #fff;
}

.notes-section {
  background: var(--page);
}

.notes-header {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(280px, 0.55fr);
  gap: 24px;
  align-items: end;
  margin-bottom: 28px;
}

.note-list {
  display: grid;
  gap: 12px;
}

.note-item {
  display: grid;
  grid-template-columns: 150px minmax(0, 220px) minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  min-height: 102px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}

.note-item[href] {
  color: inherit;
  text-decoration: none;
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

.note-item[href]:hover,
.note-item[href]:focus-visible {
  border-color: var(--ink);
  box-shadow: var(--shadow);
  outline: none;
  transform: translateY(-2px);
}

.note-item time {
  color: var(--coral);
  font-weight: 900;
}

.note-item p {
  margin: 0;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: space-between;
  padding: 30px clamp(18px, 5vw, 72px);
  background: var(--black);
  color: rgba(255, 255, 255, 0.78);
}

.site-footer a {
  color: #fff;
  font-weight: 800;
}

@media (max-width: 1120px) {
  h1 {
    font-size: 56px;
  }

  h2 {
    font-size: 38px;
  }

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

  .detail-layout {
    grid-template-columns: 1fr;
  }

  .topic-grid,
  .rule-strip,
  .progress-summary,
  .index-overview,
  .knowledge-item-grid,
  .role-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .knowledge-index {
    grid-template-columns: 1fr;
  }

  .detail-copy {
    position: static;
  }
}

@media (max-width: 780px) {
  h1 {
    font-size: 38px;
  }

  h2 {
    font-size: 30px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .intro-shell {
    min-height: auto;
    grid-template-columns: 1fr;
    padding-top: 54px;
  }

  .page-hero {
    min-height: auto;
    grid-template-columns: 1fr;
    padding-block: 54px;
  }

  .intro-copy {
    font-size: 16px;
  }

  .page-hero-copy p:not(.eyebrow) {
    font-size: 16px;
  }

  .status-panel {
    grid-template-columns: 1fr;
  }

  .card-grid,
  .lab-grid,
  .notes-header,
  .topic-grid,
  .rule-strip,
  .progress-summary,
  .knowledge-columns,
  .index-overview,
  .knowledge-item-grid,
  .role-grid {
    grid-template-columns: 1fr;
  }

  .evolution-steps li,
  .code-path li {
    grid-template-columns: 1fr;
  }

  .knowledge-article h1 {
    font-size: 30px;
  }

  .knowledge-article h2 {
    font-size: 24px;
  }

  .workspace-card {
    min-height: 380px;
  }

  .detail-section,
  .workspace-section,
  .lab-section,
  .notes-section,
  .page-section {
    padding-block: 58px;
  }

  .route-board {
    padding: 16px;
  }

  .timeline li {
    grid-template-columns: 38px minmax(0, 1fr);
    padding: 12px;
  }

  .timeline li::before {
    width: 32px;
    height: 32px;
  }

  .note-item {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .lab-item.is-wide {
    max-width: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
    animation-duration: 1ms !important;
  }
}
