:root {
  --paper: #faf8f3;
  --forest: #24473f;
  --ink: #243330;
  --muted: #586c65;
  --line: #e2dfd6;
  --cream: #fff7e6;
  --card: #ffffff;
  --tint: #eef3f1;
  --warn: #9a3b1f;
  --ok: #2f6b3a;
  --glow: #e1ece7;
  --ring: #9dbcaf;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 17px/1.55 "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}
/* Links light up on hover or tap instead of a heavier underline. Links in running text keep their underline,
   so they never rely on colour alone. */
a { color: var(--forest); text-underline-offset: 2px; border-radius: 4px;
  transition: background-color 0.15s, box-shadow 0.15s, border-color 0.15s; }
a:hover, a:active { background: var(--glow); box-shadow: 0 0 0 3px var(--glow); }
.brand:hover, .brand:active { background: none; box-shadow: none; }
/* Links that leave the site carry a small arrow, so it's clear before clicking (decorative for screen readers). */
a[href^="http"]::after { content: "\2197"; content: "\2197" / ""; display: inline-block; margin-left: 0.2em;
  font-size: 0.85em; font-weight: 400; }
:focus-visible { outline: 3px solid var(--forest); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { a { transition: none; } }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 8px; background: var(--card); padding: 6px 10px; z-index: 2; }

.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }
.wrap.narrow { max-width: 760px; }
.top { border-bottom: 1px solid var(--line); background: var(--paper); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; flex-wrap: wrap; }
.brand img { display: block; height: 34px; width: auto; }
.top nav { display: flex; gap: 4px; }
.top nav a { padding: 6px 12px; border-radius: 999px; text-decoration: none; font-weight: 600; }
.top nav a:hover, .top nav a:active { box-shadow: none; }

