:root {
  --ink: #172027;
  --muted: #5d6a72;
  --line: #d9e1e5;
  --paper: #f7f9f7;
  --panel: #ffffff;
  --asphalt: #242729;
  --asphalt-2: #3b4144;
  --safety: #f2a51a;
  --safety-dark: #a76500;
  --green: #276f55;
  --teal: #176b78;
  --blue: #245d8f;
  --danger: #b83a2f;
  --shadow: 0 18px 55px rgba(20, 31, 36, 0.13);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
  overflow-x: hidden;
}

a {
  color: inherit;
}

main,
section,
.section-heading,
.tool-grid,
.tool-panel,
.result-panel,
.mini-tool,
.cards article {
  min-width: 0;
}

p,
h1,
h2,
h3,
summary,
.metric strong,
.score-card strong {
  overflow-wrap: break-word;
}

button,
input,
select {
  font: inherit;
}

.skip-link {
  position: absolute;
  top: 0;
  left: 0;
  transform: translateY(-120%);
  background: var(--ink);
  color: #fff;
  padding: 10px 14px;
  z-index: 20;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 72px;
  padding: 12px clamp(18px, 4vw, 54px);
  background: rgba(247, 249, 247, 0.92);
  border-bottom: 1px solid rgba(23, 32, 39, 0.1);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: #fff;
  background: var(--asphalt);
  border: 3px solid var(--safety);
  border-radius: 8px;
  font-weight: 800;
  letter-spacing: 0;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  color: var(--muted);
  font-size: 0.78rem;
}

nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

nav a {
  padding: 9px 10px;
  color: var(--asphalt-2);
  text-decoration: none;
  border-radius: 7px;
}

nav a:hover,
nav a:focus-visible {
  background: #e9eef0;
  outline: none;
}

.hero-shell {
  position: relative;
  min-height: clamp(420px, 58vh, 610px);
  display: grid;
  align-items: end;
  overflow: hidden;
  background: var(--asphalt);
}

.hero-image {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(16, 22, 26, 0.88) 0%, rgba(16, 22, 26, 0.66) 44%, rgba(16, 22, 26, 0.2) 100%),
    url("https://upload.wikimedia.org/wikipedia/commons/thumb/3/35/Pneumatic_tire_roller_pressing_the_gravel_into_the_asphalt_%2848266842472%29.jpg/1280px-Pneumatic_tire_roller_pressing_the_gravel_into_the_asphalt_%2848266842472%29.jpg") center / cover;
  transform: scale(1.02);
}

.hero-overlay {
  position: relative;
  width: min(1050px, calc(100% - 36px));
  margin: 0 auto;
  padding: clamp(36px, 6vw, 72px) 0;
  color: #fff;
}

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

.hero-overlay h1 {
  max-width: 820px;
  margin: 0;
  font-size: clamp(2.2rem, 5vw, 4.35rem);
  line-height: 1;
  letter-spacing: 0;
}

.hero-copy {
  max-width: 720px;
  margin: 22px 0 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: clamp(1rem, 2vw, 1.3rem);
}

.hero-actions,
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}

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

.button.primary {
  color: #1a1d1f;
  background: var(--safety);
}

.button.primary:hover,
.button.primary:focus-visible {
  background: #ffc04d;
}

.button.secondary {
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.36);
}

.button.ghost {
  color: var(--ink);
  background: #eef3f4;
  border-color: #d5e0e4;
}

.section-band {
  padding: clamp(46px, 7vw, 92px) clamp(18px, 4vw, 54px);
}

.alt-band {
  background: #e8f0ee;
}

.guide-band {
  background: #20272b;
  color: #fff;
}

.source-band {
  background: #edf2f3;
}

