/* bodyfatpercentage.org
   Palette: paper, ink, tape yellow (the one loud color), steel, teal for links. */
:root {
  --paper: #F3F5F4;
  --white: #FFFFFF;
  --ink: #17202B;
  --ink-soft: #4A5663;
  --steel: #C9D1D8;
  --tape: #F3C623;
  --tape-deep: #D9A900;
  --teal: #0B6E6D;
  --warn: #B3402A;
  --radius-s: 4px;
  --radius-m: 10px;
  --wrap: 1120px;
  --measure: 68ch;
  --display: "Open Sans", "Helvetica Neue", Arial, sans-serif;
  --text: "Source Serif 4", Georgia, "Times New Roman", serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--text);
  font-size: 1.125rem;
  line-height: 1.65;
}
img { max-width: 100%; height: auto; }
a { color: var(--teal); text-underline-offset: 3px; }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; }

h1, h2, h3, h4, .brand, .btn, nav, label, .kicker, table, .card-meta, .result-num {
  font-family: var(--display);
}
h1 {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.015em;
  margin: 0 0 0.5em;
}
h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
  line-height: 1.1;
  margin: 2.2em 0 0.6em;
}
h3 { font-size: 1.2rem; font-weight: 700; line-height: 1.25; margin: 1.6em 0 0.4em; }
p { margin: 0 0 1em; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.prose { max-width: var(--measure); }
.prose ul, .prose ol { padding-left: 1.2em; }
.prose li { margin-bottom: 0.4em; }
.lede { font-size: 1.3rem; line-height: 1.5; color: var(--ink-soft); max-width: 60ch; }

/* Header */
.site-head { background: var(--white); border-bottom: 1px solid var(--steel); }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; flex-wrap: wrap; }
.brand { font-weight: 800; font-size: 1.15rem; color: var(--ink); text-decoration: none; display: flex; align-items: center; gap: 10px; }
.brand-mark { width: 30px; height: 14px; background: var(--tape); border-radius: 2px;
  background-image: repeating-linear-gradient(90deg, var(--ink) 0 1px, transparent 1px 5px);
  background-size: 100% 6px; background-repeat: no-repeat; background-position: bottom; }
nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; flex-wrap: wrap; }
nav a { display: block; padding: 8px 10px; font-size: 0.95rem; font-weight: 600; color: var(--ink); text-decoration: none; border-radius: var(--radius-s); }
nav a:hover, nav a[aria-current="page"] { background: var(--paper); }
nav a[aria-current="page"] { box-shadow: inset 0 -3px 0 var(--tape); }

/* Disclosure strip on money pages */
.disclose { font-family: var(--display); font-size: 0.85rem; color: var(--ink-soft); background: var(--white); border: 1px solid var(--steel); border-radius: var(--radius-s); padding: 10px 14px; margin: 0 0 28px; max-width: var(--measure); }

main { padding: 40px 0 72px; }

/* Home hero: the tape-measure calculator */
.hero { display: grid; grid-template-columns: 1fr 1.1fr; gap: 0 48px; align-items: start; }
.hero-intro { grid-column: 1; grid-row: 1; }
.hero-how { grid-column: 1; grid-row: 2; }
.hero .calc { grid-column: 2; grid-row: 1 / span 2; }
.hero h1 { margin-top: 0.2em; }
.calc {
  background: var(--tape);
  border-radius: var(--radius-m);
  padding: 28px 24px 24px;
  position: relative;
  box-shadow: 0 2px 0 var(--tape-deep);
}
.calc::before {
  content: "";
  position: absolute; left: 0; right: 0; top: 0; height: 18px;
  border-radius: var(--radius-m) var(--radius-m) 0 0;
  background-image:
    repeating-linear-gradient(90deg, var(--ink) 0 2px, transparent 2px 40px),
    repeating-linear-gradient(90deg, var(--ink) 0 1px, transparent 1px 8px);
  background-size: 100% 18px, 100% 9px;
  background-repeat: no-repeat;
}
.calc h2 { margin: 0.4em 0 0.8em; font-size: 1.35rem; }
.calc form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.calc .full { grid-column: 1 / -1; }
.calc label { display: block; font-weight: 700; font-size: 0.9rem; margin-bottom: 4px; }
.calc input, .calc select {
  width: 100%; font: 600 1.05rem var(--display); padding: 10px 12px;
  border: 2px solid var(--ink); border-radius: var(--radius-s); background: var(--white); color: var(--ink);
}
.seg { display: flex; border: 2px solid var(--ink); border-radius: var(--radius-s); overflow: hidden; background: var(--white); }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg label { flex: 1; margin: 0; text-align: center; padding: 10px 8px; cursor: pointer; font-size: 0.95rem; }
.seg input:checked + label { background: var(--ink); color: var(--white); }
.seg input:focus-visible + label { outline: 3px solid var(--teal); outline-offset: -3px; }
.hint { font-size: 0.8rem; font-family: var(--display); color: var(--ink); opacity: 0.8; margin-top: 3px; }
.hide { display: none !important; }

