:root {
  --background: #fcf9f4;
  --paper: #f7f3ea;
  --surface: #fffdf8;
  --surface-soft: #f6f3ee;
  --surface-strong: #ebe8e3;
  --ink: #20201d;
  --muted: #67645d;
  --line: #d8d0c1;
  --primary: #1f6b52;
  --primary-dark: #164b3b;
  --primary-soft: #e1f0e9;
  --accent: #c9842e;
  --accent-soft: #fff0d7;
  --info: #4f6f8f;
  --danger: #a5483e;
  --radius: 6px;
  --shadow-tight: 0 1px 2px rgba(32, 32, 29, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--background);
  color: var(--ink);
  font-family: "Source Sans 3", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(32, 32, 29, 0.035) 1px, transparent 1px) 0 0 / 32px 32px,
    linear-gradient(rgba(32, 32, 29, 0.03) 1px, transparent 1px) 0 0 / 32px 32px,
    var(--background);
}

button,
input,
select {
  font: inherit;
}

a {
  color: inherit;
}

.site {
  margin: 0 auto;
  width: min(1200px, calc(100% - 32px));
}

.topbar {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 18px;
  grid-template-columns: auto 1fr auto;
  min-height: 72px;
}

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

.brand-mark {
  align-items: center;
  background: var(--primary);
  border-radius: var(--radius);
  color: white;
  display: inline-flex;
  font-size: 0.75rem;
  height: 34px;
  justify-content: center;
  letter-spacing: 0;
  width: 34px;
}

.topbar nav {
  display: flex;
  gap: 18px;
  justify-content: center;
}

.topbar a {
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 650;
  text-decoration: none;
}

.topbar a:hover,
.service-card:hover strong,
.content-card:hover h3 {
  color: var(--primary);
}

.nav-cta,
.primary-link,
.calculate-button,
.copy-button {
  align-items: center;
  border-radius: var(--radius);
  display: inline-flex;
  font-weight: 800;
  justify-content: center;
  min-height: 44px;
  text-decoration: none;
}

.nav-cta,
.primary-link,
.calculate-button {
  background: var(--primary);
  border: 1px solid var(--primary);
  color: white !important;
  padding: 10px 16px;
}

.nav-cta:hover,
.primary-link:hover,
.calculate-button:hover {
  background: var(--primary-dark);
}

.hero {
  display: grid;
  gap: 28px;
  grid-template-columns: minmax(0, 0.88fr) minmax(500px, 1.12fr);
  min-height: calc(100vh - 72px);
  padding: 40px 0 30px;
}

.hero-copy {
  align-self: center;
  max-width: 560px;
}

.kicker {
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.05em;
  margin: 0 0 10px;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  font-family: Fraunces, Georgia, "Times New Roman", serif;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(2.55rem, 5vw, 4.55rem);
  line-height: 1;
  margin: 0 0 20px;
}

.lede {
  color: var(--muted);
  font-size: 1.18rem;
  line-height: 1.58;
  margin: 0;
}

.hero-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 24px;
}

.hero-actions span {
  color: var(--muted);
  font-size: 0.92rem;
}

.trust-strip {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 32px;
  padding-top: 20px;
}

.trust-strip div {
  background: rgba(255, 253, 248, 0.62);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
}

.trust-strip b {
  display: block;
  font-family: Fraunces, Georgia, serif;
  font-size: 1.45rem;
  line-height: 1;
}

.trust-strip span {
  color: var(--muted);
  display: block;
  font-size: 0.86rem;
  line-height: 1.35;
  margin-top: 6px;
}

.tool {
  align-self: start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-tight);
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  min-height: 660px;
}

.tool-panel,
.result-panel {
  padding: 22px;
}

.tool-panel {
  border-right: 1px solid var(--line);
}

.panel-heading {
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
  padding-bottom: 16px;
}

.panel-heading h2 {
  font-size: 1.65rem;
  line-height: 1.15;
  margin: 0;
}

.mode-row {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: grid;
  gap: 4px;
  grid-template-columns: repeat(3, 1fr);
  margin-bottom: 18px;
  padding: 4px;
}

.mode-row button,
.copy-button {
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--ink);
  cursor: pointer;
  min-height: 42px;
  padding: 9px 10px;
}

.mode-row button[aria-pressed="true"] {
  background: white;
  border-color: var(--line);
  box-shadow: var(--shadow-tight);
  color: var(--primary-dark);
  font-weight: 850;
}

.form-grid {
  display: grid;
  gap: 13px;
}

label {
  color: var(--muted);
  display: grid;
  font-size: 0.84rem;
  font-weight: 700;
  gap: 7px;
}

select,
input {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  min-height: 46px;
  padding: 10px 12px;
  width: 100%;
}

select:focus,
input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(31, 107, 82, 0.14);
  outline: 0;
}

.field-pair {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
}

.calculate-button {
  cursor: pointer;
  margin-top: 16px;
  width: 100%;
}

.affiliate-note {
  background: var(--accent-soft);
  border: 1px solid rgba(201, 132, 46, 0.35);
  border-left: 5px solid var(--accent);
  border-radius: var(--radius);
  color: #6f5128;
  font-size: 0.9rem;
  line-height: 1.45;
  margin: 18px 0 0;
  padding: 13px;
}

