:root {
  --page: #efe7d5;
  --paper: #fffaf0;
  --paper-deep: #f8efdc;
  --ink: #242334;
  --ink-soft: #535064;
  --muted: #746f78;
  --trail: #c85139;
  --trail-dark: #963824;
  --forest: #246c67;
  --forest-soft: #d9ebe5;
  --line: #c9b995;
  --line-soft: #ded1b5;
  --shadow: rgba(53, 43, 34, .13);
  --serif: -apple-system, BlinkMacSystemFont, "Segoe UI", Atkinson Hyperlegible, Aptos, sans-serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Atkinson Hyperlegible, Aptos, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --page: #151821;
    --paper: #20242f;
    --paper-deep: #292d37;
    --ink: #fff6e5;
    --ink-soft: #d2c9bd;
    --muted: #aaa297;
    --trail: #ff876b;
    --trail-dark: #ff9d85;
    --forest: #72c8bd;
    --forest-soft: #203f40;
    --line: #57534f;
    --line-soft: #3b3b40;
    --shadow: rgba(0, 0, 0, .3);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 8%, color-mix(in srgb, var(--trail) 9%, transparent) 0 2px, transparent 3px),
    radial-gradient(circle at 87% 28%, color-mix(in srgb, var(--forest) 9%, transparent) 0 2px, transparent 3px),
    linear-gradient(135deg, transparent 0 48%, color-mix(in srgb, var(--line) 22%, transparent) 49%, transparent 50%) 0 0 / 42px 42px,
    var(--page);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
}
a { color: var(--trail-dark); text-underline-offset: 3px; }
a:hover { color: var(--trail); }
.skip-link {
  position: fixed;
  left: 18px;
  top: 14px;
  z-index: 10;
  transform: translateY(-160%);
  padding: 9px 13px;
  border: 2px solid var(--ink);
  border-radius: 7px;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 3px 3px 0 var(--ink);
  font-weight: 700;
}
.skip-link:focus { transform: translateY(0); outline: 3px solid color-mix(in srgb, var(--forest) 35%, transparent); }
code {
  padding: .08em .35em;
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  background: var(--paper-deep);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .82em;
}
.section { width: min(720px, calc(100% - 36px)); margin-inline: auto; }
.section.narrow { width: min(620px, calc(100% - 36px)); }
.section + .section { margin-top: 72px; }

.inkcheck-hero { padding-top: 48px; text-align: center; }
.home-link {
  display: inline-flex;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}
.home-link:hover { color: var(--trail); }
.eyebrow, .section-label {
  color: var(--forest);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}
.eyebrow { margin: 0 0 12px; }
.section-label { display: flex; align-items: center; gap: 10px; margin: 0 0 18px; }
.section-label > span { color: var(--trail); }
.inkcheck-hero h1 {
  margin: 0;
  font: 750 clamp(54px, 12vw, 86px)/.98 var(--serif);
  letter-spacing: 0;
}
.hero-intro { max-width: 610px; margin: 22px auto 0; color: var(--ink-soft); font-size: 18px; }
.hero-intro a { font-weight: 700; }
.prose p { margin: 0 0 18px; color: var(--ink-soft); }
.prose p:last-child { margin-bottom: 0; }
.intro-copy { position: relative; padding-left: 27px; border-left: 4px solid var(--trail); }

.trailhead {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 22px;
  width: min(720px, calc(100% - 36px));
}
.community-note, .support-note {
  padding: 24px;
  border: 2px solid var(--ink);
  border-radius: 13px 13px 13px 4px;
  background: var(--paper);
  box-shadow: 6px 6px 0 var(--shadow);
}
.community-note .section-label { margin-bottom: 10px; }
.community-note > p:last-of-type, .support-note p { margin: 0; color: var(--ink-soft); font-size: 15px; }
.community-links { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; margin-top: 19px; }
.community-links a { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; font-weight: 700; }
.support-note { display: flex; flex-direction: column; justify-content: center; background: var(--forest-soft); }
.support-note strong { color: var(--ink); }
.support-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 18px;
  padding: 11px 15px;
  border: 2px solid var(--ink);
  border-radius: 8px 8px 8px 3px;
  color: #fffaf0;
  background: var(--trail);
  box-shadow: 4px 4px 0 var(--ink);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}
