/* RoyaltyProof — professional-services / audit-firm, editorial-adjacent */

:root {
  --ink: #14181f;
  --ink-soft: #3a424e;
  --muted: #6b7480;
  --line: #e2ddd3;
  --line-soft: #efeae0;
  --paper: #faf7f1;
  --paper-2: #f3eee4;
  --white: #ffffff;
  --navy: #1b2a3a;
  --navy-2: #24384c;
  --accent: #0b5c4a;      /* ledger green */
  --accent-ink: #084538;
  --gold: #9a6b17;
  --alert: #a33a2a;       /* underpaid highlight */
  --alert-soft: #f6e7e2;
  --radius: 10px;
  --wrap: 1120px;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.wrap { width: min(var(--wrap), 92vw); margin: 0 auto; }

h1, h2, h3 { font-family: var(--serif); font-weight: 500; letter-spacing: -0.01em; line-height: 1.12; margin: 0; }
h1 { font-size: clamp(2.1rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); }
h3 { font-size: 1.18rem; }
em { font-style: italic; color: var(--accent-ink); }

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

/* ---------- header ---------- */
.site-head {
  position: sticky; top: 0; z-index: 50;
  background: rgba(250, 247, 241, 0.88);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--line);
}
.head-inner { display: flex; align-items: center; justify-content: space-between; height: 66px; }
.brand { display: flex; align-items: center; gap: 0.6rem; color: var(--ink); font-weight: 600; }
.brand:hover { text-decoration: none; }
.brand-mark {
  display: grid; place-items: center;
  width: 34px; height: 34px; border-radius: 7px;
  background: var(--navy); color: #fff;
  font-family: var(--serif); font-weight: 600; font-size: 0.95rem; letter-spacing: 0.02em;
}
.brand-name { font-family: var(--serif); font-size: 1.22rem; letter-spacing: -0.01em; }
.nav { display: flex; align-items: center; gap: 1.6rem; }
.nav a { color: var(--ink-soft); font-size: 0.94rem; font-weight: 500; }
.nav-cta {
  background: var(--accent); color: #fff !important;
  padding: 0.5rem 0.95rem; border-radius: 7px;
}
.nav-cta:hover { background: var(--accent-ink); text-decoration: none; }
@media (max-width: 720px) { .nav a:not(.nav-cta) { display: none; } }

/* ---------- buttons ---------- */
.btn {
  display: inline-block; font-weight: 600; font-size: 0.98rem;
  padding: 0.8rem 1.4rem; border-radius: 8px; border: 1px solid transparent;
  cursor: pointer; transition: transform .05s ease, background .15s ease, border-color .15s ease;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-ink); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--ink-soft); background: var(--white); }
.btn-lg { padding: 1rem 1.8rem; font-size: 1.05rem; }

/* ---------- hero ---------- */
.hero { padding: clamp(3rem, 8vw, 6rem) 0 clamp(2.5rem, 5vw, 4rem); border-bottom: 1px solid var(--line); }
.eyebrow, .section-eyebrow {
  text-transform: uppercase; letter-spacing: 0.16em; font-size: 0.76rem; font-weight: 600;
  color: var(--accent-ink); margin: 0 0 1rem;
}
.hero h1 { max-width: 17ch; }
.lede { max-width: 62ch; font-size: clamp(1.05rem, 1.8vw, 1.22rem); color: var(--ink-soft); margin: 1.4rem 0 2rem; }
.lede strong { color: var(--ink); font-weight: 600; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-bottom: 3rem; }

.hero-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; margin: 0; padding-top: 2rem; border-top: 1px solid var(--line); }
.hero-stats div { }
.hero-stats dt { text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.72rem; font-weight: 600; color: var(--muted); }
.hero-stats dd { margin: 0.35rem 0 0; font-family: var(--serif); font-size: clamp(1.9rem, 4vw, 2.6rem); color: var(--ink); line-height: 1; }
.hero-stats dd span { display: block; font-family: var(--sans); font-size: 0.82rem; font-weight: 400; color: var(--muted); margin-top: 0.45rem; line-height: 1.35; }
@media (max-width: 680px) { .hero-stats { grid-template-columns: 1fr; gap: 1.4rem; } }

/* ---------- bands ---------- */
.band { padding: clamp(3rem, 7vw, 5.5rem) 0; border-bottom: 1px solid var(--line); }
.band-alt { background: var(--paper-2); }
.section-eyebrow { margin-bottom: 0.7rem; }
.band h2 { max-width: 20ch; margin-bottom: 2.2rem; }