.result { margin-top: 20px; background: var(--white); border: 2px solid var(--ink); border-radius: var(--radius-s); padding: 18px; }
.result-num { font-size: 3.2rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.result-cat { font-family: var(--display); font-weight: 700; margin: 6px 0 12px; }
.result p { font-size: 1rem; margin: 0.5em 0 0; }
.scale { position: relative; height: 34px; margin: 14px 0 22px; display: flex; border-radius: 3px; overflow: visible; }
.scale span { display: block; height: 100%; font: 600 0.65rem var(--display); color: var(--ink); padding: 3px 4px; overflow: hidden; white-space: nowrap; }
.scale .b1 { background: #E9EEF1; } .scale .b2 { background: #CFE3DF; } .scale .b3 { background: #9CCBC4; }
.scale .b4 { background: #F6E3A0; } .scale .b5 { background: #F0B9A6; }
.marker { position: absolute; top: -6px; width: 3px; height: 46px; background: var(--ink); transform: translateX(-1px); transition: left 0.35s ease; }
.marker::after { content: ""; position: absolute; top: -7px; left: -5px; border: 6px solid transparent; border-top-color: var(--ink); }
.scale-ticks { display: flex; justify-content: space-between; font: 600 0.7rem var(--display); color: var(--ink-soft); margin-top: -18px; }
.error { color: var(--warn); font-family: var(--display); font-weight: 600; font-size: 0.95rem; }

/* Buttons */
.btn { display: inline-block; font-weight: 700; font-size: 1rem; padding: 12px 18px; border-radius: var(--radius-s); text-decoration: none; border: 2px solid var(--ink); cursor: pointer; background: var(--ink); color: var(--white); }
.btn:hover { background: var(--white); color: var(--ink); }
.btn-light { background: var(--white); color: var(--ink); }
.btn-light:hover { background: var(--ink); color: var(--white); }
.calc .btn { width: 100%; }

/* Sections */
.band { background: var(--white); border-top: 1px solid var(--steel); border-bottom: 1px solid var(--steel); padding: 8px 0 40px; margin: 56px 0; }
.split { display: grid; grid-template-columns: repeat(2, 1fr); gap: 32px; }
.split > div h3 { margin-top: 1.2em; }
.linklist { list-style: none; padding: 0; margin: 0; }
.linklist li { border-top: 1px solid var(--steel); }
.linklist a { display: block; padding: 14px 0; font-family: var(--display); font-weight: 700; color: var(--ink); text-decoration: none; }
.linklist a span { display: block; font-family: var(--text); font-weight: 400; color: var(--ink-soft); font-size: 0.95rem; }
.linklist a:hover { color: var(--teal); }

/* Tables */
.table-wrap { overflow-x: auto; margin: 1em 0 1.5em; max-width: 100%; }
table { border-collapse: collapse; width: 100%; font-size: 0.95rem; background: var(--white); }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--steel); vertical-align: top; }
th { background: var(--ink); color: var(--white); font-weight: 700; }
td:first-child { font-weight: 700; }
caption { caption-side: bottom; text-align: left; font-size: 0.8rem; color: var(--ink-soft); padding-top: 6px; }

/* Product cards */
.picks { display: grid; gap: 0; margin: 24px 0; border-top: 3px solid var(--ink); }
.pick { display: grid; grid-template-columns: 180px 1fr; gap: 24px; padding: 26px 0; border-bottom: 1px solid var(--steel); }
.pick-img { background: var(--white); border: 1px solid var(--steel); border-radius: var(--radius-s); aspect-ratio: 1; display: flex; align-items: center; justify-content: center; font: 800 0.8rem var(--display); color: var(--ink-soft); text-align: center; padding: 10px; }
.pick-img img { max-height: 100%; object-fit: contain; }
.pick h3 { margin: 0 0 4px; font-size: 1.35rem; }
.card-meta { font-size: 0.85rem; font-weight: 700; color: var(--ink-soft); margin-bottom: 10px; }
.card-meta .tag { background: var(--tape); color: var(--ink); padding: 2px 8px; border-radius: 2px; margin-right: 6px; }
.pick p { font-size: 1.02rem; }
.pros { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; font-size: 0.95rem; margin: 10px 0 16px; }
.pros h4 { margin: 0 0 4px; font-size: 0.9rem; }
.pros ul { margin: 0; padding-left: 1.1em; }

/* Shop */
.shop-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 28px; }
.product { background: var(--white); border: 1px solid var(--steel); border-radius: var(--radius-m); padding: 22px; display: flex; flex-direction: column; }
.product.live { border: 2px solid var(--ink); }
.product h3 { margin: 0 0 6px; }
.product p { font-size: 1rem; flex: 1; }
.price { font: 800 1.6rem var(--display); margin: 6px 0 14px; }
.soon { font: 700 0.85rem var(--display); color: var(--ink-soft); }

