/* The public page. Same token family as the instrument in web/app/styles.css,
 * because it is the same object seen from outside, but a different register:
 * this one is read by one person on a laptop, not by six people across a room.
 *
 * Also serves web/gate.html, which is deliberately the plainest thing here.
 *
 * No external requests. Same rule as the instrument, and for the same reason:
 * it is a property being sold, not a limitation being worked around. */

:root {
  --ground: oklch(0.982 0.003 240);
  --panel: oklch(1 0 0);
  --bed: oklch(0.31 0.014 250);
  --bed-edge: oklch(0.26 0.014 250);

  --ink: oklch(0.24 0.014 250);
  --ink-soft: oklch(0.46 0.012 250);
  --ink-onbed: oklch(0.93 0.004 250);
  --ink-onbed-soft: oklch(0.72 0.008 250);

  --rule: oklch(0.905 0.005 250);
  --rule-firm: oklch(0.83 0.006 250);

  --verified: oklch(0.46 0.098 165);
  --verified-wash: oklch(0.96 0.022 165);
  --prism: oklch(0.47 0.185 285);

  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;

  /* Marketing scale, but capped well short of a display headline. A tool whose
   * whole argument is restraint does not get to shout in 96px. */
  --t-micro: 0.8125rem;
  --t-small: 0.9375rem;
  --t-body: 1.0625rem;
  --t-lead: 1.25rem;
  --t-h3: 1.25rem;
  --t-h2: clamp(1.6rem, 1.15rem + 1.6vw, 2.25rem);
  --t-h1: clamp(2.1rem, 1.3rem + 3.1vw, 3.4rem);

  --s1: 0.25rem;
  --s2: 0.5rem;
  --s3: 0.75rem;
  --s4: 1rem;
  --s5: 1.5rem;
  --s6: 2rem;
  --s7: 3rem;
  --s8: 4.5rem;

  --radius: 6px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --fast: 160ms;

  --measure: 68ch;
  --page: 68rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--t-body);
  line-height: 1.6;
  /* The viewer's own surface shows through a transparent body. Painting it
   * explicitly is what keeps this page the colour it was designed as. */
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

h1, h2, h3 {
  line-height: 1.15;
  text-wrap: balance;
  letter-spacing: -0.02em;
  margin: 0;
}
h1 { font-size: var(--t-h1); letter-spacing: -0.03em; }
h2 { font-size: var(--t-h2); }
h3 { font-size: var(--t-h3); letter-spacing: -0.01em; }

p { margin: 0 0 var(--s4); text-wrap: pretty; }

/* Every figure is monospace and tabular. Workpaper convention: columns of
 * numbers have to align for a person to compare them at a glance. */
.fig, .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

.skip {
  position: absolute;
  left: -9999px;
  background: var(--ink);
  color: var(--panel);
  padding: var(--s3) var(--s4);
  z-index: 300;
}
.skip:focus { left: var(--s4); top: var(--s4); }

/* --- Masthead ---------------------------------------------------------- */

.masthead {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--s4) var(--s6);
  max-width: var(--page);
  margin: 0 auto;
  padding: var(--s5) var(--s5) var(--s4);
}

.mark {
  font-weight: 600;
  font-size: 1.125rem;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.masthead nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2) var(--s5);
  margin-left: auto;
  font-size: var(--t-small);
}
.masthead nav a {
  color: var(--ink-soft);
  text-decoration: none;
  padding: var(--s1) 0;
  border-bottom: 1px solid transparent;
  transition: color var(--fast) var(--ease),
              border-color var(--fast) var(--ease);
}
.masthead nav a:hover { color: var(--ink); border-bottom-color: var(--rule-firm); }
.cta-small { color: var(--prism) !important; font-weight: 550; }

/* --- Hero -------------------------------------------------------------- */

.hero {
  max-width: var(--page);
  margin: 0 auto;
  padding: var(--s7) var(--s5) var(--s8);
  display: grid;
  gap: var(--s7);
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  align-items: center;
}

.hero-copy .lead {
  font-size: var(--t-lead);
  color: var(--ink-soft);
  max-width: 46ch;
  margin-top: var(--s5);
}

.actions { display: flex; flex-wrap: wrap; gap: var(--s3); margin-top: var(--s5); }

