:root {
  --ink: #171a16;
  --muted: #5e655c;
  --paper: #fbfaf2;
  --stone: #f2f1e8;
  --surface: #fffefa;
  --field: #f5f4ec;
  --line: #d7d9cc;
  --line-strong: #babdad;
  --asphalt: #171a17;
  --asphalt-soft: #242a25;
  --green: #3b6757;
  --green-strong: #24483d;
  --green-soft: #dce9df;
  --caution: #d3a13a;
  --caution-soft: #f4e6bd;
  --rust: #7a4a20;
  --shadow: 0 24px 70px rgba(26, 29, 23, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  color: var(--ink);
  background: var(--paper);
  font-family: "Avenir Next", "Helvetica Neue", sans-serif;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
}

body {
  min-width: 320px;
  margin: 0;
  background:
    linear-gradient(90deg, rgba(23, 26, 22, 0.035) 1px, transparent 1px) 0 0 / 48px 48px,
    linear-gradient(180deg, rgba(23, 26, 22, 0.03) 1px, transparent 1px) 0 0 / 48px 48px,
    var(--paper);
}

a {
  color: inherit;
}

button,
input,
select {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px clamp(18px, 4vw, 58px);
  border-bottom: 1px solid rgba(215, 217, 204, 0.86);
  background: rgba(251, 250, 242, 0.94);
  backdrop-filter: blur(16px);
}

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

.brand::before {
  width: 16px;
  height: 16px;
  border: 2px solid var(--asphalt);
  background: linear-gradient(135deg, var(--caution) 0 50%, var(--asphalt) 50% 100%);
  content: "";
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

.site-nav a {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border-radius: 6px;
  text-decoration: none;
  transition: background 160ms ease, color 160ms ease;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  background: var(--green-soft);
  color: var(--green-strong);
}

.site-nav a[aria-current="page"] {
  font-weight: 800;
}

.home-hero,
.tool-hero {
  position: relative;
  overflow: hidden;
  padding: clamp(44px, 8vw, 96px) clamp(18px, 5vw, 72px) clamp(26px, 5vw, 54px);
}

.home-hero::before,
.tool-hero::before {
  position: absolute;
  inset: auto 0 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(23, 26, 22, 0.28), transparent);
  content: "";
}

body[data-page="asphalt-calculator"] .tool-hero::after {
  position: absolute;
  right: clamp(18px, 7vw, 98px);
  bottom: 10px;
  color: rgba(23, 26, 22, 0.055);
  content: "TONS";
  font-family: "DIN Alternate", "Avenir Next", sans-serif;
  font-size: clamp(90px, 16vw, 210px);
  font-weight: 800;
  line-height: 0.8;
  pointer-events: none;
}

body[data-page="concrete-block-calculator"] .tool-hero::after {
  position: absolute;
  right: clamp(18px, 7vw, 98px);
  bottom: 10px;
  color: rgba(23, 26, 22, 0.055);
  content: "BLOCKS";
  font-family: "DIN Alternate", "Avenir Next", sans-serif;
  font-size: clamp(76px, 13vw, 170px);
  font-weight: 800;
  line-height: 0.8;
  pointer-events: none;
}

body[data-page="asphalt-driveway-cost-calculator"] .tool-hero::after {
  position: absolute;
  right: clamp(18px, 7vw, 98px);
  bottom: 10px;
  color: rgba(23, 26, 22, 0.055);
  content: "COST";
  font-family: "DIN Alternate", "Avenir Next", sans-serif;
  font-size: clamp(86px, 15vw, 190px);
  font-weight: 800;
  line-height: 0.8;
  pointer-events: none;
}

body[data-page="concrete-calculator"] .tool-hero::after {
  position: absolute;
  right: clamp(18px, 7vw, 98px);
  bottom: 10px;
  color: rgba(23, 26, 22, 0.055);
  content: "YARDS";
  font-family: "DIN Alternate", "Avenir Next", sans-serif;
  font-size: clamp(84px, 14vw, 185px);
  font-weight: 800;
  line-height: 0.8;
  pointer-events: none;
}

body[data-page="gravel-calculator"] .tool-hero::after,
body[data-page="pea-gravel-calculator"] .tool-hero::after {
  position: absolute;
  right: clamp(18px, 7vw, 98px);
  bottom: 10px;
  color: rgba(23, 26, 22, 0.055);
  content: "TONS";
  font-family: "DIN Alternate", "Avenir Next", sans-serif;
  font-size: clamp(90px, 16vw, 210px);
  font-weight: 800;
  line-height: 0.8;
  pointer-events: none;
}

body[data-page="cubic-yard-calculator"] .tool-hero::after {
  position: absolute;
  right: clamp(18px, 7vw, 98px);
  bottom: 10px;
  color: rgba(23, 26, 22, 0.055);
  content: "YD3";
  font-family: "DIN Alternate", "Avenir Next", sans-serif;
  font-size: clamp(92px, 16vw, 205px);
  font-weight: 800;
  line-height: 0.8;
  pointer-events: none;
}

.home-copy,
.tool-intro {
  position: relative;
  z-index: 1;
  width: 100%;
  min-width: 0;
  max-width: 880px;
  animation: surface-in 460ms ease both;
}

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

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

h1 {
  max-width: 820px;
  margin-bottom: 14px;
  font-size: clamp(42px, 6vw, 76px);
  font-weight: 850;
  line-height: 0.98;
  letter-spacing: 0;
  overflow-wrap: break-word;
  text-wrap: pretty;
}

h2 {
  margin-bottom: 12px;
  font-size: clamp(26px, 3vw, 38px);
  font-weight: 850;
  line-height: 1.08;
  letter-spacing: 0;
  overflow-wrap: break-word;
  text-wrap: pretty;
}

.home-copy > p:not(.eyebrow),
.tool-intro > p:not(.eyebrow) {
  max-width: 680px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 18px;
}

.home-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}

