
.article-page, .story {
  --ar-board: #e9f0f8; --ar-stud: rgba(0, 0, 0, 0.07);
  --ar-amber: #a5670b;
  --ar-oc: var(--muted);      --ar-mb: var(--accent);   }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) :is(.article-page, .story) {
    --ar-board: #1e2936; --ar-stud: rgba(255, 255, 255, 0.08); --ar-amber: #e2ac4d;
  }
}
:root[data-theme="dark"] :is(.article-page, .story) {
  --ar-board: #1e2936; --ar-stud: rgba(255, 255, 255, 0.08); --ar-amber: #e2ac4d;
}

.article-page .page { max-width: 44rem; margin: 0 auto; padding: 2.5rem 1.5rem 4rem; }
.article-page header.top { margin-bottom: 3rem; }
.article { line-height: 1.65; }
.article strong { font-weight: 600; }

.article .banner { margin: 0 0 2.5rem; padding: 0.7rem 0.95rem; font-size: 0.88rem; line-height: 1.5; color: var(--text-2);
  background: color-mix(in srgb, var(--ar-amber) 8%, var(--surface)); border: 1px dashed color-mix(in srgb, var(--ar-amber) 55%, transparent); border-radius: 8px; }

.article .kicker { margin: 0 0 0.7rem; font-size: 0.78rem; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase; color: var(--accent); }
.article h1 { margin-bottom: 1.1rem; }
.article .lead { margin-bottom: 1.4rem; }
.article .meta { margin: 0 0 0.5rem; padding-top: 0.9rem; border-top: 1px solid var(--line); font-size: 0.88rem; line-height: 1.55; color: var(--muted); }

.article h2 { margin: 3.25rem 0 0.85rem; font-size: 1.5rem; line-height: 1.25; font-weight: 650; letter-spacing: -0.012em; text-transform: none; color: var(--text); text-wrap: balance; }
.article p { margin: 0 0 1.05rem; }
.article ul, .article ol { margin: 0 0 1.25rem; padding-left: 1.35rem; }
.article li { margin: 0 0 0.45rem; }
.article li::marker { color: var(--muted); }

.article blockquote.oneline { position: relative; margin: 1.6rem 0 1.75rem; padding: 1.15rem 1.3rem 1.15rem 2.75rem;
  background: var(--raised); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 4px 10px 10px 4px; }
.article blockquote.oneline::before { content: "\203A"; content: "\203A" / ""; position: absolute; left: 1.15rem; top: 1.05rem; font: 600 1.2rem/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--accent); }
.article blockquote.oneline p { margin: 0; font: 500 1.12rem/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: -0.01em; color: var(--text); overflow-wrap: anywhere; }

