/* Deadweight shared system: trust-first B2B, IBM Plex, one red accent. */

:root {
  color-scheme: light dark;
  --paper: #f5f6f7;
  --surface: #fbfbfc;
  --surface-raised: #ffffff;
  --surface-tint: #eceef0;
  --ink: #17181a;
  --ink-soft: #5c6066;
  --ink-faint: #747980;
  --rule: #d7dade;
  --rule-strong: #aeb3b9;
  --red: #c7362d;
  --red-strong: #a72b24;
  --red-hover: #a72b24;
  --red-soft: #f6e8e6;
  --green: #2f704a;
  --green-soft: #e5f1e9;
  --on-ink: #f7f7f8;
  --on-ink-muted: #c6c9cd;
  --shadow: 0 24px 70px rgba(32, 35, 38, 0.10);
  --max: 1200px;
  --radius-control: 10px;
  --radius-panel: 18px;
  --font-sans: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  --font-mono: 'IBM Plex Mono', 'SFMono-Regular', Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #131517;
    --surface: #181b1e;
    --surface-raised: #1f2226;
    --surface-tint: #24282c;
    --ink: #f1f2f3;
    --ink-soft: #b1b5ba;
    --ink-faint: #92979d;
    --rule: #34383d;
    --rule-strong: #565c63;
    --red: #b83a33;
    --red-strong: #ef756c;
    --red-hover: #9f302a;
    --red-soft: #382321;
    --green: #70ad86;
    --green-soft: #1f3428;
    --on-ink: #f5f5f6;
    --on-ink-muted: #c5c8cc;
    --shadow: 0 28px 80px rgba(0, 0, 0, 0.30);
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }

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

h1, h2, h3, h4, p, figure, blockquote { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

:focus-visible {
  outline: 3px solid var(--red);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  left: 16px;
  top: -80px;
  z-index: 200;
  padding: 11px 16px;
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--radius-control);
  font-weight: 650;
  transition: top 140ms ease;
}
.skip-link:focus { top: 16px; }

.shell {
  width: min(var(--max), calc(100% - 48px));
  margin-inline: auto;
}

/* Buttons use 10px corners. Panels use 18px corners. */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  font-weight: 650;
  font-size: 15px;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 140ms ease, background 140ms ease, border-color 140ms ease, color 140ms ease;
}
.button.primary { background: var(--red); border-color: var(--red); color: #fff; }
.button.primary:hover { background: var(--red-hover); border-color: var(--red-hover); }
.button.secondary { background: var(--surface-raised); border-color: var(--rule-strong); color: var(--ink); }
.button.secondary:hover { border-color: var(--ink); }
.button.ghost { min-height: auto; padding: 0; border: 0; color: var(--ink-soft); background: transparent; }
.button.ghost:hover { color: var(--ink); }
.button.small { min-height: 40px; padding-inline: 15px; font-size: 14px; }
.button.full { width: 100%; }
.button:disabled { opacity: .55; cursor: not-allowed; }
.button:active:not(:disabled) { transform: translateY(1px); }

.text-link {
  color: var(--red-strong);
  font-weight: 650;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 3px;
}
.text-link:hover { text-decoration-color: currentColor; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid color-mix(in srgb, var(--rule) 84%, transparent);
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(14px);
}
.site-header .shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  min-height: 68px;
}
.brand {
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: .1em;
  white-space: nowrap;
}
.brand s { color: var(--red-strong); text-decoration-thickness: 2px; }
.site-nav { display: flex; align-items: center; gap: 26px; }
.site-nav a, .signin { color: var(--ink-soft); font-size: 14px; font-weight: 600; }
.site-nav a:hover, .signin:hover { color: var(--ink); }
.header-actions { display: flex; align-items: center; gap: 16px; }
.mobile-menu { display: none; position: relative; }
.mobile-menu summary {
  list-style: none;
  min-height: 40px;
  padding: 9px 12px;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-control);
  font-weight: 600;
  cursor: pointer;
}
.mobile-menu summary::-webkit-details-marker { display: none; }
.mobile-menu nav {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  display: grid;
  min-width: 220px;
  padding: 8px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-panel);
  background: var(--surface-raised);
  box-shadow: var(--shadow);
}
.mobile-menu nav a { padding: 11px 12px; border-radius: var(--radius-control); font-weight: 600; }
.mobile-menu nav a:hover { background: var(--surface-tint); }

.site-footer {
  border-top: 1px solid var(--rule);
  background: var(--surface);
  padding-block: 48px;
}
.site-footer .shell {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
  gap: 36px;
}
.foot-brand p { margin-top: 10px; max-width: 50ch; color: var(--ink-soft); font-size: 13px; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: flex-end; align-content: start; gap: 9px 22px; }
.footer-links a { color: var(--ink-soft); font-size: 13px; font-weight: 600; }
.footer-links a:hover { color: var(--ink); }
.site-footer .legal {
  grid-column: 1 / -1;
  padding-top: 22px;
  border-top: 1px solid var(--rule);
  color: var(--ink-faint);
  font-size: 12px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.pill.neutral { background: var(--ink); color: var(--paper); }
.pill.good { background: var(--green); color: #fff; }
.pill.outline { background: transparent; border: 1px solid var(--rule-strong); color: var(--ink-soft); }

.ledger {
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: var(--radius-panel);
  background: var(--surface-raised);
}
.ledger-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--rule-strong);
}
.ledger-head h2, .ledger-head h3 { font-size: 16px; font-weight: 700; }
.ledger-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--rule);
  font-size: 15px;
}
.ledger-row:last-child { border-bottom: 0; }
.ledger-row .amt { font-weight: 550; }
.ledger-row.tint { background: var(--red-soft); }
.ledger-row.total { padding-top: 18px; font-weight: 700; font-size: 16px; }

label { display: block; margin-bottom: 7px; font-size: 13px; font-weight: 650; }
input[type='email'], input[type='text'], input[type='password'], input[type='number'], select, textarea {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-control);
  background: var(--surface-raised);
  color: var(--ink);
}
textarea { min-height: 120px; padding-block: 12px; resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--ink-faint); opacity: 1; }
input[type='range'] { width: 100%; accent-color: var(--red); }
.check-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: start;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 500;
}
.check-row input { width: 17px; height: 17px; margin-top: 3px; accent-color: var(--red); }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 900px) {
  .site-nav, .header-actions .signin { display: none; }
  .mobile-menu { display: block; }
}

@media (max-width: 640px) {
  .shell { width: min(var(--max), calc(100% - 32px)); }
  .site-header .shell { min-height: 62px; gap: 12px; }
  .header-actions { gap: 8px; }
  .header-actions > .button { display: none; }
  .site-footer .shell { grid-template-columns: 1fr; }
  .footer-links { justify-content: flex-start; }
  .site-footer .legal { grid-column: auto; }
}

@supports not (backdrop-filter: blur(14px)) {
  .site-header { background: var(--paper); }
}

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