:root {
  color-scheme: light;
  --bg: #f6f3ec;
  --ink: #22231f;
  --muted: #687069;
  --line: #d8d0c3;
  --panel: #fffdf8;
  --accent: #2f6d62;
  --accent-dark: #214c46;
  --gold: #b5782e;
  --danger: #963f34;
  --shadow: 0 18px 44px rgba(42, 34, 24, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(130deg, rgba(47, 109, 98, 0.13), transparent 34%),
    linear-gradient(310deg, rgba(181, 120, 46, 0.15), transparent 34%),
    var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
  font-size: 16px;
}

a {
  color: inherit;
}

.page {
  width: min(1120px, calc(100% - 28px));
  margin: 0 auto;
  padding: 20px 0 38px;
}

.hero {
  padding: 10px 0 16px;
}

.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.brand img {
  width: 116px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 5px;
  box-shadow: 0 8px 20px rgba(42, 34, 24, 0.08);
}

.text-link {
  color: var(--accent-dark);
  font-weight: 850;
  text-decoration: none;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.46fr);
  gap: 16px;
  align-items: stretch;
}

.hero-copy,
.panel,
.result-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.96);
  box-shadow: var(--shadow);
}

.hero-copy {
  padding: clamp(18px, 4vw, 34px);
}

.eyebrow,
.field span,
.result-card span,
.friction-result span,
.print-grid span {
  display: block;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 880;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  max-width: 780px;
  margin-top: 8px;
  font-size: clamp(2.2rem, 7vw, 5.6rem);
  line-height: 0.92;
  letter-spacing: 0;
}

h2 {
  font-size: clamp(1.4rem, 3vw, 2.15rem);
  line-height: 1;
  letter-spacing: 0;
}

.lead,
.section-title p,
.cta p,
.note {
  margin-top: 10px;
  color: var(--muted);
  font-weight: 720;
  line-height: 1.48;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 22px;
}

.button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 7px;
  padding: 0 15px;
  cursor: pointer;
  font-weight: 880;
  text-decoration: none;
}

.primary {
  background: var(--accent);
  color: #fff;
}

.secondary {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--accent-dark);
}

.result-card {
  display: grid;
  align-content: center;
  padding: clamp(18px, 4vw, 28px);
}

.result-card strong {
  display: block;
  margin-top: 8px;
  color: var(--accent-dark);
  font-size: clamp(3rem, 8vw, 5.8rem);
  line-height: 0.95;
}

.result-card small {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-weight: 780;
  line-height: 1.35;
}

.calculator-grid,
.reference-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 14px;
}

.panel {
  padding: 16px;
}

.section-title {
  margin-bottom: 14px;
}

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

.compact {
  margin-top: 14px;
}

.field span {
  margin-bottom: 6px;
  color: var(--muted);
}

.input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  padding-right: 10px;
}

.input-row input {
  width: 100%;
  min-height: 44px;
  border: 0;
  background: transparent;
  padding: 0 11px;
}

.input-row b {
  color: var(--accent-dark);
}

input:focus {
  outline: 0;
}

.input-row:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(47, 109, 98, 0.14);
}

.check-row {
  display: flex;
  align-items: center;
  min-height: 44px;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  padding: 0 11px;
  color: var(--accent-dark);
  font-weight: 820;
}

.formula-strip {
  margin-top: 14px;
  border: 1px solid rgba(47, 109, 98, 0.2);
  border-radius: 7px;
  background: rgba(47, 109, 98, 0.08);
  padding: 11px;
  color: var(--accent-dark);
  font-weight: 840;
  line-height: 1.35;
}

.guide-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 13px;
}

.guide-card ol {
  margin: 0;
  padding-left: 21px;
  color: var(--ink);
  font-weight: 690;
  line-height: 1.52;
}

.friction-result {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 12px;
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.friction-result strong {
  display: block;
  margin-top: 5px;
  color: var(--accent-dark);
  font-size: 2.35rem;
  line-height: 1;
}

.reference-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.reference-list div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 8px 0;
}

.reference-list span {
  color: var(--muted);
  font-weight: 780;
}

.reference-list strong {
  color: var(--accent-dark);
  font-size: 1.1rem;
}

.cta {
  display: grid;
  align-content: center;
}

.cta .button {
  width: fit-content;
  margin-top: 16px;
}

.warning {
  color: var(--danger) !important;
}

.print-guide {
  display: none;
}

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

  .result-card strong {
    font-size: 3.2rem;
  }
}

@media (max-width: 560px) {
  .page {
    width: min(100% - 18px, 520px);
    padding-top: 12px;
  }

  .brand img {
    width: 88px;
  }

  .brand-row {
    align-items: start;
  }

  h1 {
    font-size: 2.55rem;
  }

  .fields,
  .friction-result {
    grid-template-columns: 1fr;
  }

  .hero-actions .button,
  .friction-result .button {
    width: 100%;
  }
}

@media print {
  @page {
    margin: 0.45in;
    size: letter portrait;
  }

  body {
    background: #fff;
  }

  .hero,
  .calculator-grid,
  .reference-grid {
    display: none !important;
  }

  .page {
    width: 100%;
    padding: 0;
  }

  .print-guide {
    display: block;
  }

  .print-guide header {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    border-bottom: 2px solid #111;
    padding-bottom: 10px;
    margin-bottom: 14px;
  }

  .print-guide img {
    width: 110px;
    object-fit: contain;
  }

  .print-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 14px;
  }

  .print-grid div {
    border: 1px solid #111;
    padding: 7px;
  }

  .print-grid strong {
    display: block;
    margin-top: 4px;
    font-size: 12pt;
  }

  table {
    width: 100%;
    border-collapse: collapse;
  }

  th,
  td {
    border: 1px solid #111;
    padding: 8px;
    text-align: left;
    vertical-align: top;
    font-size: 10pt;
  }

  th {
    width: 32%;
    background: #f2f2f2;
  }
}
