@font-face {
  font-family: "DM Sans";
  src: url("fonts/dm-sans-var.woff2") format("woff2");
  font-weight: 100 1000;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #f2efe6;
  --paper-light: #fbf9f3;
  --paper-white: #fffefa;
  --ink: #171917;
  --dark: #171a18;
  --dark-soft: #222723;
  --muted: #5e625e;
  --line: #d7d4ca;
  --line-dark: rgba(255, 255, 255, 0.16);
  --green: #47df88;
  --green-deep: #087844;
  --green-wash: #dff5e8;
  --amber: #d3b74f;
  --amber-wash: #f6edc9;
  --error: #973b34;
  --radius: 5px;
  --radius-sm: 3px;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  --type-micro: 0.69rem;
  --type-caption: 0.78rem;
  --type-small: 0.84rem;
  --type-body: 0.94rem;
  --type-support: 1rem;
}

* { box-sizing: border-box; }

html { background: var(--paper); }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "DM Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  line-height: 1.5;
}

vercel-live-feedback {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.topbar {
  padding: 9px 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: var(--dark);
  color: #fff;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.015em;
}

.topbar p {
  max-width: 1120px;
  margin: 0 auto;
}

.topbar-label {
  color: var(--green);
  font-weight: 700;
}

.topbar-label::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 9px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(71, 223, 136, 0.12);
  vertical-align: 0.08em;
}

.topbar-context::before {
  content: "/";
  margin: 0 11px;
  color: rgba(255, 255, 255, 0.34);
}

.hero-band {
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(rgba(23, 25, 23, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 25, 23, 0.025) 1px, transparent 1px),
    var(--paper-light);
  background-size: 28px 28px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 22px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 30px 22px 28px;
}

.hero-copy { max-width: 760px; }

.hero-kicker,
.engine-num,
.inputs-title,
.result-label {
  margin: 0;
  color: var(--green-deep);
  font-family: var(--mono);
  font-size: var(--type-micro);
  font-weight: 750;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.hero-kicker { margin-bottom: 12px; }

h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(2.5rem, 6vw, 4.35rem);
  font-weight: 820;
  letter-spacing: -0.058em;
  line-height: 0.96;
}

h1 span {
  position: relative;
  display: inline-block;
  white-space: nowrap;
}

h1 span::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -0.06em;
  left: 0.04em;
  height: 0.1em;
  background: var(--green);
}

.hero-deck {
  max-width: 63ch;
  margin: 19px 0 0;
  color: #3e433f;
  font-size: clamp(1rem, 2.1vw, 1.12rem);
  line-height: 1.55;
}

.honesty {
  max-width: 44ch;
  margin: 0;
  padding: 15px 0 0 18px;
  border-top: 1px solid var(--ink);
  border-left: 4px solid var(--amber);
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.55;
}

