/* EPRDesk — "The auditor's worksheet". Tokens per DESIGN.md §2. Light only. */

:root {
  --paper: #FBFCFD;
  --surface: #FFFFFF;
  --well: #F2F5F8;
  --ink: #132A43;
  --ink-2: #35506C;
  --ink-3: #4A6178;
  --rule: #D9DFE7;
  --rule-strong: #C3CEDA;
  --rule-faint: #E9EDF2;
  --action: #17456E;
  --action-hover: #102F4C;
  --save: #166534;
  --save-tint: #EDF7F0;
  --save-bar: #2E8B57;
  --expose: #B3261E;
  --expose-tint: #FCF0EE;
  --expose-bar: #C0392B;
  --clock: #8A5A00;
  --clock-tint: #FBF3E0;
  --clock-bar: #C99A2E;
  --lift: 0 1px 2px rgba(19, 42, 67, 0.06), 0 8px 24px rgba(19, 42, 67, 0.05);

  --sans: "Public Sans", -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; }

a { color: var(--action); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible {
  outline: 2px solid var(--action);
  outline-offset: 2px;
}

.container { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* ---------- type scale ---------- */
.display-lg { font-size: 46px; line-height: 1.12; font-weight: 600; letter-spacing: -0.5px; }
.display-md { font-size: 34px; line-height: 1.18; font-weight: 600; letter-spacing: -0.25px; }
.heading-lg { font-size: 24px; line-height: 1.3; font-weight: 600; letter-spacing: -0.2px; }
.heading-md { font-size: 19px; line-height: 1.35; font-weight: 600; }
.body-lg { font-size: 18px; line-height: 1.6; }
.body-sm { font-size: 14px; line-height: 1.55; }
.caption { font-size: 13px; line-height: 1.5; color: var(--ink-3); }
.label { font-size: 13px; line-height: 1.4; font-weight: 600; color: var(--ink-3); }

.fig-lg { font-family: var(--mono); font-size: 28px; line-height: 1.3; font-weight: 600; }
.fig-md { font-family: var(--mono); font-size: 18px; line-height: 1.4; font-weight: 500; }
.fig-sm { font-family: var(--mono); font-size: 14px; line-height: 1.5; }
.fig-em { font-family: var(--mono); font-size: 15px; line-height: 1.4; font-weight: 600; }
.fig-xs { font-family: var(--mono); font-size: 13px; line-height: 1.4; }

.inline-fig { font-family: var(--mono); font-size: 0.92em; }

.prose { max-width: 680px; }
.prose p + p { margin-top: 12px; }
.muted { color: var(--ink-2); }

/* ---------- buttons ---------- */
.btn {
  display: inline-block;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 12px 16px;
  min-height: 44px;
  border-radius: 4px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 100ms cubic-bezier(0.23, 1, 0.32, 1);
}
.btn-primary { background: var(--action); color: #fff; }
.btn-primary:hover { background: var(--action-hover); text-decoration: none; }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--rule-strong); }
.btn-secondary:hover { border-color: var(--ink-3); text-decoration: none; }
.btn:active { transform: scale(0.98); }
.btn[disabled] { opacity: 0.55; cursor: default; }

/* ---------- chips ---------- */
.chip {
  display: inline-block;
  font-size: 13px;
  line-height: 1.4;
  font-weight: 600;
  border-radius: 2px;
  padding: 2px 8px;
}
.chip-save { background: var(--save-tint); color: var(--save); }
.chip-expose { background: var(--expose-tint); color: var(--expose); }
.chip-info { background: var(--well); color: var(--ink-2); }
.chip-clock { background: var(--clock-tint); color: var(--clock); font-family: var(--mono); font-weight: 500; }

/* ---------- header ---------- */
.site-header {
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
  position: sticky;
  top: 0;
  z-index: 20;
}
.site-header .container { display: flex; align-items: center; gap: 24px; height: 64px; }
.wordmark { font-weight: 700; font-size: 18px; color: var(--ink); text-decoration: none; white-space: nowrap; }
.wordmark .delta { color: var(--action); font-weight: 700; margin-right: 6px; }
.site-nav { display: flex; gap: 20px; margin-left: 12px; }
.site-nav a { font-size: 14px; color: var(--ink-2); }
.site-header .btn { margin-left: auto; padding: 9px 16px; }

/* ---------- sections ---------- */
.sec { padding: 96px 0 0; }
.sec:last-of-type { padding-bottom: 96px; }
.sec-head { border-top: 1px solid var(--rule); padding-top: 20px; margin-bottom: 32px; }
.sec-head .label { display: block; margin-bottom: 10px; }
.sec-lead { margin-top: 14px; max-width: 680px; color: var(--ink-2); font-size: 18px; line-height: 1.6; }

/* ---------- hero ---------- */
#hero { padding-top: 64px; }
.hero-grid { display: grid; grid-template-columns: 5fr 7fr; gap: 48px; align-items: start; }
.hero-copy .label { margin-bottom: 16px; display: block; }
.hero-copy h1 { margin-bottom: 16px; }
.hero-copy .body-lg { color: var(--ink-2); margin-bottom: 24px; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 12px; }
.micro-trust { max-width: 460px; }

/* desk card */
.desk-card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 6px;
  box-shadow: var(--lift);
  padding: 24px;
  min-width: 0;
}
.desk-titleblock {
  background: var(--well);
  border-bottom: 1px solid var(--rule);
  margin: -24px -24px 20px;
  padding: 14px 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 28px;
  border-radius: 6px 6px 0 0;
}
.kv { display: flex; gap: 8px; align-items: baseline; }
.kv .label { color: var(--ink-3); }
.kv .fig-xs { color: var(--ink); }
.desk-money { display: grid; gap: 8px; margin-bottom: 16px; }
.money-row { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.money-row + .money-row { border-top: 1px solid var(--rule-faint); padding-top: 8px; }
.delta-row { display: flex; justify-content: space-between; align-items: baseline; border-top: 1px solid var(--rule); margin-top: 4px; padding-top: 12px; }
.desk-caption { margin: 16px -24px -24px; padding: 10px 24px 12px; border-top: 1px solid var(--rule-faint); background: var(--surface); border-radius: 0 0 6px 6px; }

/* ---------- ribbon (Δ finding) ---------- */
.ribbon-list { list-style: none; display: grid; gap: 12px; }
.ribbon {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--rule-strong);
  border-radius: 4px;
  padding: 12px 16px 12px 20px;
  overflow: hidden;
}
.ribbon::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--rule-strong);
}
.ribbon.is-save::before { background: var(--save-bar); }
.ribbon.is-expose::before { background: var(--expose-bar); }
.r-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.r-class { font-size: 13px; font-weight: 600; }
.is-save .r-class { color: var(--save); }
.is-expose .r-class { color: var(--expose); }
.is-info .r-class { color: var(--ink-2); }
.r-cite { font-family: var(--mono); font-size: 13px; color: var(--ink-3); white-space: nowrap; }
.r-math {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap;
  font-family: var(--mono); font-size: 14px; color: var(--ink);
}
.r-math .ops { color: var(--ink-2); }
.r-delta { font-family: var(--mono); font-size: 15px; font-weight: 600; white-space: nowrap; }
.is-save .r-delta { color: var(--save); }
.is-expose .r-delta { color: var(--expose); }
.is-info .r-delta { color: var(--ink-2); }
.r-prose { font-size: 14px; color: var(--ink-2); margin-top: 4px; line-height: 1.55; }
.r-clock { margin-top: 8px; }

