/* ==========================================================================
   CAUTtools — public site
   Palette drawn from the shop: action-drawing paper, ebonized case,
   hammer felt, tuning-pin brass.
   ========================================================================== */

:root {
  --paper:        #E7E9E1;
  --paper-deep:   #DCDFD5;
  --surface:      #F4F5F0;
  --ink:          #191C18;
  --ink-soft:     #2E332C;
  --graphite:     #575D54;
  --graphite-dim: #7C8378;
  --rule:         #C9CDC0;
  --rule-faint:   #D8DBD0;
  --felt:         #9B2033;
  --felt-deep:    #741726;
  --brass:        #8E7031;
  --brass-lift:   #EFE7D2;

  --display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --body:    "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono:    "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --measure: 66ch;
  --shell: 1180px;
  --gap: 24px;
}

/* --------------------------------------------------------- reset + base */

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
  font-feature-settings: "kern" 1;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: var(--felt); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--felt-deep); }

:focus-visible {
  outline: 2px solid var(--felt);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--surface);
  padding: 10px 16px;
  z-index: 50;
}
.skip:focus { left: 12px; top: 12px; }

/* ------------------------------------------------------------ structure */

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

/* Sticky masthead would otherwise cover a jumped-to section heading. */
[id] { scroll-margin-top: 84px; }

.band { padding: 88px 0; }
.band-tight { padding: 56px 0; }
.band-ink { background: var(--ink); color: var(--paper); }
.band-ink a { color: var(--brass-lift); }
.band-surface { background: var(--surface); }
.band-rule { border-top: 1px solid var(--rule); }

/* ---------------------------------------------------------------- type  */

h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 600;
  font-variation-settings: "SOFT" 20, "WONK" 1, "opsz" 40;
  line-height: 1.06;
  letter-spacing: -0.015em;
  margin: 0;
  text-wrap: balance;
}

h1 { font-size: clamp(2.9rem, 7.2vw, 5.1rem); }
h2 { font-size: clamp(2rem, 4vw, 2.9rem); }
h3 { font-size: clamp(1.25rem, 2vw, 1.5rem); font-variation-settings: "SOFT" 20, "WONK" 0, "opsz" 20; }
h4 { font-size: 1.05rem; font-family: var(--body); font-weight: 600; letter-spacing: 0; }

p { margin: 0 0 1em; max-width: var(--measure); }
p:last-child { margin-bottom: 0; }

.lede {
  font-size: clamp(1.1rem, 1.7vw, 1.3rem);
  line-height: 1.5;
  color: var(--ink-soft);
  max-width: 60ch;
}

.eyebrow {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--felt);
  margin: 0 0 20px;
  display: block;
}
.band-ink .eyebrow { color: var(--brass-lift); }

/* The structural stamp: which clause of the Guidelines a capability serves. */
.clause {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--graphite);
  border-left: 2px solid var(--felt);
  padding-left: 10px;
  display: block;
  margin-bottom: 14px;
}
.band-ink .clause { color: var(--graphite-dim); border-left-color: var(--brass); }

.mono { font-family: var(--mono); }

/* Marks original CAUTtools methodology (Category C) wherever it appears next to
   a published-guidance clause stamp, so the two are never read as the same
   thing. Links back to the full A/B/C/D framework on standards.html. */
.cat-c {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.03em;
  color: var(--brass);
  border: 1px solid var(--brass);
  border-radius: 2px;
  padding: 1px 6px;
  margin-top: 10px;
  text-decoration: none;
  white-space: nowrap;
}
.cat-c:hover { background: var(--brass-lift); }
.band-ink .cat-c { color: var(--brass); border-color: var(--brass); }

/* Status qualifier that must sit adjacent to the claim it qualifies, not
   further down the page. Used for anything not yet built or not yet agreed. */
.status-note {
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--ink-soft);
  background: var(--brass-lift);
  border-left: 2px solid var(--brass);
  padding: 10px 14px;
  max-width: 62ch;
}

.quote {
  font-family: var(--display);
  font-variation-settings: "SOFT" 40, "WONK" 1, "opsz" 30;
  font-size: clamp(1.35rem, 2.6vw, 1.9rem);
  line-height: 1.3;
  margin: 0;
  max-width: 24ch;
}
/* A fuller quotation needs a longer measure and a smaller size to stay a
   pull quote rather than a wall. */
