@import url("https://fonts.googleapis.com/css2?family=Instrument+Sans:wght@400;500;600;700&family=Instrument+Serif:ital@0;1&family=JetBrains+Mono:wght@400;500&display=swap");

:root {
  --ink: #111111;
  --muted: #8a8a8a;
  --mid: #111111;
  --muted-2: #cfcfcf;
  --line: #e4e4e4;
  --line-soft: #efefef;
  --panel: #ffffff;
  --bg: #ffffff;
  --area: rgba(17, 17, 17, 0.06);
  --serif: "Instrument Serif", Georgia, serif;
  --sans: "Instrument Sans", "Helvetica Neue", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --page: 1080px;
  --pad: 38px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
}

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

a:hover {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

input,
select,
button {
  font: inherit;
  color: inherit;
}

/* —— Calculator (extracted from index.html) —— */

@media (max-width: 1040px) {
  html, body { overflow-y: auto; }
  [data-r="root"] { height: auto !important; min-height: 0 !important; overflow: visible !important; gap: 20px !important; }
  [data-r="cols"] { flex-direction: column; gap: 26px !important; }
  [data-r="main"] { order: 1; height: auto !important; }
  [data-r="side"] { order: 2; width: 100% !important; flex: 1 1 auto !important; min-width: 0 !important; height: auto !important; overflow: visible !important; border-right: 0 !important; border-top: 2px solid #111111; padding-right: 0 !important; padding-top: 22px; }
  [data-r="chart"] { min-height: 320px !important; }
}
@media (max-width: 720px) {
  [data-r="root"] { padding: 20px 16px 28px !important; }
  [data-r="masthead"] { flex-direction: column; align-items: flex-start; gap: 4px !important; }
  [data-r="masthead"] > div { flex-direction: column; align-items: flex-start; gap: 2px !important; }
  [data-r="masthead"] > span { display: none; }
  [data-r="heroRow"] { flex-direction: column; align-items: stretch; gap: 16px !important; }
  [data-r="controls"] { align-items: stretch !important; }
  [data-r="controls"] > div:first-child { justify-content: stretch; }
  [data-r="controls"] > div:first-child > button { flex: 1; }
  [data-r="controls"] > div:last-child { justify-content: flex-start !important; }
  [data-r="chart"] { min-height: 260px !important; }
  [data-r="scen"] { grid-template-columns: 1fr !important; }
  [data-r="summary"] { margin-top: 8px !important; }
}
@media (max-width: 420px) {
  [data-r="chart"] { min-height: 220px !important; }
}

/* —— Masthead (shared with the calculator’s editorial system) —— */

header {
  background: var(--panel);
  position: sticky;
  top: 0;
  z-index: 100;
}

.masthead {
  max-width: var(--page);
  margin: 0 auto;
  padding: 28px var(--pad) 14px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.logo {
  font-family: var(--serif);
  font-size: 42px;
  line-height: 0.95;
  letter-spacing: -0.025em;
  font-weight: 400;
  text-decoration: none;
}

.logo:hover {
  text-decoration: none;
}

.masthead > div {
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
}

.logo-tag,
.masthead-vol {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

nav {
  max-width: var(--page);
  margin: 0 auto;
  padding: 0 var(--pad) 18px;
  border-bottom: 2px solid var(--ink);
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  list-style: none;
  align-items: center;
}

.nav-links a {
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--ink);
  text-decoration: none;
}

.nav-links .calculator-btn {
  background: var(--ink);
  color: #fff;
  padding: 7px 15px;
  letter-spacing: 0.1em;
}

.nav-links .calculator-btn:hover {
  background: var(--ink);
  color: #fff;
  text-decoration: none;
}

/* —— Article pages —— */

main {
  max-width: var(--page);
  margin: 0 auto;
  padding: 48px var(--pad) 72px;
}

article {
  background: transparent;
  padding: 0;
}

.page-kicker {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}

h1 {
  font-family: var(--serif);
  font-size: clamp(36px, 5vw, 58px);
  font-weight: 400;
  line-height: 0.98;
  letter-spacing: -0.03em;
  margin-bottom: 1.4rem;
  color: var(--ink);
}

h2 {
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 400;
  letter-spacing: -0.02em;
  margin: 2.4rem 0 0.9rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--line);
  color: var(--ink);
}

h2:first-of-type {
  border-top: none;
  padding-top: 0;
  margin-top: 1.4rem;
}

h3 {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 400;
  letter-spacing: -0.01em;
  margin: 1.6rem 0 0.6rem;
  color: var(--ink);
}

p {
  margin-bottom: 1rem;
  color: #3a3a3a;
  line-height: 1.8;
}

article ul,
article ol {
  margin: 0 0 1rem 1.5rem;
  color: #3a3a3a;
}

article li {
  margin-bottom: 0.35rem;
  line-height: 1.75;
}

strong {
  font-weight: 600;
  color: var(--ink);
}

code {
  font-family: var(--mono);
  font-size: 0.88em;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}

th {
  font-size: 11.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--muted);
  text-align: left;
  padding: 0.9rem 0.75rem 0.9rem 0;
  border-bottom: 1px solid var(--ink);
  white-space: nowrap;
}

td {
  padding: 0.9rem 0.75rem 0.9rem 0;
  border-bottom: 1px solid var(--line);
  color: #444;
  font-family: var(--serif);
  font-size: 1.05rem;
}

tr:last-child td {
  border-bottom: none;
}

/* Callouts */

.highlight-box,
.insight-box,
.tip-box,
.scenario-box,
.result-highlight,
.cta-section {
  padding: 1.25rem 0;
  margin: 1.6rem 0;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  background: transparent;
  border-radius: 0;
  border-left: 0;
}

.highlight-box strong,
.insight-box strong,
.tip-box strong,
.cta-section h3,
.scenario-box h3 {
  display: block;
  margin-top: 0;
  margin-bottom: 0.45rem;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.result-highlight strong {
  display: block;
  margin-bottom: 0.2rem;
  color: var(--ink);
}

.cta-section {
  text-align: left;
}

.cta-button,
.btn-run {
  display: inline-block;
  background: var(--ink);
  color: #fff;
  padding: 10px 18px;
  margin-top: 0.85rem;
  border: 0;
  cursor: pointer;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
}

.cta-button:hover,
.btn-run:hover {
  background: var(--ink);
  color: #fff;
  text-decoration: none;
}

.content-links {
  margin: 2.4rem 0 0;
  padding: 1.4rem 0 0;
  border-top: 1px solid var(--line);
  background: transparent;
}

.content-links h4 {
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.85rem;
}

.content-links ul {
  list-style: none;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.content-links li {
  margin: 0;
}

.content-links a {
  display: inline-flex;
  align-items: center;
}

.content-links a::before {
  content: "→";
  margin-right: 0.55rem;
  color: var(--muted);
}

.faq-item {
  margin-bottom: 1.8rem;
  padding-bottom: 1.8rem;
  border-bottom: 1px solid var(--line);
}

.faq-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.faq-item > strong {
  display: block;
  margin-bottom: 0.7rem;
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--ink);
}

footer {
  max-width: var(--page);
  margin: 0 auto;
  padding: 28px var(--pad) 48px;
  border-top: 1px solid var(--ink);
  color: var(--muted);
  font-size: 0.9rem;
  text-align: left;
  background: transparent;
}

footer a {
  color: var(--ink);
}

.source-note,
.muted,
.fine-print {
  font-size: 0.9rem;
  color: var(--muted);
}

/* Historical tools */

.form-grid,
.stats-grid,
.dash-grid {
  display: grid;
  gap: 1px;
  background: var(--line);
  margin: 1.25rem 0 1.6rem;
}

@media (min-width: 768px) {
  .form-grid {
    grid-template-columns: 1fr 1fr;
  }

  .stats-grid,
  .dash-grid.cols-3 {
    grid-template-columns: 1fr 1fr 1fr;
  }

  .dash-grid.cols-2 {
    grid-template-columns: 1fr 1fr;
  }
}

.form-grid > div,
.stat-card,
.dash-card {
  background: var(--panel);
  padding: 16px 18px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

label {
  display: block;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 400;
  margin-bottom: 0.4rem;
}

input[type="number"],
select {
  width: 100%;
  padding: 0.35rem 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  font-size: 17px;
  letter-spacing: -0.01em;
}

input:focus,
select:focus {
  outline: none;
  border-bottom-color: var(--ink);
  box-shadow: none;
}

.chart-wrap {
  position: relative;
  height: 320px;
  margin: 1.25rem 0 2rem;
}

.stat-label,
.dash-card h3 {
  margin: 0;
  font-size: 11.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 400;
  font-family: var(--sans);
}

.stat-value,
.dash-value {
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.stat-sub,
.dash-delta {
  display: inline-block;
  margin-top: 0.35rem;
  font-size: 13px;
  color: var(--muted);
  background: transparent;
  padding: 0;
  border-radius: 0;
}

.dash-delta.down {
  color: var(--ink);
  background: transparent;
}

.tool-error {
  display: none;
  color: var(--ink);
  padding: 0.85rem 0;
  margin: 0.75rem 0;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}

.tool-error.visible {
  display: block;
}

.crash-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  margin: 1rem 0 1.5rem;
}

.crash-chip {
  border: 0;
  background: transparent;
  color: var(--ink);
  padding: 0;
  min-width: 0;
  border-radius: 0;
}

.crash-chip strong {
  display: block;
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 400;
}

.crash-chip span {
  font-family: var(--serif);
  font-size: 22px;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: end;
  margin: 1rem 0;
}

.filter-row label {
  margin-bottom: 0.25rem;
}

#dcaWinner {
  font-weight: 600;
  color: var(--ink);
}

/* —— Below-fold homepage links —— */

.below-fold-placeholder {
  width: min(1388px, 100%);
  margin: 0 auto;
  height: 100vh;
  min-height: 700px;
  padding: 34px clamp(18px, 2.7vw, 38px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-family: var(--serif);
  box-sizing: border-box;
}

.below-fold-placeholder-masthead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--ink);
}

.below-fold-placeholder-note {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.below-fold {
  width: min(1388px, 100%);
  margin: 0 auto;
  padding: 0 clamp(18px, 2.7vw, 38px) 56px;
  box-sizing: border-box;
}

.below-fold .content-links {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.below-fold-cols {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 32px 24px;
  align-items: start;
  padding-top: 28px;
  border-top: 2px solid var(--ink);
}

.below-fold-col-center {
  text-align: center;
}

.below-fold-col-center .content-links ul {
  align-items: center;
}

.below-fold-col-center .content-links a {
  justify-content: center;
}

.below-fold-col-right {
  text-align: right;
}

.below-fold-disclaimer h4 {
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.85rem;
}

.below-fold-disclaimer p {
  margin: 0 0 0 auto;
  max-width: 28ch;
  font-size: 13px;
  line-height: 1.65;
  color: var(--muted);
}

@media (max-width: 1040px) {
  .below-fold-cols {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .below-fold-col-center,
  .below-fold-col-right {
    text-align: left;
  }

  .below-fold-col-center .content-links ul {
    align-items: flex-start;
  }

  .below-fold-col-center .content-links a {
    justify-content: flex-start;
  }

  .below-fold-disclaimer p {
    margin-left: 0;
    max-width: none;
  }
}

@media (max-width: 768px) {
  :root {
    --pad: 20px;
  }

  .below-fold-cols {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .masthead {
    padding-top: 22px;
  }

  .logo {
    font-size: 34px;
  }

  .logo-tag {
    width: 100%;
  }

  .nav-links {
    gap: 10px 16px;
  }

  h1 {
    font-size: 34px;
  }

  h2 {
    font-size: 24px;
  }

  main {
    padding: 32px var(--pad) 56px;
  }

  .chart-wrap {
    height: 260px;
  }

  th,
  td {
    padding: 0.7rem 0.5rem 0.7rem 0;
  }
}