.cols { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: start; }
@media (max-width: 840px) { .cols { grid-template-columns: 1fr; gap: 2rem; } }
.prose p { color: var(--ink-soft); max-width: 60ch; }
.prose p + p { margin-top: 1rem; }
.prose strong { color: var(--ink); }

.problem-list { list-style: none; margin: 0; padding: 0; }
.problem-list li { padding: 1.1rem 0; border-top: 1px solid var(--line); color: var(--ink-soft); font-size: 0.98rem; }
.problem-list li:last-child { border-bottom: 1px solid var(--line); }
.pl-k { display: block; font-family: var(--serif); font-size: 1.1rem; color: var(--ink); margin-bottom: 0.3rem; }

/* ---------- service ---------- */
.service-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; }
@media (max-width: 840px) { .service-grid { grid-template-columns: 1fr; } }
.svc { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.6rem; }
.svc h3 { margin-bottom: 0.6rem; }
.svc h3::before { content: ""; display: block; width: 34px; height: 3px; background: var(--accent); border-radius: 2px; margin-bottom: 0.9rem; }
.svc p { margin: 0; color: var(--ink-soft); font-size: 0.96rem; }
.risk-line {
  margin: 2rem 0 0; padding: 1.2rem 1.5rem; border-left: 3px solid var(--accent);
  background: var(--white); border-radius: 0 var(--radius) var(--radius) 0;
  font-family: var(--serif); font-size: 1.2rem; color: var(--ink);
}

/* ---------- steps ---------- */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.4rem; counter-reset: step; }
@media (max-width: 900px) { .steps { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .steps { grid-template-columns: 1fr; } }
.steps li { padding-top: 1.2rem; border-top: 2px solid var(--ink); }
.step-n { font-family: var(--serif); font-size: 0.95rem; color: var(--accent-ink); font-weight: 600; letter-spacing: 0.05em; }
.steps h3 { margin: 0.5rem 0 0.5rem; }
.steps p { margin: 0; color: var(--ink-soft); font-size: 0.94rem; }

/* ---------- demo ---------- */
.band-demo { background: var(--navy); color: #eef1f4; border-bottom: none; }
.band-demo .section-eyebrow { color: #7fd0bd; }
.band-demo h2 { color: #fff; }
.demo-intro { max-width: 62ch; color: #c3cdd8; margin: 0 0 2rem; }

.tabs { display: inline-flex; gap: 0.4rem; padding: 0.35rem; background: rgba(255,255,255,0.06); border-radius: 10px; margin-bottom: 1.6rem; }
.tab {
  border: none; background: transparent; color: #c3cdd8; font-family: var(--sans);
  font-weight: 600; font-size: 0.94rem; padding: 0.6rem 1.1rem; border-radius: 7px; cursor: pointer;
}
.tab.is-active { background: var(--white); color: var(--navy); }

.panel { background: var(--white); color: var(--ink); border-radius: var(--radius); padding: clamp(1.4rem, 3vw, 2.2rem); }
.panel[hidden] { display: none; }

/* estimator */
.est-grid { display: grid; grid-template-columns: 1fr 0.95fr; gap: 2rem; align-items: start; }
@media (max-width: 820px) { .est-grid { grid-template-columns: 1fr; } }
.field { display: block; margin-bottom: 1.2rem; }
.field > span:first-child, .legend { display: block; font-weight: 600; font-size: 0.92rem; color: var(--ink); margin-bottom: 0.45rem; }
.field small { display: block; color: var(--muted); font-size: 0.82rem; margin-top: 0.3rem; }
.field code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.8rem; color: var(--gold); font-weight: 400; }
input[type=number], textarea {
  width: 100%; font-family: var(--sans); font-size: 1rem; color: var(--ink);
  padding: 0.7rem 0.85rem; border: 1px solid var(--line); border-radius: 8px; background: var(--paper);
}
input[type=number]:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
textarea { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.85rem; line-height: 1.5; resize: vertical; }
.input-money { position: relative; display: flex; align-items: center; }
.input-money .prefix { position: absolute; left: 0.85rem; color: var(--muted); font-weight: 600; }
.input-money .prefix + input { padding-left: 1.7rem; }
.input-money.suffix-pct .suffix { position: absolute; right: 0.85rem; color: var(--muted); font-weight: 600; }
.input-money.suffix-pct input { padding-right: 1.9rem; }
fieldset.field { border: none; margin: 0 0 1.2rem; padding: 0; }
.radio-row { display: flex; gap: 0.5rem; }
.radio { flex: 1; display: flex; align-items: center; justify-content: center; gap: 0.4rem; padding: 0.55rem; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); font-size: 0.9rem; cursor: pointer; }
.radio input { accent-color: var(--accent); }

.est-out { background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; position: sticky; top: 84px; }
.est-out h4 { margin: 0 0 0.3rem; font-family: var(--sans); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); }
.est-figure { font-family: var(--serif); font-size: clamp(1.8rem, 4vw, 2.4rem); color: var(--accent-ink); line-height: 1.1; margin: 0.2rem 0 0.2rem; }
.est-sub { color: var(--ink-soft); font-size: 0.92rem; margin: 0 0 1.2rem; }
.est-out hr { border: none; border-top: 1px solid var(--line); margin: 1.1rem 0; }
.est-net { font-family: var(--serif); font-size: 1.3rem; color: var(--ink); }
.est-net strong { color: var(--accent-ink); }
.est-row { display: flex; justify-content: space-between; font-size: 0.92rem; color: var(--ink-soft); padding: 0.25rem 0; }
.est-row span:last-child { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }

.fineprint, .csv-error, .csv-note { font-size: 0.82rem; color: var(--muted); margin-top: 1.4rem; }
.band-demo .fineprint { color: #93a1b0; }
.csv-error { color: var(--alert); font-weight: 500; }

/* reconciliation */
.recon-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 0.8rem; margin-bottom: 1.2rem; }
.recon-hint { color: var(--muted); font-size: 0.86rem; }
.paste-area { margin-bottom: 1.4rem; padding: 1.2rem; background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius); }
.paste-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; margin-bottom: 1rem; }
@media (max-width: 720px) { .paste-grid { grid-template-columns: 1fr; } }