.callout { background: var(--white); border-left: 6px solid var(--tape); padding: 16px 20px; margin: 1.5em 0; max-width: var(--measure); }
.callout p:last-child { margin: 0; }

.tldr { background: var(--white); border: 1px solid var(--steel); border-radius: var(--radius-s); padding: 16px 20px 6px; margin: 0 0 28px; max-width: var(--measure); }
.tldr strong { font-family: var(--display); }

.form-row { display: flex; gap: 8px; flex-wrap: wrap; max-width: 520px; }
.form-row input { flex: 1; min-width: 220px; font: 1rem var(--display); padding: 12px; border: 2px solid var(--ink); border-radius: var(--radius-s); }

/* Footer */
.site-foot { background: var(--ink); color: #D5DBE0; padding: 40px 0; font-size: 0.95rem; }
.site-foot a { color: var(--white); }
.foot-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px; }
.site-foot h4 { color: var(--white); margin: 0 0 10px; }
.site-foot ul { list-style: none; padding: 0; margin: 0; }
.site-foot li { margin-bottom: 6px; }
.fineprint { font-size: 0.85rem; margin-top: 28px; border-top: 1px solid #3A4552; padding-top: 18px; }

@media (max-width: 860px) {
  .hero, .split, .foot-grid { grid-template-columns: 1fr; }
  .shop-grid { grid-template-columns: 1fr; }
  .pick { grid-template-columns: 1fr; }
  .pick-img { max-width: 160px; }
  .hero-intro, .hero-how, .hero .calc { grid-column: 1; grid-row: auto; }
  .hero-intro { order: 1; } .hero .calc { order: 2; margin-top: 8px; } .hero-how { order: 3; margin-top: 24px; }
  .hero h1 { font-size: 2rem; }
  nav { width: 100%; overflow-x: auto; }
  nav ul { flex-wrap: nowrap; }
  nav a { white-space: nowrap; }
}
@media (max-width: 480px) {
  .calc form { grid-template-columns: 1fr; }
  .pros { grid-template-columns: 1fr; }
  body { font-size: 1.05rem; }
}
@media (prefers-reduced-motion: reduce) { .marker { transition: none; } }
