/* NetReal — money math, after inflation */

:root {
  --paper:     #fbfbf9;
  --surface:   #ffffff;
  --sunk:      #f2f3f0;
  --ink:       #14170f;
  --ink-soft:  #4c5347;
  --ink-faint: #7f8779;
  --rule:      #dcded6;
  --rule-soft: #eaece5;

  --green:     #1c6b4b;
  --green-bg:  #e3efe8;
  --clay:      #9c4321;
  --clay-bg:   #f6e8e1;
  --gold:      #8a6a12;

  --display: "Instrument Serif", Georgia, "Times New Roman", serif;
  --ui: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --wrap: 1080px;
  --text: 680px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper:     #101208;
    --surface:   #181b12;
    --sunk:      #1f2318;
    --ink:       #eceee5;
    --ink-soft:  #a9b09f;
    --ink-faint: #7c8474;
    --rule:      #2f3427;
    --rule-soft: #252a1e;
    --green:     #6cc79b;
    --green-bg:  #17301f;
    --clay:      #e0917a;
    --clay-bg:   #341b12;
    --gold:      #d4ae5c;
  }
}

:root[data-theme="dark"] {
  --paper:     #101208;
  --surface:   #181b12;
  --sunk:      #1f2318;
  --ink:       #eceee5;
  --ink-soft:  #a9b09f;
  --ink-faint: #7c8474;
  --rule:      #2f3427;
  --rule-soft: #252a1e;
  --green:     #6cc79b;
  --green-bg:  #17301f;
  --clay:      #e0917a;
  --clay-bg:   #341b12;
  --gold:      #d4ae5c;
}

* { box-sizing: border-box; }

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

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

.wrap { max-width: var(--wrap); margin: 0 auto; padding-inline: 20px; }
.narrow { max-width: var(--text); }

a { color: var(--green); text-underline-offset: 2px; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--green); outline-offset: 2px; border-radius: 2px;
}

/* ---------------- header ---------------- */

.masthead {
  border-bottom: 1px solid var(--rule);
  background: var(--surface);
  position: sticky; top: 0; z-index: 40;
}
.masthead .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding-block: 13px; flex-wrap: wrap;
}
.brand {
  display: inline-flex; align-items: baseline; gap: 8px;
  font-family: var(--display); font-size: 25px; letter-spacing: -0.01em;
  color: var(--ink); text-decoration: none; line-height: 1;
}
.brand b { font-weight: 400; }
.brand .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); display: inline-block; }
nav.top { display: flex; gap: 22px; flex-wrap: wrap; }
nav.top a {
  font-size: 14px; font-weight: 500; color: var(--ink-soft); text-decoration: none;
}
nav.top a:hover, nav.top a[aria-current="page"] { color: var(--green); }

/* ---------------- type ---------------- */

h1 {
  font-family: var(--display); font-weight: 400;
  font-size: clamp(2.3rem, 6.2vw, 3.6rem); line-height: 1.03;
  letter-spacing: -0.015em; text-wrap: balance; margin: 0 0 16px;
}
h2 {
  font-family: var(--display); font-weight: 400;
  font-size: clamp(1.6rem, 3.6vw, 2.1rem); line-height: 1.15;
  letter-spacing: -0.01em; text-wrap: balance; margin: 0 0 12px;
}
h3 {
  font-size: 16px; font-weight: 600; margin: 0 0 8px; letter-spacing: -0.005em;
}
p { margin: 0 0 16px; max-width: var(--text); }
.lede { font-size: 19px; line-height: 1.55; color: var(--ink-soft); max-width: 62ch; }

.eyebrow {
  font-family: var(--mono); font-size: 11px; font-weight: 500;
  letter-spacing: .14em; text-transform: uppercase; color: var(--ink-faint);
  margin: 0 0 12px;
}

section { padding-block: 56px; }
section.tight { padding-block: 34px; }
.rule-top { border-top: 1px solid var(--rule); }

/* ---------------- calculator ---------------- */