.honesty::before {
  content: "Model boundary";
  display: block;
  margin-bottom: 7px;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.67rem;
  font-weight: 750;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.page {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 22px;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
  margin-top: 24px;
}

.inputs {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  align-content: start;
  padding: 22px;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  background: var(--paper-white);
  box-shadow: 7px 7px 0 #dce7df;
}

.inputs-title {
  padding-bottom: 13px;
  border-bottom: 1px solid var(--line);
}

.field {
  display: grid;
  gap: 7px;
}

.field label {
  color: #303430;
  font-size: 0.86rem;
  font-weight: 700;
}

.field-help {
  margin: 1px 0 0;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.42;
}

.control {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 54px;
  padding: 0 13px;
  border: 1px solid #c8c7c0;
  border-radius: var(--radius-sm);
  background: #fdfcf7;
  box-shadow: inset 0 -2px 0 rgba(23, 25, 23, 0.035);
  transition: border-color 170ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 170ms cubic-bezier(0.16, 1, 0.3, 1);
}

.control:focus-within {
  border-color: var(--green-deep);
  outline: 0;
  box-shadow: 0 0 0 3px rgba(71, 223, 136, 0.22);
}

.field:has(input[aria-invalid="true"]) .control { border-color: var(--error); }

.control input {
  flex: 1;
  min-width: 0;
  padding: 10px 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 1.24rem;
  font-variant-numeric: tabular-nums;
  font-weight: 760;
}

.affix {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 650;
}

.inputs-note,
.input-error {
  margin: 0;
  font-size: 0.82rem;
}

.inputs-note { color: var(--muted); }
.input-error { color: var(--error); font-weight: 700; }

.reset-button {
  width: 100%;
  min-height: 46px;
  padding: 10px 14px;
  border: 1px solid var(--ink);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 750;
  transition: background 170ms cubic-bezier(0.16, 1, 0.3, 1), color 170ms cubic-bezier(0.16, 1, 0.3, 1), transform 170ms cubic-bezier(0.16, 1, 0.3, 1);
}

.reset-button:hover {
  background: var(--dark);
  color: #fff;
  transform: translateY(-1px);
}

.reset-button:focus-visible,
.customer-proof summary:focus-visible,
.method summary:focus-visible {
  outline: 3px solid rgba(71, 223, 136, 0.48);
  outline-offset: 3px;
}

.results {
  display: grid;
  gap: 18px;
  align-content: start;
}

.planning-panel {
  display: grid;
  gap: 16px;
}

.planning-head {
  display: grid;
  gap: 12px;
  align-items: end;
}

.planning-head h2 {
  max-width: 580px;
  margin: 5px 0 0;
  font-size: clamp(1.7rem, 4vw, 2.2rem);
  font-weight: 780;
  letter-spacing: -0.035em;
  line-height: 1.05;
}

.planning-head > p {
  max-width: 34ch;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #b99e38;
  border-radius: var(--radius-sm);
  background: var(--amber-wash);
  color: #574b1e;
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 650;
  line-height: 1.42;
}

.primary-result {
  position: relative;
  display: grid;
  gap: 0;
  overflow: hidden;
  padding: 22px;
  border: 1px solid #0d100e;
  border-radius: var(--radius);
  background:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    var(--dark);
  background-size: 100% 31px;
  color: #fff;
  box-shadow: 9px 9px 0 rgba(8, 120, 68, 0.11);
}

.primary-result::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 5px;
  background: repeating-linear-gradient(90deg, var(--green) 0 12px, transparent 12px 18px);
  opacity: 0.88;
}

.primary-result > * {
  position: relative;
  z-index: 1;
}

.time-window {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line-dark);
}

.primary-result .result-label { color: var(--green); }

.primary-value {
  margin: 8px 0 0;
  color: #fff;
  font-size: clamp(3.15rem, 8vw, 5.2rem);
  font-variant-numeric: tabular-nums;
  font-weight: 820;
  letter-spacing: -0.065em;
  line-height: 0.94;
}

.exact {
  margin: 7px 0 10px;
  color: var(--muted);
  font-size: var(--type-small);
  font-variant-numeric: tabular-nums;
}

.time-window .exact {
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.62);
}

.math-trail {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  margin: 0;
  padding: 0;
  border-bottom: 1px solid var(--line-dark);
  list-style: none;
}

.math-trail li {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 18px 0;
  border-bottom: 1px solid var(--line-dark);
}

.math-trail li:last-child { border-bottom: 0; }

.math-trail li > span {
  color: var(--green);
  font-family: var(--mono);
  font-size: var(--type-micro);
  font-weight: 700;
  letter-spacing: 0.085em;
  text-transform: uppercase;
}

.math-trail strong {
  color: #fff;
  font-size: 1.02rem;
  font-variant-numeric: tabular-nums;
}

.math-trail small {
  color: rgba(255, 255, 255, 0.55);
  font-family: var(--mono);
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.42;
}

.value-translation {
  display: grid;
  gap: 6px 18px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line-dark);
}

.translated-value {
  margin: 0;
  color: var(--green);
  font-size: clamp(2.85rem, 7vw, 4.2rem);
  font-variant-numeric: tabular-nums;
  font-weight: 820;
  letter-spacing: -0.055em;
  line-height: 0.95;
}

.value-translation .exact {
  margin: 0;
  color: rgba(255, 255, 255, 0.56);
  font-family: var(--mono);
  font-size: 0.72rem;
}

.result-boundary {
  margin: 0;
  padding: 14px 0 5px;
  color: rgba(255, 255, 255, 0.66);
  font-size: 0.8rem;
  line-height: 1.5;
}

