:root {
  color-scheme: light;
  --editorial-bg: #fbf8f4;
  --editorial-surface: #f2eae1;
  --editorial-raised: #fffdfa;
  --editorial-ink: #2b221d;
  --editorial-muted: #63574e;
  --editorial-soft: #746359;
  --editorial-line: #ded2c6;
  --editorial-control: #8c7869;
  --editorial-accent: #94472f;
  --editorial-accent-hover: #753420;
  --editorial-accent-soft: #f2e2d6;
  --editorial-error: #993d31;
  --editorial-info: #36576e;
  --editorial-media: #332820;
  --editorial-radius-control: 6px;
  --editorial-radius-media: 12px;
  --editorial-radius-stage: clamp(.875rem, 1.5vw, 1.25rem);
  --editorial-serif: "Songti SC", "Noto Serif CJK SC", "Source Han Serif SC", SimSun, Georgia, serif;
  --editorial-width: 78rem;
  --editorial-gutter: clamp(1rem, 4vw, 3rem);
  --bg: var(--editorial-bg);
  --paper: var(--editorial-raised);
  --panel: var(--editorial-surface);
  --ink: var(--editorial-ink);
  --quiet: var(--editorial-muted);
  --line: var(--editorial-line);
  --green: var(--editorial-accent);
}

body { background: var(--editorial-bg); color: var(--editorial-ink); }
::selection { background: var(--editorial-accent-soft); color: var(--editorial-ink); }
:focus-visible { outline: 2px solid var(--editorial-accent); outline-offset: 3px; }
[id] { scroll-margin-top: 20px; }
h1, h2, h3 { text-wrap: balance; }
.skip-link {
  position: fixed;
  inset: 10px auto auto 12px;
  z-index: 20;
  transform: translateY(calc(-100% - 1rem));
  color: var(--editorial-raised);
  background: var(--editorial-accent-hover);
  border-radius: var(--editorial-radius-control);
}
.skip-link:focus { transform: none; }

.lab-shell,
.editorial-header .header-inner {
  inline-size: min(var(--editorial-width), calc(100% - 2 * var(--editorial-gutter)));
  margin-inline: auto;
}
.site-header.editorial-header {
  background: var(--editorial-bg);
  border-block-end: 1px solid var(--editorial-line);
}
.editorial-header .header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0 2rem;
  min-block-size: 4rem;
  block-size: auto;
}
.editorial-header .wordmark {
  min-block-size: 44px;
  gap: .6rem;
  color: var(--editorial-ink);
  font-size: 1.05rem;
  letter-spacing: .02em;
}
.editorial-header .brand-mark {
  inline-size: 1.7rem;
  block-size: 1.7rem;
  background: var(--editorial-accent);
  color: var(--editorial-raised);
  border-radius: var(--editorial-radius-control);
}
.editorial-header .brand-mark i { background: currentColor; }
.editorial-header .editorial-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0 clamp(.9rem, 3vw, 2.1rem);
  color: var(--editorial-muted);
}
.editorial-header .editorial-nav a {
  display: inline-flex;
  align-items: center;
  min-block-size: 44px;
  padding: .45rem 0;
  font-size: .9rem;
  white-space: nowrap;
}
.editorial-header .editorial-nav a:hover,
.editorial-header .editorial-nav a[aria-current] { color: var(--editorial-accent-hover); text-decoration: underline; text-underline-offset: .35em; }
.editorial-header .editorial-nav a[aria-current] { font-weight: 700; }
.editorial-jumps {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 clamp(.9rem, 2.8vw, 1.65rem);
  margin-block: 0 15px;
}
.editorial-jumps a { display: inline-flex; min-block-size: 44px; align-items: center; color: var(--editorial-accent); font-size: .875rem; }
.editorial-jumps a:hover { color: var(--editorial-accent-hover); text-decoration: underline; text-underline-offset: .22em; }

.outline-button, .community-button, .operator-shell :is(button, select, input:not([type="checkbox"]), textarea) {
  border-radius: var(--editorial-radius-control);
}
.outline-button, .operator-shell button {
  transition: background-color 160ms ease-out, border-color 160ms ease-out, color 160ms ease-out;
}
.outline-button, .operator-secondary {
  background: transparent;
  border: 1px solid var(--editorial-control);
  color: var(--editorial-accent-hover);
  min-block-size: 44px;
}
.outline-button:hover, .operator-secondary:hover { background: var(--editorial-accent-soft); border-color: var(--editorial-accent); }
.operator-button, .community-button {
  background: var(--editorial-accent);
  color: var(--editorial-raised);
  min-block-size: 44px;
}
.operator-button:hover, .community-button:hover { background: var(--editorial-accent-hover); }
.text-link, .back-link, .category-back, .operator-back { color: var(--editorial-accent); }
.text-link:hover, .back-link:hover, .category-back:hover, .operator-back:hover { color: var(--editorial-accent-hover); text-decoration: underline; text-underline-offset: .22em; }
.table-scroll { max-inline-size: 100%; overscroll-behavior-inline: contain; }
:is(.archive-page, .work-page, .category-page, .operator-shell) :is(input:not([type="checkbox"]), select, textarea) {
  border: 1px solid var(--editorial-control);
  background: var(--editorial-raised);
  color: var(--editorial-ink);
  color-scheme: light;
  min-block-size: 44px;
  border-radius: var(--editorial-radius-control);
}
:is(.archive-page, .operator-shell) :is(input, select, textarea):user-invalid { border-color: var(--editorial-error); }

