/* ==========================================================================
   Trailwise — map paper, pine ink, one blaze-orange marker.

   The palette is lifted from what a US trail actually looks like: a cool
   grey-green map sheet, dark pine ink, a blaze on a tree trunk, and the blue
   of a creek. Nothing warm-cream, because warm cream reads as a kitchen.

   --surface is *lighter* than --bg, so cards float up out of the page rather
   than sinking into it. --primary-strong is darker than --primary, because
   hover on a light theme moves toward the ink. Shadows are tinted pine rather
   than black; rgba(0,0,0,.08) on a pale ground reads as dirt.
   ========================================================================== */

:root {
  color-scheme: light;

  --bg: #e9ede4;
  --bg-tint: #e0e6d7;
  --surface: #ffffff;
  --surface-2: #eff2ec;

  --text: #16241d;
  --text-soft: #3d4d44;
  --text-mute: #56655c;

  --primary: #1f4d3a;
  --primary-strong: #143528;
  --primary-wash: #dbe7dd;
  --accent: #c25a24;
  --accent-ink: #9b4318;
  --accent-wash: #f7e3d6;
  --water: #2f6d8c;

  --ok: #1f6b46;
  --ok-wash: #dcefe2;
  --warn: #85550f;
  --warn-wash: #f8edd4;
  --err: #97362a;
  --err-wash: #f8e1db;

  --line: #ccd7c9;
  --line-strong: #afbdab;

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;

  --shadow-sm: 0 1px 2px rgba(20, 40, 31, 0.07), 0 2px 6px rgba(20, 40, 31, 0.05);
  --shadow-md: 0 2px 4px rgba(20, 40, 31, 0.07), 0 10px 24px rgba(20, 40, 31, 0.09);

  /* No webfont is downloaded: the stack prefers Inter when the reader already
     has it, then falls back to the platform UI face. */
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-head: var(--font);
  --font-mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace;

  --wrap: 1120px;
  --header-h: 66px;
}

/* ---------- reset ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16.5px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-head);
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: -0.015em;
  margin: 0;
  color: var(--text);
}

p {
  margin: 0;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: var(--primary);
  text-decoration-color: color-mix(in srgb, var(--primary) 35%, transparent);
  text-underline-offset: 2px;
}

a:hover {
  color: var(--primary-strong);
  text-decoration-color: currentColor;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

button {
  font: inherit;
  color: inherit;
}

/* Numbers that sit in columns or next to units. Proportional figures make a
   column of times look like it was set by hand. */
.tnum {
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1;
}

.icon {
  width: 1.15em;
  height: 1.15em;
  flex: none;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- skip link ---------- */

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 10px 16px;
  background: var(--primary);
  color: #fff;
  border-radius: 0 0 var(--r-sm) 0;
}

.skip-link:focus {
  left: 0;
  color: #fff;
}

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 24px;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
  text-decoration: none;
  font-family: var(--font-head);
  font-weight: 650;
  letter-spacing: -0.02em;
}

.brand:hover {
  color: var(--text);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--primary);
  color: #fff;
}

.brand-mark .icon {
  width: 19px;
  height: 19px;
}

.brand-name {
  font-size: 18px;
}

.nav ul {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link {
  display: inline-block;
  padding: 8px 13px;
  border-radius: 999px;
  color: var(--text-soft);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
}

.nav-link:hover {
  color: var(--text);
  background: var(--surface-2);
}

.nav-link.is-current {
  color: var(--primary-strong);
  background: var(--primary-wash);
  font-weight: 600;
}

.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  cursor: pointer;
}

.nav-toggle .icon {
  width: 20px;
  height: 20px;
}

.nav-toggle-close {
  display: none;
}

.nav-toggle[aria-expanded='true'] .nav-toggle-open {
  display: none;
}

.nav-toggle[aria-expanded='true'] .nav-toggle-close {
  display: block;
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-family: var(--font-head);
  font-size: 15.5px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}

.btn .icon {
  width: 17px;
  height: 17px;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background: var(--primary-strong);
  color: #fff;
}

.btn-ghost {
  background: var(--surface);
  color: var(--primary-strong);
  border-color: var(--line-strong);
}

.btn-ghost:hover {
  background: var(--primary-wash);
  border-color: var(--primary);
  color: var(--primary-strong);
}