.conversation-prompt {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 4px;
  padding: 15px 17px 15px 20px;
  border: 1px solid var(--ink);
  border-radius: var(--radius-sm);
  background: var(--paper-white);
  box-shadow: 5px 5px 0 var(--green-wash);
}

.conversation-prompt::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 4px;
  background: var(--green);
}

.conversation-prompt p {
  margin: 0;
  color: var(--green-deep);
  font-family: var(--mono);
  font-size: 0.67rem;
  font-weight: 750;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.conversation-prompt strong {
  max-width: 54ch;
  font-size: 1.05rem;
  line-height: 1.3;
}

.stats {
  display: grid;
  gap: 0;
  margin: 10px 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

.stats > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.stats dt { color: var(--muted); font-size: var(--type-small); }

.stats dd {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.86rem;
  font-variant-numeric: tabular-nums;
  font-weight: 750;
  text-align: right;
  white-space: nowrap;
}

.primary-stats { margin-bottom: 0; }

.documented-reference {
  display: grid;
  gap: 10px;
  padding: 18px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--green-deep);
  border-radius: var(--radius-sm);
  background:
    repeating-linear-gradient(180deg, transparent 0 29px, rgba(23, 25, 23, 0.035) 29px 30px),
    var(--paper-white);
}

.documented-reference.not-comparable { background: #ebe9e2; }

.documented-reference h3 {
  margin: 4px 0 0;
  font-size: 0.98rem;
  line-height: 1.28;
}

.reference-values {
  display: grid;
  gap: 3px;
}

.reference-values strong {
  font-size: clamp(1.45rem, 3vw, 1.62rem);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.04em;
  line-height: 1;
}

.reference-values span {
  color: var(--green-deep);
  font-family: var(--mono);
  font-size: var(--type-caption);
  font-variant-numeric: tabular-nums;
}

.capacity-definition {
  max-width: 68ch;
  margin: 0 auto;
  color: var(--muted);
  font-size: var(--type-caption);
  line-height: 1.5;
  text-align: center;
}

.ledger { display: grid; gap: 12px; }
.split { display: grid; gap: 12px; }

.customer-proof,
.method {
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  background: var(--paper-white);
}

.customer-proof summary,
.method summary {
  padding: 17px 19px;
  cursor: pointer;
  font-size: 0.92rem;
  font-weight: 760;
}

.customer-proof summary::marker,
.method summary::marker { color: var(--green-deep); }

.customer-proof[open] summary,
.method[open] summary { border-bottom: 1px solid var(--line); }

.customer-proof .ledger { padding: 12px; }

.row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  align-content: start;
  padding: 19px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper-white);
}

.benchmark-card { border-top: 4px solid var(--green-deep); }

.peer-card {
  border-top: 4px solid var(--green);
  background: #f6fbf7;
}

.row h3 {
  margin: 0;
  font-size: 0.98rem;
}

.big-value,
.peer-chain {
  margin: 3px 0 0;
  font-size: clamp(1.65rem, 4vw, 1.9rem);
  font-variant-numeric: tabular-nums;
  font-weight: 810;
  letter-spacing: -0.035em;
  line-height: 1.05;
}

.row-note {
  max-width: 58ch;
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.5;
}

