:root {
  color-scheme: light;
  --canvas: #eeece6;
  --paper: #fffefa;
  --ink: #202522;
  --muted: #5d645f;
  --link: #245b73;
  --link-hover: #153d50;
  --rule: #d8d9d3;
  --rule-strong: #aeb5b1;
  --table-head: #edf2f1;
  --table-stripe: #f7f8f5;
  --code: #182126;
  --code-ink: #e6edf1;
  --code-key: #9dd3ff;
  --code-fn: #d9a8ff;
  --code-string: #b6e3a8;
  --code-comment: #9da8ae;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: Charter, "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  font-size: 18px;
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
}

.page-shell {
  width: min(100% - 48px, 1040px);
  margin: 48px auto;
  padding: 76px clamp(36px, 7vw, 88px) 84px;
  background: var(--paper);
  border: 1px solid rgba(73, 79, 75, 0.14);
  box-shadow: 0 18px 55px rgba(38, 43, 40, 0.08);
}

article {
  max-width: 840px;
  margin: 0 auto;
}

.article-header {
  margin-bottom: 2.5rem;
}

h1,
h2 {
  color: #171b19;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.08;
}

h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(3rem, 7vw, 5.2rem);
}

h2 {
  margin: 4.5rem 0 1.4rem;
  font-size: clamp(2rem, 4vw, 2.8rem);
}

p {
  margin: 0 0 1.45rem;
}

.reward-equation {
  margin: 1.45rem 0;
  padding: 1rem 1.25rem;
  overflow-x: auto;
  border-block: 1px solid var(--rule);
  color: #27312d;
  font-size: 1.03rem;
  text-align: center;
  white-space: nowrap;
}

.reward-equation sub {
  font-size: 0.72em;
}

ul,
ol {
  margin: 0 0 1.6rem 1.4rem;
  padding: 0;
}

li {
  padding-left: 0.35rem;
}

a {
  color: var(--link);
  text-decoration-color: rgba(36, 91, 115, 0.45);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.15em;
}

a:hover {
  color: var(--link-hover);
  text-decoration-color: currentColor;
}

a:focus-visible {
  border-radius: 2px;
  outline: 3px solid rgba(36, 91, 115, 0.3);
  outline-offset: 3px;
}

.table-wrap {
  margin: 2.2rem 0 2.4rem;
  overflow-x: auto;
  border: 1px solid var(--rule-strong);
  border-radius: 3px;
  background: #fff;
  box-shadow: 0 6px 20px rgba(49, 57, 52, 0.04);
  -webkit-overflow-scrolling: touch;
}

.table-wrap-wide table {
  min-width: 780px;
}

.table-wrap-compact {
  max-width: 690px;
}

table {
  width: 100%;
  border-collapse: collapse;
  color: #202724;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.84rem;
  font-variant-numeric: tabular-nums lining-nums;
  line-height: 1.35;
}

thead {
  background: var(--table-head);
}

th,
td {
  padding: 0.72rem 0.82rem;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  text-align: left;
  vertical-align: middle;
}

tr > :last-child {
  border-right: 0;
}

tbody tr:last-child > * {
  border-bottom: 0;
}

thead th {
  color: #27312d;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.015em;
}

tbody th {
  font-weight: 600;
}

tbody tr:nth-child(even) {
  background: var(--table-stripe);
}

.numeric {
  text-align: right;
  white-space: nowrap;
}

td strong {
  color: #133f52;
  font-weight: 750;
}

.curriculum-figure {
  margin: 2.25rem 0 2.55rem;
}

.curriculum-timeline {
  display: grid;
  grid-template-columns: 80fr 40fr 40fr 40fr 50fr;
  gap: 3px;
  margin: 0;
  padding: 3px;
  overflow: hidden;
  border: 1px solid var(--rule-strong);
  border-radius: 4px;
  background: var(--rule);
  box-shadow: 0 6px 20px rgba(49, 57, 52, 0.04);
  list-style: none;
}

.curriculum-stage {
  display: flex;
  min-width: 0;
  min-height: 126px;
  padding: 1rem 0.9rem 0.85rem;
  flex-direction: column;
  background: #f4f7f5;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.25;
}

.curriculum-stage:nth-child(even) {
  background: #eaf0ee;
}