/* ---------- tables ---------- */
.tbl-wrap { background: var(--surface); border: 1px solid var(--rule); border-radius: 4px; overflow: hidden; }
.scroll-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl caption { text-align: left; padding: 12px 16px; caption-side: bottom; }
.tbl th {
  background: var(--well);
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-3);
  padding: 10px 16px;
  border-bottom: 1px solid var(--rule);
  white-space: nowrap;
}
.tbl td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--rule-faint);
  vertical-align: top;
}
.tbl tr:last-child td { border-bottom: none; }
.tbl .num { text-align: right; font-family: var(--mono); font-size: 14px; white-space: nowrap; }
.tbl .pos { color: var(--expose); }
.tbl .neg { color: var(--save); }
.tbl .totals td { border-top: 1px solid var(--rule-strong); border-bottom: none; font-weight: 600; background: var(--surface); }
.tbl .rate-note { font-size: 14px; color: var(--ink-2); }
.tbl-src { padding: 12px 16px; border-top: 1px solid var(--rule-faint); }

/* worksheet rows */
tr.wrow { cursor: pointer; }
tr.wrow:hover td { background: var(--well); }
tr.wrow td .cellsub { display: block; font-size: 13px; color: var(--ink-3); font-family: var(--sans); }
tr.wexp > td { padding: 0 0 0 0; border-bottom: 1px solid var(--rule-faint); background: var(--paper); }
.wexp-inner { padding: 12px 16px 16px; }
.row-btn { all: unset; display: table-row; cursor: pointer; }

