/* PaceCalc — Trailhead visual system. Tokens first; components below. */
:root {
  --bg: #fbf7f0; --panel: #ffffff; --ink: #2b2a26; --muted: #6f6858; --line: #e6dfd2;
  --green: #0b6e4f; --green-soft: #e3f0ea; --orange: #f4a259; --err: #b42318;
  --serif: Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --radius: 14px;
  font-family: var(--sans);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161a17; --panel: #1f2420; --ink: #ece7dc; --muted: #a8a191; --line: #323a34;
    --green: #5cc49b; --green-soft: #1d3329; --orange: #f4a259; --err: #ff8a80;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink); line-height: 1.6; }
a { color: var(--green); }
h1, h2, h3 { font-family: var(--serif); line-height: 1.2; }
h1 { font-size: 2rem; margin: 1.25rem 0 1rem; }
h2 { font-size: 1.35rem; margin: 2rem 0 .75rem; }

/* Header */
.site-header { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; align-items: baseline; justify-content: space-between;
  max-width: 48rem; margin: 0 auto; padding: 1rem; }
.brand { font-family: var(--serif); font-weight: 700; font-size: 1.5rem; text-decoration: none; color: var(--ink); }
.site-nav { display: flex; flex-wrap: wrap; gap: .25rem 1rem; }
.site-nav a { text-decoration: none; color: var(--muted); font-weight: 600; }
.site-nav a:hover, .site-nav .nav-all { color: var(--green); }

.container { max-width: 48rem; margin: 0 auto; padding: 0 1rem 2rem; }

/* Calculator panel */
.calc { display: grid; gap: 1rem; padding: 1.25rem; background: var(--panel); border-radius: var(--radius);
  box-shadow: 0 1px 3px rgba(0,0,0,.08); }
fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .25rem 1rem; }
legend { font-weight: 600; margin-bottom: .25rem; }
.field { display: grid; gap: .25rem; }
.field label { font-weight: 600; }
.hint { font-weight: 400; color: var(--muted); font-size: .9rem; }
input[type=text], select { font: inherit; padding: .65rem .75rem; border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg); color: inherit; width: 100%; font-variant-numeric: tabular-nums; }
input:focus-visible, select:focus-visible, a:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
input[readonly] { background: var(--green-soft); font-weight: 700; }
.error { color: var(--err); margin: 0; min-height: 1.2em; font-size: .9rem; }

/* Result card */
.result { display: block; font-size: 1.35rem; font-weight: 700; color: var(--green); font-variant-numeric: tabular-nums; }
.result:empty { display: none; }

/* Tables */
.splits { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.splits th, .splits td { text-align: left; padding: .4rem .5rem; border-bottom: 1px solid var(--line); }
.splits th { color: var(--muted); font-weight: 600; }
.splits caption { text-align: left; padding: 0 .5rem .25rem; color: var(--muted); font-size: .95rem; }

/* A set of fields shown for one input method at a time. */
.calc-group { display: grid; gap: 1rem; }

/* Pace charts: the table scrolls sideways on narrow screens instead of the page. */
.chart-wrap { overflow-x: auto; background: var(--panel); border-radius: var(--radius);
  box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.chart { min-width: 34rem; }
.chart caption { text-align: left; padding: .75rem .5rem .25rem; color: var(--muted); font-size: .95rem; }
.chart tbody th { color: var(--green); font-weight: 700; }
.chart tbody tr:nth-child(even) { background: var(--bg); }

/* Use this next / tools hub cards */
.next-grid { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); }
.next-card { display: grid; gap: .2rem; padding: 1rem; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); text-decoration: none; color: var(--ink); }
.next-card strong { color: var(--green); }
.next-card span { color: var(--muted); font-size: .95rem; }
.next-card:hover { border-color: var(--green); }
.lede { color: var(--muted); font-size: 1.1rem; }

/* Copy */
.content, .faq, .prose { margin-top: 2rem; }
.faq h3 { font-size: 1.05rem; margin-bottom: .25rem; }
.prose { max-width: 40rem; }

/* Reserved ad positions: hidden until ads are enabled (then give them a min-height). */
.ad-slot { display: none; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); color: var(--muted); padding: 2rem 1rem; font-size: .95rem;
  max-width: 48rem; margin: 2rem auto 0; }
.footer-tools { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); }
.footer-tools h2 { font-size: 1rem; margin: 0 0 .4rem; color: var(--ink); }
.footer-tools ul { list-style: none; margin: 0; padding: 0; }
.footer-trust { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; margin: 1.5rem 0 .5rem; }
