:root {
  --ink: #18212b;
  --muted: #5b6876;
  --line: #d8e1e8;
  --paper: #ffffff;
  --soft: #f4f7f6;
  --teal: #0b7268;
  --green: #2b8a3e;
  --blue: #275f9f;
  --gold: #b77a24;
  --shadow: 0 18px 50px rgba(24, 33, 43, 0.13);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.5;
}

a {
  color: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
  padding: 0 5vw;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

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

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: white;
  background: var(--teal);
  border-radius: 8px;
  font-size: 0.82rem;
  letter-spacing: 0;
}

.nav {
  display: flex;
  gap: 1.25rem;
  color: var(--muted);
  font-size: 0.94rem;
}

.nav a,
.site-footer a {
  text-decoration: none;
}

.nav a:hover,
.site-footer a:hover {
  color: var(--teal);
}

.hero {
  position: relative;
  min-height: 78vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: url("assets/finance-workspace-hero.png") center right / cover no-repeat;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 86px;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0), white);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.96) 0%, rgba(255, 255, 255, 0.84) 43%, rgba(255, 255, 255, 0.12) 78%);
}

.hero-inner {
  position: relative;
  z-index: 1;
  width: min(680px, 90vw);
  padding: 7rem 0 8rem 5vw;
}

.eyebrow {
  margin: 0 0 0.75rem;
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

h1 {
  margin: 0;
  font-size: clamp(3.4rem, 9vw, 6.8rem);
  line-height: 0.92;
  letter-spacing: 0;
}

h2 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1;
  letter-spacing: 0;
}

h3 {
  margin: 0;
  font-size: 1.25rem;
  letter-spacing: 0;
}

.hero-copy {
  max-width: 590px;
  margin: 1.2rem 0 1.8rem;
  color: #344251;
  font-size: 1.12rem;
}

.hero-actions,
.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0.78rem 1.05rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 800;
  text-decoration: none;
}

.button.primary {
  color: white;
  border-color: var(--teal);
  background: var(--teal);
}

.button.secondary {
  background: white;
}

.trust-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.trust-strip span {
  padding: 1rem;
  text-align: center;
  background: white;
  font-weight: 700;
  color: #3a4653;
}

.section {
  padding: 5rem 5vw;
}

.section.tinted {
  background: var(--soft);
}

.section-heading {
  max-width: 820px;
  margin-bottom: 2rem;
}

.section-heading p:not(.eyebrow) {
  color: var(--muted);
  font-size: 1.05rem;
}

.calculator-layout {
  display: grid;
  grid-template-columns: minmax(190px, 260px) 1fr;
  gap: 1.25rem;
  align-items: start;
}

.tool-tabs {
  display: grid;
  gap: 0.45rem;
}

.tab {
  min-height: 44px;
  padding: 0.65rem 0.85rem;
  color: var(--ink);
  text-align: left;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
}

.tab.active {
  color: white;
  background: var(--teal);
  border-color: var(--teal);
}

.tool-panel {
  min-height: 440px;
}

