:root {
  color-scheme: light;
  --ink: #152026;
  --muted: #5d6b72;
  --line: #d9e2df;
  --paper: #f7faf8;
  --field: #1f6a4a;
  --clay: #c36d3d;
  --gold: #f0b94f;
  --blue: #245c73;
  --white: #ffffff;
  --shadow: 0 18px 45px rgba(21, 32, 38, 0.13);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
}
a { color: inherit; }
.skip-link {
  position: absolute;
  left: 16px;
  top: -80px;
  z-index: 20;
  background: var(--white);
  padding: 10px 14px;
  border: 1px solid var(--line);
}
.skip-link:focus { top: 16px; }
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid rgba(217, 226, 223, 0.9);
  background: rgba(247, 250, 248, 0.94);
  backdrop-filter: blur(14px);
}
.nav {
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px 20px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  text-decoration: none;
}
.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--field);
  color: var(--white);
  font-size: 13px;
  letter-spacing: 0;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.nav-links a {
  text-decoration: none;
  color: #2f4149;
  font-size: 14px;
  padding: 8px 10px;
  border-radius: 7px;
}
.nav-links a:hover, .nav-links a:focus { background: #eaf1ee; }
.nav-dropdown {
  position: relative;
}
.nav-dropdown summary {
  list-style: none;
  color: #2f4149;
  font-size: 14px;
  padding: 8px 28px 8px 10px;
  border-radius: 7px;
  cursor: pointer;
  position: relative;
}
.nav-dropdown summary::-webkit-details-marker { display: none; }
.nav-dropdown summary::after {
  content: "";
  position: absolute;
  right: 10px;
  top: 50%;
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-65%) rotate(45deg);
}
.nav-dropdown[open] summary,
.nav-dropdown summary:hover,
.nav-dropdown summary:focus { background: #eaf1ee; }
.nav-dropdown-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 230px;
  padding: 8px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.nav-dropdown-menu a {
  display: block;
  white-space: nowrap;
}
.hero {
  position: relative;
  overflow: hidden;
  color: var(--white);
  background:
    linear-gradient(90deg, rgba(13, 29, 31, 0.96), rgba(13, 29, 31, 0.78) 42%, rgba(13, 29, 31, 0.28)),
    radial-gradient(circle at 72% 48%, rgba(240, 185, 79, 0.34), transparent 22%),
    linear-gradient(135deg, #17372f 0%, #1f6a4a 48%, #b66a40 49%, #284c63 100%);
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(45deg, transparent 47%, rgba(255,255,255,0.22) 48%, rgba(255,255,255,0.22) 52%, transparent 53%) 74% 56% / 230px 230px no-repeat,
    linear-gradient(135deg, transparent 47%, rgba(255,255,255,0.16) 48%, rgba(255,255,255,0.16) 52%, transparent 53%) 74% 56% / 230px 230px no-repeat;
  opacity: 0.88;
}
.hero-inner {
  position: relative;
  max-width: 1180px;
  min-height: 620px;
  margin: 0 auto;
  padding: 72px 20px 54px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 48px;
  align-items: center;
}
.eyebrow {
  margin: 0 0 14px;
  color: #a9d9c2;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 13px;
}
h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(42px, 6vw, 76px);
  line-height: 0.98;
  letter-spacing: 0;
}
.hero-copy {
  max-width: 650px;
  margin: 22px 0 30px;
  color: #dcebe5;
  font-size: 19px;
}
.hero-actions, .button-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 11px 16px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}
.button.primary {
  background: var(--gold);
  color: #1f241f;
}
.button.secondary {
  color: var(--white);
  border-color: rgba(255,255,255,0.34);
  background: rgba(255,255,255,0.08);
}
.mini-scorebook {
  background: rgba(255,255,255,0.95);
  color: var(--ink);
  border-radius: 8px;
  padding: 18px;
  box-shadow: var(--shadow);
}
.mini-scorebook table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.mini-scorebook caption {
  text-align: left;
  font-weight: 800;
  margin-bottom: 8px;
}
.mini-scorebook th, .mini-scorebook td {
  border: 1px solid var(--line);
  padding: 8px;
  text-align: right;
}
.mini-scorebook th:first-child, .mini-scorebook td:first-child { text-align: left; }
.section {
  max-width: 1180px;
  margin: 0 auto;
  padding: 58px 20px;
}
.section.tight { padding-top: 34px; }
.section h2 {
  margin: 0 0 16px;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.08;
  letter-spacing: 0;
}
.lead {
  max-width: 760px;
  color: var(--muted);
  font-size: 18px;
  margin: 0 0 26px;
}
.tool-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 20px;
  align-items: start;
}
.calculator, .result-panel, .content-card, .keyword-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 25px rgba(21, 32, 38, 0.06);
}
.calculator { padding: 20px; }
.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.field label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-weight: 800;
  margin-bottom: 6px;
}
.field output {
  min-width: 62px;
  padding: 4px 8px;
  border-radius: 7px;
  background: #e5f2ec;
  color: #164b34;
  text-align: center;
  font-size: 14px;
}
.field small { display: block; color: var(--muted); margin-top: 5px; }
input, select {
  width: 100%;
  min-height: 44px;
  border: 1px solid #bdcbc7;
  border-radius: 7px;
  padding: 9px 11px;
  font: inherit;
  background: #fbfdfc;
  color: var(--ink);
}
input:focus, select:focus {
  outline: 3px solid rgba(36, 92, 115, 0.18);
  border-color: var(--blue);
}
input[type="range"] {
  position: relative;
  min-height: 38px;
  padding: 0;
  border: 0;
  background: transparent;
  accent-color: var(--field);
  cursor: pointer;
}
.range-control {
  position: relative;
  padding-top: 28px;
}
.range-control input[type="range"] {
  display: block;
}
.range-bubble {
  position: absolute;
  top: 0;
  left: var(--range-percent, 0%);
  transform: translateX(-50%);
  min-width: 40px;
  padding: 3px 7px;
  border-radius: 7px;
  background: #142225;
  color: var(--white);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
  pointer-events: none;
  white-space: nowrap;
}
.range-bubble::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -5px;
  transform: translateX(-50%);
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid #142225;
}
input[type="range"]:focus {
  outline: 3px solid rgba(36, 92, 115, 0.18);
  outline-offset: 4px;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, #c36d3d, #1f6a4a);
}
input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 22px;
  height: 22px;
  margin-top: -7px;
  border-radius: 50%;
  border: 3px solid var(--white);
  background: var(--field);
  box-shadow: 0 3px 10px rgba(21, 32, 38, 0.28);
}
input[type="range"]::-moz-range-track {
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, #c36d3d, #1f6a4a);
}
input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 3px solid var(--white);
  background: var(--field);
  box-shadow: 0 3px 10px rgba(21, 32, 38, 0.28);
}
.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 16px 0;
}
.segmented label {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 9px 10px;
  text-align: center;
  font-weight: 800;
  cursor: pointer;
  background: #fbfdfc;
}
.segmented input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.segmented label:has(input:checked) {
  background: #e5f2ec;
  border-color: var(--field);
  color: #164b34;
}
.result-panel {
  padding: 22px;
  position: sticky;
  top: 86px;
}
.result-label {
  color: var(--muted);
  font-weight: 800;
  margin: 0;
}
.result-value {
  font-size: 64px;
  line-height: 1;
  font-weight: 900;
  margin: 8px 0 8px;
  color: var(--field);
}
.formula-box {
  background: #edf5f1;
  border: 1px solid #c9ded4;
  border-radius: 8px;
  padding: 14px;
  font-weight: 800;
}
.muted { color: var(--muted); }
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.keyword-card, .content-card { padding: 20px; }
.keyword-card a {
  display: inline-block;
  margin-top: 10px;
  font-weight: 800;
  color: var(--blue);
}
.content {
  display: grid;
  grid-template-columns: minmax(0, 760px) 320px;
  gap: 36px;
  align-items: start;
}
.content article {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 26px;
}
.content article h2 { font-size: 30px; margin-top: 34px; }
.content article h2:first-child { margin-top: 0; }
.content article h3 { margin-top: 24px; }
.content article a { color: var(--blue); font-weight: 700; }
.toc {
  position: sticky;
  top: 86px;
  background: #ecf4f0;
  border: 1px solid #d1e0db;
  border-radius: 8px;
  padding: 18px;
}
.toc a {
  display: block;
  padding: 7px 0;
  color: #29434d;
  text-decoration: none;
  font-weight: 700;
}
.faq details {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 10px 0;
  padding: 14px 16px;
}
.faq summary { cursor: pointer; font-weight: 800; }
.site-footer {
  margin-top: 40px;
  background: #142225;
  color: #dbe7e3;
}
.footer-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 34px 20px;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.footer-inner a { color: #dbe7e3; margin-right: 14px; }

@media (max-width: 900px) {
  .hero-inner, .tool-shell, .content { grid-template-columns: 1fr; }
  .hero-inner { min-height: auto; padding-top: 54px; }
  .mini-scorebook, .result-panel, .toc { position: static; }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .nav { align-items: flex-start; flex-direction: column; }
  .nav-links { justify-content: flex-start; }
  .nav-dropdown-menu {
    position: static;
    margin-top: 4px;
    min-width: 100%;
    box-shadow: none;
  }
  .hero-copy { font-size: 17px; }
  .field-grid, .grid-3, .segmented { grid-template-columns: 1fr; }
  .result-value { font-size: 52px; }
}