.btn {
  display: inline-block;
  padding: var(--s3) var(--s5);
  border: 1px solid var(--rule-firm);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--ink);
  font-size: var(--t-small);
  font-weight: 550;
  text-decoration: none;
  transition: border-color var(--fast) var(--ease),
              background var(--fast) var(--ease);
}
.btn:hover { border-color: var(--ink-soft); }
.btn.primary {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--panel);
}
.btn.primary:hover { background: oklch(0.18 0.014 250); }

.micro { font-size: var(--t-micro); color: var(--ink-soft); }
.micro.spread { max-width: var(--measure); margin-top: var(--s5); }
/* Sits under the buttons, and needs to read as a footnote to them rather than
   as a caption glued to their underside. */
.actions + .micro { margin-top: var(--s4); max-width: 48ch; }

/* The specimen. A real reconciled total from a published filing, set the way
 * the instrument sets it, so the first thing seen is the actual output. */
.specimen {
  margin: 0;
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: var(--s5);
  box-shadow: 0 1px 2px oklch(0.24 0.014 250 / 0.04),
              0 8px 24px oklch(0.24 0.014 250 / 0.05);
}
.specimen figcaption {
  font-size: var(--t-micro);
  color: var(--ink-soft);
  padding-bottom: var(--s3);
  border-bottom: 1px solid var(--rule);
  margin-bottom: var(--s3);
}

.ledger-demo { width: 100%; border-collapse: collapse; font-size: var(--t-small); }
.ledger-demo td { padding: var(--s2) 0; }
.ledger-demo .fig { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.ledger-demo tfoot .total td {
  border-top: 1px solid var(--rule-firm);
  padding-top: var(--s3);
  font-weight: 600;
}
.ledger-demo tfoot .total .fig {
  color: var(--verified);
  background: var(--verified-wash);
  box-shadow: 0 0 0 4px var(--verified-wash);
  border-radius: 2px;
}

.verdict {
  margin: var(--s5) 0 0;
  font-size: var(--t-micro);
  padding-top: var(--s3);
  border-top: 1px solid var(--rule);
}
.verdict.verified { color: var(--verified); }

/* --- Bands ------------------------------------------------------------- */

.band {
  max-width: var(--page);
  margin: 0 auto;
  padding: var(--s8) var(--s5);
  border-top: 1px solid var(--rule);
}
.band.alt { background: transparent; }
.band > h2 { max-width: 24ch; margin-bottom: var(--s6); }

.prose { max-width: var(--measure); }
.prose p:last-child { margin-bottom: 0; }
.prose em { font-style: normal; font-weight: 600; }

/* Not a decorated blockquote. A single indented line at the weight of the
 * thing it is claiming, with no left stripe and no quotation marks. */
.pull {
  font-size: var(--t-lead);
  line-height: 1.4;
  letter-spacing: -0.01em;
  margin: var(--s6) 0;
  padding-top: var(--s5);
  border-top: 1px solid var(--rule-firm);
  max-width: 44ch;
}

/* --- Comparison -------------------------------------------------------- */

.scroller { overflow-x: auto; margin: var(--s6) 0; }
.scroller:focus-visible { outline: 2px solid var(--prism); outline-offset: 3px; }

/* A table that scrolls inside its own box keeps the page from scrolling
 * sideways, but it also hides the fact that there is more to the right. The
 * hint appears only at the widths where the table actually overflows, so it
 * never claims a scroll that is not there. */
.scroll-hint { display: none; }
@media (max-width: 46rem) {
  .scroll-hint {
    display: block;
    font-size: var(--t-micro);
    color: var(--ink-soft);
    margin: calc(var(--s6) * -1 + var(--s2)) 0 var(--s3);
  }
}

.compare {
  width: 100%;
  min-width: 44rem;
  border-collapse: collapse;
  font-size: var(--t-small);
  text-align: left;
}
.compare caption {
  text-align: left;
  font-size: var(--t-micro);
  color: var(--ink-soft);
  padding-bottom: var(--s3);
}
.compare th, .compare td {
  padding: var(--s4) var(--s4) var(--s4) 0;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}
.compare thead th {
  font-size: var(--t-micro);
  color: var(--ink-soft);
  font-weight: 550;
  border-bottom-color: var(--rule-firm);
}
.compare thead th:last-child { color: var(--ink); }
.compare tbody th {
  font-weight: 550;
  width: 12rem;
  color: var(--ink);
}
.compare td { color: var(--ink-soft); width: 26%; }
.compare td:last-child { color: var(--ink); }

/* --- Results ----------------------------------------------------------- */

.results {
  width: 100%;
  min-width: 42rem;
  border-collapse: collapse;
  font-size: var(--t-small);
  text-align: left;
}
.results caption {
  text-align: left;
  font-size: var(--t-micro);
  color: var(--ink-soft);
  padding-bottom: var(--s3);
}
.results th, .results td {
  padding: var(--s3) var(--s4) var(--s3) 0;
  border-bottom: 1px solid var(--rule);
}
.results thead th {
  font-size: var(--t-micro);
  color: var(--ink-soft);
  font-weight: 550;
  border-bottom-color: var(--rule-firm);
}
.results tbody th { font-weight: 450; }
.results .num {
  text-align: right;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}
.results tfoot th, .results tfoot td {
  border-top: 1px solid var(--rule-firm);
  border-bottom: 0;
  font-weight: 600;
  padding-top: var(--s4);
}
/* The zero is the point of the table, so it is the one figure that carries
 * colour, and it carries the colour that means reconciled rather than a colour
 * that means good. */
.results .zero { color: var(--verified); }

/* --- Features ---------------------------------------------------------- */

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  gap: var(--s6) var(--s6);
}
/* A rule above each, not a card around each. Six boxes of identical chrome is
 * the shape every one of these pages already has. */