.support-button:hover { color: #fffaf0; background: var(--trail-dark); transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink); }
.support-note small { margin-top: 13px; color: var(--muted); font-size: 12px; text-align: center; }

.checker-card {
  border: 2px solid var(--ink);
  border-radius: 13px 13px 13px 4px;
  background: var(--paper);
  box-shadow: 7px 7px 0 var(--shadow);
}
.mode-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 72px;
  padding: 18px 22px;
  border: 2px dashed var(--forest);
  border-radius: 13px;
  background: var(--forest-soft);
  text-align: center;
}
.mode-card p { margin: 0; color: var(--ink-soft); font-size: 15px; }
.mode-card code { max-width: 100%; user-select: all; }
#check-form { display: grid; gap: 24px; }
#check-form[aria-busy="true"] { opacity: .92; }
.checker-card { min-width: 0; margin: 0; padding: 30px; }
.checker-card legend { padding: 0 12px 0 0; color: var(--ink); background: var(--paper); font: 650 24px var(--serif); }
.checker-card legend span {
  display: inline-grid;
  place-items: center;
  width: 31px;
  height: 31px;
  margin-right: 8px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  color: #fffaf0;
  background: var(--forest);
  font: 700 14px var(--sans);
}
.field-help { margin: 0 0 20px; color: var(--muted); font-size: 15px; }
.value-note {
  margin: -6px 0 22px;
  padding: 13px 15px;
  border-left: 4px solid var(--forest);
  border-radius: 6px;
  color: var(--ink-soft);
  background: var(--forest-soft);
  font-size: 15px;
}
.value-note strong { color: var(--ink); }
.file-drop {
  display: grid;
  gap: 5px;
  padding: 25px;
  border: 2px dashed var(--trail);
  border-radius: 10px;
  background: color-mix(in srgb, var(--trail) 4%, var(--paper));
  text-align: center;
  cursor: pointer;
  transition: transform .18s ease, background .18s ease;
}
.file-drop:hover { background: color-mix(in srgb, var(--trail) 10%, var(--paper)); transform: translateY(-2px); }
.file-drop strong { font: 650 19px var(--serif); }
.file-drop span { color: var(--muted); font-size: 13px; }
.file-drop input { width: 100%; min-width: 0; max-width: 100%; margin: 13px auto 0; color: var(--ink-soft); font: 14px var(--sans); }
.file-drop.compact { padding: 18px; }
.file-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.checker-card label:not(.file-drop):not(.check-row) { display: grid; gap: 8px; color: var(--ink-soft); font-size: 14px; font-weight: 700; }
select, input[type="number"], input[type="password"] {
  width: 100%;
  padding: 13px;
  border: 2px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  background: var(--paper-deep);
  font: inherit;
}
select:focus, input:focus { outline: 3px solid color-mix(in srgb, var(--forest) 35%, transparent); outline-offset: 2px; }
details { margin-top: 22px; }
summary { color: var(--forest); cursor: pointer; font-weight: 700; }
.selection-summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-top: 16px;
}
.selection-note { margin: 0; color: var(--muted); font-size: 13px; }
.story-rule { margin-top: 22px; padding-top: 18px; border-top: 2px dotted var(--line); }
.story-rule summary { cursor: pointer; color: var(--forest); font: 650 18px var(--serif); }
.story-rule > .field-help { margin: 12px 0; }
.rule-enable { margin: 0 0 12px; }
.rule-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.rule-fields label { display: grid; gap: 5px; color: var(--ink-soft); font-size: 13px; font-weight: 700; }
.rule-fields input, .rule-fields select { width: 100%; min-width: 0; padding: 9px 10px; border: 1px solid var(--line); border-radius: 5px; color: var(--ink); background: var(--paper-deep); font: inherit; }
.rule-preview { margin: 15px 0 0; color: var(--ink-soft); font-size: 14px; }
.rule-preview strong { color: var(--ink); }
.rule-config { margin: 9px 0 0; padding: 10px; overflow-x: auto; border: 1px solid var(--line-soft); border-radius: 5px; background: var(--paper-deep); color: var(--ink-soft); font: 12px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace; }
.text-button {
  appearance: none;
  border: 0;
  padding: 0;
  color: var(--trail-dark);
  background: transparent;
  font: 700 13px var(--sans);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.text-button:hover { color: var(--trail); }
#root-choice { margin-top: 18px; }
.check-row { display: flex; gap: 12px; align-items: flex-start; margin: 16px 0; color: var(--ink-soft); font-size: 15px; }
.check-row input { width: 19px; height: 19px; margin-top: 2px; flex: 0 0 auto; accent-color: var(--forest); }
.upload-disclaimer { margin: 18px 0 0; padding-top: 16px; border-top: 2px dotted var(--line); color: var(--muted); font-size: 14px; }
.run-intent { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin: 0; padding: 0; border: 0; }
.run-intent legend { width: 100%; margin-bottom: 9px; color: var(--ink); font: 650 18px var(--serif); }
.run-intent label { display: flex; min-width: 0; gap: 10px; align-items: flex-start; margin: 0; padding: 13px 14px; border: 2px solid var(--line); border-radius: 6px; background: var(--paper-deep); cursor: pointer; }
.run-intent label:has(input:checked) { border-color: var(--forest); background: var(--forest-soft); }
.run-intent input { width: 18px; height: 18px; margin: 2px 0 0; flex: 0 0 auto; accent-color: var(--forest); }
.run-intent span, .run-intent small { display: block; min-width: 0; }
.run-intent small { margin-top: 3px; color: var(--muted); font-size: 13px; line-height: 1.35; }
.advanced-options { padding-top: 18px; border-top: 2px dotted var(--line); }
.run-button, .quiet-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  appearance: none;
  border: 2px solid var(--ink);
  border-radius: 9px 9px 9px 3px;
  color: #fffaf0;
  background: var(--trail);
  box-shadow: 5px 5px 0 var(--ink);
  font: 700 16px var(--sans);
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}
.run-button { width: 100%; padding: 17px 28px; }
.run-button span:last-child { font-size: 23px; line-height: 1; }
.run-button:hover, .quiet-button:hover { background: var(--trail-dark); transform: translate(2px, 2px); box-shadow: 3px 3px 0 var(--ink); }
.run-button:disabled { opacity: .55; cursor: wait; }
.form-status { min-height: 1.65em; margin: -7px 0 0; color: var(--ink-soft); text-align: center; font-size: 15px; }
.run-progress { display: grid; gap: 5px; margin: 2px auto 0; max-width: 600px; padding: 15px 18px; border: 2px solid var(--ink); border-radius: 6px; background: var(--paper-deep); text-align: center; }
.run-progress[hidden] { display: none; }
.run-progress[data-state="cancelled"] { border-color: var(--forest); background: var(--forest-soft); }
.progress-phase { margin: 0; font: 650 19px var(--serif); }
.progress-budget, .progress-details, .progress-trust { margin: 0; color: var(--ink-soft); font-size: 14px; }
.progress-budget { color: var(--forest); font-weight: 700; }
.progress-trust { font-size: 13px; }
.run-progress .text-button { justify-self: center; margin-top: 4px; }
.maze-loader {
  display: grid;
  justify-items: center;
  margin-top: -3px;
}
.maze-loader[hidden] { display: none; }
.maze-track {
  position: relative;
  width: min(260px, 100%);
  height: 56px;
  overflow: hidden;
  border: 2px solid var(--ink);
  border-radius: 4px;
  background:
    linear-gradient(90deg, transparent 0 18px, color-mix(in srgb, var(--ink) 14%, transparent) 18px 20px, transparent 20px 38px) 0 0 / 38px 100%,
    var(--paper);
  image-rendering: pixelated;
}
.maze-wall {
  position: absolute;
  height: 6px;
  background: var(--ink);
}
.maze-wall.top { top: 10px; left: 24px; width: 76px; }
.maze-wall.mid { top: 25px; right: 35px; width: 118px; }
.maze-wall.bottom { bottom: 10px; left: 70px; width: 104px; }
.pixel-explorer {
  position: absolute;
  left: 18px;
  top: 22px;
  width: 8px;
  height: 8px;
  background: var(--ink);
  box-shadow:
    0 -8px 0 var(--ink),
    -8px 0 0 var(--ink),
    8px 0 0 var(--ink),
    -8px 8px 0 var(--ink),
    8px 8px 0 var(--ink);
  animation: maze-walk 1.8s steps(9, end) infinite;
}
@keyframes maze-walk {
  0% { transform: translate(0, 0); }
  22% { transform: translate(42px, 0); }
  38% { transform: translate(42px, -12px); }
  58% { transform: translate(112px, -12px); }
  74% { transform: translate(112px, 12px); }
  100% { transform: translate(208px, 12px); }
}
.report { margin-top: 42px; }
.report:focus { outline: 3px solid color-mix(in srgb, var(--forest) 35%, transparent); outline-offset: 5px; }
.report-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; }
.report-heading .section-label { margin-bottom: 5px; }
.report-heading h2 { margin: 0; font: 650 30px var(--serif); }
.quiet-button { padding: 10px 14px; font-size: 13px; box-shadow: 3px 3px 0 var(--ink); }
.report-summary { color: var(--ink-soft); font: 500 18px/1.55 var(--sans); }
.report-metrics { display: grid; grid-template-columns: repeat(4, 1fr); margin: 25px 0; overflow: hidden; border: 2px solid var(--ink); border-radius: 8px; }
.report-metrics div { display: grid; gap: 4px; padding: 16px 9px; border-right: 1px solid var(--line); background: var(--paper-deep); text-align: center; }
.report-metrics div:last-child { border-right: 0; }
.report-metrics strong { color: var(--ink); font: 650 27px var(--serif); }
.report-metrics span { color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; }
.report-findings section { padding: 19px 0; border-top: 2px dotted var(--line); }
.report-findings h3 { margin: 0 0 8px; font: 650 19px var(--serif); }
.report-findings p, .report-findings ol { margin: 0; color: var(--ink-soft); font-size: 15px; }
.finding-list { display: grid; gap: 14px; padding: 0; list-style: none; }
.finding-list li { padding: 15px; border: 1px solid var(--line-soft); border-radius: 8px; background: var(--paper-deep); }
.finding-list strong { display: block; margin-bottom: 4px; color: var(--ink); font: 650 17px/1.3 var(--serif); }
.report-findings .finding-meta { margin-bottom: 8px; color: var(--forest); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0; }
.report-findings .finding-path { margin-top: 9px; color: var(--ink); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.report-findings .finding-action { margin-top: 9px; color: var(--ink-soft); font-weight: 700; }
.finding-clear::before { content: "✓ "; color: var(--forest); font-weight: 700; }
.limitations { padding: 26px 28px; border: 2px dashed var(--forest); border-radius: 13px; background: var(--forest-soft); }
.small-note { font-size: 14px; }
.foot { padding: 74px 0 44px; color: var(--muted); text-align: center; }
.elsewhere { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px 28px; margin-bottom: 26px; }
.elsewhere a { color: var(--ink-soft); font-size: 14px; font-weight: 700; }
.legal-note { max-width: 520px; margin: 0 auto 16px; font-size: 12px; }
.colophon { margin: 0; font-size: 13px; }
.colophon span { margin-inline: 7px; }

@media (max-width: 600px) {
  body { font-size: 16px; }
  .section + .section { margin-top: 56px; }
  .inkcheck-hero { padding-top: 30px; }
  .trailhead { grid-template-columns: 1fr; }
  .community-links { grid-template-columns: 1fr; }
  .mode-card, .selection-summary { align-items: stretch; flex-direction: column; }
  .mode-card code { width: 100%; overflow-x: auto; }
  .checker-card { padding: 24px 18px; }
  .limitations { padding: 22px 20px; }
  .file-options { grid-template-columns: 1fr; }
  .run-intent { grid-template-columns: 1fr; }
  .rule-fields { grid-template-columns: 1fr; }
  .report-heading { display: block; }
  .quiet-button { margin-top: 15px; }
  .report-metrics { grid-template-columns: 1fr 1fr; }
  .report-metrics div:nth-child(2) { border-right: 0; }
  .report-metrics div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .colophon span { display: block; height: 4px; overflow: hidden; color: transparent; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .pixel-explorer { transform: translate(112px, -12px); }
  *, *::before, *::after {
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}