.quote-long {
  font-size: clamp(1.15rem, 1.9vw, 1.45rem);
  line-height: 1.38;
  max-width: 40ch;
}

.quote-src {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--graphite-dim);
  margin-top: 18px;
  text-transform: uppercase;
}

/* -------------------------------------------------------------- header  */

.masthead {
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
  position: sticky;
  top: 0;
  z-index: 20;
}

.masthead-in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 62px;
  flex-wrap: wrap;
}

.wordmark {
  font-family: var(--display);
  font-variation-settings: "SOFT" 10, "WONK" 1, "opsz" 20;
  font-size: 1.32rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
.wordmark span { color: var(--felt); }

.nav {
  display: flex;
  align-items: center;
  gap: 26px;
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  flex-wrap: wrap;
}
.nav a { color: var(--ink-soft); text-decoration: none; padding: 4px 0; border-bottom: 1px solid transparent; }
.nav a:hover { border-bottom-color: var(--felt); color: var(--ink); }
.nav a[aria-current="page"] { border-bottom-color: var(--felt); color: var(--ink); }

/* ------------------------------------------------------------- buttons  */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 0.82rem;
  letter-spacing: 0.03em;
  padding: 12px 20px;
  border: 1px solid var(--felt);
  background: var(--felt);
  color: var(--surface);
  text-decoration: none;
  border-radius: 2px;
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease;
}
.btn:hover { background: var(--felt-deep); border-color: var(--felt-deep); color: var(--surface); }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--rule);
}
.btn-ghost:hover { background: transparent; border-color: var(--ink); color: var(--ink); }

.band-ink .btn-ghost { color: var(--paper); border-color: #4A5147; }
.band-ink .btn-ghost:hover { border-color: var(--paper); color: var(--paper); }

.btn-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 32px; }

/* ---------------------------------------------------------------- hero  */

.hero { padding: 76px 0 0; }
.hero h1 { max-width: 15ch; }
.hero .lede { margin-top: 26px; }

/* ===================================================== the workload rig  */

.rig {
  margin-top: 56px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 3px;
}

.rig-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
  padding: 18px 22px;
  border-bottom: 1px solid var(--rule);
}
.rig-title {
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
  margin: 0;
}
.rig-note {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--graphite);
  margin: 0;
  max-width: 46ch;
}

.chain {
  display: grid;
  grid-template-columns: repeat(8, minmax(118px, 1fr));
  overflow-x: auto;
  scrollbar-width: thin;
}

.factor {
  padding: 18px 14px 20px;
  border-right: 1px solid var(--rule-faint);
  position: relative;
  min-width: 0;
}
.factor:last-child { border-right: 0; }

/* multiplication sign sits in the gutter between factors */
.factor + .factor::before {
  content: "\00d7";
  position: absolute;
  left: -7px;
  top: 86px;
  width: 14px;
  text-align: center;
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--graphite-dim);
  background: var(--surface);
  line-height: 1;
}

.factor-code {
  display: block;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--felt);
}
.factor-name {
  display: block;
  font-size: 0.78rem;
  line-height: 1.25;
  color: var(--graphite);
  margin-top: 3px;
  min-height: 2.5em;
}
.factor-mult {
  display: block;
  font-family: var(--mono);
  font-size: 1.6rem;
  font-weight: 500;
  color: var(--ink);
  margin: 6px 0 10px;
  font-variant-numeric: tabular-nums;
}
.factor-desc {
  display: block;
  font-family: var(--mono);
  font-size: 0.68rem;
  line-height: 1.4;
  color: var(--graphite);
  margin-top: 10px;
  min-height: 4em;
}

input[type="range"] {
  width: 100%;
  margin: 0;
  accent-color: var(--felt);
  height: 20px;
}

.rig-out {
  border-top: 1px solid var(--rule);
  background: var(--ink);
  color: var(--paper);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.4fr);
  gap: 0;
}

.out-cell {
  padding: 22px;
  border-right: 1px solid #333A31;
}
.out-cell:last-child { border-right: 0; }

