:root {
  --ink: #102c3f;
  --text: #243b4a;
  --muted: #627b8d;
  --blue-900: #003d66;
  --blue-800: #004b76;
  --blue-700: #005f96;
  --blue-100: #eaf7ff;
  --blue-050: #f4fbff;
  --teal: #138779;
  --teal-soft: #d9f4ef;
  --orange: #f6a23a;
  --orange-soft: #fff3df;
  --line: #c9ddeb;
  --line-soft: #e2edf5;
  --surface: #ffffff;
  --surface-muted: #f3f5f7;
  --danger: #a33a22;
  --shadow: 0 18px 45px rgba(0, 61, 102, 0.12);
  --radius: 8px;
  --container: min(1180px, calc(100vw - 40px));
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--surface);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.6;
}

button,
input,
select {
  font: inherit;
}

button,
a,
input,
select {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: var(--blue-700);
  text-underline-offset: 0.18em;
}

:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 3px;
}

.container {
  width: var(--container);
  margin: 0 auto;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -120px;
  z-index: 20;
  padding: 10px 14px;
  color: #fff;
  background: var(--blue-900);
}

.skip-link:focus {
  top: 16px;
}

.notice-bar {
  color: #fff;
  background: var(--blue-900);
  font-size: 0.92rem;
}

.notice-bar__inner {
  display: flex;
  gap: 18px;
  justify-content: space-between;
  align-items: center;
  min-height: 44px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line-soft);
  backdrop-filter: blur(14px);
}

.header-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 24px;
  align-items: center;
  min-height: 82px;
}

.brand {
  display: inline-flex;
  gap: 12px;
  align-items: center;
  color: var(--ink);
  text-decoration: none;
}

.brand__mark {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  color: #fff;
  background: var(--blue-800);
  border-radius: 6px;
  font-size: 1.35rem;
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
  line-height: 1.1;
}

.brand small {
  margin-top: 4px;
  color: var(--muted);
  font-weight: 700;
}

.main-nav {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
  align-items: center;
}

.main-nav a {
  padding: 10px 12px;
  color: var(--ink);
  border-radius: 4px;
  font-weight: 700;
  text-decoration: none;
}

.main-nav a:hover {
  color: var(--blue-800);
  background: var(--blue-050);
}

.section {
  padding: 84px 0;
}

.hero-tool {
  padding: 72px 0 84px;
  background:
    linear-gradient(135deg, rgba(234, 247, 255, 0.96), rgba(255, 255, 255, 0.92)),
    var(--blue-100);
  border-bottom: 1px solid var(--line-soft);
}

.tool-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(520px, 1.14fr);
  gap: 42px;
  align-items: start;
}

.tool-intro {
  position: sticky;
  top: 126px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--blue-800);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  color: var(--ink);
  line-height: 1.08;
}

h1 {
  max-width: 680px;
  margin-bottom: 22px;
  font-size: clamp(2.35rem, 5vw, 4.2rem);
  font-weight: 800;
}

h2 {
  margin-bottom: 18px;
  font-size: clamp(1.8rem, 3vw, 2.7rem);
  font-weight: 800;
}

h3 {
  margin-bottom: 12px;
  font-size: 1.22rem;
  font-weight: 800;
}

.lead {
  max-width: 620px;
  margin-bottom: 32px;
  color: #29485c;
  font-size: 1.14rem;
}

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

.fact-strip div {
  min-height: 104px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(0, 75, 118, 0.16);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.fact-strip dt {
  color: var(--blue-800);
  font-size: 1.3rem;
  font-weight: 800;
  line-height: 1.12;
}

.fact-strip dd {
  margin: 8px 0 0;
  color: var(--text);
  font-weight: 700;
}

.calculator,
.result-card,
.formula-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(0, 61, 102, 0.08);
}

.calculator {
  padding: 28px;
}

.calculator__header {
  display: flex;
  gap: 18px;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 22px;
}

.calculator__header h2 {
  margin-bottom: 0;
}

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

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

.field span,
.segmented legend {
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 800;
}

.field input,
.field select {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  color: var(--ink);
  background: var(--blue-050);
  border: 1px solid var(--line);
  border-radius: 4px;
}

.field input:focus,
.field select:focus {
  background: #fff;
  border-color: var(--blue-700);
}