/* segmented toggle */
.seg { display: inline-flex; border: 1px solid var(--rule-strong); border-radius: 2px; overflow: hidden; }
.seg button {
  font-family: var(--sans); font-size: 13px; font-weight: 600;
  padding: 8px 14px; min-height: 36px;
  background: var(--surface); color: var(--ink-2); border: none; cursor: pointer;
}
.seg button[aria-pressed="true"] { background: var(--well); color: var(--ink); }
.desk-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-bottom: 16px; }

/* ---------- desk section ---------- */
.desk-panel { background: var(--surface); border: 1px solid var(--rule); border-radius: 6px; padding: 24px; }
.desk-empty { text-align: left; }
.desk-empty .heading-lg { margin: 8px 0 12px; }
.desk-empty p { max-width: 620px; color: var(--ink-2); }
.paste-box { margin-top: 20px; }
.paste-box textarea {
  width: 100%; min-height: 170px;
  font-family: var(--mono); font-size: 13px; line-height: 1.5;
  padding: 12px; border: 1px solid var(--rule-strong); border-radius: 4px;
  background: var(--surface); color: var(--ink); resize: vertical;
}
.paste-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; }
.err-box {
  margin-top: 12px; border: 1px solid var(--expose-bar); border-left: 3px solid var(--expose-bar);
  border-radius: 4px; background: var(--expose-tint); padding: 10px 14px; color: var(--ink);
  font-size: 14px;
}
.err-box ul { margin: 6px 0 0 18px; }

.results-head { border-top: 1px solid var(--rule); margin-top: 24px; padding-top: 20px; }
.results-head .tpl { max-width: 760px; font-size: 16px; }
.results-head .fig { font-family: var(--mono); font-weight: 600; }
.results-meta { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0 6px; }
.advice-block {
  margin-top: 20px; background: var(--well); border: 1px solid var(--rule);
  border-radius: 4px; padding: 14px 16px; font-size: 14px; color: var(--ink-2);
}
.advice-block .label { display: block; margin-bottom: 6px; }
.findings-block { margin-top: 24px; }
.findings-block > .label { display: block; margin-bottom: 12px; }

/* gated findings */
.gated-count { font-size: 14px; color: var(--ink-2); margin: 12px 0; }
.ribbon.is-gated .r-head, .ribbon.is-gated .r-math, .ribbon.is-gated .r-prose { filter: blur(4px); user-select: none; }
.ribbon.is-gated { position: relative; }
.lock-label {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600; color: var(--ink-3); background: rgba(251, 252, 253, 0.55);
}
.paywall-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 16px; }

/* share + export row */
.actions-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--rule-faint); }
.share-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 10px; }

/* ---------- ruled definition list (checks, trust) ---------- */
.ruled-list { border-top: 1px solid var(--rule); }
.ruled-row { border-bottom: 1px solid var(--rule); padding: 20px 0; display: grid; grid-template-columns: 260px 1fr; gap: 8px 32px; }
.ruled-row .term { font-size: 19px; font-weight: 600; line-height: 1.35; }
.ruled-row .def { font-size: 14px; color: var(--ink-2); max-width: 680px; }
.ruled-row .def .fig-sm { color: var(--ink); }

