/* AI Agents, Made Clear — static Articulet course */
:root {
  color-scheme: light;
  --bg: #f7f8f5;
  --surface: #ffffff;
  --surface-soft: #f0f1fb;
  --surface-code: #121322;
  --rule: #dfe2df;
  --rule-strong: #c8ceca;
  --ink: #151722;
  --ink-muted: #58636a;
  --ink-soft: #7c878d;
  --accent: #6357c7;
  --accent-strong: #473ba8;
  --accent-soft: #e9e7ff;
  --agent: #087d70;
  --agent-soft: #ddf3ee;
  --lab: #a55c12;
  --lab-soft: #fff0d7;
  --danger: #a83f38;
  --danger-soft: #fde9e6;
  --container: 800px;
  --wide: 1120px;
  --radius: 10px;
  --shadow: 0 12px 36px rgba(25, 28, 42, 0.08);
  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 24px;
  --s6: 32px;
  --s7: 48px;
  --s8: 72px;
  --s9: 96px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--bg);
  overflow-x: clip;
}

body {
  margin: 0;
  background: var(--bg);
  overflow-x: clip;
  color: var(--ink);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--accent-soft);
  color: var(--ink);
}

a {
  color: var(--accent-strong);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--accent);
}

a:focus-visible,
button:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid rgba(99, 87, 199, 0.42);
  outline-offset: 3px;
  border-radius: 4px;
}

img {
  max-width: 100%;
  height: auto;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 24px;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 8px;
  left: 8px;
  padding: 10px 14px;
  transform: translateY(-160%);
  background: var(--ink);
  color: #fff;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.skip-link:focus {
  transform: translateY(0);
}

.topbar {
  position: sticky;
  z-index: 50;
  top: 0;
  border-bottom: 1px solid rgba(200, 206, 202, 0.9);
  background: rgba(247, 248, 245, 0.92);
  -webkit-backdrop-filter: blur(14px) saturate(145%);
  backdrop-filter: blur(14px) saturate(145%);
}

.topbar-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  width: 100%;
  max-width: var(--wide);
  min-width: 0;
  margin-inline: auto;
  padding: 12px 24px;
  color: var(--ink-muted);
  font-size: 13px;
}

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

.topbar .course {
  color: var(--ink);
  font-weight: 800;
  white-space: nowrap;
}

.topbar .chap {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

section {
  padding-block: var(--s8);
  border-bottom: 1px solid var(--rule);
}

.hero {
  position: relative;
  overflow: hidden;
  padding-block: var(--s9) var(--s8);
}

.hero::after {
  position: absolute;
  z-index: -1;
  top: -190px;
  left: 50%;
  width: 660px;
  height: 420px;
  transform: translateX(10%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(99, 87, 199, 0.12), rgba(8, 125, 112, 0.04) 48%, transparent 72%);
  content: "";
  pointer-events: none;
}

.hero-course {
  isolation: isolate;
  min-height: 720px;
  display: grid;
  align-items: center;
}

.hero-course::before {
  position: absolute;
  z-index: 1;
  inset: 0;
  background: linear-gradient(90deg, rgba(247, 248, 245, 0.99) 0%, rgba(247, 248, 245, 0.94) 34%, rgba(247, 248, 245, 0.58) 55%, rgba(247, 248, 245, 0.04) 78%);
  content: "";
  pointer-events: none;
}

.hero-course__inner {
  position: relative;
  z-index: 2;
  max-width: var(--wide);
}

.hero-course__copy {
  max-width: 590px;
}

.hero-course__art {
  position: absolute;
  z-index: 0;
  inset: 0;
  display: block;
  overflow: hidden;
}

.hero-course__art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.hero-course .objective {
  background: rgba(255, 255, 255, 0.9);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: var(--s5);
  padding: 12px 17px;
  border: 1px solid var(--accent-strong);
  border-radius: 999px;
  background: var(--accent-strong);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 8px 22px rgba(71, 59, 168, 0.2);
}

.hero-cta:hover {
  background: var(--accent);
  color: #fff;
}

.chapter-hero {
  padding-bottom: var(--s7);
}

.meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: var(--s5);
  color: var(--ink-muted);
  font-size: 13px;
  font-weight: 650;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 11px;
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 750;
}