.calc {
  display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr);
  gap: 0; border: 1px solid var(--rule); background: var(--surface);
  border-radius: 3px; overflow: hidden; margin-block: 28px;
}
@media (max-width: 800px) { .calc { grid-template-columns: 1fr; } }

.calc .inputs {
  padding: 24px; background: var(--sunk); border-right: 1px solid var(--rule);
  display: flex; flex-direction: column; gap: 18px;
}
@media (max-width: 800px) {
  .calc .inputs { border-right: 0; border-bottom: 1px solid var(--rule); }
}
.calc .output { padding: 26px 24px; display: flex; flex-direction: column; gap: 22px; min-width: 0; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label {
  font-size: 12px; font-weight: 600; letter-spacing: .03em;
  text-transform: uppercase; color: var(--ink-soft);
}
.field .hint { font-size: 12px; color: var(--ink-faint); line-height: 1.45; }
.inputline { display: flex; align-items: stretch; }
.inputline .pre, .inputline .post {
  display: flex; align-items: center; padding: 0 9px;
  background: var(--surface); border: 1px solid var(--rule);
  font-family: var(--mono); font-size: 13px; color: var(--ink-faint);
}
.inputline .pre { border-right: 0; border-radius: 2px 0 0 2px; }
.inputline .post { border-left: 0; border-radius: 0 2px 2px 0; }
.field input[type="number"], .field select {
  flex: 1; min-width: 0; width: 100%;
  font-family: var(--mono); font-size: 15px; font-variant-numeric: tabular-nums;
  padding: 9px 10px; border: 1px solid var(--rule); background: var(--surface);
  color: var(--ink); border-radius: 2px;
}
.inputline input[type="number"] { border-radius: 0; }
.inputline .pre + input { border-radius: 0 2px 2px 0; }
.inputline input + .post { border-radius: 0 2px 2px 0; }
.inputline .pre + input:has(+ .post) { border-radius: 0; }
.field input[type="range"] { width: 100%; accent-color: var(--green); }

/* headline results */

.result-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--rule); border: 1px solid var(--rule); border-radius: 3px; overflow: hidden; }
@media (max-width: 520px) { .result-pair { grid-template-columns: 1fr; } }
.result {
  background: var(--surface); padding: 18px 18px 16px;
  display: flex; flex-direction: column; gap: 3px;
}
.result .k {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--ink-faint);
}
.result .v {
  font-family: var(--mono); font-size: clamp(1.5rem, 4.2vw, 2rem); font-weight: 500;
  font-variant-numeric: tabular-nums; letter-spacing: -0.02em; line-height: 1.1;
}
.result .sub { font-size: 12.5px; color: var(--ink-faint); line-height: 1.4; }
.result.real { background: var(--green-bg); }
.result.real .v { color: var(--green); }
.result.real .k { color: var(--green); }

.breakdown { border-top: 1px solid var(--rule-soft); }
.breakdown .row {
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  padding: 9px 0; border-bottom: 1px solid var(--rule-soft); font-size: 14px;
}
.breakdown .row .lab { color: var(--ink-soft); }
.breakdown .row .val { font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.breakdown .row.total { font-weight: 600; }
.breakdown .row .val.neg { color: var(--clay); }

.chart-box { width: 100%; }
.chart-box svg { display: block; width: 100%; height: auto; max-width: 100%; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 12.5px; color: var(--ink-soft); margin-top: 8px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 11px; height: 11px; border-radius: 2px; display: inline-block; }

/* ---------------- cards / grids ---------------- */

.grid { display: grid; gap: 1px; background: var(--rule); border: 1px solid var(--rule); border-radius: 3px; overflow: hidden; }
.grid.c3 { grid-template-columns: repeat(3, 1fr); }
.grid.c2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 860px) { .grid.c3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .grid.c3, .grid.c2 { grid-template-columns: 1fr; } }