.home-actions a {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid rgba(59, 103, 87, 0.34);
  border-radius: 6px;
  background: rgba(255, 254, 250, 0.84);
  color: var(--green-strong);
  font-size: 13px;
  font-weight: 850;
  text-decoration: none;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.home-actions a:hover {
  transform: translateY(-1px);
  border-color: var(--green-strong);
  background: var(--green-soft);
  color: var(--ink);
}

.assumption-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 850px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.assumption-strip span {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 254, 250, 0.78);
  color: var(--green-strong);
  font-size: 13px;
  font-weight: 800;
}

.section,
.compact-section,
.content-grid,
.calculator-shell {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
}

.section {
  padding: 42px 0;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 18px;
}

.section-heading p {
  max-width: 460px;
  color: var(--muted);
}

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

.tool-link {
  min-height: 134px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 254, 250, 0.92);
  text-decoration: none;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.tool-link:hover {
  transform: translateY(-2px);
  border-color: rgba(59, 103, 87, 0.45);
  background: var(--surface);
  box-shadow: 0 18px 45px rgba(26, 29, 23, 0.12);
}

.tool-link span {
  font-size: 18px;
  font-weight: 850;
}

.tool-link small {
  color: var(--muted);
  font-size: 14px;
}

.tool-link.primary {
  border-color: rgba(59, 103, 87, 0.52);
  background:
    linear-gradient(135deg, rgba(244, 230, 189, 0.52), transparent 45%),
    var(--green-soft);
}

.home-guide {
  padding-top: 24px;
}

.guide-grid,
.formula-grid,
.project-grid {
  display: grid;
  gap: 12px;
}

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

.guide-card,
.formula-card,
.project-grid a {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 254, 250, 0.9);
  text-decoration: none;
}