.subpage-hero {
  position: relative;
  padding: clamp(54px, 8vw, 112px) clamp(18px, 4vw, 54px);
  color: #fff;
  background:
    linear-gradient(90deg, rgba(18, 24, 28, 0.92), rgba(18, 24, 28, 0.72)),
    url("https://upload.wikimedia.org/wikipedia/commons/thumb/3/35/Pneumatic_tire_roller_pressing_the_gravel_into_the_asphalt_%2848266842472%29.jpg/1280px-Pneumatic_tire_roller_pressing_the_gravel_into_the_asphalt_%2848266842472%29.jpg") center / cover;
}

.subpage-hero-inner {
  width: min(1050px, 100%);
  margin: 0 auto;
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.92rem;
}

.breadcrumbs a {
  color: #fff;
}

.subpage-hero h1 {
  max-width: 850px;
  margin: 0;
  font-size: clamp(2.2rem, 5vw, 4.45rem);
  line-height: 1;
}

.subpage-hero p:not(.eyebrow) {
  max-width: 760px;
  margin: 18px 0 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: 1.12rem;
}

.tool-link-grid {
  width: min(1180px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.tool-link {
  display: block;
  min-height: 148px;
  padding: 18px;
  text-decoration: none;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.tool-link strong,
.tool-link span {
  display: block;
}

.tool-link span {
  margin-top: 8px;
  color: var(--muted);
}

.content-grid {
  width: min(1050px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(280px, 0.55fr);
  gap: 24px;
}

.content-panel,
.side-panel {
  padding: 22px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.content-panel h2,
.side-panel h2 {
  margin-top: 0;
}

.formula-box {
  padding: 16px;
  margin: 16px 0;
  background: #f2f5f4;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow-x: auto;
}

.formula-box code {
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

.plain-list {
  margin: 12px 0 0;
  padding-left: 20px;
}

.plain-list li {
  margin-top: 8px;
}

.page-cta {
  width: min(1050px, 100%);
  margin: 0 auto;
  padding: 24px;
  color: #fff;
  background: #20272b;
  border-radius: var(--radius);
}

.page-cta h2 {
  margin-top: 0;
}

.section-heading {
  width: min(1050px, 100%);
  margin: 0 auto 28px;
}

.section-heading h2,
.guide-grid h2,
.source-grid h2 {
  margin: 0;
  font-size: clamp(1.8rem, 3.5vw, 3.2rem);
  line-height: 1.05;
  letter-spacing: 0;
}

.section-heading p:not(.eyebrow) {
  max-width: 760px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 1.04rem;
}

.tool-grid {
  width: min(1180px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(340px, 0.82fr);
  gap: 18px;
  align-items: start;
}

.tool-panel,
.result-panel,
.mini-tool,
.cards article {
  background: var(--panel);
  border: 1px solid rgba(23, 32, 39, 0.1);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.tool-panel,
.result-panel {
  padding: clamp(18px, 3vw, 28px);
}

.panel-title {
  margin-bottom: 18px;
}

.panel-title h3,
.mini-tool h3,
.cards h3,
.breakdown h4,
.flag-list h4 {
  margin: 0;
  line-height: 1.2;
}

.panel-title p,
.mini-tool p,
.cards p {
  margin: 6px 0 0;
  color: var(--muted);
}

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

label,
fieldset legend {
  color: var(--asphalt-2);
  font-size: 0.9rem;
  font-weight: 750;
}

input,
select {
  width: 100%;
  min-height: 44px;
  margin-top: 6px;
  padding: 10px 11px;
  color: var(--ink);
  background: #fbfcfc;
  border: 1px solid #cfd9dd;
  border-radius: 7px;
}

input:focus,
select:focus,
button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(242, 165, 26, 0.45);
  outline-offset: 2px;
}

.input-unit {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-weight: 700;
}

.input-unit input {
  margin-top: 6px;
}

.is-hidden {
  display: none;
}

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

.metric,
.score-card > div {
  min-height: 94px;
  padding: 15px;
  background: #f3f7f6;
  border: 1px solid #dce6e5;
  border-radius: 7px;
}

.metric span,
.score-card span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.metric strong,
.score-card strong {
  display: block;
  margin-top: 7px;
  font-size: clamp(1.25rem, 2.4vw, 1.85rem);
  line-height: 1.05;
}

.breakdown {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.breakdown dl {
  margin: 12px 0 0;
}

.breakdown div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0;
  border-bottom: 1px solid #edf1f2;
}

.breakdown dt {
  color: var(--muted);
}

.breakdown dd {
  margin: 0;
  font-weight: 800;
}

.insight-box,
.mini-result {
  margin-top: 18px;
  padding: 14px;
  color: #123a2d;
  background: #e4f4ed;
  border: 1px solid #b7dccd;
  border-radius: 7px;
  font-weight: 750;
}

.check-list {
  display: grid;
  gap: 10px;
  margin: 18px 0 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.check-list label {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  font-weight: 650;
}

.check-list input {
  width: 18px;
  min-height: 18px;
  margin: 2px 0 0;
}

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

.flag-list ul {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.flag-list li {
  padding: 11px 12px;
  margin-top: 8px;
  background: #fff8e7;
  border: 1px solid #f3d796;
  border-radius: 7px;
}

.flag-list li.good {
  background: #e8f4ee;
  border-color: #badbcc;
}

.flag-list li.bad {
  background: #fff0ef;
  border-color: #efc3bd;
}

.specialty-layout {
  width: min(1180px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.mini-tool {
  padding: 22px;
}

.mini-grid {
  grid-template-columns: 1fr;
  margin-top: 16px;
}

.guide-grid,
.source-grid {
  width: min(1050px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 0.82fr 1.18fr;
  gap: clamp(24px, 5vw, 72px);
}

.guide-copy p {
  margin-top: 0;
  color: rgba(255, 255, 255, 0.78);
}

.cards {
  width: min(1050px, 100%);
  margin: 28px auto 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.cards article {
  padding: 20px;
  color: var(--ink);
}

.faq-list {
  width: min(900px, 100%);
  margin: 0 auto;
}

details {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
  margin-top: 10px;
  padding: 16px 18px;
}

summary {
  cursor: pointer;
  font-weight: 850;
}

details p {
  margin-bottom: 0;
  color: var(--muted);
}

.source-grid p {
  margin-top: 0;
}

.source-grid ul {
  margin: 12px 0 0;
  padding-left: 20px;
}

.source-grid li {
  margin-top: 6px;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 24px clamp(18px, 4vw, 54px);
  color: #dbe4e7;
  background: #161b1e;
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  color: #fff;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: min(360px, calc(100vw - 36px));
  padding: 12px 14px;
  color: #fff;
  background: var(--asphalt);
  border-radius: 7px;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 980px) {
  .tool-grid,
  .specialty-layout,
  .guide-grid,
  .source-grid,
  .tool-link-grid,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .score-card,
  .cards {
    grid-template-columns: 1fr;
  }

  .hero-shell {
    min-height: 540px;
  }
}

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

  nav {
    justify-content: flex-start;
  }

  .hero-overlay {
    width: min(calc(100% - 28px), 680px);
    padding-top: 46px;
  }

  .hero-overlay h1 {
    max-width: 340px;
    font-size: clamp(1.9rem, 8vw, 2.35rem);
    line-height: 1.04;
  }

  .hero-copy {
    max-width: 340px;
    font-size: 0.98rem;
  }

  .subpage-hero h1 {
    max-width: 340px;
    font-size: clamp(1.9rem, 8vw, 2.45rem);
  }

  .subpage-hero p:not(.eyebrow) {
    max-width: 340px;
    font-size: 1rem;
  }

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

  .section-heading h2,
  .section-heading p:not(.eyebrow),
  .panel-title p,
  .mini-tool p {
    max-width: 340px;
  }

  .section-band {
    padding-left: 14px;
    padding-right: 14px;
  }

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

  .site-footer {
    flex-direction: column;
  }
}