/* ---------- method ---------- */
.method-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; }
.doc-list { list-style: none; counter-reset: step; }
.doc-list li { counter-increment: step; display: flex; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--rule-faint); font-size: 14px; color: var(--ink-2); }
.doc-list li::before { content: counter(step); font-family: var(--mono); font-size: 13px; color: var(--ink-3); min-width: 18px; padding-top: 2px; }
.quote-block { border-left: 2px solid var(--rule-strong); background: var(--well); padding: 10px 14px; margin: 8px 0 4px; font-size: 14px; color: var(--ink-2); }
.honesty-block { margin-top: 32px; border-top: 1px solid var(--rule); padding-top: 14px; max-width: 760px; }

/* ---------- artifact ---------- */
.artifact-shell { background: var(--surface); border: 1px solid var(--rule); border-radius: 6px; }
.artifact-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--rule); background: var(--well); border-radius: 6px 6px 0 0; }
#artifact-panel { position: relative; padding: 32px 40px 48px; max-height: 640px; overflow-y: auto; }
.watermark {
  position: absolute; top: 18px; right: 26px;
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.02em;
  color: var(--ink-3); border: 1px solid var(--rule-strong); border-radius: 2px;
  padding: 3px 8px; transform: rotate(-6deg); background: var(--surface); opacity: 0.85;
}
.artifact-doc h3 { font-size: 22px; font-weight: 600; margin-bottom: 16px; letter-spacing: -0.2px; }
.artifact-doc h4 { font-size: 16px; font-weight: 600; margin: 22px 0 8px; border-bottom: 1px solid var(--rule-faint); padding-bottom: 4px; }
.artifact-doc p { font-size: 14px; margin: 6px 0; color: var(--ink-2); }
.artifact-doc ul { margin: 6px 0 6px 18px; }
.artifact-doc li { font-size: 14px; color: var(--ink-2); margin: 3px 0; }
.artifact-doc pre {
  font-family: var(--mono); font-size: 13px; line-height: 1.6;
  background: var(--well); border: 1px solid var(--rule-faint); border-radius: 4px;
  padding: 10px 14px; margin: 8px 0; overflow-x: auto; color: var(--ink); white-space: pre-wrap;
}
.artifact-doc blockquote { border-left: 2px solid var(--rule-strong); padding: 2px 0 2px 12px; margin: 8px 0; font-size: 13px; color: var(--ink-3); }
.artifact-doc table { width: 100%; border-collapse: collapse; margin: 8px 0; font-size: 13px; }
.artifact-doc th { background: var(--well); text-align: left; padding: 6px 10px; border: 1px solid var(--rule-faint); font-weight: 600; color: var(--ink-3); }
.artifact-doc td { padding: 6px 10px; border: 1px solid var(--rule-faint); font-family: var(--mono); }
.artifact-doc strong { color: var(--ink); }

/* ---------- pricing ---------- */
.price-btn-cell { text-align: right; white-space: nowrap; }
.footnote { font-size: 13px; color: var(--ink-3); margin-top: 12px; }

/* ---------- faq ---------- */
.faq-list { border-top: 1px solid var(--rule); max-width: 760px; }
.faq-item { border-bottom: 1px solid var(--rule); padding: 20px 0; }
.faq-item h3 { font-size: 19px; font-weight: 600; margin-bottom: 8px; }
.faq-item p { color: var(--ink-2); }