.pill--soft {
  border-color: transparent;
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.eyebrow {
  margin: 0 0 var(--s3);
  color: var(--agent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0;
  color: var(--ink);
  line-height: 1.18;
  text-wrap: balance;
}

h1 {
  max-width: 760px;
  font-size: clamp(2.55rem, 7vw, 3.5rem);
  font-weight: 830;
  letter-spacing: -0.035em;
}

h2 {
  margin-top: var(--s7);
  margin-bottom: var(--s4);
  font-size: 30px;
  letter-spacing: -0.02em;
}

h3 {
  margin-top: var(--s6);
  margin-bottom: var(--s3);
  font-size: 22px;
}

h4 {
  margin-top: var(--s5);
  margin-bottom: var(--s2);
  font-size: 18px;
}

h5,
h6 {
  margin-top: var(--s4);
  margin-bottom: var(--s2);
  font-size: 16px;
}

.section-title {
  margin-top: 0;
  margin-bottom: var(--s7);
}

.accent {
  color: var(--accent);
}

.subtitle {
  max-width: 730px;
  margin: var(--s3) 0 0;
  color: var(--ink-muted);
  font-family: Newsreader, Georgia, serif;
  font-size: clamp(1.28rem, 3vw, 1.55rem);
  font-style: italic;
  line-height: 1.48;
}

.objective {
  margin-top: var(--s6);
  padding: var(--s5);
  border: 1px solid var(--rule);
  border-left: 4px solid var(--agent);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 8px 22px rgba(25, 28, 42, 0.035);
}

.objective .label {
  margin-bottom: 6px;
  color: var(--agent);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.chapter-progress {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  margin-top: var(--s5);
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 750;
}

.overview {
  background: var(--surface);
}

.curriculum {
  border-bottom: 0;
}

.content {
  padding-block: var(--s7);
}

.content .container > :first-child,
.content > :first-child {
  margin-top: 0;
}

.content p {
  margin: 0 0 var(--s4);
}

.content strong {
  overflow-wrap: break-word;
  font-weight: 750;
}

.content blockquote {
  margin: var(--s5) 0;
  padding: var(--s4) var(--s5);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
}

.overview .content blockquote {
  background: var(--surface-soft);
}

.content blockquote p:last-child {
  margin-bottom: 0;
}

.content ul,
.content ol {
  margin: 0 0 var(--s5);
  padding-left: 1.35rem;
}

.content li {
  margin-block: 7px;
  padding-left: 3px;
}

.content hr {
  margin: var(--s6) 0;
  border: 0;
  border-top: 1px solid var(--rule);
}

.module-intro-heading {
  display: inline-flex;
  margin: 0 0 var(--s4);
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--agent-soft);
  color: var(--agent);
  font-size: 13px;
  font-weight: 850;
}

code {
  padding: 1px 5px;
  border: 1px solid #dadde7;
  border-radius: 5px;
  background: #eef0f7;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.86em;
  overflow-wrap: anywhere;
  word-break: break-word;
}

pre {
  max-width: 100%;
  margin: var(--s5) 0;
  padding: var(--s5);
  overflow-x: auto;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius);
  background: var(--surface-code);
  color: #edf0ff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.025);
  tab-size: 2;
}

pre code {
  display: block;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 14px;
  line-height: 1.65;
  overflow-wrap: normal;
  white-space: pre;
  word-break: normal;
}

.diagram,
.course-figure {
  margin: var(--s5) 0;
  padding: var(--s5);
  overflow-x: auto;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--surface);
  break-inside: avoid;
}

.diagram .mermaid {
  min-width: 560px;
  text-align: center;
}

.course-figure img {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 760px;
  margin-inline: auto;
  border-radius: 7px;
}

figcaption {
  margin-top: var(--s3);
  color: var(--ink-muted);
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
}

.inline-image {
  max-height: 1.35em;
  vertical-align: text-bottom;
}

.table-wrap {
  max-width: 100%;
  margin: var(--s5) 0;
  overflow-x: auto;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--surface);
  break-inside: avoid;
}

table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  background: var(--surface);
}

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
  text-align: left;
}