.guide-card {
  min-height: 138px;
  display: grid;
  align-content: space-between;
  gap: 16px;
  padding: 18px;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.guide-card strong {
  color: var(--ink);
  font-size: 17px;
  font-weight: 850;
  line-height: 1.2;
}

.guide-card span,
.formula-card span {
  color: var(--muted);
  font-size: 14px;
}

.guide-card:hover,
.project-grid a:hover {
  transform: translateY(-2px);
  border-color: rgba(59, 103, 87, 0.45);
  background: var(--surface);
  box-shadow: 0 18px 45px rgba(26, 29, 23, 0.1);
}

.home-split {
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(0, 1.14fr);
  align-items: start;
  gap: clamp(22px, 4vw, 52px);
  padding-top: 34px;
}

.home-split > div:first-child p:not(.eyebrow) {
  color: var(--muted);
}

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

.formula-card {
  min-height: 120px;
  display: grid;
  align-content: space-between;
  gap: 14px;
  padding: 18px;
  background:
    linear-gradient(135deg, rgba(220, 233, 223, 0.55), transparent 68%),
    rgba(255, 254, 250, 0.9);
}

.formula-card strong {
  color: var(--green-strong);
  font-size: 15px;
  font-weight: 850;
}

.project-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.project-grid a {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 14px;
  color: var(--green-strong);
  font-size: 14px;
  font-weight: 850;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease, background 160ms ease, color 160ms ease;
}

.project-grid a::after {
  color: var(--rust);
  content: ">";
  font-family: "DIN Alternate", "Avenir Next", sans-serif;
  font-weight: 850;
}

.home-notes {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(26px, 4vw, 56px);
}

.home-notes .content-section {
  padding-top: 0;
}

.compact-section {
  padding: 36px 0 70px;
}

.check-list,
.number-list {
  padding-left: 22px;
  color: var(--muted);
}

.check-list li,
.number-list li {
  margin-bottom: 8px;
}

.notice {
  color: var(--rust);
  font-size: 14px;
}

.calculator-shell {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(340px, 0.8fr);
  gap: 0;
  overflow: visible;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  animation: surface-in 560ms 90ms ease both;
}

.calculator-shell::before {
  position: absolute;
  inset: 0 0 auto;
  z-index: 2;
  height: 7px;
  background: repeating-linear-gradient(
    135deg,
    var(--caution) 0 16px,
    var(--caution) 16px 28px,
    var(--asphalt) 28px 40px,
    var(--asphalt) 40px 52px
  );
  content: "";
}

.calculator-form {
  padding: clamp(24px, 4vw, 38px);
  overflow: visible;
  border-radius: 8px 0 0 8px;
  background:
    linear-gradient(90deg, rgba(23, 26, 22, 0.03) 1px, transparent 1px) 0 0 / 32px 32px,
    linear-gradient(180deg, rgba(23, 26, 22, 0.026) 1px, transparent 1px) 0 0 / 32px 32px,
    var(--surface);
}

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

.calculator-title-row h2 {
  margin-bottom: 0;
}

.ghost-button,
.copy-button,
.preset-button {
  min-height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  font-weight: 850;
  letter-spacing: 0;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.ghost-button {
  padding: 0 15px;
}

.ghost-button:hover,
.copy-button:hover,
.preset-button:hover {
  transform: translateY(-1px);
  border-color: rgba(59, 103, 87, 0.55);
  background: var(--field);
}

.preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
}

.preset-button {
  min-height: 38px;
  padding: 0 12px;
  background: rgba(255, 254, 250, 0.82);
  color: var(--green-strong);
  font-size: 13px;
}

.preset-button.is-active {
  border-color: var(--green-strong);
  background: var(--green-strong);
  color: #fbfaf2;
  box-shadow: 0 8px 20px rgba(36, 72, 61, 0.2);
}

.mode-visual {
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(180px, 0.68fr);
  align-items: center;
  gap: 18px;
  margin: 0 0 22px;
  padding: 16px;
  overflow: hidden;
  border: 1px solid rgba(59, 103, 87, 0.22);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(220, 233, 223, 0.72), rgba(255, 254, 250, 0.86)),
    var(--surface);
}