.btn-quiet {
  background: var(--surface-2);
  color: var(--text-soft);
  border-color: var(--line);
  padding: 7px 14px;
  font-size: 14px;
}

.btn-quiet:hover {
  background: var(--primary-wash);
  color: var(--primary-strong);
  border-color: var(--line-strong);
}

/* ---------- hero ---------- */

.hero {
  position: relative;
  padding: 66px 0 54px;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(900px 380px at 12% -10%, rgba(31, 77, 58, 0.1), transparent 70%),
    radial-gradient(700px 320px at 92% 0%, rgba(194, 90, 36, 0.09), transparent 72%),
    var(--bg);
  overflow: hidden;
}

/* Map paper: a faint graticule under contour rings. The grid is what makes it
   read as a map sheet rather than as a coloured box; the rings alone read as a
   stain, and the grid alone reads as graph paper. */
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(0deg, rgba(31, 77, 58, 0.05) 0 1px, transparent 1px 36px),
    repeating-linear-gradient(90deg, rgba(31, 77, 58, 0.05) 0 1px, transparent 1px 36px),
    repeating-radial-gradient(
      circle at 88% -14%,
      transparent 0 30px,
      rgba(31, 77, 58, 0.07) 30px 31px
    );
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.9), transparent 86%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 24px;
}

.hero-kicker {
  display: inline-block;
  margin-bottom: 18px;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text-mute);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hero-title {
  font-size: clamp(34px, 5.2vw, 54px);
  line-height: 1.06;
  letter-spacing: -0.03em;
  max-width: 16ch;
}

.hero-sub {
  margin-top: 20px;
  max-width: 62ch;
  color: var(--text-soft);
  font-size: 18px;
  line-height: 1.62;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.hero-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 26px;
  margin-top: 30px;
  color: var(--text-mute);
  font-size: 14.5px;
}

.hero-facts li {
  display: flex;
  align-items: center;
  gap: 7px;
}

.hero-facts .icon {
  color: var(--primary);
  width: 16px;
  height: 16px;
}

/* ---------- sections ---------- */

.section {
  padding: 62px 0;
}

.section-tint {
  background: var(--bg-tint);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 18px;
  margin-bottom: 28px;
}

.section-head h2 {
  font-size: 27px;
  letter-spacing: -0.02em;
}

/* The blaze: a short orange bar before a section heading, the way a painted
   marker sits on a tree. It is the one warm note on the page, so it stays
   small — a bigger mark would read as a warning stripe. */
.section-head h2::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 0.78em;
  margin-right: 11px;
  border-radius: 2px;
  background: var(--accent);
  transform: translateY(1px);
}

.section-head p {
  flex: 1 1 320px;
  min-width: 0;
  color: var(--text-mute);
  font-size: 15.5px;
}

.section-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--primary);
  font-size: 14.5px;
  font-weight: 600;
  text-decoration: none;
}

.section-more .icon {
  width: 15px;
  height: 15px;
}

/* ---------- tool cards ---------- */

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

.tool-card {
  min-width: 0;
}

.tool-card-link {
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: 100%;
  padding: 22px 22px 18px;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: var(--text);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.tool-card-link:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--line-strong);
  color: var(--text);
}

.tool-card-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--primary-wash);
  color: var(--primary);
  margin-bottom: 2px;
}

.tool-card-icon .icon {
  width: 23px;
  height: 23px;
}

.tool-card-title {
  font-size: 18px;
  letter-spacing: -0.01em;
}

.tool-card-blurb {
  color: var(--text-soft);
  font-size: 14.8px;
  line-height: 1.58;
}

/* The example is the card's only evidence that the tool computes something.
   Truncating it turns six cards into six ellipses, so it wraps. */
.tool-card-example {
  margin-top: auto;
  padding: 9px 11px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text-mute);
  font-size: 13.2px;
  line-height: 1.55;
  white-space: normal;
  overflow-wrap: anywhere;
}

.tool-card-more {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--primary);
  font-size: 14px;
  font-weight: 600;
}

.tool-card-more .icon {
  width: 15px;
  height: 15px;
  transition: transform 160ms ease;
}

.tool-card-link:hover .tool-card-more .icon {
  transform: translateX(3px);
}

