:root {
  color-scheme: light;
  --ink: #17201b;
  --muted: #5d6861;
  --paper: #f5f7f2;
  --panel: #ffffff;
  --line: #d9ded6;
  --green: #1f6b4f;
  --green-strong: #104a37;
  --amber: #c98d20;
  --blue: #2f5d7c;
  --shadow: 0 20px 60px rgba(23, 32, 27, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

a {
  color: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px clamp(18px, 4vw, 56px);
  background: rgba(245, 247, 242, 0.9);
  border-bottom: 1px solid rgba(217, 222, 214, 0.75);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 7px;
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  letter-spacing: 0;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(12px, 3vw, 28px);
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.nav a {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.hero {
  position: relative;
  min-height: min(760px, calc(100vh - 40px));
  display: grid;
  align-items: end;
  overflow: hidden;
  background: #17201b;
}

.hero-media {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(12, 18, 15, 0.82) 0%, rgba(12, 18, 15, 0.58) 42%, rgba(12, 18, 15, 0.16) 100%),
    url("https://images.unsplash.com/photo-1503376780353-7e6692767b70?auto=format&fit=crop&w=2200&q=82") center / cover;
  transform: scale(1.02);
}

.hero-copy {
  position: relative;
  width: min(760px, calc(100% - 36px));
  margin: 0 0 clamp(72px, 12vh, 150px) clamp(18px, 7vw, 96px);
  color: #fff;
}

.page-hero {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
  padding: clamp(70px, 11vw, 130px) 0 42px;
}

.page-hero h1 {
  max-width: 820px;
  margin: 0;
  font-size: clamp(46px, 8vw, 92px);
  line-height: 0.95;
  letter-spacing: 0;
}

.page-hero p:not(.eyebrow) {
  max-width: 760px;
  margin: 20px 0 0;
  color: var(--muted);
  font-size: clamp(18px, 2vw, 23px);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--amber);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 11ch;
  margin: 0;
  font-size: clamp(54px, 9vw, 112px);
  line-height: 0.92;
  letter-spacing: 0;
}

.hero p:not(.eyebrow) {
  max-width: 630px;
  margin: 22px 0 0;
  color: rgba(255, 255, 255, 0.88);
  font-size: clamp(18px, 2.1vw, 24px);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 0 18px;
  font-weight: 850;
  text-decoration: none;
}

.button.primary {
  background: #fff;
  color: var(--ink);
}

.button.secondary {
  border-color: rgba(255, 255, 255, 0.5);
  color: #fff;
}

.metrics,
.tool-section,
.compare-section,
.guide-section,
.checklist-section,
.faq-section,
.glossary-section,
.red-flags,
.sources {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin-top: -38px;
  position: relative;
  z-index: 2;
  background: var(--line);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.metrics article {
  min-height: 190px;
  padding: 26px;
  background: var(--panel);
}

.metrics span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: #e7efe7;
  color: var(--green-strong);
  font-weight: 900;
}

h2,
h3,
p {
  overflow-wrap: anywhere;
}

.metrics h2,
.offer h3,
.guide-list h3 {
  margin: 22px 0 8px;
  font-size: 21px;
}

.metrics p,
.offer p,
.guide-list p,
.sources p {
  margin: 0;
  color: var(--muted);
}

.tool-section,
.compare-section,
.guide-section,
.checklist-section,
.faq-section,
.glossary-section,
.red-flags,
.sources {
  padding-top: clamp(72px, 10vw, 118px);
}

.section-heading {
  max-width: 760px;
  margin-bottom: 28px;
}

.section-heading h2,
.red-flags h2 {
  margin: 0;
  font-size: clamp(34px, 5vw, 60px);
  line-height: 1;
  letter-spacing: 0;
}

.section-heading p:not(.eyebrow) {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 18px;
}

.tool-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.65fr);
  gap: 18px;
  align-items: stretch;
}

.calculator,
.results,
.offer,
.guide-list article,
.page-card,
.faq-grid article,
.glossary div,
.checklist,
.red-flags {
  border: 1px solid var(--line);
  background: var(--panel);
}