.out-label {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--graphite-dim);
  display: block;
  margin-bottom: 8px;
}
.out-value {
  font-family: var(--display);
  font-variation-settings: "SOFT" 0, "WONK" 0, "opsz" 60;
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  line-height: 1;
  color: var(--surface);
  font-variant-numeric: tabular-nums;
  display: block;
}
.out-value em {
  font-style: normal;
  color: var(--brass-lift);
  font-size: 0.42em;
  font-family: var(--mono);
  letter-spacing: 0.04em;
  margin-left: 8px;
}
.out-read {
  font-size: 0.88rem;
  line-height: 1.5;
  color: #C3C9BC;
  margin: 0;
  max-width: 42ch;
}
.out-read strong { color: var(--brass-lift); font-weight: 600; }

.count-field {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.count-field input {
  font-family: var(--display);
  font-variation-settings: "SOFT" 0, "WONK" 0, "opsz" 60;
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  line-height: 1;
  width: 4.2ch;
  background: transparent;
  border: 0;
  border-bottom: 2px solid var(--felt);
  color: var(--surface);
  padding: 0 0 2px;
  font-variant-numeric: tabular-nums;
}
.count-field input::-webkit-outer-spin-button,
.count-field input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.count-field input[type="number"] { -moz-appearance: textfield; }

.rig-foot {
  padding: 14px 22px;
  border-top: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--graphite);
  background: var(--surface);
}
.rig-foot p { max-width: none; margin: 0; }

/* ------------------------------------------------------------- content  */

.split {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 56px;
  align-items: start;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(268px, 1fr));
  gap: 40px 44px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 40px 48px;
}

.item h3 { margin-bottom: 10px; }
.item p { font-size: 0.96rem; color: var(--ink-soft); }

.ticks {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  font-size: 0.92rem;
  color: var(--ink-soft);
}
.ticks li {
  padding: 7px 0 7px 20px;
  border-top: 1px solid var(--rule-faint);
  position: relative;
}
.ticks li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 15px;
  width: 9px;
  height: 1px;
  background: var(--felt);
}

.figures {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1px;
  background: #333A31;
  border: 1px solid #333A31;
}
.figure { background: var(--ink); padding: 26px 24px; }
.figure-n {
  font-family: var(--display);
  font-variation-settings: "SOFT" 0, "WONK" 0, "opsz" 60;
  font-size: 2.6rem;
  line-height: 1;
  color: var(--surface);
  display: block;
}
.figure-t {
  font-family: var(--mono);
  font-size: 0.72rem;
  line-height: 1.5;
  color: #A9B0A2;
  margin-top: 12px;
  display: block;
}

/* ----------------------------------------------------------- long-form  */

.prose { max-width: 74ch; }
.prose h2 {
  font-size: clamp(1.4rem, 2.4vw, 1.8rem);
  margin: 52px 0 14px;
  padding-top: 22px;
  border-top: 1px solid var(--rule);
}
.prose h2:first-of-type { margin-top: 0; border-top: 0; padding-top: 0; }
.prose h3 {
  font-family: var(--body);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0;
  margin: 26px 0 8px;
}
.prose p { font-size: 0.98rem; max-width: none; }
.prose ul, .prose ol { font-size: 0.98rem; padding-left: 20px; margin: 0 0 1em; }
.prose li { margin-bottom: 8px; }
.prose li::marker { color: var(--felt); }
.prose dt {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--ink);
  margin-top: 18px;
}
.prose dd { margin: 5px 0 0; font-size: 0.96rem; color: var(--ink-soft); }

.doc-meta {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--graphite);
  margin: 0 0 40px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--rule);
  text-transform: uppercase;
}

/* Unfilled placeholder in a legal document. Deliberately loud: these pages
   must not go live until every one of these is replaced. */
.fill {
  background: #FFE9A8;
  color: #4A3B00;
  font-family: var(--mono);
  font-size: 0.82em;
  padding: 1px 6px;
  border-radius: 2px;
  border: 1px solid #D9B84A;
}

.callout {
  border-left: 2px solid var(--felt);
  background: var(--surface);
  padding: 18px 22px;
  margin: 26px 0;
}
.callout p { margin-bottom: 0.6em; }
.callout p:last-child { margin-bottom: 0; }