/* ---------- form ---------- */
.cta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; }
.lead-form { background: var(--surface); border: 1px solid var(--rule); border-radius: 6px; padding: 24px; }
.lead-form .heading-lg { margin-bottom: 4px; }
.lead-form .body-sm { color: var(--ink-2); margin-bottom: 16px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; }
.field input, .field textarea {
  width: 100%; font-family: var(--sans); font-size: 15px; color: var(--ink);
  padding: 10px 12px; border: 1px solid var(--rule-strong); border-radius: 4px; background: var(--surface);
}
.field textarea { min-height: 84px; resize: vertical; }
.field .help { font-size: 13px; color: var(--ink-3); margin-top: 4px; }
.field .err { font-size: 13px; color: var(--expose); margin-top: 4px; }
.field.invalid input, .field.invalid textarea { border-color: var(--expose-bar); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-success { border: 1px solid var(--save-bar); background: var(--save-tint); border-radius: 4px; padding: 16px; font-size: 15px; color: var(--ink); }
.form-success .offline-note { display: block; margin-top: 8px; font-size: 13px; color: var(--ink-2); }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--rule); margin-top: 96px; background: var(--paper); }
.site-footer .container { padding: 40px 24px 48px; }
.footer-cols { display: grid; grid-template-columns: 2fr 3fr; gap: 40px; margin-bottom: 24px; }
.footer-notes { list-style: none; }
.footer-notes li { font-size: 13px; color: var(--ink-3); padding: 3px 0; max-width: 680px; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: var(--ink); color: #fff; font-size: 14px;
  padding: 10px 16px; border-radius: 4px; box-shadow: var(--lift);
  opacity: 0; pointer-events: none; transition: opacity 160ms cubic-bezier(0.23, 1, 0.32, 1);
  z-index: 50; max-width: 90vw;
}
.toast.show { opacity: 1; }

/* ---------- motion ---------- */
.fade-in { animation: fadeUp 200ms cubic-bezier(0.23, 1, 0.32, 1) both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.wexp-inner { transform-origin: top; animation: expandRow 180ms cubic-bezier(0.77, 0, 0.175, 1) both; }
@keyframes expandRow { from { opacity: 0; transform: scaleY(0.99); } to { opacity: 1; transform: none; } }
.xfade { animation: xfade 160ms cubic-bezier(0.23, 1, 0.32, 1) both; }
@keyframes xfade { from { opacity: 0; } to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001s !important; animation-delay: 0s !important; transition-duration: 0.001s !important; }
  .btn:active { transform: none; }
}

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; }
  .desk-card { min-width: 0; }
  .method-grid, .cta-grid { grid-template-columns: 1fr; }
  .ruled-row { grid-template-columns: 1fr; gap: 4px; }
  .sec { padding-top: 64px; }
  .sec:last-of-type { padding-bottom: 64px; }
}
@media (max-width: 720px) {
  .site-nav { display: none; }
  .display-lg { font-size: 32px; }
  .display-md { font-size: 26px; }
  .footer-cols { grid-template-columns: 1fr; }
  .sec { padding-top: 48px; }
  .sec:last-of-type { padding-bottom: 48px; }
  #artifact-panel { padding: 24px 18px 36px; }
  .site-header .btn { padding: 8px 12px; font-size: 14px; }
}

/* ---------- pricing: the $499 row is the product ---------- */
.tier-hero { background: #F0F5FA; box-shadow: inset 3px 0 0 var(--action); }
.tier-hero td { border-top: 1px solid var(--rule-strong); border-bottom: 1px solid var(--rule-strong); }
#pricing .tbl td.num.tier-price { font-family: var(--mono); font-size: 18px; font-weight: 500; }
.tier-hero .tier-note { display: block; margin-top: 2px; text-transform: none; letter-spacing: 0; }
.btn-quiet {
  background: none; border: none; padding: 10px 2px; cursor: pointer;
  font: inherit; font-size: 15px; color: var(--action); text-decoration: underline;
  text-underline-offset: 3px;
}
.btn-quiet:hover { color: var(--ink); }
@media (max-width: 640px) {
  #pricing .tbl thead { display: none; }
  #pricing .tbl tr { display: block; border-bottom: 1px solid var(--rule); padding: 10px 0; }
  #pricing .tbl td { display: block; border: none; padding: 4px 14px; text-align: left; }
  #pricing .tbl td.num { font-size: 18px; }
  #pricing .tbl td.price-btn-cell { padding-top: 8px; }
}

/* ---------- print: only the artifact panel ---------- */
@media print {
  body * { visibility: hidden; }
  #artifact-panel, #artifact-panel * { visibility: visible; }
  #artifact-panel {
    position: absolute; left: 0; top: 0; width: 100%;
    max-height: none; overflow: visible; border: none; padding: 0;
  }
  .watermark { position: fixed; top: 8px; right: 8px; }
  .no-print { display: none !important; }
}