.mode-visual__copy {
  min-width: 0;
}

.mode-visual__kicker {
  display: block;
  margin-bottom: 4px;
  color: var(--green);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.mode-visual strong {
  display: block;
  color: var(--ink);
  font-size: 17px;
  line-height: 1.2;
}

.mode-visual p {
  max-width: 34em;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.mode-visual__art {
  min-width: 0;
}

.mode-visual__svg {
  width: 100%;
  max-height: 148px;
  display: block;
}

.diagram-face {
  fill: rgba(251, 250, 242, 0.9);
  stroke: var(--green-strong);
  stroke-width: 2;
}

.diagram-side {
  fill: rgba(220, 233, 223, 0.68);
  stroke: var(--green-strong);
  stroke-width: 2;
}

.diagram-back {
  fill: rgba(244, 230, 189, 0.4);
}

.diagram-cut {
  fill: var(--surface);
  stroke: var(--green-strong);
  stroke-width: 2;
}

.diagram-line,
.diagram-accent {
  fill: none;
  stroke: var(--rust);
  stroke-linecap: round;
  stroke-width: 2;
}

.diagram-label {
  fill: var(--rust);
  font-family: "Avenir Next", "Helvetica Neue", sans-serif;
  font-size: 12px;
  font-weight: 850;
}

.input-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
  gap: 16px;
  overflow: visible;
}

label {
  position: relative;
  z-index: 1;
  min-width: 0;
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

label.has-open-select {
  z-index: 80;
}

input,
select {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--field);
  color: var(--ink);
  font-size: 16px;
  outline: none;
  padding: 0 12px;
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

select {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

input {
  font-family: "DIN Alternate", "Avenir Next", sans-serif;
  font-variant-numeric: tabular-nums;
}

input:focus,
select:focus {
  border-color: var(--green);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(59, 103, 87, 0.14);
}

.native-select-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  min-height: 1px !important;
  margin: 0 !important;
  opacity: 0 !important;
  overflow: hidden !important;
  pointer-events: none !important;
}

.custom-select {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 6px;
  min-width: 0;
}

.custom-select.is-floating {
  position: relative;
}

.custom-select.is-open {
  z-index: 90;
}

.custom-select__button {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background:
    linear-gradient(180deg, rgba(255, 254, 250, 0.72), transparent),
    var(--field);
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-weight: 850;
  overflow: hidden;
  text-align: left;
  transition: background 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.custom-select__button:hover,
.custom-select.is-open .custom-select__button {
  border-color: var(--green);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(59, 103, 87, 0.12);
}

.custom-select__value {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.custom-select__chevron {
  width: 0;
  height: 0;
  flex: 0 0 auto;
  border-top: 6px solid var(--muted);
  border-right: 5px solid transparent;
  border-left: 5px solid transparent;
  transition: transform 150ms ease;
}

.custom-select.is-open .custom-select__chevron {
  transform: rotate(180deg);
}

.custom-select__menu {
  display: none;
  max-height: 220px;
  overflow: auto;
  padding: 6px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background:
    linear-gradient(90deg, rgba(23, 26, 22, 0.028) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(180deg, rgba(23, 26, 22, 0.024) 1px, transparent 1px) 0 0 / 24px 24px,
    var(--surface);
  box-shadow: 0 14px 34px rgba(26, 29, 23, 0.14);
}

.custom-select.is-open .custom-select__menu {
  display: grid;
  gap: 4px;
}

.custom-select.is-floating .custom-select__menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 100;
}

.custom-select.is-floating.opens-up .custom-select__menu {
  top: auto;
  bottom: calc(100% + 6px);
}

.custom-select__option {
  width: 100%;
  min-width: 0;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: var(--green-strong);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left;
  white-space: nowrap;
}

.custom-select__option:hover,
.custom-select__option:focus {
  border-color: rgba(59, 103, 87, 0.28);
  background: var(--green-soft);
  outline: none;
}

.custom-select__option.is-selected {
  background: var(--green-strong);
  color: #fbfaf2;
}

.hidden {
  display: none;
}

.results-panel {
  position: relative;
  overflow: hidden;
  padding: clamp(26px, 4vw, 40px);
  border-radius: 0 8px 8px 0;
  background:
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 10px),
    linear-gradient(180deg, var(--asphalt-soft), var(--asphalt));
  color: #fbfaf2;
}

.results-panel::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 1px;
  background: rgba(255, 254, 250, 0.12);
  content: "";
}

.results-panel .eyebrow {
  color: #bfd6c8;
}

.primary-result {
  position: relative;
  padding: 4px 0 24px;
  border-bottom: 1px solid rgba(251, 250, 242, 0.18);
}

.primary-result span {
  display: block;
  font-family: "DIN Alternate", "Avenir Next", sans-serif;
  font-size: clamp(56px, 8vw, 96px);
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  line-height: 0.9;
}

.primary-result small {
  color: #d5dfd6;
  font-size: 15px;
}

.results-panel.is-updated .primary-result span {
  animation: number-pop 240ms ease;
}

.result-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 18px 0 6px;
}

.result-meta span {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid rgba(251, 250, 242, 0.14);
  border-radius: 6px;
  background: rgba(251, 250, 242, 0.07);
  color: #d5dfd6;
  font-size: 12px;
  font-weight: 850;
}

.result-list {
  display: grid;
  gap: 0;
  margin: 18px 0 22px;
}

.result-list div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 0;
  border-bottom: 1px solid rgba(251, 250, 242, 0.14);
}