/* ---------- audience ---------- */

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

.audience-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--line);
}

.audience-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--accent-wash);
  color: var(--accent-ink);
}

.audience-icon .icon {
  width: 20px;
  height: 20px;
}

.audience-card h3 {
  font-size: 16.5px;
}

.audience-line {
  color: var(--text-soft);
  font-size: 14.5px;
  line-height: 1.55;
  flex: 1 1 auto;
}

.audience-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 4px;
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
}

.audience-link .icon {
  width: 14px;
  height: 14px;
}

/* ---------- post cards ---------- */

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

.post-card {
  min-width: 0;
  padding: 20px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--surface);
}

.post-card-meta {
  color: var(--text-mute);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.post-card h3 {
  margin: 8px 0 8px;
  font-size: 17px;
  line-height: 1.32;
}

.post-card h3 a {
  text-decoration: none;
  color: var(--text);
}

.post-card h3 a:hover {
  color: var(--primary-strong);
  text-decoration: underline;
}

.post-card p {
  color: var(--text-soft);
  font-size: 14.5px;
  line-height: 1.58;
}

/* ---------- faq preview ---------- */

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

.faq-preview-item {
  min-width: 0;
  padding: 18px 20px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--line);
}

.faq-preview-item h3 {
  font-size: 16px;
  line-height: 1.35;
}

.faq-preview-item h3 a {
  text-decoration: none;
  color: var(--text);
}

.faq-preview-item h3 a:hover {
  color: var(--primary-strong);
  text-decoration: underline;
}

.faq-preview-item p {
  margin-top: 7px;
  color: var(--text-soft);
  font-size: 14.5px;
  line-height: 1.55;
}

/* ---------- page head / breadcrumb ---------- */

.breadcrumb {
  padding-top: 26px;
  font-size: 13.5px;
  color: var(--text-mute);
}

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

.breadcrumb li {
  display: flex;
  align-items: center;
  gap: 7px;
}

.breadcrumb li + li::before {
  content: '/';
  color: var(--line-strong);
}

.breadcrumb a {
  color: var(--text-mute);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--primary);
  text-decoration: underline;
}

.page-head {
  padding: 22px 0 30px;
}

.page-head h1 {
  font-size: clamp(28px, 3.6vw, 38px);
  letter-spacing: -0.025em;
}

.page-lead {
  margin-top: 12px;
  max-width: 68ch;
  color: var(--text-soft);
  font-size: 17px;
  line-height: 1.6;
}

/* ---------- tool layout ---------- */

.tool-layout {
  display: grid;
  grid-template-columns: minmax(0, 350px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  padding-bottom: 8px;
}

.panel {
  min-width: 0;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.panel-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}

.panel-head h2 {
  font-size: 14px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-mute);
}

.tool-form {
  padding-bottom: 6px;
  position: sticky;
  top: calc(var(--header-h) + 16px);
}

.field {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}

.field:last-of-type {
  border-bottom: 0;
}

.field-label {
  display: block;
  margin-bottom: 8px;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text);
}

.field-hint {
  margin-top: 8px;
  color: var(--text-mute);
  font-size: 13px;
  line-height: 1.5;
}

/* Checkboxes and radios must not inherit the full-width treatment. */
.field input:not([type='hidden']):not([type='checkbox']):not([type='radio']),
.field select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}

.field input:not([type='hidden']):not([type='checkbox']):not([type='radio']):hover,
.field select:hover {
  border-color: var(--text-mute);
}

.field input:not([type='hidden']):not([type='checkbox']):not([type='radio']):focus,
.field select:focus {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
  border-color: var(--primary);
}

.segmented {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.segmented button {
  flex: 1 1 auto;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text-soft);
  font-size: 14px;
  font-weight: 550;
  cursor: pointer;
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}

.segmented button:hover {
  background: var(--surface-2);
  color: var(--text);
}