.archive-page {
  inline-size: min(64rem, calc(100% - 2 * var(--editorial-gutter)));
  padding-block: clamp(1.85rem, 5vw, 4.1rem) 4rem;
}
:is(.archive-page, .category-page, .operator-shell, .work-page) h1 {
  color: var(--editorial-ink);
  font-family: var(--editorial-serif);
  font-size: clamp(2.125rem, 1.55rem + 3vw, 4.8rem);
  font-weight: 700;
  letter-spacing: -.035em;
  line-height: 1.13;
}
.archive-page h1 { margin-block: 0 .55rem; }
.archive-page h1 + p { font-size: clamp(.96rem, .9rem + .38vw, 1.2rem); }
.archive-page p, .archive-page section p, .work-page .title-band p { color: var(--editorial-muted); }
:is(.archive-page, .work-page) .archive-index {
  margin-block: clamp(1.65rem, 4vw, 3.4rem) 0;
  padding-block: 1.25rem 0;
  border: 0;
  border-block-start: 1px solid var(--editorial-line);
  background: transparent;
}
.archive-page .archive-index h2 { margin-block-start: 0; color: var(--editorial-ink); letter-spacing: -.026em; }
:is(.archive-page, .work-page) .archive-index figure { margin-inline: 0; }
:is(.archive-page, .work-page) .archive-index img { border-radius: var(--editorial-radius-media); }
:is(.archive-page, .work-page) .archive-index figcaption { color: var(--editorial-muted); }
.archive-links { gap: .25rem 1.1rem; }
.archive-links a {
  display: inline-flex;
  inline-size: fit-content;
  align-items: center;
  min-block-size: 44px;
  padding: .35rem 0;
  border: 0;
  background: transparent;
  color: var(--editorial-accent);
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: .18em;
}
.archive-links a:hover { color: var(--editorial-accent-hover); text-decoration-thickness: .12em; }
.archive-page th, .archive-page td { border-color: var(--editorial-line); }
.archive-page thead th, .archive-page .field { color: var(--editorial-muted); }
.technical-grid { column-gap: clamp(1rem, 4vw, 3rem); }
.technical-grid > div { padding: .65rem 0; border: 0; background: transparent; }
.technical-grid dt, .technical-grid code { color: var(--editorial-accent-hover); }
.technical-grid dd { color: var(--editorial-muted); }
.batch-evidence :is(.batch-evidence-card, .batch-evidence-metric) {
  border: 0;
  border-radius: var(--editorial-radius-control);
  background: var(--editorial-surface);
}

.category-page { padding-block: clamp(1.65rem, 5vw, 3.9rem) 4rem; }
.category-heading { margin-block: 0 1.15rem; }
.category-heading p, #category-status { color: var(--editorial-muted); }
#category-navigation { border-block: 0; border-block-end: 1px solid var(--editorial-line); gap: 0 clamp(.85rem, 2.5vw, 1.6rem); }
#category-navigation a { color: var(--editorial-muted); min-block-size: 44px; }
#category-navigation a[aria-current="page"] { color: var(--editorial-accent-hover); }
.category-works { gap: clamp(1.5rem, 4vw, 2.8rem); }
.category-work { background: transparent; border: 0; }
.category-work:target .category-work-body { background: var(--editorial-accent-soft); }
.category-work :is(img, video) { background: var(--editorial-surface); border-radius: var(--editorial-radius-media); }
.category-work-body { padding: .85rem 0 .3rem; }
.category-work:target .category-work-body { padding-inline: .75rem; border-radius: var(--editorial-radius-control); }
.category-work h2 { letter-spacing: -.02em; }
.category-work-body > p, .category-prompt p { color: var(--editorial-muted); }
.category-work-body > a { display: inline-flex; min-block-size: 44px; align-items: center; }
.category-prompt { border-color: var(--editorial-line); }
.category-prompt summary { min-block-size: 44px; padding-block: .7rem; color: var(--editorial-accent); }
.category-prompt pre {
  border: 0;
  border-radius: var(--editorial-radius-control);
  background: var(--editorial-surface);
  color: var(--editorial-ink);
}
.work-page { padding-block-end: 4rem; }
.work-page .lab-kicker { color: var(--editorial-accent); }
.work-page .lab-kicker > span { display: none; }
#work-image { aspect-ratio: auto 16 / 9; block-size: auto; }
#work-evidence figcaption { color: var(--editorial-muted); }

.operator-header p, .operator-facts dt, .operator-empty { color: var(--editorial-muted); }
.operator-shell fieldset { border-color: var(--editorial-line); border-radius: var(--editorial-radius-control); }
.operator-shell legend { color: var(--editorial-muted); }
.operator-shell :is(button, input, select, textarea, summary, a):focus-visible { outline-color: var(--editorial-accent); }
.operator-entry, .operator-entry:last-child { border-color: var(--editorial-line); }
.operator-entry summary span, .operator-entry summary::marker, .operator-facts a, .operator-response { color: var(--editorial-accent); }
.operator-response[data-error] { color: var(--editorial-error); }
.operator-decode-choice input[type="checkbox"] { accent-color: var(--editorial-accent); }

@media (max-width: 35rem) {
  .editorial-header .header-inner { align-items: flex-start; gap: 0; padding-block: .25rem; }
  .editorial-header .wordmark { flex-basis: 100%; }
  .editorial-header .editorial-nav { column-gap: 1rem; }
  .editorial-jumps { margin-block-end: .6rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