.row-note a,
.method-body a {
  color: var(--green-deep);
  font-weight: 700;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

.method-body {
  padding: 3px 20px 20px;
  color: var(--muted);
  font-size: 0.88rem;
}

.method-body p { margin: 12px 0 0; }

.method-body h3 {
  margin: 16px 0 0;
  color: var(--ink);
  font-size: 1rem;
}

.provenance-note { color: var(--ink); }

.method-steps {
  display: grid;
  gap: 8px;
  margin: 14px 0 0;
  padding-left: 20px;
}

.method-steps strong { color: var(--ink); }

.worked-math {
  display: grid;
  gap: 0;
  margin: 10px 0 0;
  padding: 0;
  border-top: 1px solid var(--line);
  list-style: none;
}

.worked-math li {
  display: grid;
  gap: 2px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.worked-math span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.worked-math strong {
  color: var(--ink);
  font-family: var(--mono);
  font-size: var(--type-small);
  font-variant-numeric: tabular-nums;
}

.method-boundary {
  padding: 11px 12px;
  border-left: 4px solid var(--green);
  background: var(--green-wash);
  color: #414641;
}

.formula-block {
  display: grid;
  gap: 7px;
  margin-top: 15px;
  padding: 14px;
  border-left: 4px solid var(--green-deep);
  background: #edf7f1;
}

.formula-block p { margin: 0; }

.method-body table {
  width: 100%;
  margin-top: 10px;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.method-body th,
.method-body td {
  padding: 7px 8px 7px 0;
  border-bottom: 1px solid var(--line);
  font-size: var(--type-small);
  text-align: left;
}

.method-body td:last-child,
.method-body th:last-child { text-align: right; }

.load-error {
  margin: 0;
  color: var(--error);
  font-weight: 700;
}

.foot {
  margin-top: 54px;
  padding: 30px 22px;
  border-top: 5px solid var(--green);
  background: var(--dark);
  color: rgba(255, 255, 255, 0.68);
}

.foot-inner {
  max-width: 1120px;
  margin: 0 auto;
}

.foot p {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.72rem;
  line-height: 1.55;
}

@media (min-width: 720px) {
  .hero {
    grid-template-columns: minmax(0, 1.55fr) minmax(220px, 0.62fr);
    gap: clamp(40px, 7vw, 94px);
    align-items: end;
  }

  .honesty { align-self: end; }

  .inputs { grid-template-columns: repeat(3, 1fr); }
  .inputs-title,
  .inputs-note,
  .input-error,
  .reset-button { grid-column: 1 / -1; }

  .split { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .documented-reference {
    grid-template-columns: minmax(0, 1.1fr) minmax(210px, 0.9fr);
    align-items: center;
  }

  .documented-reference .row-note { grid-column: 1 / -1; }
}

@media (min-width: 900px) {
  .layout {
    grid-template-columns: 305px minmax(0, 1fr);
    gap: 34px;
    align-items: start;
  }

  .inputs {
    position: sticky;
    top: 22px;
    grid-template-columns: 1fr;
  }

  .inputs-title,
  .inputs-note,
  .input-error,
  .reset-button { grid-column: auto; }

  .planning-head {
    grid-template-columns: minmax(0, 1fr) minmax(205px, 0.55fr);
    gap: 24px;
  }

  .planning-head > p { justify-self: end; }

  .math-trail { grid-template-columns: repeat(3, minmax(0, 1fr)); }

  .math-trail li {
    padding: 16px 16px 16px 0;
    border-right: 1px solid var(--line-dark);
    border-bottom: 0;
  }

  .math-trail li + li { padding-left: 16px; }
  .math-trail li:last-child { border-right: 0; }

  .value-translation {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
  }

  .value-translation .result-label { grid-column: 1; }
  .value-translation .translated-value {
    grid-column: 2;
    grid-row: 1 / span 2;
    text-align: right;
  }
  .value-translation .exact { grid-column: 1; }
}

@media (max-width: 520px) {
  .topbar { padding: 9px 18px; }
  .topbar-context { display: none; }

  .hero {
    gap: 18px;
    padding: 27px 18px 25px;
  }

  h1 {
    font-size: clamp(2.3rem, 10.5vw, 2.7rem);
    line-height: 0.99;
  }

  .hero-deck {
    margin-top: 16px;
    font-size: 0.96rem;
    line-height: 1.48;
  }

  .honesty {
    max-width: none;
    padding-top: 13px;
  }

  .page { padding-inline: 18px; }
  .layout { margin-top: 22px; }
  .inputs { padding: 20px; }

  .planning-head h2 { font-size: 1.75rem; }
  .planning-head > p { max-width: none; }

  .primary-result { padding: 21px; }
  .primary-value { font-size: 3.25rem; }
  .translated-value { font-size: 3.15rem; }

  .stats > div {
    display: grid;
    gap: 2px;
  }

  .stats dd {
    text-align: left;
    white-space: normal;
  }

  .reference-values strong {
    font-size: 1.38rem;
    line-height: 1.06;
  }

  .customer-proof summary,
  .method summary { padding: 16px 17px; }
}

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