.segmented button.is-on {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.form-aside {
  padding: 14px 20px 16px;
  color: var(--text-mute);
  font-size: 12.8px;
  line-height: 1.5;
  border-top: 1px solid var(--line);
}

/* ---------- result panel ---------- */

.tool-result {
  padding-bottom: 22px;
}

.result-body {
  padding: 20px;
}

.result-hero {
  padding-bottom: 16px;
  border-bottom: 1px dashed var(--line-strong);
}

.result-kicker {
  color: var(--text-mute);
  font-size: 12.5px;
  font-weight: 650;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.result-value {
  margin-top: 6px;
  font-family: var(--font-head);
  font-size: clamp(38px, 6vw, 56px);
  font-weight: 680;
  line-height: 1.02;
  letter-spacing: -0.035em;
  color: var(--primary);
}

.result-unit {
  margin-left: 7px;
  font-size: 0.42em;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--text-mute);
}

.result-sub {
  margin-top: 8px;
  color: var(--text-soft);
  font-size: 14.5px;
  line-height: 1.55;
}

.result-context {
  margin-top: 14px;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  color: var(--text-mute);
  font-size: 13px;
  line-height: 1.55;
}

.result-badge {
  display: inline-block;
  margin-top: 14px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 650;
}

.badge-ok {
  background: var(--ok-wash);
  color: var(--ok);
}

.badge-warn {
  background: var(--warn-wash);
  color: var(--warn);
}

.badge-err {
  background: var(--err-wash);
  color: var(--err);
}

/* ---------- spec grid ----------
   Four columns by default, three when there are three values. A fixed
   four-column grid holding three values paints the empty track as a blank
   cell, and `auto-fit` cannot collapse it. */

.spec-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin: 18px 0;
  padding: 0;
  border-radius: var(--r-md);
  background: var(--line);
  border: 1px solid var(--line);
  overflow: hidden;
}

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

.spec {
  min-width: 0;
  padding: 12px 14px;
  background: var(--surface);
}

.spec dt {
  color: var(--text-mute);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.spec dd {
  margin: 5px 0 0;
  font-size: 16.5px;
  font-weight: 650;
  color: var(--text);
  white-space: nowrap;
}

/* ---------- result blocks ---------- */

.result-block {
  margin-top: 20px;
}

.result-block-title {
  margin-bottom: 10px;
  color: var(--text-mute);
  font-size: 12.5px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.result-line {
  color: var(--text-soft);
  font-size: 14.5px;
  line-height: 1.6;
}

.result-line + .result-line {
  margin-top: 6px;
}

.result-note {
  padding: 12px 14px;
  border-radius: var(--r-sm);
  font-size: 14px;
}

.result-note.is-warn {
  background: var(--warn-wash);
  color: var(--warn);
}

/* ---------- bars ---------- */

.bar {
  display: flex;
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.bar-seg {
  display: block;
  height: 100%;
}

.bar-primary {
  background: var(--primary);
}

.bar-water {
  background: var(--water);
}

.bar-accent {
  background: var(--accent);
}

.bar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin-top: 9px;
  color: var(--text-soft);
  font-size: 13px;
}

.bar-legend li {
  display: flex;
  align-items: center;
  gap: 6px;
}

.bar-legend b {
  color: var(--text);
  font-weight: 650;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
}

.dot-primary {
  background: var(--primary);
}

.dot-water {
  background: var(--water);
}

.dot-accent {
  background: var(--accent);
}

/* ---------- notes ---------- */

.note-list {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.note-list li {
  display: flex;
  gap: 9px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  background: var(--primary-wash);
  color: var(--text-soft);
  font-size: 13.8px;
  line-height: 1.55;
}

.note-list .icon {
  color: var(--primary);
  width: 16px;
  height: 16px;
  margin-top: 2px;
}

.reason-list {
  display: grid;
  gap: 8px;
}

.reason-list li {
  display: flex;
  gap: 9px;
  color: var(--text-soft);
  font-size: 14.5px;
  line-height: 1.55;
}

.reason-list .icon {
  color: var(--primary);
  width: 16px;
  height: 16px;
  margin-top: 3px;
}

/* ---------- tables ---------- */

.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  background: var(--surface);
}

table.data th,
table.data td {
  padding: 9px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

table.data th {
  background: var(--surface-2);
  color: var(--text-mute);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

table.data tbody tr:last-child td {
  border-bottom: 0;
}

table.data .num {
  text-align: right;
  white-space: nowrap;
}

/* ---------- gauge ---------- */

.gauge {
  position: relative;
  display: flex;
  height: 14px;
  margin: 18px 0 0;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--line);
}

.gauge-band {
  height: 100%;
}

.gauge-easy {
  background: #cbe1d1;
}

.gauge-moderate {
  background: #e7dfb4;
}

.gauge-hard {
  background: #eec9a5;
}

.gauge-extreme {
  background: #e2aea3;
}

.gauge-mark {
  position: absolute;
  top: -4px;
  width: 3px;
  height: 22px;
  margin-left: -1.5px;
  border-radius: 2px;
  background: var(--text);
  box-shadow: 0 0 0 2px var(--surface);
}

.gauge-legend {
  display: flex;
  margin-top: 7px;
  color: var(--text-mute);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.gauge-legend li {
  flex: 1 1 auto;
}

.gauge-legend li:nth-child(1) {
  flex: 0 0 20%;
}

.gauge-legend li:nth-child(2) {
  flex: 0 0 20%;
}

.gauge-legend li:nth-child(3) {
  flex: 0 0 30%;
}

.gauge-legend li:nth-child(4) {
  flex: 0 0 30%;
  text-align: right;
}

/* ---------- bottles ---------- */

.bottle-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 6px;
  margin-top: 16px;
}

.bottle {
  position: relative;
  display: block;
  width: 16px;
  height: 30px;
  border-radius: 4px 4px 6px 6px;
  border: 1.5px solid var(--water);
  background: color-mix(in srgb, var(--water) 16%, transparent);
}

.bottle::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 4px;
  width: 6px;
  height: 6px;
  border-radius: 2px 2px 0 0;
  border: 1.5px solid var(--water);
  border-bottom: 0;
  background: var(--surface);
}

.bottle-more {
  font-size: 13px;
  font-weight: 650;
  color: var(--water);
  padding-bottom: 4px;
}

/* ---------- gear checklist ---------- */

.gear-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 16px 0 4px;
}

.gear-count {
  color: var(--text-mute);
  font-size: 13.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.gear-groups {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.gear-group {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
}

.gear-group-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-mute);
}

.gear-group-weight {
  font-size: 12px;
  color: var(--text-mute);
  font-weight: 600;
}

.gear-list {
  display: grid;
  gap: 1px;
  background: var(--line);
}

.gear-item {
  background: var(--surface);
}

.gear-label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  cursor: pointer;
  font-size: 14.5px;
}