.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1.8rem; }
@media (max-width: 820px) { .kpis { grid-template-columns: repeat(2, 1fr); } }
.kpi { background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem; }
.kpi.kpi-alert { background: var(--alert-soft); border-color: #e6c6bd; }
.kpi dt { font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); font-weight: 600; }
.kpi dd { margin: 0.4rem 0 0; font-family: var(--serif); font-size: 1.7rem; color: var(--ink); font-variant-numeric: tabular-nums; }
.kpi.kpi-alert dd { color: var(--alert); }

.chart-wrap { margin: 0 0 1.8rem; }
.chart-wrap figcaption { font-size: 0.88rem; color: var(--ink-soft); font-weight: 500; margin-bottom: 0.8rem; }
#chart { width: 100%; }
#chart svg { width: 100%; height: auto; display: block; }
.legend-row { display: flex; flex-wrap: wrap; gap: 1.2rem; margin-top: 0.7rem; }
.lg { font-size: 0.82rem; color: var(--ink-soft); display: inline-flex; align-items: center; gap: 0.4rem; }
.lg::before { content: ""; width: 12px; height: 12px; border-radius: 3px; }
.lg-observed::before { background: var(--navy-2); }
.lg-credited::before { background: #b9a77f; }
.lg-gap::before { background: var(--alert); }

.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.recon-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.recon-table th, .recon-table td { padding: 0.55rem 0.9rem; text-align: right; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
.recon-table th { position: sticky; top: 0; background: var(--paper-2); font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.recon-table th:first-child, .recon-table td:first-child { text-align: left; }
.recon-table tr.is-underpaid td { background: var(--alert-soft); }
.recon-table td.gap-pos { color: var(--alert); font-weight: 600; }
.recon-table tfoot td { font-weight: 700; border-top: 2px solid var(--ink); background: var(--paper-2); }

/* precedent + cta */
.precedent .prose p { max-width: 68ch; font-size: 1.08rem; }
.band-cta { background: var(--accent); border-bottom: none; text-align: center; }
.cta-inner { max-width: 60ch; margin: 0 auto; }
.band-cta h2 { color: #fff; margin: 0 auto 1rem; }
.band-cta p { color: #d8ede7; margin: 0 auto 2rem; max-width: 50ch; }
.band-cta .btn-primary { background: #fff; color: var(--accent-ink); }
.band-cta .btn-primary:hover { background: var(--paper); }

/* footer */
.site-foot { background: var(--navy); color: #aeb9c4; padding: 2rem 0; }
.foot-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.foot-brand { display: flex; align-items: center; gap: 0.6rem; color: #fff; font-family: var(--serif); font-size: 1.1rem; }
.foot-brand .brand-mark { background: rgba(255,255,255,0.12); }
.foot-note { margin: 0; font-size: 0.86rem; }

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