.result-list dt {
  color: #d5dfd6;
}

.result-list dd {
  margin: 0;
  font-family: "DIN Alternate", "Avenir Next", sans-serif;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  text-align: right;
}

.copy-button {
  width: 100%;
  background: var(--caution-soft);
  color: var(--asphalt);
}

.copy-button:hover {
  border-color: var(--caution);
  background: #ffe9a7;
}

.result-note {
  margin: 14px 0 0;
  color: #d5dfd6;
  font-size: 13px;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 280px);
  gap: clamp(18px, 3vw, 34px);
  padding: 58px 0 80px;
}

.content-grid-single {
  grid-template-columns: minmax(0, 1fr);
}

.content-grid-single .content-main {
  width: min(100%, 920px);
}

.content-section {
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
}

.content-section:first-child {
  padding-top: 0;
}

.content-section p {
  color: var(--muted);
}

.formula-block {
  display: grid;
  gap: 8px;
  padding: 18px;
  border: 1px solid var(--line);
  border-left: 7px solid var(--green);
  border-radius: 0 8px 8px 0;
  background:
    linear-gradient(90deg, rgba(59, 103, 87, 0.08), transparent 60%),
    var(--stone);
  font-weight: 850;
}

.formula-block p {
  margin: 0;
  color: var(--ink);
}

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

.related-list a {
  min-height: 48px;
  display: flex;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 254, 250, 0.86);
  color: var(--green-strong);
  font-weight: 850;
  text-decoration: none;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.related-list a:hover {
  transform: translateY(-1px);
  border-color: rgba(59, 103, 87, 0.48);
  background: var(--green-soft);
}

details {
  padding: 16px 0;
  border-top: 1px solid var(--line);
}

details:first-of-type {
  border-top: 0;
}

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

details p {
  margin: 10px 0 0;
}

.related-panel {
  position: sticky;
  top: 92px;
  align-self: start;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 254, 250, 0.92);
  box-shadow: 0 18px 45px rgba(26, 29, 23, 0.08);
}

.related-panel h2 {
  margin-top: 0;
  font-size: 22px;
}

.related-panel p {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 13px;
}

