:root {
  color-scheme: light;
  --ink: #102a2f;
  --muted: #587078;
  --line: #d9e5e8;
  --paper: #ffffff;
  --wash: #f3f8f7;
  --teal: #0f766e;
  --blue: #2563eb;
  --amber: #d97706;
  --red: #b42318;
  --shadow: 0 24px 70px rgba(25, 52, 59, 0.13);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--wash);
}

a {
  color: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px clamp(18px, 5vw, 72px);
  background: rgba(247, 251, 252, 0.9);
  border-bottom: 1px solid rgba(217, 229, 232, 0.8);
  backdrop-filter: blur(18px);
}

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

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: var(--ink);
}

.brand-mark svg {
  display: block;
  width: 42px;
  height: 42px;
}

.logo-tile {
  fill: var(--ink);
}

.logo-monogram {
  fill: #ffffff;
}

.logo-accent {
  fill: #14b8a6;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.header-nav a {
  padding: 10px 12px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(360px, 1.1fr);
  gap: clamp(30px, 6vw, 76px);
  align-items: center;
  min-height: clamp(560px, calc(100vh - 260px), 760px);
  padding: clamp(38px, 6vw, 76px) clamp(18px, 5vw, 72px) clamp(34px, 5vw, 58px);
}

.hero-copy {
  max-width: 690px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--teal);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin: 0;
  max-width: 11ch;
  font-size: clamp(48px, 7vw, 92px);
  line-height: 0.94;
  letter-spacing: 0;
}

h2 {
  margin: 0;
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1.05;
  letter-spacing: 0;
}

h3 {
  margin: 32px 0 10px;
  font-size: 22px;
}

.lead {
  max-width: 620px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: clamp(18px, 2.4vw, 24px);
  line-height: 1.45;
}

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

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

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

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

.button.full {
  width: 100%;
}

.hero-visual {
  min-width: 0;
}

.score-orbit {
  position: relative;
  max-width: 680px;
  margin-inline: auto;
  filter: drop-shadow(var(--shadow));
}

.score-orbit svg {
  display: block;
  width: 100%;
  height: auto;
}

.score-chip {
  position: absolute;
  top: -18px;
  right: 28px;
  display: grid;
  min-width: 104px;
  min-height: 48px;
  place-items: center;
  color: #fff;
  background: var(--teal);
  border: 5px solid var(--wash);
  border-radius: 8px;
  font-size: 20px;
  font-weight: 900;
}

.ad-slot {
  display: grid;
  min-height: 96px;
  place-items: center;
  padding: 14px;
  color: #768a90;
  background: repeating-linear-gradient(135deg, #fff, #fff 12px, #f5f9fa 12px, #f5f9fa 24px);
  border: 1px dashed #b8c9ce;
  border-radius: 8px;
  font-size: 12px;
  text-transform: uppercase;
}

.ad-slot.is-hidden {
  display: none;
}

.top-ad {
  margin: 0 clamp(18px, 5vw, 72px) 24px;
}

.tool-band,
.content-band,
.faq-band,
.insights-band {
  padding: clamp(48px, 7vw, 86px) clamp(18px, 5vw, 72px);
}

.tool-band {
  background: #fff;
}

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

.calculator-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 24px;
  align-items: stretch;
}

.calculator-panel,
.result-panel,
.insight-grid article,
.faq-list details {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 40px rgba(16, 42, 47, 0.08);
}

.calculator-panel {
  padding: clamp(18px, 3vw, 30px);
}

.mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 5px;
  background: #edf4f5;
  border-radius: 8px;
}

.mode-button,
.quick-actions button,
.period-row button {
  min-height: 42px;
  border: 0;
  border-radius: 7px;
  color: var(--ink);
  background: transparent;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.mode-button.active {
  background: #fff;
  box-shadow: 0 4px 12px rgba(16, 42, 47, 0.08);
}

.input-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 22px;
}

label span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

input {
  width: 100%;
  height: 58px;
  padding: 0 14px;
  color: var(--ink);
  background: #fff;
  border: 1px solid #b8c9ce;
  border-radius: 8px;
  font: inherit;
  font-size: 22px;
  font-weight: 800;
}

input:focus,
button:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.25);
  outline-offset: 2px;
}

.period-builder {
  margin-top: 22px;
}

.period-list {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
}

.period-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  gap: 10px;
  align-items: end;
}

.period-row button {
  color: var(--red);
  background: #fff3f1;
}

.hidden {
  display: none;
}

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}

.quick-actions button {
  padding: 0 12px;
  background: #eef6f5;
  font-size: 14px;
}

.result-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(22px, 4vw, 38px);
  color: #fff;
  background: var(--ink);
  border-color: var(--ink);
}

.result-label {
  margin: 0;
  color: #a9c0c6;
  font-weight: 800;
  text-transform: uppercase;
}

.score {
  display: block;
  margin: 10px 0 18px;
  font-size: clamp(66px, 10vw, 126px);
  font-weight: 900;
  line-height: 0.9;
}