.article .scroll { margin: 1.6rem 0 1.5rem; overflow-x: auto; border-radius: 12px; }
.article table.ladder { --bk: 2.4rem; width: 100%; border-collapse: separate; border-spacing: 0; padding: 0.75rem 0.9rem 0.6rem; background: var(--ar-board); border-radius: 12px; font-size: 0.9rem; line-height: 1.3; }
.article .ladder th, .article .ladder td { padding: 0.3rem 0.35rem; }
.article .ladder thead th { vertical-align: bottom; padding-bottom: 0.65rem; font-size: 0.74rem; font-weight: 600; line-height: 1.25; letter-spacing: 0.01em; color: var(--text-2); text-align: center; }
.article .ladder thead th:first-child { text-align: left; color: var(--muted); }
.article .ladder tr.mb ~ * th:last-child, .article .ladder thead:has(+ tbody tr.mb) th:last-child { color: var(--accent); }
.article .ladder tbody th { text-align: left; font-weight: 500; color: var(--text); padding-right: 0.8rem; }
.article .ladder td { position: relative; width: 17%; height: calc(var(--bk) + 0.55rem); text-align: center; color: transparent; user-select: none; }
.article .ladder td::before { content: ""; position: absolute; left: 50%; top: 50%; width: var(--bk); height: var(--bk); transform: translate(-50%, -50%); border-radius: calc(var(--bk) * 0.17); }
.article .ladder td.off::before { background: radial-gradient(circle closest-side, var(--ar-stud) 0 40%, transparent calc(40% + 0.75px)); }
.article .ladder td.on { --k: var(--ar-oc); }
.article .ladder tr.mb td.on { --k: var(--ar-mb); }
.article .ladder td.on::before {
  background:
    radial-gradient(circle closest-side, color-mix(in srgb, var(--k), #fff 16%) 0 48%, color-mix(in srgb, var(--k), #000 20%) calc(48% + 0.5px) 52%, transparent calc(52% + 0.75px)),
    var(--k);
  box-shadow: 0 1px 0 color-mix(in srgb, var(--k), #000 30%);
}
.article .ladder tr.mb > * { border-top: 1px dashed color-mix(in srgb, var(--accent) 40%, transparent); padding-top: 0.6rem; }
.article .ladder tr.mb th { font-weight: 600; }
@media (forced-colors: active) { .article .ladder td { color: CanvasText; } .article .ladder td::before { display: none; } }

.article ul.rungs { list-style: none; padding-left: 0; }
.article ul.rungs li { position: relative; padding-left: 2rem; margin-bottom: 0.6rem; }
.article ul.rungs li::before { content: ""; position: absolute; left: 0.1rem; top: 0.3rem; width: 1.1rem; height: 1.1rem; border-radius: 0.2rem; --k: var(--ar-oc);
  background: radial-gradient(circle closest-side, color-mix(in srgb, var(--k), #fff 16%) 0 47%, color-mix(in srgb, var(--k), #000 20%) calc(47% + 0.5px) 56%, transparent calc(56% + 0.75px)), var(--k); }
.article ul.rungs li:first-child::before { background: radial-gradient(circle closest-side, var(--ar-stud) 0 44%, transparent calc(44% + 0.75px)), var(--ar-board); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 22%, transparent); }
.article ul.rungs li:last-child::before { --k: var(--ar-mb); }

.article span.todo { padding: 0.05em 0.3em; border-radius: 4px; font-size: 0.94em; color: var(--text-2); background: color-mix(in srgb, var(--ar-amber) 11%, transparent);
  -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.article p.todo { padding: 0.55rem 0.85rem; border-left: 2px dashed color-mix(in srgb, var(--ar-amber) 70%, transparent); border-radius: 0 6px 6px 0;
  background: color-mix(in srgb, var(--ar-amber) 7%, transparent); color: var(--text-2); font-size: 0.95rem; }

.article figure.figure { margin: 1.5rem 0 2rem; }
.article .slot { display: grid; place-items: center; min-height: 15rem; padding: 1.5rem; text-align: center; font-size: 0.92rem; color: var(--muted);
  border: 1px dashed var(--axis); border-radius: 12px;
  background-color: var(--raised);
  background-image: linear-gradient(to top, var(--line) 1px, transparent 1px);
  background-size: 100% 3rem; background-position: 0 -1px; }
.article figcaption { margin-top: 0.6rem; font-size: 0.86rem; color: var(--muted); }

.article ol.answers { list-style: none; padding-left: 0; counter-reset: answer; }
.article ol.answers li { position: relative; counter-increment: answer; padding-left: 2.4rem; margin-bottom: 0.95rem; }
.article ol.answers li::before { content: counter(answer); position: absolute; left: 0; top: 0.12rem; display: grid; place-items: center; width: 1.5rem; height: 1.5rem; border-radius: 0.3rem;
  font-size: 0.78rem; font-weight: 650; line-height: 1; color: var(--text-2); background: var(--raised); border: 1px solid var(--line); }
.article ol.answers strong { display: block; margin-bottom: 0.2rem; }

.article ul.limits { list-style: none; padding-left: 0; }
.article ul.limits li { margin: 0; padding: 0.7rem 0; border-top: 1px solid var(--line); color: var(--text-2); }
.article ul.limits li:last-child { border-bottom: 1px solid var(--line); }
.article ul.limits .todo { color: var(--text); }

@media (max-width: 34rem) {
  .article-page .page { padding-top: 1.75rem; }
  .article-page header.top { margin-bottom: 2.25rem; }
  .article h2 { font-size: 1.3rem; margin-top: 2.75rem; }
  .article blockquote.oneline { padding-left: 2.35rem; }
  .article blockquote.oneline::before { left: 0.9rem; }
  .article blockquote.oneline p { font-size: 1rem; }
  .article table.ladder { --bk: 1.9rem; padding: 0.6rem 0.4rem 0.45rem; font-size: 0.82rem; }
  .article .ladder th, .article .ladder td { padding: 0.25rem 0.2rem; }
  .article .ladder thead th { font-size: 0.66rem; letter-spacing: 0; }
  .article .ladder tbody th { padding-right: 0.4rem; }
  .article .slot { min-height: 11rem; }
}

.story { display: block; margin: 2rem 0 0; padding: 1.35rem 1.5rem 1.3rem; color: var(--text); background: var(--raised); border: 1px solid var(--line); border-radius: 12px;
  transition: border-color 0.15s, background-color 0.15s, box-shadow 0.15s; }
.story:hover { text-decoration: none; border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); background: color-mix(in srgb, var(--accent) 4%, var(--raised)); box-shadow: 0 2px 12px rgba(0, 0, 0, 0.07); }
.story:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.story > span, .story > strong { display: block; }
.story > .story-kicker { display: flex; align-items: flex-start; gap: 0.55rem; font-size: 0.74rem; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); }
.story-kicker::before { content: ""; flex: none; width: 1rem; height: 1rem; margin-top: 0.08rem; border-radius: 0.18rem; --k: var(--ar-mb);
  background: radial-gradient(circle closest-side, color-mix(in srgb, var(--k), #fff 16%) 0 47%, color-mix(in srgb, var(--k), #000 20%) calc(47% + 0.5px) 56%, transparent calc(56% + 0.75px)), var(--k); }
.story-title { margin: 0.6rem 0 0.5rem; font-size: 1.6rem; line-height: 1.22; font-weight: 650; letter-spacing: -0.015em; text-wrap: balance; }
.story-sum { color: var(--text-2); font-size: 0.98rem; line-height: 1.55; }
.story-more { margin-top: 0.95rem; font-size: 0.94rem; font-weight: 600; color: var(--accent); }
.story-more span { display: inline-block; transition: transform 0.15s; }
.story:hover .story-more span { transform: translateX(3px); }
.story:hover .story-title { color: var(--accent); }
@media (max-width: 34rem) { .story { padding: 1.1rem 1.1rem 1.05rem; } .story-title { font-size: 1.3rem; } }
@media (prefers-reduced-motion: reduce) { .story, .story-more span { transition: none; } }

.article table.data { border-collapse: collapse; width: 100%; font-size: 0.92rem; margin: 0.5rem 0 1rem; }
.article table.data th, .article table.data td { text-align: left; padding: 0.5rem 0.9rem 0.5rem 0; border-bottom: 1px solid var(--line); white-space: nowrap; }
.article table.data thead th { font-weight: 600; color: var(--text-2); font-size: 0.8rem; }
.article table.data .num { text-align: right; font-variant-numeric: tabular-nums; }
.article table.data tbody th { font-weight: 500; }
.article table.data td:last-child, .article table.data th:last-child { padding-right: 0; }
.article code { font: 0.9em ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