th {
  background: var(--surface-soft);
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

tr:last-child td {
  border-bottom: 0;
}

.model-answer {
  margin: var(--s5) 0;
  overflow: clip;
  border: 1px solid #ccc8f0;
  border-radius: var(--radius);
  background: var(--surface);
  break-inside: avoid;
}

.model-answer summary {
  padding: 14px 18px;
  cursor: pointer;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 800;
  list-style-position: inside;
}

.model-answer[open] summary {
  border-bottom: 1px solid #ccc8f0;
}

.model-answer__body {
  padding: 18px;
}

.model-answer__body > :first-child {
  margin-top: 0;
}

.model-answer__body > :last-child {
  margin-bottom: 0;
}

.citation {
  margin-left: 2px;
  font-size: 0.72em;
  line-height: 0;
}

.citation a {
  font-weight: 750;
  text-decoration: none;
}

.citation--missing {
  color: var(--danger);
}

.citations {
  margin-top: var(--s8);
  padding-top: var(--s6);
  padding-bottom: 0;
  border-top: 1px solid var(--rule);
  border-bottom: 0;
}

.citations h2 {
  margin-top: 0;
  font-size: 23px;
}

.citations ol {
  padding-left: 1.5rem;
  color: var(--ink-muted);
  font-size: 14px;
}

.citation-back {
  margin-left: 6px;
  text-decoration: none;
}

.parts {
  display: grid;
  gap: var(--s7);
}

.part-block {
  padding: var(--s6);
  border: 1px solid var(--rule);
  border-radius: calc(var(--radius) + 2px);
  background: rgba(255, 255, 255, 0.5);
}

.part-block h2 {
  margin-top: 0;
}

.part-label {
  margin-bottom: var(--s2);
  color: var(--agent);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

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

.chapter-card {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--surface);
  color: inherit;
  text-decoration: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.chapter-card:hover,
.chapter-card:focus-visible {
  border-color: var(--accent);
  color: inherit;
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.chapter-card.is-complete {
  border-color: rgba(8, 125, 112, 0.45);
  background: linear-gradient(90deg, var(--agent-soft), var(--surface) 42%);
}

.chapter-card .num {
  color: var(--accent);
  font-size: 14px;
  font-weight: 850;
}

.chapter-card .title {
  display: block;
  font-weight: 800;
  line-height: 1.3;
}

.chapter-card .sub {
  display: block;
  margin-top: 4px;
  color: var(--ink-muted);
  font-size: 14px;
  line-height: 1.48;
}

.chapter-card .status {
  color: var(--agent);
  font-size: 12px;
  font-weight: 850;
}

.completion {
  padding-block: var(--s5);
  border-top: 1px solid var(--rule);
  border-bottom: 0;
  background: var(--agent-soft);
}

.completion__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  color: var(--ink-muted);
  font-size: 14px;
}

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

.completion button {
  flex: 0 0 auto;
  padding: 11px 15px;
  border: 1px solid var(--agent);
  border-radius: 999px;
  background: var(--surface);
  color: var(--agent);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

.completion button[aria-pressed="true"] {
  background: var(--agent);
  color: #fff;
}

.chapter-nav {
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  background: var(--surface);
}

.nav-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 16px;
  padding-top: 18px;
  padding-bottom: 18px;
  font-size: 14px;
  font-weight: 800;
}

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

.nav-inner a:last-child {
  text-align: right;
}

footer {
  padding-block: var(--s6);
  color: var(--ink-soft);
  font-size: 13px;
}

@media (max-width: 760px) {
  :root {
    --s8: 56px;
    --s9: 68px;
  }

  body {
    font-size: 16px;
  }

  .container,
  .topbar-inner {
    padding-inline: 18px;
  }

  .topbar-inner {
    gap: 12px;
  }

  h2 {
    font-size: 26px;
  }

  .part-block {
    padding: 20px;
  }

  .hero-course {
    min-height: 0;
    display: block;
    padding-bottom: 0;
  }

  .hero-course::before {
    display: none;
  }

  .hero-course__art {
    position: relative;
    height: auto;
    margin-top: 30px;
    border-top: 1px solid var(--rule);
  }

  .hero-course__art img {
    display: block;
    width: 100%;
    height: auto;
  }

  .chapter-card {
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 12px;
  }

  .chapter-card .status {
    display: none;
  }

  .nav-inner {
    grid-template-columns: 1fr;
  }

  .completion__inner {
    align-items: stretch;
    flex-direction: column;
  }

  .completion button {
    width: 100%;
  }

  .nav-inner a:last-child {
    text-align: left;
  }

  .diagram,
  .course-figure,
  pre {
    margin-inline: -4px;
    padding: 18px;
  }
}

@media (max-width: 480px) {
  .back-articulet {
    white-space: nowrap;
  }

  .topbar .course {
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .topbar .chap {
    display: none;
  }

  .meta {
    gap: 7px;
  }

  .objective,
  .content blockquote,
  .model-answer__body {
    padding: 16px;
  }

  .part-block {
    padding: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

@media print {
  @page {
    margin: 16mm;
  }

  :root {
    --bg: #fff;
    --surface: #fff;
    --ink: #000;
    --ink-muted: #333;
    --rule: #bbb;
  }

  body {
    background: #fff;
    color: #000;
    font-size: 11pt;
  }

  .topbar,
  .skip-link,
  .completion,
  .hero-course__art,
  .chapter-nav,
  footer {
    display: none !important;
  }

  .hero,
  section,
  .content {
    padding-block: 14pt;
  }

  .hero::after {
    display: none;
  }

  .container {
    max-width: none;
    padding-inline: 0;
  }

  h1 {
    font-size: 28pt;
  }

  h2 {
    font-size: 19pt;
  }

  a {
    color: #000;
  }

  pre {
    overflow: visible;
    border: 1px solid #888;
    background: #fff;
    color: #000;
    white-space: pre-wrap;
  }

  pre code {
    white-space: pre-wrap;
  }

  .model-answer > :not(summary) {
    display: block !important;
  }

  .part-block,
  .chapter-card,
  .diagram,
  .course-figure,
  .table-wrap,
  .model-answer,
  pre {
    box-shadow: none;
    break-inside: avoid;
  }
}