.toc-box {
  border: 1px solid var(--rule);
  background: var(--surface);
  padding: 20px 24px;
  margin-bottom: 44px;
}
.toc-box h2 {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--graphite);
  margin: 0 0 12px;
  border: 0;
  padding: 0;
  font-weight: 500;
}
.toc-box ol { margin: 0; padding-left: 18px; font-size: 0.9rem; }
.toc-box li { margin-bottom: 5px; }

/* ---------------------------------------------------------------- table */

.table-wrap { overflow-x: auto; border: 1px solid var(--rule); background: var(--surface); }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  min-width: 640px;
}
caption {
  text-align: left;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--graphite);
  padding: 16px 18px;
  border-bottom: 1px solid var(--rule);
}
th, td {
  text-align: left;
  padding: 12px 18px;
  border-bottom: 1px solid var(--rule-faint);
  vertical-align: top;
}
th {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--graphite);
  font-weight: 500;
  white-space: nowrap;
}
tbody tr:last-child td { border-bottom: 0; }
td.num {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  color: var(--felt);
  white-space: nowrap;
}
td.code {
  font-family: var(--mono);
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
}

/* ----------------------------------------------------------------- form */

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 22px;
}
.field { display: flex; flex-direction: column; gap: 7px; }
.field-wide { grid-column: 1 / -1; }
.field label {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--graphite);
}
.field input,
.field select,
.field textarea {
  font-family: var(--body);
  font-size: 1rem;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 11px 13px;
  width: 100%;
}
.field textarea { min-height: 130px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--felt); }
.hint { font-size: 0.82rem; color: var(--graphite); margin: 0; }

/* --------------------------------------------------------------- footer */

.footer {
  background: var(--ink);
  color: #A9B0A2;
  padding: 56px 0 40px;
  font-size: 0.88rem;
}
.footer h4 {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--graphite-dim);
  margin: 0 0 14px;
  font-weight: 500;
}
.footer a { color: var(--paper); text-decoration: none; }
.footer a:hover { text-decoration: underline; }
.footer ul { list-style: none; margin: 0; padding: 0; }
.footer li { padding: 5px 0; }
.footer-cols {
  display: grid;
  grid-template-columns: minmax(0, 2fr) repeat(auto-fit, minmax(150px, 1fr));
  gap: 40px;
}
.colophon {
  margin-top: 48px;
  padding-top: 22px;
  border-top: 1px solid #333A31;
  font-family: var(--mono);
  font-size: 0.72rem;
  line-height: 1.7;
  color: var(--graphite-dim);
}
.colophon p { max-width: 78ch; }

/* -------------------------------------------------------------- motion  */

@media (prefers-reduced-motion: no-preference) {
  .rise {
    animation: rise 620ms cubic-bezier(.2, .7, .3, 1) backwards;
  }
  @keyframes rise {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: none; }
  }
  .factor { animation: rise 500ms cubic-bezier(.2,.7,.3,1) backwards; }
  .factor:nth-child(1) { animation-delay: 180ms; }
  .factor:nth-child(2) { animation-delay: 230ms; }
  .factor:nth-child(3) { animation-delay: 280ms; }
  .factor:nth-child(4) { animation-delay: 330ms; }
  .factor:nth-child(5) { animation-delay: 380ms; }
  .factor:nth-child(6) { animation-delay: 430ms; }
  .factor:nth-child(7) { animation-delay: 480ms; }
  .factor:nth-child(8) { animation-delay: 530ms; }
  .tick { animation: tickflash 420ms ease-out; }
  @keyframes tickflash {
    0%   { color: var(--brass-lift); }
    100% { color: var(--surface); }
  }
}

/* ------------------------------------------------------------ responsive */

@media (max-width: 900px) {
  .split { grid-template-columns: 1fr; gap: 32px; }
  .rig-out { grid-template-columns: 1fr; }
  .out-cell { border-right: 0; border-bottom: 1px solid #333A31; }
  .out-cell:last-child { border-bottom: 0; }
  .chain { grid-template-columns: repeat(8, 156px); }
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  .band { padding: 60px 0; }
  .hero { padding: 48px 0 0; }
  .shell { padding: 0 18px; }
  .masthead-in { min-height: 0; padding: 12px 0; }
  .nav { gap: 18px; font-size: 0.74rem; }
}

@media print {
  .masthead, .btn-row, .footer { display: none; }
  body { background: #fff; }
}