h1 { font-size: clamp(28px, 4.6vw, 42px); line-height: 1.15; margin: 8px 0 12px; letter-spacing: -0.01em; }
h2 { font-size: 23px; line-height: 1.25; margin: 0 0 8px; }
/* Headings share their words evenly across lines, so none ends on a single stray word. */
h1, h2, .answer .big, .card strong { text-wrap: balance; }
.lead, .answer p { text-wrap: pretty; }
.lead { font-size: 19px; color: var(--muted); margin: 0 0 22px; }
.crumb { margin: 26px 0 0; font-size: 15px; }
.eyebrow { display: block; font-size: 13px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.small { font-size: 14px; color: var(--muted); }
.note { font-size: 15px; color: var(--muted); border-left: 3px solid var(--line); padding-left: 12px; }

.hero { padding: 28px 0 8px; }
.hero .lead { max-width: 760px; }   /* the heading uses the full width, so it fits on one line on laptops */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; margin: 10px 0 40px; }
.card { display: flex; flex-direction: column; gap: 4px; background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 20px; text-decoration: none; color: var(--ink); }
.card strong { font-size: 19px; line-height: 1.3; color: var(--forest); }
.card span:last-child { color: var(--muted); font-size: 16px; }
.card:hover, .card:active { border-color: var(--forest); background: #f4f8f6; box-shadow: none; }
/* The header's Calculators link previews where it goes: hovering or focusing it rings the cards on the home page.
   Arriving through it rings them once, then fades, which also works on phones. */
@media (hover: hover) {   /* a tapped link stays "hovered" on phones, which would leave the ring on */
  body:has(.top nav a[href="/#calculators"]:hover) .card { box-shadow: 0 0 0 2px var(--ring); }
}
body:has(.top nav a[href="/#calculators"]:focus-visible) .card { box-shadow: 0 0 0 2px var(--ring); }
@keyframes ring-fade { 0%, 45% { box-shadow: 0 0 0 2px var(--ring); } 100% { box-shadow: 0 0 0 2px rgba(157, 188, 175, 0); } }
#calculators { scroll-margin-top: 20px; }
#calculators:target .card { animation: ring-fade 1.1s ease-out; }
@media (prefers-reduced-motion: reduce) { #calculators:target .card { animation: none; } }
.range { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 24px; margin-bottom: 48px; }
.tools { padding-left: 20px; }
.tools li { margin: 6px 0; }

.calc { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 22px; margin: 0 0 22px; }
.calc .lead { font-size: 17px; margin-bottom: 14px; }
.currency { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; font-size: 15px; color: var(--muted); }
.currency select { font: inherit; padding: 4px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); color: var(--ink); }
.fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px 20px; }
.field { display: flex; flex-direction: column; gap: 3px; }
.field label { font-weight: 600; }
.hint { font-size: 14px; color: var(--muted); }
.input { display: flex; align-items: center; background: var(--cream); border: 1px solid #e6d9b8; border-radius: 10px; }
.input:focus-within { border-color: var(--forest); box-shadow: 0 0 0 2px rgba(36, 71, 63, 0.18); }
.input input { flex: 1; min-width: 0; font: inherit; font-size: 18px; padding: 10px 12px; border: 0; background: transparent; color: var(--ink); outline: none; }
.input.has-pre input { padding-left: 4px; }
.unit { color: var(--muted); padding: 0 12px; white-space: nowrap; }
.unit.pre { padding-right: 0; }
.input input[aria-invalid="true"] { color: var(--warn); }
.input select { flex: 1; min-width: 0; font: inherit; font-size: 17px; padding: 10px 12px; border: 0; background: transparent; color: var(--ink); outline: none; }
.field.wide { grid-column: 1 / -1; }
.days { grid-column: 1 / -1; border: 0; margin: 0; padding: 0; min-width: 0; }
.days legend { font-weight: 600; padding: 0; margin-bottom: 6px; }
.boxes { display: flex; flex-wrap: wrap; gap: 8px; }
.day { display: inline-flex; align-items: center; gap: 6px; background: var(--cream); border: 1px solid #e6d9b8; border-radius: 10px;
  padding: 8px 12px; cursor: pointer; font-weight: 600; }
.day input { width: 18px; height: 18px; margin: 0; accent-color: var(--forest); }
.day:has(input:focus-visible) { outline: 3px solid var(--forest); outline-offset: 2px; }
.check { min-height: 1em; font-size: 14px; color: var(--warn); }
.check:empty { min-height: 0; }
.check.soft { color: var(--muted); }
.input:has(input[aria-invalid="true"]) { border-color: var(--warn); box-shadow: 0 0 0 2px rgba(154, 59, 31, 0.15); }

.answer { margin-top: 18px; padding: 18px; border-radius: 12px; background: var(--tint); }
.answer p { margin: 0 0 8px; }
.answer p:last-child { margin-bottom: 0; }
.answer .big { font-size: 26px; font-weight: 700; color: var(--forest); line-height: 1.2; margin-bottom: 10px; }
.answer p:not(.big):not(.pending) { font-size: 16px; color: #3f514c; }
.answer p strong { color: var(--ink); }
.answer .big.warn, .answer .warn { color: var(--warn); }
.answer .big.ok { color: var(--ok); }
.answer .pending { color: var(--muted); }
.answer table { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 16px; background: var(--card); border-radius: 8px; overflow: hidden; }
.answer th, .answer td { padding: 8px 10px; text-align: right; border-bottom: 1px solid var(--line); }
.answer th[scope="row"], .answer thead th:first-child { text-align: left; }
.answer thead th { font-size: 14px; color: var(--muted); font-weight: 600; }
.answer td { white-space: nowrap; }
.answer td.neg { color: var(--warn); }
.answer table.plain { background: transparent; border-radius: 0; border-top: 1px solid var(--line); }
.answer table.plain th[scope="row"] { font-weight: 400; }

.how { margin: 30px 0; }
.how ul { padding-left: 20px; }
.how li { margin: 6px 0; }

.product { background: var(--forest); color: #fff; border-radius: 14px; padding: 24px; margin: 30px 0 48px; }
.product .eyebrow { color: #cfe0da; }
.product h2 { color: #fff; margin-top: 6px; }
.product p { margin: 0 0 14px; }
.product .small { color: #cfe0da; margin: 14px 0 0; }
.buttons { display: flex; flex-wrap: wrap; gap: 10px; }
.button { display: inline-block; background: var(--forest); color: #fff; text-decoration: none; font-weight: 600;
  padding: 10px 16px; border-radius: 10px; border: 2px solid var(--forest); }
.product .button { background: #fff; color: var(--forest); border-color: #fff; }
.product .button.ghost { background: transparent; color: #fff; }
.button:hover, .button:active { background: #2f5d52; border-color: #2f5d52; box-shadow: none; }
.product .button:hover, .product .button:active { background: var(--glow); border-color: var(--glow); }
.product .button.ghost:hover, .product .button.ghost:active { background: rgba(255, 255, 255, 0.14); border-color: #fff; }

.more { margin: -24px 0 48px; }
.more h2 { font-size: 19px; margin-bottom: 6px; }
.more ul { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 0 20px; }
.more li { border-bottom: 1px solid var(--line); }
.more a { display: block; padding: 10px 8px; margin: 0 -8px; border-radius: 8px; font-weight: 600; text-decoration: none; }
.more a:hover, .more a:active { box-shadow: none; }

.bottom { border-top: 1px solid var(--line); padding: 26px 0 40px; color: var(--muted); font-size: 15px; }
.bottom p { margin: 6px 0; }
.bottom img { vertical-align: -4px; margin-right: 4px; }

@media (max-width: 560px) {
  body { font-size: 16px; }
  .calc, .range, .product { padding: 16px; border-radius: 12px; }
  .answer table { font-size: 14px; }
  .answer th, .answer td { padding: 6px; }
}
@media (max-width: 600px) {
  .top nav { margin-left: -12px; }   /* nav wraps under the logo: line its text up with the logo */
}