a.tool {
  background: var(--surface); padding: 20px; text-decoration: none; color: inherit;
  display: flex; flex-direction: column; gap: 7px; min-height: 100%;
}
a.tool:hover { background: var(--green-bg); }
a.tool .name { font-size: 16px; font-weight: 600; color: var(--ink); }
a.tool:hover .name { color: var(--green); }
a.tool .desc { font-size: 13.5px; color: var(--ink-soft); line-height: 1.5; margin: 0; }
a.tool .tagrow { margin-top: auto; padding-top: 10px; }

.pill {
  display: inline-block; font-family: var(--mono); font-size: 10px; font-weight: 500;
  letter-spacing: .08em; text-transform: uppercase; padding: 3px 7px; border-radius: 2px;
  background: var(--sunk); color: var(--ink-faint);
}
.pill.live { background: var(--green-bg); color: var(--green); }
.pill.soon { background: var(--clay-bg); color: var(--clay); }

/* ---------------- notes ---------------- */

.note {
  border-left: 3px solid var(--green); background: var(--green-bg);
  padding: 15px 17px; margin: 24px 0; border-radius: 0 3px 3px 0;
}
.note p { margin: 0; max-width: none; font-size: 14.5px; }
.note .lbl {
  display: block; font-family: var(--mono); font-size: 10.5px; font-weight: 600;
  letter-spacing: .09em; text-transform: uppercase; color: var(--green); margin-bottom: 5px;
}
.note.warn { border-left-color: var(--clay); background: var(--clay-bg); }
.note.warn .lbl { color: var(--clay); }

.method {
  border: 1px solid var(--rule); border-radius: 3px; background: var(--surface);
  padding: 20px 22px; margin: 28px 0;
}
.method h3 { margin-bottom: 10px; }
.method p, .method li { font-size: 14.5px; color: var(--ink-soft); }
.method code {
  font-family: var(--mono); font-size: 13px; background: var(--sunk);
  padding: 2px 5px; border-radius: 2px; color: var(--ink);
}
.method ul { margin: 0; padding-left: 20px; }
.method li { margin-bottom: 6px; }

/* prose */
.prose h2 { margin-top: 40px; }
.prose h3 { margin-top: 26px; font-size: 17px; }
.prose ul, .prose ol { max-width: var(--text); padding-left: 22px; }
.prose li { margin-bottom: 8px; }
.prose table { width: 100%; border-collapse: collapse; font-size: 14.5px; margin: 20px 0; }
.prose th, .prose td { text-align: left; padding: 10px 14px 10px 0; border-bottom: 1px solid var(--rule-soft); vertical-align: top; }
.prose thead th {
  font-family: var(--mono); font-size: 10.5px; font-weight: 500; letter-spacing: .08em;
  text-transform: uppercase; color: var(--ink-faint); border-bottom: 1px solid var(--rule);
}
.tw { overflow-x: auto; }
.tw table { min-width: 460px; }

/* ---------------- footer ---------------- */

footer.site {
  border-top: 1px solid var(--rule); background: var(--surface); margin-top: 70px;
  padding-block: 40px 48px;
}
footer.site .cols { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 32px; }
@media (max-width: 720px) { footer.site .cols { grid-template-columns: 1fr; gap: 26px; } }
footer.site h4 {
  font-family: var(--mono); font-size: 10.5px; font-weight: 500; letter-spacing: .1em;
  text-transform: uppercase; color: var(--ink-faint); margin: 0 0 11px;
}
footer.site ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
footer.site a { font-size: 14px; color: var(--ink-soft); text-decoration: none; }
footer.site a:hover { color: var(--green); }
footer.site .fine {
  margin-top: 32px; padding-top: 18px; border-top: 1px solid var(--rule-soft);
  font-size: 12.5px; color: var(--ink-faint); line-height: 1.6; max-width: 78ch;
}

/* ad slots — reserved space to avoid layout shift */
.adslot {
  margin: 34px auto; display: block; text-align: center; min-height: 90px;
  border: 1px dashed var(--rule); border-radius: 3px; color: var(--ink-faint);
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase;
  display: flex; align-items: center; justify-content: center;
}