.risk-meter {
  position: relative;
  height: 14px;
  overflow: hidden;
  background: linear-gradient(90deg, var(--teal), var(--blue), var(--amber), var(--red));
  border-radius: 999px;
}

.risk-meter span {
  position: absolute;
  top: -5px;
  left: 0;
  width: 8px;
  height: 24px;
  background: #fff;
  border-radius: 999px;
  transform: translateX(-4px);
  transition: left 180ms ease;
}

.risk-title {
  margin: 22px 0 8px;
  font-size: 22px;
  font-weight: 900;
}

.risk-copy {
  margin: 0;
  color: #cfe0e4;
  line-height: 1.55;
}

.formula-breakdown {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 28px 0 0;
}

.formula-breakdown div {
  padding: 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
}

.formula-breakdown dt {
  color: #a9c0c6;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.formula-breakdown dd {
  margin: 6px 0 0;
  font-weight: 900;
}

.insight-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  align-items: stretch;
}

.insight-grid.no-square-ad {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.insight-grid article {
  padding: 28px;
}

.insight-grid h2 {
  font-size: clamp(24px, 3vw, 34px);
}

.insight-grid p,
.content-main p,
.faq-list p {
  color: var(--muted);
  line-height: 1.7;
}

.score-list {
  display: grid;
  gap: 10px;
  padding: 0;
  margin: 22px 0 0;
  list-style: none;
}

.score-list li {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px;
  background: #f5f9fa;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 700;
}

.score-list span {
  min-width: 82px;
  color: var(--ink);
  font-weight: 900;
}

.square-ad {
  min-height: 280px;
}

.content-band {
  background: #fff;
}

.content-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 34px;
  align-items: start;
  max-width: 1180px;
  margin-inline: auto;
}

.content-main.no-sidebar-ad {
  grid-template-columns: minmax(0, 1fr);
}

.content-main article {
  max-width: 780px;
}

.content-main h2 {
  margin-bottom: 18px;
}

.example-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin: 24px 0;
  padding: 16px;
  background: #eef6f5;
  border-left: 5px solid var(--teal);
  border-radius: 8px;
}

.example-strip span {
  color: var(--teal);
  font-weight: 900;
  text-transform: uppercase;
}

.sidebar-ad {
  position: sticky;
  top: 92px;
  min-height: 600px;
}

.faq-list {
  display: grid;
  gap: 12px;
  max-width: 920px;
}

.faq-list details {
  padding: 20px 22px;
}

.faq-list summary {
  cursor: pointer;
  font-size: 18px;
  font-weight: 900;
}

.resource-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  max-width: 1180px;
}

.resource-grid a {
  display: grid;
  gap: 10px;
  min-height: 150px;
  padding: 24px;
  color: var(--muted);
  background: #f5f9fa;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 700;
  line-height: 1.55;
  text-decoration: none;
}

.resource-grid span {
  color: var(--ink);
  font-size: 20px;
  font-weight: 900;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  padding: 28px clamp(18px, 5vw, 72px);
  color: #d3e3e7;
  background: var(--ink);
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  color: inherit;
  font-weight: 800;
}

.policy-page {
  padding: clamp(48px, 7vw, 86px) clamp(18px, 5vw, 72px);
  background: #fff;
}

.policy-content {
  max-width: 820px;
}

.policy-content h1 {
  max-width: none;
  margin-bottom: 24px;
  font-size: clamp(44px, 6vw, 72px);
}

.policy-content h2 {
  margin-top: 36px;
  font-size: clamp(24px, 3vw, 34px);
}

.policy-content p {
  color: var(--muted);
  line-height: 1.7;
}

.policy-content ul,
.policy-content ol {
  color: var(--muted);
  line-height: 1.7;
}

.policy-content li + li {
  margin-top: 8px;
}

.data-table {
  width: 100%;
  margin: 24px 0;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

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

.data-table th {
  color: var(--ink);
  background: #eef6f5;
}

.data-table td {
  color: var(--muted);
}

@media (max-width: 900px) {
  .hero,
  .calculator-layout,
  .insight-grid,
  .content-main,
  .resource-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .content-main article {
    max-width: none;
  }

  .sidebar-ad {
    position: static;
    min-height: 160px;
  }
}

@media (min-width: 901px) and (max-width: 1180px) {
  .hero {
    grid-template-columns: minmax(0, 0.95fr) minmax(320px, 0.9fr);
    min-height: 620px;
    padding-top: 52px;
    padding-bottom: 52px;
  }

  .hero-copy {
    max-width: 520px;
  }

  h1 {
    font-size: clamp(54px, 7vw, 74px);
  }

  .lead {
    font-size: 20px;
  }
}

@media (max-width: 640px) {
  .site-header {
    position: static;
    align-items: flex-start;
    flex-direction: column;
  }

  .brand {
    font-size: 14px;
  }

  .header-nav {
    width: 100%;
    justify-content: space-between;
  }

  .hero {
    padding-top: 34px;
  }

  .input-grid,
  .formula-breakdown {
    grid-template-columns: 1fr;
  }

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