.related-panel > a {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 9px;
  padding: 11px 12px;
  border: 1px solid rgba(59, 103, 87, 0.34);
  border-radius: 6px;
  background: rgba(255, 254, 250, 0.88);
  color: var(--green-strong);
  font-weight: 850;
  text-decoration: none;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.related-panel > a::after {
  color: var(--rust);
  content: ">";
  font-family: "DIN Alternate", "Avenir Next", sans-serif;
  font-weight: 800;
}

.related-panel > a:hover {
  transform: translateY(-1px);
  border-color: var(--green-strong);
  background: var(--green-soft);
  color: var(--ink);
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 28px clamp(18px, 4vw, 56px);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.site-footer.site-disclaimer {
  display: block;
}

.site-footer.site-disclaimer span {
  display: block;
  max-width: 920px;
}

@keyframes surface-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes number-pop {
  0% {
    transform: translateY(0) scale(1);
  }

  45% {
    transform: translateY(-2px) scale(1.015);
  }

  100% {
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 980px) {
  .site-header,
  .section-heading,
  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .site-nav {
    flex-wrap: wrap;
  }

  .calculator-grid,
  .calculator-shell,
  .guide-grid,
  .home-split,
  .home-notes,
  .input-grid,
  .mode-visual {
    grid-template-columns: 1fr;
  }

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

  .results-panel::before {
    inset: 0 0 auto;
    width: auto;
    height: 1px;
  }

  .calculator-form {
    border-radius: 8px 8px 0 0;
  }

  .results-panel {
    border-radius: 0 0 8px 8px;
  }

}

@media (max-width: 620px) {
  .content-grid {
    grid-template-columns: 1fr;
  }

  .related-panel {
    position: static;
  }

  h1 {
    max-width: 11ch;
    font-size: 38px;
    line-height: 1.02;
  }

  .home-hero,
  .tool-hero {
    padding-top: 34px;
  }

  body[data-page="asphalt-calculator"] .tool-hero::after,
  body[data-page="asphalt-driveway-cost-calculator"] .tool-hero::after,
  body[data-page="concrete-calculator"] .tool-hero::after,
  body[data-page="concrete-block-calculator"] .tool-hero::after,
  body[data-page="gravel-calculator"] .tool-hero::after,
  body[data-page="pea-gravel-calculator"] .tool-hero::after,
  body[data-page="cubic-yard-calculator"] .tool-hero::after {
    display: none;
  }

  .home-copy > p:not(.eyebrow),
  .tool-intro > p:not(.eyebrow) {
    max-width: 32ch;
    font-size: 16px;
    overflow-wrap: break-word;
  }

  .calculator-title-row h2 {
    max-width: 13ch;
    font-size: 28px;
  }

  .assumption-strip {
    display: grid;
    margin-top: 18px;
  }

  .assumption-strip span {
    width: 100%;
  }

  .site-header {
    gap: 12px;
  }

  .site-nav {
    gap: 4px;
    font-size: 13px;
  }

  .site-nav a {
    padding: 0 7px;
  }

  .section,
  .compact-section,
  .content-grid,
  .calculator-shell {
    width: min(100% - 24px, 1180px);
  }

  .formula-grid,
  .project-grid {
    grid-template-columns: 1fr;
  }

  .home-actions a,
  .project-grid a {
    width: 100%;
  }

  .calculator-shell,
  .tool-link,
  .related-panel {
    border-radius: 6px;
  }

  .calculator-form {
    border-radius: 6px 6px 0 0;
  }

  .results-panel {
    border-radius: 0 0 6px 6px;
  }

  .calculator-title-row,
  .result-meta,
  .result-list div {
    grid-template-columns: 1fr;
  }

  .calculator-title-row {
    flex-direction: column;
  }

  .ghost-button {
    width: 100%;
  }

  .preset-button {
    flex: 1 1 100%;
  }

  .primary-result span {
    font-size: 56px;
  }

  .result-list div {
    display: grid;
    gap: 3px;
  }

  .result-list dd {
    text-align: left;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }
}