.calculator {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-content: start;
  padding: 24px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.calc-field {
  min-height: 132px;
  grid-template-rows: 18px 46px minmax(34px, auto);
  align-items: start;
  padding: 14px;
  border: 1px solid #e2e6de;
  border-radius: 7px;
  background: #fbfcfa;
}

.calc-field > span:first-child {
  color: var(--ink);
  font-size: 13px;
  line-height: 18px;
}

.calc-field-wide {
  grid-column: 1 / -1;
}

.calculator small {
  color: #6d7870;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.35;
}

input,
select {
  width: 100%;
  min-height: 46px;
  border: 1px solid #c8d0c7;
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  font-weight: 750;
  padding: 0 12px;
}

input::placeholder {
  color: #9aa49d;
}

.field-box {
  position: relative;
  display: block;
  height: 46px;
}

.field-box::before,
.field-box::after {
  position: absolute;
  top: 50%;
  z-index: 1;
  color: var(--muted);
  font-size: 16px;
  font-weight: 900;
  transform: translateY(-50%);
  pointer-events: none;
}

.field-box.money::before {
  content: "$";
  left: 13px;
}

.field-box.percent::after {
  content: "%";
  right: 13px;
}

.field-box.money input {
  padding-left: 30px;
}

.field-box.percent input {
  padding-right: 34px;
}

input:focus,
select:focus,
.nav a:focus,
.button:focus {
  outline: 3px solid rgba(201, 141, 32, 0.35);
  outline-offset: 3px;
}

.results {
  display: grid;
  gap: 18px;
  padding: 24px;
  color: var(--muted);
}

.results strong {
  display: block;
  color: var(--green-strong);
  font-size: clamp(42px, 6vw, 72px);
  line-height: 1;
}

.result-pair {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.result-pair.single {
  grid-template-columns: 1fr;
}

.result-pair span {
  min-height: 92px;
  display: grid;
  align-content: center;
  gap: 6px;
  padding: 14px;
  border-radius: 7px;
  background: #f3f6f1;
  font-size: 13px;
  font-weight: 800;
}

.result-pair b {
  color: var(--ink);
  font-size: 22px;
}

.accuracy-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.timeline-panel {
  margin-top: 18px;
  padding: 24px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.timeline-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.timeline-heading h3 {
  margin: 0;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.05;
}

.timeline-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.timeline-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.timeline-legend i {
  width: 13px;
  height: 13px;
  border-radius: 3px;
}

.legend-principal,
.bar-principal {
  background: var(--green);
}

.legend-interest,
.bar-interest {
  background: var(--amber);
}

.timeline-bars {
  display: grid;
  gap: 14px;
}

.empty-timeline {
  margin: 0;
  padding: 16px;
  border: 1px dashed #c8d0c7;
  border-radius: 7px;
  color: var(--muted);
  font-weight: 750;
}

.timeline-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}

.timeline-summary span {
  display: grid;
  gap: 6px;
  min-height: 84px;
  align-content: center;
  padding: 14px;
  border-radius: 7px;
  background: #f3f6f1;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.timeline-summary b {
  color: var(--ink);
  font-size: 24px;
}

.timeline-year {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 14px;
  align-items: center;
}

.timeline-year-label {
  display: grid;
  gap: 2px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.timeline-year-label b {
  color: var(--ink);
  font-size: 15px;
}

.stacked-bar {
  display: flex;
  width: 100%;
  height: 28px;
  overflow: hidden;
  border-radius: 7px;
  background: #edf2eb;
}

.stacked-bar span {
  min-width: 2px;
}

.timeline-table-wrap {
  overflow-x: auto;
  margin-top: 22px;
}

.timeline-table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
}

.timeline-table th,
.timeline-table td {
  padding: 13px;
  border: 1px solid var(--line);
  text-align: left;
}

.timeline-table th {
  background: #edf2eb;
  color: var(--ink);
  font-size: 13px;
}

.timeline-table td {
  color: var(--muted);
  font-weight: 750;
}

.offer-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.offer {
  padding: 24px;
}

.offer ul,
.red-flags ul {
  display: grid;
  gap: 10px;
  margin: 18px 0 0;
  padding-left: 20px;
  color: var(--muted);
}

.guide-list {
  display: grid;
  gap: 12px;
}

.guide-list article {
  display: grid;
  grid-template-columns: 0.38fr 1fr;
  gap: 24px;
  padding: 24px;
}

.guide-list h3 {
  margin: 0;
}

.page-card-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.page-card {
  display: grid;
  align-content: start;
  gap: 12px;
  min-height: 230px;
  padding: 22px;
  color: inherit;
  text-decoration: none;
}

.page-card span {
  color: var(--green);
  font-size: 13px;
  font-weight: 950;
}

.page-card h3 {
  margin: 0;
  font-size: 20px;
  line-height: 1.1;
}

.page-card p {
  margin: 0;
  color: var(--muted);
}

.page-card:hover {
  border-color: var(--green);
}

.checklist {
  display: grid;
  gap: 1px;
  background: var(--line);
}

.checklist label {
  min-height: 58px;
  display: grid;
  grid-template-columns: 22px 1fr;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  background: var(--panel);
  color: var(--ink);
  font-size: 16px;
  font-weight: 750;
}

.checklist input {
  min-height: 20px;
  accent-color: var(--green);
}

.faq-grid,
.glossary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.faq-grid article,
.glossary div {
  padding: 24px;
}

.faq-grid h3,
.glossary dt {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 20px;
  font-weight: 900;
}

.faq-grid p,
.glossary dd {
  margin: 0;
  color: var(--muted);
}

.glossary {
  margin: 0;
}

.red-flags {
  display: grid;
  grid-template-columns: 0.8fr 1fr;
  gap: 24px;
  padding: 34px;
  margin-top: clamp(72px, 10vw, 118px);
  border-color: #e5c98d;
  background: #fffaf0;
}

.red-flags ul {
  margin: 0;
  color: #5b4520;
  font-weight: 750;
}

.sources {
  padding-bottom: 72px;
}

.article-layout {
  width: min(1180px, calc(100% - 36px));
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 42px;
  margin: 0 auto;
  padding-bottom: 80px;
}

.article-nav {
  position: sticky;
  top: 92px;
  align-self: start;
  display: grid;
  gap: 8px;
  padding: 18px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.article-nav a {
  color: var(--muted);
  font-size: 14px;
  font-weight: 850;
  text-decoration: none;
}

.article-nav a:hover {
  color: var(--green-strong);
}

.article-content {
  display: grid;
  gap: 16px;
}

.article-section {
  padding: 28px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.article-section h2 {
  margin: 0 0 10px;
  font-size: clamp(28px, 3vw, 40px);
  line-height: 1.05;
}

.article-section h3 {
  margin: 24px 0 8px;
  font-size: 21px;
}

.article-section p,
.article-section li,
.article-section dd {
  color: var(--muted);
}

.article-section p {
  margin: 0 0 14px;
}

.article-section p:last-child {
  margin-bottom: 0;
}

.article-section ul,
.article-section ol {
  display: grid;
  gap: 10px;
  margin: 14px 0 0;
  padding-left: 22px;
}

.term-list {
  display: grid;
  gap: 1px;
  margin: 0;
  background: var(--line);
  border: 1px solid var(--line);
}

.term-list div {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 18px;
  padding: 20px;
  background: var(--panel);
}

.term-list dt {
  color: var(--ink);
  font-weight: 950;
}

.term-list dd {
  margin: 0;
}

.comparison-table {
  display: block;
  overflow-x: auto;
  width: 100%;
  border-collapse: collapse;
  background: var(--panel);
}

.comparison-table th,
.comparison-table td {
  padding: 15px;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.comparison-table th {
  background: #edf2eb;
}

.sources h2 {
  margin: 0 0 10px;
  font-size: 24px;
}

.sources a {
  color: var(--blue);
  font-weight: 800;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 26px clamp(18px, 4vw, 56px);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-weight: 800;
}

@media (max-width: 840px) {
  .site-header {
    position: static;
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
  }

  .hero {
    min-height: 680px;
  }

  .hero-copy {
    width: min(680px, calc(100% - 36px));
    margin: 0 auto 74px;
  }

  .metrics,
  .tool-grid,
  .offer-grid,
  .page-card-grid,
  .article-layout,
  .term-list div,
  .guide-list article,
  .faq-grid,
  .glossary,
  .red-flags {
    grid-template-columns: 1fr;
  }

  .metrics {
    margin-top: 0;
    width: 100%;
    border-left: 0;
    border-right: 0;
    box-shadow: none;
  }

  .calculator {
    grid-template-columns: 1fr;
  }

  .page-card {
    min-height: auto;
  }

  .article-nav {
    position: static;
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 12px;
    scrollbar-width: thin;
  }

  .article-nav a {
    flex: 0 0 auto;
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #fbfcfa;
  }

  .timeline-heading,
  .timeline-summary,
  .timeline-year {
    grid-template-columns: 1fr;
  }

  .timeline-heading {
    align-items: start;
  }
}

@media (max-width: 520px) {
  .site-header {
    padding: 12px 14px;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
  }

  .nav {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .nav a {
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.62);
    font-size: 13px;
  }

  .hero {
    min-height: 620px;
  }

  .hero-media {
    background:
      linear-gradient(180deg, rgba(12, 18, 15, 0.44) 0%, rgba(12, 18, 15, 0.9) 76%),
      url("https://images.unsplash.com/photo-1503376780353-7e6692767b70?auto=format&fit=crop&w=1200&q=78") center / cover;
  }

  .hero h1 {
    max-width: 10ch;
    font-size: 44px;
    line-height: 0.96;
  }

  .hero p:not(.eyebrow) {
    font-size: 17px;
  }

  .hero-copy {
    margin-bottom: 48px;
  }

  .hero-actions,
  .button,
  .footer {
    width: 100%;
  }

  .footer {
    flex-direction: column;
  }

  .result-pair {
    grid-template-columns: 1fr;
  }

  .metrics,
  .tool-section,
  .compare-section,
  .guide-section,
  .checklist-section,
  .faq-section,
  .glossary-section,
  .red-flags,
  .sources,
  .article-layout,
  .page-hero {
    width: min(100% - 28px, 1180px);
  }

  .metrics article,
  .calculator,
  .results,
  .timeline-panel,
  .offer,
  .faq-grid article,
  .glossary div,
  .article-section {
    padding: 18px;
  }

  .section-heading h2,
  .red-flags h2 {
    font-size: 32px;
    line-height: 1.04;
  }

  .section-heading p:not(.eyebrow) {
    font-size: 16px;
  }

  .page-hero {
    padding: 46px 0 28px;
  }

  .page-hero h1 {
    font-size: 40px;
    line-height: 1;
  }

  .page-hero p:not(.eyebrow) {
    font-size: 17px;
  }

  .calc-field {
    min-height: auto;
  }

  .results strong {
    font-size: 44px;
  }

  .timeline-summary b,
  .result-pair b {
    font-size: 20px;
  }

  .checklist label {
    align-items: start;
    font-size: 15px;
  }

  .red-flags {
    padding: 22px;
  }

  .footer {
    padding: 22px 14px;
  }
}