.segmented {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  padding: 0;
  margin: 0 0 22px;
  border: 0;
}

.segmented--compact {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 0;
}

.segmented legend {
  grid-column: 1 / -1;
  margin-bottom: 8px;
}

.segmented label {
  min-width: 0;
}

.segmented input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented span {
  display: grid;
  min-height: 48px;
  padding: 10px;
  place-items: center;
  color: var(--blue-800);
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 4px;
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
}

.segmented input:checked + span {
  color: #fff;
  background: var(--blue-800);
  border-color: var(--blue-800);
}

.button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border: 2px solid transparent;
  border-radius: 4px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

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

.button--primary:hover {
  background: var(--blue-900);
}

.button--secondary,
.button--ghost {
  color: var(--blue-800);
  background: #fff;
  border-color: var(--blue-700);
}

.button--secondary:hover,
.button--ghost:hover {
  color: var(--blue-900);
  background: var(--blue-050);
}

.results-section {
  background: #fff;
}

.results-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.9fr 0.9fr;
  gap: 18px;
}

.result-card {
  padding: 26px;
}

.result-card--primary {
  background: var(--blue-050);
}

.total-cost {
  display: block;
  margin-bottom: 18px;
  color: var(--ink);
  font-size: clamp(2.4rem, 5vw, 4.2rem);
  font-weight: 800;
  line-height: 1;
}

.impact-meter {
  height: 14px;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
}

.impact-meter span {
  display: block;
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--teal), var(--orange));
  transition: width 180ms ease;
}

.metric-list {
  display: grid;
  gap: 12px;
  margin: 0;
}

.metric-list div {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line-soft);
}

.metric-list div:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.metric-list dt {
  color: var(--muted);
  font-weight: 700;
}

.metric-list dd {
  margin: 0;
  color: var(--ink);
  font-weight: 800;
  text-align: right;
}

.section-heading {
  max-width: 620px;
}

.method-section {
  background: linear-gradient(180deg, #fff 0%, var(--blue-050) 100%);
}

.method-layout {
  display: grid;
  grid-template-columns: 0.9fr 1fr;
  gap: 36px;
  align-items: start;
}

.method-copy {
  font-size: 1.05rem;
}

.formula-card {
  grid-column: 1 / -1;
  padding: 24px;
  overflow-x: auto;
}

.formula-card code {
  color: var(--blue-900);
  font-size: 1rem;
  font-weight: 800;
  white-space: nowrap;
}

.privacy-section {
  color: #fff;
  background: var(--blue-900);
}

.privacy-section h2,
.privacy-section p,
.privacy-section .eyebrow {
  color: #fff;
}

.privacy-layout {
  display: grid;
  grid-template-columns: 1fr 0.84fr;
  gap: 42px;
  align-items: center;
}

.privacy-layout p {
  margin-bottom: 0;
  font-size: 1.05rem;
}

.site-footer {
  padding: 28px 0;
  color: #fff;
  background: #052b44;
}

.footer-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  justify-content: space-between;
  align-items: center;
}

.footer-grid p {
  margin: 0;
}

@media (max-width: 1060px) {
  .tool-layout,
  .method-layout,
  .privacy-layout {
    grid-template-columns: 1fr;
  }

  .tool-intro {
    position: static;
  }

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

  .result-card--primary,
  .result-card {
    grid-column: 1 / -1;
  }
}

@media (max-width: 820px) {
  :root {
    --container: min(100vw - 28px, 1180px);
  }

  .notice-bar__inner {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
    padding: 9px 0;
  }

  .header-grid {
    grid-template-columns: 1fr;
    gap: 12px;
    min-height: auto;
    padding: 14px 0;
  }

  .main-nav {
    justify-content: flex-start;
  }

  .section {
    padding: 62px 0;
  }

  .hero-tool {
    padding-top: 48px;
  }

  .fact-strip,
  .form-grid,
  .results-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 520px) {
  .calculator,
  .result-card,
  .formula-card {
    padding: 20px;
  }

  .calculator__header,
  .metric-list div {
    flex-direction: column;
    align-items: stretch;
  }

  .button {
    width: 100%;
  }

  .segmented,
  .segmented--compact {
    grid-template-columns: 1fr;
  }
}
