:root {
  color-scheme: light;
  --ink: #182026;
  --muted: #63707a;
  --line: #d9e0e4;
  --paper: #f7f8f5;
  --white: #ffffff;
  --green: #2f6f62;
  --green-2: #dcebe4;
  --red: #b84a46;
  --gold: #c19a4a;
  --blue: #3d6f9f;
  --shadow: 0 18px 50px rgba(24, 32, 38, 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;
}

a {
  color: inherit;
  text-decoration: none;
}

.topbar {
  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(247, 248, 245, 0.92);
  border-bottom: 1px solid rgba(217, 224, 228, 0.8);
  backdrop-filter: blur(16px);
}

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

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

nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px 18px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.intro {
  min-height: calc(100vh - 74px);
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  align-items: center;
  gap: clamp(28px, 6vw, 72px);
  padding: 40px 0 28px;
}

.intro h1 {
  max-width: 860px;
  margin: 0;
  font-size: clamp(40px, 6vw, 78px);
  line-height: 0.96;
  letter-spacing: 0;
}

.intro p {
  max-width: 670px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.65;
}

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

.search-wrap {
  max-width: 620px;
  margin-top: 32px;
}

.search-wrap label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

input,
select {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: var(--ink);
  padding: 12px 13px;
  font: inherit;
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(47, 111, 98, 0.14);
}

.visual {
  min-height: 540px;
  display: grid;
  align-items: center;
  background:
    radial-gradient(circle at 20% 20%, rgba(193, 154, 74, 0.28), transparent 28%),
    linear-gradient(135deg, #ffffff, #dcebe4 55%, #edf0ea);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.visual-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  padding: 34px;
  transform: rotate(-2deg);
}

.tile {
  aspect-ratio: 1;
  border: 1px solid rgba(24, 32, 38, 0.12);
  border-radius: 8px;
  background: var(--white);
  box-shadow: 0 12px 28px rgba(24, 32, 38, 0.12);
  position: relative;
}

.tile::before,
.tile::after {
  content: "";
  position: absolute;
}

.tape::before {
  inset: 24%;
  border: 14px solid var(--gold);
  border-radius: 50%;
}

.key::before {
  width: 44%;
  height: 24%;
  left: 18%;
  top: 38%;
  border: 10px solid var(--green);
  border-radius: 99px;
}

.key::after {
  width: 38%;
  height: 10px;
  right: 16%;
  top: 48%;
  background: var(--green);
}

.wrench::before {
  width: 68%;
  height: 12px;
  left: 16%;
  top: 48%;
  background: var(--blue);
  transform: rotate(-35deg);
  border-radius: 99px;
}

.chart::before {
  left: 20%;
  right: 20%;
  bottom: 24%;
  height: 48%;
  background: linear-gradient(90deg, var(--red) 0 24%, transparent 24% 38%, var(--gold) 38% 62%, transparent 62% 76%, var(--green) 76%);
}

.coin::before {
  inset: 22%;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: inset 0 0 0 12px rgba(255, 255, 255, 0.38);
}

.home::before {
  left: 24%;
  right: 24%;
  bottom: 22%;
  height: 36%;
  background: var(--green);
}

.home::after {
  left: 20%;
  top: 24%;
  width: 60%;
  height: 42%;
  background: var(--red);
  transform: rotate(45deg);
  border-radius: 4px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin: 0 0 28px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.stats div {
  padding: 22px;
  background: var(--white);
}

.stats strong {
  display: block;
  font-size: 34px;
}

.stats span {
  color: var(--muted);
  font-weight: 700;
}

.trust-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 26px;
}

.trust-strip a,
.footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: var(--muted);
  padding: 7px 11px;
  font-size: 13px;
  font-weight: 800;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(280px, 390px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  padding: 28px 0 60px;
}

.directory,
.calculator-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.directory {
  position: sticky;
  top: 82px;
  max-height: calc(100vh - 104px);
  overflow: hidden;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1px;
  background: var(--line);
}

.tab {
  min-height: 42px;
  border: 0;
  background: #f9faf7;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

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

.calculator-list {
  max-height: calc(100vh - 146px);
  overflow: auto;
  padding: 10px;
}

.calc-button {
  width: 100%;
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 12px;
  align-items: center;
  min-height: 72px;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.calc-button:hover,
.calc-button.active {
  border-color: var(--line);
  background: #f5f8f4;
}

.calc-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  background: var(--green-2);
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
}

.calc-button strong {
  display: block;
  font-size: 14px;
}

.calc-button span:last-child {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.calculator-panel {
  min-height: 650px;
  padding: clamp(20px, 4vw, 38px);
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 20px;
}

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

.panel-head p:last-child {
  max-width: 760px;
  color: var(--muted);
  line-height: 1.55;
}

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

.field {
  display: grid;
  gap: 7px;
}

.field label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.result-box {
  border-radius: 8px;
  background: #182026;
  color: var(--white);
  padding: clamp(20px, 4vw, 32px);
}

.result-box span {
  color: #b8c3c9;
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.result-box strong {
  display: block;
  margin-top: 10px;
  font-size: clamp(36px, 6vw, 64px);
  line-height: 1;
  letter-spacing: 0;
}

.result-box p {
  color: #d7dee1;
  font-size: 16px;
  line-height: 1.55;
}

.fine-print,
footer {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.calculator-content {
  display: grid;
  gap: 14px;
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.calculator-content h3,
.editorial h3,
.guide-grid h3 {
  margin: 0;
  line-height: 1.15;
  letter-spacing: 0;
}

.calculator-content h3 {
  font-size: 22px;
}

.calculator-content p,
.editorial p,
.faq p {
  color: var(--muted);
  line-height: 1.65;
}

.calculator-content p {
  margin: 0;
}

.recommendations {
  padding: 24px 0 34px;
}

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

.recommendation-grid article {
  display: grid;
  align-content: start;
  gap: 12px;
  min-height: 246px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.recommendation-grid h3 {
  margin: 0;
  font-size: 22px;
  line-height: 1.12;
  letter-spacing: 0;
}

.recommendation-grid p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.recommendation-grid a {
  align-self: end;
  justify-self: start;
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  border-radius: 8px;
  background: var(--green);
  color: var(--white);
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 900;
}

.rec-tag {
  justify-self: start;
  border-radius: 8px;
  background: var(--green-2);
  color: var(--green);
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 900;
}

.editorial {
  padding: 34px 0 30px;
}

.section-head {
  max-width: 760px;
  margin-bottom: 22px;
}

.section-head.compact {
  margin-bottom: 14px;
}

.section-head h2 {
  margin: 0;
  font-size: clamp(32px, 5vw, 56px);
  line-height: 1.02;
  letter-spacing: 0;
}

.section-head p:last-child {
  font-size: 17px;
}

.guide-feature {
  display: grid;
  grid-template-columns: minmax(230px, 0.75fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px;
  padding: clamp(22px, 4vw, 34px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.guide-feature h3 {
  font-size: clamp(26px, 4vw, 38px);
}

.guide-feature p,
.guide-grid p {
  margin: 0;
}

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

.guide-grid article {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.guide-grid h3 {
  font-size: 24px;
}

.faq {
  padding: 28px 0 34px;
}

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

details {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  padding: 16px 18px;
}

summary {
  color: var(--ink);
  font-weight: 850;
  cursor: pointer;
}

details p {
  margin: 12px 0 0;
}

.category-band {
  padding: 26px 0;
}

.category-band h2 {
  margin: 0 0 14px;
  font-size: 28px;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.mini-card {
  min-height: 108px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  cursor: pointer;
}

.mini-card strong {
  display: block;
}

.mini-card span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

footer {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 46px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.legal-main {
  width: min(900px, calc(100% - 32px));
  margin: 0 auto;
}

.legal-hero {
  padding: 64px 0 24px;
}

.legal-hero h1 {
  margin: 0;
  font-size: clamp(38px, 6vw, 68px);
  line-height: 1;
  letter-spacing: 0;
}

.legal-hero p {
  max-width: 760px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.65;
}

.legal-content {
  display: grid;
  gap: 18px;
  padding: 0 0 56px;
}

.legal-content section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  padding: clamp(18px, 4vw, 28px);
}

.legal-content h2 {
  margin: 0 0 10px;
  font-size: 24px;
  letter-spacing: 0;
}

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

.legal-content ul {
  margin: 0;
  padding-left: 20px;
}

@media (max-width: 920px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  nav {
    justify-content: flex-start;
  }

  .intro,
  .workspace {
    grid-template-columns: 1fr;
  }

  .guide-feature,
  .guide-grid,
  .faq-list,
  .recommendation-grid {
    grid-template-columns: 1fr;
  }

  .intro {
    min-height: auto;
  }

  .visual {
    min-height: 360px;
  }

  .directory {
    position: static;
    max-height: none;
  }

  .calculator-list {
    max-height: 430px;
  }

  .category-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 620px) {
  main,
  footer {
    width: min(100% - 22px, 1180px);
  }

  .intro h1 {
    font-size: 38px;
  }

  .stats,
  .calculator-form,
  .category-grid {
    grid-template-columns: 1fr;
  }

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

  .visual-grid {
    grid-template-columns: repeat(2, 1fr);
    padding: 22px;
  }
}