.result-panel {
  background:
    linear-gradient(180deg, rgba(31, 107, 82, 0.07), transparent 210px),
    var(--surface-soft);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.result__header {
  align-items: end;
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr auto;
  padding: 18px;
}

.result__header p {
  color: var(--muted);
  font-weight: 750;
  margin: 0;
}

.result__header strong {
  color: var(--accent);
  font-family: Fraunces, Georgia, serif;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1;
}

.result__header span {
  color: var(--primary);
  font-size: 0.9rem;
  font-weight: 750;
  grid-column: 1 / -1;
}

.range {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, 1fr);
  margin: 14px 0;
}

.range div {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-height: 98px;
  padding: 15px;
}

.range div:nth-child(2) {
  background: var(--accent-soft);
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(201, 132, 46, 0.3);
}

.range span,
.result-block h3 {
  color: var(--muted);
  display: block;
  font-size: 0.76rem;
  font-weight: 850;
  letter-spacing: 0.05em;
  margin: 0 0 8px;
  text-transform: uppercase;
}

.range b {
  color: var(--ink);
  font-family: Fraunces, Georgia, serif;
  font-size: 1.35rem;
  line-height: 1;
}

.result-block {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-top: 12px;
  padding: 15px;
}

.result-block--muted {
  background: #f8f1e7;
}

.result-block ul {
  margin: 0;
  padding-left: 18px;
}

.result-block li {
  color: var(--muted);
  line-height: 1.42;
  margin: 7px 0;
}

.fine-print {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.48;
}

.result-actions {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr 1fr;
  margin-top: 14px;
}

.copy-button {
  background: white;
  border-color: var(--line);
  width: 100%;
}

.copy-button:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.service-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(3, 1fr);
  padding: 8px 0 28px;
}

.service-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: grid;
  gap: 9px;
  min-height: 144px;
  padding: 18px;
  text-decoration: none;
}

.service-card:hover {
  border-color: var(--primary);
}

.service-icon {
  align-items: center;
  background: #eef3f2;
  border: 1px solid #cad9d8;
  border-radius: var(--radius);
  color: var(--info);
  display: inline-flex;
  font-size: 0.78rem;
  font-weight: 900;
  height: 34px;
  justify-content: center;
  width: 38px;
}

.service-card strong {
  font-family: Fraunces, Georgia, serif;
  font-size: 1.2rem;
  line-height: 1.2;
}

.service-card small {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.content-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(3, 1fr);
  padding: 28px 0 58px;
}

.section-heading {
  border-bottom: 1px solid var(--line);
  grid-column: 1 / -1;
  padding-bottom: 16px;
}

.section-heading h2 {
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.05;
  margin: 0;
  max-width: 760px;
}

.content-card {
  background: rgba(255, 253, 248, 0.78);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
}

.content-card h3 {
  font-size: 1.25rem;
  margin: 0 0 10px;
}

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

.content-card p {
  margin: 0;
}

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

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

.site-footer {
  align-items: center;
  border-top: 1px solid var(--line);
  color: var(--muted);
  display: flex;
  gap: 18px;
  justify-content: space-between;
  padding: 22px 0 34px;
}

.site-footer p {
  line-height: 1.45;
  margin: 0;
  max-width: 700px;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.site-footer a {
  color: var(--primary);
  font-size: 0.9rem;
  font-weight: 800;
  text-decoration: none;
}

.legal-page {
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 760px);
  padding: 48px 0 64px;
}

.legal-page h1 {
  font-size: clamp(2.5rem, 6vw, 5rem);
}

.legal-section {
  background: rgba(255, 253, 248, 0.78);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
}

.legal-section h2 {
  font-size: 1.25rem;
  margin: 0 0 10px;
}

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

@media (max-width: 1080px) {
  .hero,
  .tool {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: 0;
  }

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

  .tool-panel {
    border-bottom: 1px solid var(--line);
    border-right: 0;
  }

  .result-panel {
    border-radius: 0 0 var(--radius) var(--radius);
  }
}

@media (max-width: 760px) {
  .site {
    width: min(100% - 24px, 1200px);
  }

  .topbar {
    align-items: flex-start;
    grid-template-columns: 1fr;
    padding: 14px 0;
  }

  .topbar nav {
    display: grid;
    gap: 9px;
    justify-content: start;
  }

  .nav-cta {
    width: 100%;
  }

  .hero {
    padding-top: 28px;
  }

  .hero-actions,
  .primary-link {
    width: 100%;
  }

  .trust-strip,
  .field-pair,
  .range,
  .result-actions,
  .service-grid,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .mode-row {
    grid-template-columns: 1fr;
  }

  .tool-panel,
  .result-panel {
    padding: 16px;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media print {
  body {
    background: white;
  }

  .topbar,
  .hero-copy,
  .tool-panel,
  .service-grid,
  .content-grid,
  .result-actions {
    display: none !important;
  }

  .site,
  .hero,
  .tool,
  .result-panel {
    box-shadow: none;
    display: block;
    margin: 0;
    max-width: none;
    min-height: 0;
    padding: 0;
    width: 100%;
  }

  .tool,
  .result-panel,
  .result__header,
  .result-block,
  .range div {
    background: white;
    border-color: #999;
    color: #111;
  }
}