.gear-label:hover {
  background: var(--surface-2);
}

.gear-check {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.gear-box {
  display: grid;
  place-items: center;
  width: 19px;
  height: 19px;
  flex: none;
  border: 1.5px solid var(--line-strong);
  border-radius: 5px;
  background: var(--surface);
  color: transparent;
}

.gear-box .icon {
  width: 13px;
  height: 13px;
}

.gear-check:checked + .gear-box {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.gear-check:focus-visible + .gear-box {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.gear-text {
  flex: 1 1 auto;
  min-width: 0;
}

.gear-weight {
  flex: none;
  color: var(--text-mute);
  font-size: 12.5px;
}

.gear-item.is-packed .gear-text {
  color: var(--text-mute);
  text-decoration: line-through;
  text-decoration-color: var(--line-strong);
}

/* ---------- reference ---------- */

.reference {
  margin: 40px 0 8px;
  padding: 24px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--line);
}

.reference h2 {
  font-size: 20px;
}

.reference p {
  margin: 8px 0 16px;
  max-width: 70ch;
  color: var(--text-soft);
  font-size: 14.8px;
  line-height: 1.6;
}

/* ---------- next step ---------- */

.next-step {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
  margin: 30px 0 60px;
  padding: 18px 22px;
  border-radius: var(--r-md);
  background: var(--bg-tint);
  border: 1px solid var(--line);
}

.next-step-label {
  color: var(--text-mute);
  font-size: 12.5px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.next-step-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--primary-strong);
  font-weight: 600;
  font-size: 15.5px;
  text-decoration: none;
}

.next-step-link:hover {
  text-decoration: underline;
}

/* ---------- article ---------- */

/* Reading pages get a centered column rather than the full 1,120px wrap. The
   prose is already capped at 70ch, so a full-width container left a third of
   the page empty on the right and made the article look like it had fallen
   over sideways. */
.article {
  max-width: 760px;
  margin: 0 auto;
  padding-bottom: 40px;
}

/* The breadcrumb sits outside the article element, so it needs the same
   column or it hangs at the far left of a centered page. */
body[data-page='guide'] main > .breadcrumb,
body[data-page='blog'] main > .breadcrumb,
body[data-page='faq'] main > .breadcrumb,
body[data-page='faq-index'] main > .breadcrumb,
body[data-page='page'] main > .breadcrumb {
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}

.article-head {
  padding: 20px 0 26px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 26px;
}

.article-kicker {
  color: var(--accent-ink);
  font-size: 12.5px;
  font-weight: 650;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.article-head h1 {
  margin-top: 9px;
  font-size: clamp(29px, 4vw, 40px);
  letter-spacing: -0.028em;
  max-width: 24ch;
}

.article-lead {
  margin-top: 14px;
  max-width: 66ch;
  color: var(--text-soft);
  font-size: 17.5px;
  line-height: 1.6;
}

.article-tool,
.article-updated {
  margin-top: 12px;
  color: var(--text-mute);
  font-size: 14px;
}

.article-narrow .prose {
  max-width: 72ch;
}

/* ---------- table of contents ---------- */

.toc {
  margin-bottom: 28px;
  padding: 16px 20px;
  border-radius: var(--r-md);
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.toc-title {
  margin-bottom: 8px;
  color: var(--text-mute);
  font-size: 12.5px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.toc ol {
  display: grid;
  gap: 5px;
  counter-reset: toc;
}

.toc li {
  counter-increment: toc;
  font-size: 14.5px;
  line-height: 1.45;
}

.toc li::before {
  content: counter(toc) '.';
  display: inline-block;
  width: 1.5em;
  color: var(--text-mute);
  font-variant-numeric: tabular-nums;
}

.toc a {
  text-decoration: none;
  color: var(--text-soft);
}

.toc a:hover {
  color: var(--primary-strong);
  text-decoration: underline;
}

/* ---------- prose ---------- */

.prose {
  font-size: 17px;
  line-height: 1.72;
  color: var(--text);
}

/* Long-form reading: 45–75 characters a line. Only the text elements are
   constrained — tables and code keep the full column width. */
.prose > p,
.prose > ul,
.prose > ol,
.prose > blockquote,
.prose > h2,
.prose > h3,
.prose > h4 {
  max-width: 70ch;
}

.prose h2 {
  margin: 40px 0 14px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  font-size: 25px;
  letter-spacing: -0.02em;
  max-width: 70ch;
}

.prose h3 {
  margin: 28px 0 10px;
  font-size: 19px;
  letter-spacing: -0.01em;
}

.prose h4 {
  margin: 22px 0 8px;
  font-size: 16.5px;
}

.prose > *:first-child {
  margin-top: 0;
}

.prose p + p {
  margin-top: 14px;
}

.prose ul,
.prose ol {
  margin: 14px 0;
  display: grid;
  gap: 7px;
}

.prose ul li {
  position: relative;
  padding-left: 20px;
}

.prose ul li::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 0.66em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
  opacity: 0.55;
}

.prose ol {
  counter-reset: prose;
}

.prose ol li {
  position: relative;
  padding-left: 26px;
  counter-increment: prose;
}

.prose ol li::before {
  content: counter(prose) '.';
  position: absolute;
  left: 0;
  color: var(--primary);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.prose a {
  font-weight: 500;
}

.prose strong {
  font-weight: 650;
  color: var(--text);
}

.prose blockquote {
  margin: 20px 0;
  padding: 14px 18px;
  border-left: 3px solid var(--primary);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  background: var(--primary-wash);
  color: var(--text-soft);
  font-size: 16px;
}

.prose blockquote p {
  margin: 0;
}

.prose hr {
  margin: 32px 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.prose code {
  padding: 2px 5px;
  border-radius: 4px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.87em;
  /* Inline code sits inside sentences; a horizontal scrollbar would drag the
     whole paragraph with it, so it has to be able to break. */
  overflow-wrap: anywhere;
  word-break: break-word;
}

.prose .code-block {
  margin: 18px 0;
  padding: 14px 16px;
  border-radius: var(--r-md);
  background: #16241d;
  color: #e9efe7;
  overflow-x: auto;
  font-size: 13.5px;
  line-height: 1.6;
}

.prose .code-block code {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font-size: 1em;
  /* The block scrolls on its own; wrapping would defeat the point. */
  overflow-wrap: normal;
  word-break: normal;
}

.prose .table-wrap {
  margin: 20px 0;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}

.prose table.data {
  /* A floor, not a target: wide tables still expand and scroll. */
  min-width: 340px;
}

/* ---------- cta / related ---------- */

.cta {
  margin: 36px 0 8px;
  padding: 22px 24px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-sm);
  max-width: 70ch;
}

.cta-label {
  margin-bottom: 10px;
  color: var(--text-mute);
  font-size: 12.5px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.cta-note {
  margin-top: 10px;
  color: var(--text-mute);
  font-size: 13px;
}

.cta-quiet {
  background: var(--bg-tint);
  border-color: var(--line);
  box-shadow: none;
}

.related {
  margin: 34px 0 20px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.related-title {
  font-size: 15px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-mute);
  font-weight: 650;
}

.related ul {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.related li {
  min-width: 0;
}

.related li a {
  display: flex;
  flex-direction: column;
  gap: 4px;
  height: 100%;
  padding: 14px 16px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--line);
  text-decoration: none;
}

.related li a:hover {
  border-color: var(--line-strong);
  background: var(--surface-2);
}

.related-title-text {
  color: var(--text);
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.4;
}

.related-note {
  color: var(--text-mute);
  font-size: 12.5px;
}

/* ---------- guide index ---------- */

.guide-list {
  display: grid;
  gap: 14px;
  padding-bottom: 40px;
}

.guide-card {
  display: flex;
  gap: 18px;
  padding: 22px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  min-width: 0;
}

.guide-index {
  flex: none;
  color: var(--line-strong);
  font-family: var(--font-head);
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
}

.guide-card-body {
  min-width: 0;
}

.guide-card h2 {
  font-size: 19px;
  line-height: 1.35;
}

.guide-card h2 a {
  text-decoration: none;
  color: var(--text);
}

.guide-card h2 a:hover {
  color: var(--primary-strong);
  text-decoration: underline;
}

.guide-card p {
  margin-top: 7px;
  color: var(--text-soft);
  font-size: 14.8px;
  line-height: 1.6;
  max-width: 76ch;
}

/* Specificity, not `!important`: `.guide-card p` above is one class deeper
   than a bare `.guide-card-tool`, so the compound selector wins on merit. */
.guide-card p.guide-card-tool {
  color: var(--text-mute);
  font-size: 13.5px;
}

/* ---------- blog index ---------- */

.post-list {
  display: grid;
  gap: 0;
  padding-bottom: 40px;
  border-top: 1px solid var(--line);
}

.post-item {
  display: grid;
  grid-template-columns: minmax(0, 150px) minmax(0, 1fr);
  gap: 18px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
  min-width: 0;
}

.post-date {
  color: var(--text-mute);
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
  padding-top: 3px;
}

.post-body {
  min-width: 0;
}

.post-body h2 {
  font-size: 19px;
  line-height: 1.35;
}

.post-body h2 a {
  text-decoration: none;
  color: var(--text);
}

.post-body h2 a:hover {
  color: var(--primary-strong);
  text-decoration: underline;
}

.post-body p {
  margin-top: 7px;
  color: var(--text-soft);
  font-size: 15px;
  line-height: 1.6;
  max-width: 76ch;
}

.post-body p.post-tag {
  color: var(--accent-ink);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* ---------- faq index ---------- */

.faq-group {
  padding-bottom: 30px;
}

.faq-group h2 {
  font-size: 14px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-mute);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 4px;
}

.faq-list {
  display: grid;
}

.faq-item {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.faq-item h3 {
  font-size: 17px;
  line-height: 1.4;
}

.faq-item h3 a {
  text-decoration: none;
  color: var(--text);
}

.faq-item h3 a:hover {
  color: var(--primary-strong);
  text-decoration: underline;
}

.faq-item p {
  margin-top: 6px;
  color: var(--text-soft);
  font-size: 14.8px;
  line-height: 1.58;
  max-width: 78ch;
}

.faq-back {
  margin-top: 26px;
  font-size: 14.5px;
}

/* ---------- footer ---------- */

.site-footer {
  margin-top: 20px;
  background: var(--bg-tint);
  border-top: 1px solid var(--line);
}

.footer-inner {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 46px 24px 26px;
}

/* The blog column carries full post titles and needs the extra width; the
   brand column only carries two short lines. Equal fifths made the footer
   twice as tall as it needed to be. */
.footer-grid {
  display: grid;
  grid-template-columns:
    minmax(0, 1.05fr) minmax(0, 1fr) minmax(0, 1.05fr)
    minmax(0, 1.35fr) minmax(0, 0.85fr);
  gap: 28px 24px;
}

.footer-col {
  min-width: 0;
}

.footer-col h4 {
  margin-bottom: 12px;
  font-size: 12.5px;
  font-weight: 650;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-mute);
}

.footer-col ul {
  display: grid;
  gap: 8px;
}

.footer-col li {
  min-width: 0;
}

.footer-col a {
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.45;
  text-decoration: none;
}

.footer-col a:hover {
  color: var(--primary-strong);
  text-decoration: underline;
}

.footer-brand .brand {
  margin-bottom: 12px;
}

.footer-tagline {
  max-width: 28ch;
  color: var(--text-mute);
  font-size: 14px;
  line-height: 1.55;
}

.footer-col a.footer-more {
  color: var(--primary);
  font-weight: 600;
}

.footer-legal {
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px solid var(--line-strong);
  display: grid;
  gap: 5px;
}

.copyright {
  color: var(--text-mute);
  font-size: 12.8px;
}

/* ---------- focus ---------- */

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 3px;
}

/* ---------- motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ---------- responsive ---------- */

@media (max-width: 980px) {
  .tool-grid,
  .audience-grid,
  .post-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .footer-brand {
    grid-column: 1 / -1;
  }

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

  .tool-form {
    position: static;
  }

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

  .nav-toggle {
    display: inline-flex;
  }

  .nav {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: var(--header-h);
    padding: 10px 18px 18px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-md);
  }

  .nav.is-open {
    display: block;
  }

  .nav ul {
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
  }

  .nav-link {
    display: block;
    padding: 11px 12px;
    border-radius: var(--r-sm);
    font-size: 16px;
  }

  .header-inner {
    position: relative;
  }

  .post-item {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
  }
}

@media (max-width: 720px) {
  body {
    font-size: 16px;
  }

  /* Three short options belong on one row on a phone. Wrapping the last one
     onto a full-width row of its own reads as a different control. */
  .segmented {
    flex-wrap: nowrap;
  }

  .segmented button {
    flex: 1 1 0;
    padding: 9px 6px;
    font-size: 13.5px;
  }

  .wrap,
  .header-inner,
  .hero-inner,
  .footer-inner {
    padding-left: 18px;
    padding-right: 18px;
  }

  .hero {
    padding: 44px 0 38px;
  }

  .hero-sub {
    font-size: 16.5px;
  }

  .section {
    padding: 44px 0;
  }

  .tool-grid,
  .audience-grid,
  .post-grid,
  .faq-preview {
    grid-template-columns: minmax(0, 1fr);
  }

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

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

  .spec-grid--3 .spec:last-child {
    grid-column: 1 / -1;
  }

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

  .result-body {
    padding: 16px;
  }

  .field {
    padding: 14px 16px;
  }

  .article-head h1 {
    font-size: 28px;
  }

  .prose {
    font-size: 16.5px;
  }

  .prose table.data {
    min-width: 320px;
  }

  .guide-card {
    gap: 12px;
    padding: 18px;
  }

  .guide-index {
    font-size: 22px;
  }

  .segmented button {
    flex: 1 1 45%;
  }

  .next-step {
    margin-bottom: 40px;
  }
}

/* ---------- print: the gear list is meant to leave the screen ---------- */

@media print {
  .site-header,
  .site-footer,
  .breadcrumb,
  .next-step,
  .tool-form,
  .gear-actions,
  .note-list,
  .reference,
  .skip-link {
    display: none !important;
  }

  body {
    background: #fff;
    font-size: 11.5pt;
  }

  .panel,
  .tool-result {
    border: 0;
    box-shadow: none;
  }

  .tool-layout {
    display: block;
  }

  .gear-group {
    break-inside: avoid;
  }

  .result-value {
    color: #000;
  }
}