.calculator {
  display: none;
  padding: 1.4rem;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.calculator.active {
  display: block;
}

.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.pill {
  flex: 0 0 auto;
  padding: 0.35rem 0.55rem;
  color: white;
  background: var(--blue);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

label {
  display: grid;
  gap: 0.4rem;
  color: #2d3844;
  font-weight: 700;
}

input {
  width: 100%;
  min-height: 44px;
  padding: 0.65rem 0.7rem;
  color: var(--ink);
  background: #fbfcfd;
  border: 1px solid #bcc9d4;
  border-radius: 8px;
  font: inherit;
}

.result {
  margin-top: 1.25rem;
  padding: 1rem;
  background: #eef7f5;
  border: 1px solid #b9ded8;
  border-radius: 8px;
}

.result strong {
  display: block;
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1.05;
  color: var(--teal);
}

.result p {
  margin: 0.45rem 0 0;
  color: #405060;
}

.ad-band {
  margin: 0 5vw 2rem;
  padding: 1.4rem;
  text-align: center;
  color: #5d6570;
  background: repeating-linear-gradient(135deg, #f2f5f7, #f2f5f7 10px, #e9eef2 10px, #e9eef2 20px);
  border: 1px dashed #aeb9c4;
  border-radius: 8px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.content-card {
  padding: 1.2rem;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.content-card p,
.article-list p,
.glossary dd,
.site-footer p,
.cta p {
  color: var(--muted);
}

.content-card a {
  color: var(--teal);
  font-weight: 800;
}

.article-list {
  display: grid;
  gap: 1rem;
}

.article-list article {
  padding: 1rem 0;
  border-top: 1px solid var(--line);
}

.article-list span {
  color: var(--gold);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.article-list a {
  display: inline-block;
  margin-top: 0.45rem;
  color: var(--teal);
  font-weight: 800;
}

.legal {
  max-width: 960px;
}

.legal h1 {
  font-size: clamp(2.8rem, 7vw, 5.2rem);
}

.legal h2,
.guide-body h2 {
  margin-top: 2rem;
  font-size: clamp(1.55rem, 4vw, 2.25rem);
}

.guide-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(260px, 0.8fr);
  gap: 2rem;
}

.guide-body {
  max-width: 820px;
}

.guide-body > p:first-of-type {
  font-size: 1.08rem;
  color: #344251;
}

.guide-body li {
  margin-bottom: 0.45rem;
}

.formula-box,
.example-box,
.note-box,
.faq-block {
  margin: 1.25rem 0;
  padding: 1rem;
  border-radius: 8px;
}

.formula-box {
  background: #eef7f5;
  border: 1px solid #b9ded8;
}

.example-box {
  background: #fff8ed;
  border: 1px solid #ecd2a9;
}

.note-box {
  background: #f4f7f6;
  border: 1px solid var(--line);
}

.faq-block {
  background: white;
  border: 1px solid var(--line);
}

.formula-box strong,
.example-box strong,
.note-box strong,
.faq-block strong {
  display: block;
  margin-bottom: 0.35rem;
}

.guide-body table {
  width: 100%;
  margin: 1.25rem 0;
  border-collapse: collapse;
  background: white;
  border: 1px solid var(--line);
}

.guide-body th,
.guide-body td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.guide-body th {
  background: var(--soft);
}

.side-box {
  align-self: start;
  padding: 1.1rem;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.side-box ul {
  padding-left: 1.1rem;
}

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

.glossary div {
  padding: 1rem;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.glossary dt {
  font-weight: 800;
}

.glossary dd {
  margin: 0.25rem 0 0;
}

.cta {
  padding: 4rem 5vw;
  color: white;
  background: #17313b;
}

.cta p {
  max-width: 680px;
  color: #d8e8e8;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 2rem 5vw;
  border-top: 1px solid var(--line);
}

.site-footer p {
  max-width: 620px;
  margin: 0.35rem 0 0;
}

@media (max-width: 850px) {
  .site-header,
  .site-footer {
    align-items: flex-start;
    flex-direction: column;
    padding-top: 0.9rem;
    padding-bottom: 0.9rem;
  }

  .nav {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 0.25rem;
  }

  .hero {
    min-height: 72vh;
    background-position: 60% center;
  }

  .hero-overlay {
    background: rgba(255, 255, 255, 0.84);
  }

  .hero-inner {
    padding: 4rem 5vw 6rem;
  }

  .trust-strip,
  .calculator-layout,
  .card-grid,
  .glossary,
  .guide-layout {
    grid-template-columns: 1fr;
  }

  .tool-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 480px) {
  .tool-tabs {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 3.15rem;
  }

  .panel-title {
    align-items: flex-start;
    flex-direction: column;
  }
}