.features article { border-top: 1px solid var(--rule-firm); padding-top: var(--s4); }
.features h3 { margin-bottom: var(--s3); }
.features p { color: var(--ink-soft); font-size: var(--t-small); margin: 0; }

/* --- Uses -------------------------------------------------------------- */

.uses { margin: 0; display: grid; gap: var(--s5); }
.uses > div {
  display: grid;
  grid-template-columns: minmax(0, 15rem) minmax(0, 1fr);
  gap: var(--s3) var(--s6);
  padding-bottom: var(--s5);
  border-bottom: 1px solid var(--rule);
}
.uses > div:last-child { border-bottom: 0; padding-bottom: 0; }
.uses dt { font-weight: 600; letter-spacing: -0.01em; }
.uses dd { margin: 0; color: var(--ink-soft); font-size: var(--t-small); max-width: 60ch; }

/* --- Limits ------------------------------------------------------------ */

.limits { list-style: none; margin: var(--s6) 0 0; padding: 0; display: grid; gap: var(--s5); }
.limits li {
  max-width: var(--measure);
  color: var(--ink-soft);
  font-size: var(--t-small);
  padding-left: var(--s5);
  border-left: 1px solid var(--rule-firm);
}
.limits strong { display: block; color: var(--ink); font-weight: 600; margin-bottom: var(--s1); }

/* --- Talk -------------------------------------------------------------- */

.talk {
  background: var(--bed);
  color: var(--ink-onbed);
  border-top: 0;
  max-width: none;
  padding-left: max(var(--s5), calc((100vw - var(--page)) / 2 + var(--s5)));
  padding-right: max(var(--s5), calc((100vw - var(--page)) / 2 + var(--s5)));
}
.talk-grid {
  display: grid;
  gap: var(--s7);
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: start;
  max-width: var(--page);
  margin: 0 auto;
}
.talk-copy p { color: var(--ink-onbed-soft); max-width: 42ch; }
.talk-copy h2 { margin-bottom: var(--s5); max-width: 18ch; }
.talk-copy a { color: var(--ink-onbed); }

.talk-form { display: grid; gap: var(--s4); }
.field { display: grid; gap: var(--s2); }
.field label { font-size: var(--t-micro); color: var(--ink-onbed-soft); }
.field input, .field textarea {
  font: inherit;
  font-size: var(--t-small);
  color: var(--ink-onbed);
  background: var(--bed-edge);
  border: 1px solid oklch(0.42 0.014 250);
  border-radius: var(--radius);
  padding: var(--s3);
  width: 100%;
}
.field textarea { resize: vertical; }
.field input:focus-visible, .field textarea:focus-visible {
  outline: 2px solid oklch(0.72 0.13 285);
  outline-offset: 1px;
  border-color: transparent;
}