.curriculum-stage strong {
  margin: auto 0 0.6rem;
  font-size: 0.92rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.stage-number,
.stage-range {
  color: var(--muted);
  font-size: 0.7rem;
  font-variant-numeric: tabular-nums lining-nums;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.stage-range {
  white-space: nowrap;
}

pre {
  width: 100%;
  margin: 2rem 0 2.35rem;
  overflow-x: auto;
  border-radius: 4px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.78rem;
  line-height: 1.62;
  tab-size: 4;
  -webkit-overflow-scrolling: touch;
}

pre code {
  font: inherit;
}

.prompt-example {
  padding: 1.4rem 1.5rem;
  border: 1px solid var(--rule);
  background: #f5f4ef;
  color: #303733;
}

.tool-example {
  padding: 1.45rem 1.55rem;
  background: var(--code);
  color: var(--code-ink);
  box-shadow: 0 8px 24px rgba(24, 33, 38, 0.12);
}

.syntax-key {
  color: var(--code-key);
}

.syntax-fn {
  color: var(--code-fn);
}

.syntax-string {
  color: var(--code-string);
}

.syntax-comment {
  color: var(--code-comment);
}

.inline-footnote {
  position: relative;
  display: inline-block;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1;
}

.footnote-trigger {
  margin: 0 0.05em;
  padding: 0 0.13em;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: var(--link);
  font: inherit;
  cursor: pointer;
}

.footnote-trigger sup {
  font-size: 0.66em;
}

.footnote-trigger:hover,
.footnote-trigger:focus-visible,
.footnote-trigger[aria-expanded="true"] {
  background: rgba(36, 91, 115, 0.1);
  color: var(--link-hover);
  outline: none;
}

.footnote-trigger:focus-visible {
  box-shadow: 0 0 0 3px rgba(36, 91, 115, 0.24);
}

.footnote-popover {
  position: absolute;
  z-index: 10;
  left: 50%;
  bottom: calc(100% + 0.72rem);
  width: min(330px, calc(100vw - 40px));
  padding: 0.78rem 0.9rem;
  border: 1px solid var(--rule-strong);
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(38, 43, 40, 0.16);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.78rem;
  line-height: 1.45;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 0.35rem);
  transition: opacity 120ms ease, transform 120ms ease, visibility 120ms;
  visibility: hidden;
}

.footnote-popover::after {
  position: absolute;
  left: 50%;
  bottom: -0.38rem;
  width: 0.7rem;
  height: 0.7rem;
  border-right: 1px solid var(--rule-strong);
  border-bottom: 1px solid var(--rule-strong);
  background: #fff;
  content: "";
  transform: translateX(-50%) rotate(45deg);
}

.inline-footnote:hover .footnote-popover,
.inline-footnote.is-open .footnote-popover {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0);
  visibility: visible;
}

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

@media (max-width: 720px) {
  body {
    background: var(--paper);
    font-size: 17px;
  }

  .page-shell {
    width: 100%;
    margin: 0;
    padding: 42px 20px 58px;
    border: 0;
    box-shadow: none;
  }

  h1 {
    font-size: clamp(2.75rem, 14vw, 4rem);
  }

  h2 {
    margin-top: 3.7rem;
  }

  .curriculum-timeline {
    grid-template-columns: 1fr;
  }

  .curriculum-stage {
    display: grid;
    min-height: 0;
    padding: 0.8rem 0.9rem;
    grid-template-columns: 72px 1fr auto;
    gap: 0.75rem;
    align-items: center;
  }

  .curriculum-stage strong {
    margin: 0;
  }

  .footnote-popover {
    position: fixed;
    right: 20px;
    bottom: 20px;
    left: 20px;
    width: auto;
    transform: translateY(0.35rem);
  }

  .footnote-popover::after {
    display: none;
  }

  .inline-footnote:hover .footnote-popover,
  .inline-footnote.is-open .footnote-popover {
    transform: translateY(0);
  }

  .table-wrap {
    width: calc(100% + 20px);
    margin-right: -20px;
    border-right: 0;
    border-radius: 3px 0 0 3px;
  }

  th,
  td {
    padding: 0.66rem 0.72rem;
  }

  pre {
    width: calc(100% + 20px);
    border-radius: 4px 0 0 4px;
  }
}

@media print {
  body {
    background: #fff;
    font-size: 11pt;
  }

  .page-shell {
    width: auto;
    margin: 0;
    padding: 0;
    border: 0;
    box-shadow: none;
  }

  h2,
  .table-wrap,
  .curriculum-figure,
  pre {
    break-inside: avoid;
  }

  .footnote-popover {
    position: static;
    display: inline;
    padding: 0;
    border: 0;
    box-shadow: none;
    font-family: inherit;
    font-size: inherit;
    opacity: 1;
    pointer-events: auto;
    transform: none;
    visibility: visible;
  }

  .footnote-popover::before {
    content: " (";
  }

  .footnote-popover::after {
    position: static;
    display: inline;
    width: auto;
    height: auto;
    border: 0;
    background: transparent;
    content: ")";
    transform: none;
  }

  .footnote-trigger {
    display: none;
  }

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