.talk-form button {
  font: inherit;
  font-size: var(--t-small);
  font-weight: 550;
  justify-self: start;
  padding: var(--s3) var(--s6);
  border: 0;
  border-radius: var(--radius);
  background: var(--ink-onbed);
  color: var(--bed);
  cursor: pointer;
  transition: background var(--fast) var(--ease);
}
.talk-form button:hover { background: var(--panel); }
.talk-form button[disabled] { opacity: 0.55; cursor: default; }

.form-status { font-size: var(--t-micro); color: var(--ink-onbed-soft); margin: 0; min-height: 1.4em; }

/* The honeypot. Off-screen rather than display:none, which some form fillers
 * skip, and hidden from assistive technology by aria-hidden on the wrapper. */
.trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* --- FAQ --------------------------------------------------------------- */

.faq { max-width: var(--measure); border-top: 1px solid var(--rule); }
.faq details { border-bottom: 1px solid var(--rule); }
.faq summary {
  cursor: pointer;
  padding: var(--s4) var(--s6) var(--s4) 0;
  font-weight: 550;
  list-style: none;
  position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  position: absolute;
  right: 0;
  top: var(--s4);
  color: var(--ink-soft);
  font-family: var(--mono);
}
.faq details[open] summary::after { content: "\2212"; }
.faq summary:focus-visible { outline: 2px solid var(--prism); outline-offset: 2px; }
.faq details p {
  color: var(--ink-soft);
  font-size: var(--t-small);
  margin: 0 0 var(--s5);
  padding-right: var(--s6);
}

/* --- Footer ------------------------------------------------------------ */

.foot {
  max-width: var(--page);
  margin: 0 auto;
  padding: var(--s6) var(--s5) var(--s7);
  border-top: 1px solid var(--rule);
  font-size: var(--t-micro);
  color: var(--ink-soft);
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2) var(--s5);
}
.foot p { margin: 0; }

/* --- The gate ---------------------------------------------------------- */

.gate-body {
  display: grid;
  place-items: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: var(--s5);
}
.gate { max-width: 26rem; width: 100%; }
.gate-mark { font-weight: 600; letter-spacing: -0.02em; margin-bottom: var(--s6); }
.gate h1 { font-size: 1.5rem; margin-bottom: var(--s4); }
.gate-note { color: var(--ink-soft); font-size: var(--t-small); }
.gate-form { display: grid; gap: var(--s2); margin-top: var(--s6); }
.gate-form label { font-size: var(--t-micro); color: var(--ink-soft); }
.gate-form input[type="password"] {
  font: inherit;
  font-family: var(--mono);
  padding: var(--s3);
  border: 1px solid var(--rule-firm);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--ink);
}
.gate-form input[type="password"]:focus-visible {
  outline: 2px solid var(--prism);
  outline-offset: 1px;
}
.gate-form button {
  font: inherit;
  font-size: var(--t-small);
  font-weight: 550;
  margin-top: var(--s2);
  padding: var(--s3);
  border: 0;
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--panel);
  cursor: pointer;
}
.gate-error {
  min-height: 1.4em;
  margin: var(--s4) 0 0;
  font-size: var(--t-small);
  color: oklch(0.47 0.168 28);
}
.gate-back { margin-top: var(--s6); font-size: var(--t-micro); color: var(--ink-soft); }

/* --- Responsive -------------------------------------------------------- */

@media (max-width: 60rem) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: var(--s6); padding-bottom: var(--s7); }
  .talk-grid { grid-template-columns: minmax(0, 1fr); gap: var(--s6); }
  .uses > div { grid-template-columns: minmax(0, 1fr); gap: var(--s2); }
  .compare tbody th { width: 10rem; }
}

@media (max-width: 40rem) {
  .band { padding: var(--s7) var(--s4); }
  .hero { padding: var(--s6) var(--s4) var(--s7); }
  .masthead, .foot { padding-left: var(--s4); padding-right: var(--s4); }
  .masthead nav { margin-left: 0; width: 100%; }
  .talk { padding-left: var(--s4); padding-right: var(--s4); }
  .actions .btn { flex: 1 1 auto; text-align: center; }
}

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
