/* TreadmillPace — visual system from design mockup */
:root {
  --ink: #14171c;
  --ink-soft: #2a3038;
  --steel: #5e6975;
  --line: #d5d8e0;
  --paper: #e9edf1;
  --panel: #f7f9fb;
  --white: #ffffff;
  --signal: #ff5a1f;
  --signal-deep: #d9430f;
  --ok: #1f7a4c;
  --warn: #9a6700;
  --radius: 10px;
  --max: 1080px;
  --font-brand: "Barlow Condensed", sans-serif;
  --font-ui: "Barlow", sans-serif;
  --font-num: "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-ui);
  color: var(--ink);
  background: linear-gradient(180deg, #dfe5eb 0%, var(--paper) 42%, var(--paper) 100%);
  min-height: 100vh;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    repeating-linear-gradient(
      90deg,
      transparent 0,
      transparent 72px,
      rgba(20, 23, 28, 0.035) 72px,
      rgba(20, 23, 28, 0.035) 74px
    ),
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(255, 90, 31, 0.12), transparent 55%);
}

.wrap {
  position: relative;
  z-index: 1;
  width: min(100% - 2rem, var(--max));
  margin: 0 auto;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 0 0.6rem;
  gap: 1rem;
}
.brand {
  font-family: var(--font-brand);
  font-weight: 700;
  font-size: 1.55rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  line-height: 1;
}
.brand span { color: var(--signal); }
.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  font-size: 0.95rem;
  font-weight: 500;
}
.nav a {
  color: var(--ink-soft);
  text-decoration: none;
}
.nav a:hover,
.nav a[aria-current="page"] { color: var(--signal-deep); }

.hero {
  padding: 1.25rem 0 2.5rem;
  display: grid;
  gap: 1.35rem;
}
.hero-copy h1 {
  margin: 0;
  font-family: var(--font-brand);
  font-weight: 700;
  font-size: clamp(2.4rem, 6.5vw, 4rem);
  line-height: 0.95;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  max-width: 18ch;
}
.hero-copy h1 em {
  font-style: normal;
  color: var(--signal);
}
.hero-copy p {
  margin: 0.7rem 0 0;
  max-width: 36rem;
  font-size: 1.05rem;
  color: var(--steel);
  line-height: 1.45;
}

.tool {
  background: var(--panel);
  border: 1px solid rgba(20, 23, 28, 0.08);
  border-radius: var(--radius);
  padding: 1.15rem 1.15rem 1.25rem;
}
.tool-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}
.seg {
  display: inline-flex;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.seg button {
  appearance: none;
  border: 0;
  background: transparent;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 0.88rem;
  padding: 0.55rem 0.9rem;
  color: var(--steel);
  cursor: pointer;
}
.seg button[aria-pressed="true"] {
  background: var(--ink);
  color: var(--white);
}
.units {
  font-size: 0.85rem;
  color: var(--steel);
  font-weight: 500;
}
.units button {
  appearance: none;
  border: 0;
  background: none;
  font: inherit;
  color: var(--ink);
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0.85rem;
  align-items: stretch;
}
@media (max-width: 720px) {
  .grid { grid-template-columns: 1fr; }
  .arrow { transform: rotate(90deg); justify-self: center; }
}

.field {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.85rem 1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-height: 7.5rem;
}
.field label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--steel);
}
.field input {
  width: 100%;
  border: 0;
  outline: none;
  font-family: var(--font-num);
  font-weight: 600;
  font-size: clamp(2rem, 5vw, 2.6rem);
  color: var(--ink);
  background: transparent;
  font-variant-numeric: tabular-nums;
  padding: 0;
}
.field .hint {
  font-size: 0.85rem;
  color: var(--steel);
}
.field.out {
  background: var(--ink);
  border-color: var(--ink);
}
.field.out label { color: #9aa3ad; }
.field.out .value {
  font-family: var(--font-num);
  font-weight: 600;
  font-size: clamp(2rem, 5vw, 2.6rem);
  color: #fff;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}
.field.out .hint { color: #8b949e; }
.field.out .actions {
  margin-top: auto;
  display: flex;
  gap: 0.5rem;
}
.btn {
  appearance: none;
  border: 0;
  border-radius: 6px;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.45rem 0.75rem;
  cursor: pointer;
}
.btn-copy {
  background: var(--signal);
  color: #fff;
}
.btn-copy:hover { background: var(--signal-deep); }
.arrow {
  align-self: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 999px;
  background: var(--white);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  color: var(--ink);
  font-size: 1.1rem;
}

.extras {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
  margin-top: 0.85rem;
}
@media (max-width: 640px) {
  .extras { grid-template-columns: 1fr; }
}
.extra {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.75rem 0.9rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.extra label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-soft);
}
.extra input[type="number"] {
  width: 5.5rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.4rem 0.5rem;
  font-family: var(--font-num);
  font-size: 1rem;
  font-weight: 500;
}
.badge {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--warn);
  background: #fff6dd;
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
}
.check {
  margin-top: 0.85rem;
  font-size: 0.9rem;
  color: var(--steel);
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  align-items: baseline;
}
.check strong {
  font-family: var(--font-num);
  font-weight: 600;
  color: var(--ok);
}
.err {
  margin-top: 0.65rem;
  font-size: 0.88rem;
  color: #b42318;
  min-height: 1.2em;
}

.section {
  padding: 2rem 0 0.5rem;
  border-top: 1px solid rgba(20, 23, 28, 0.08);
}
.section h2 {
  margin: 0 0 0.35rem;
  font-family: var(--font-brand);
  font-size: 1.75rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.section > p.lead {
  margin: 0 0 1.1rem;
  color: var(--steel);
  max-width: 40rem;
}
.quick {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.chip {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--white);
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  color: var(--ink);
}
.chip:hover { border-color: var(--signal); color: var(--signal-deep); }

.links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
@media (max-width: 640px) {
  .links { grid-template-columns: 1fr; }
}
.link-tile {
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1rem 1.1rem;
}
.link-tile strong {
  display: block;
  font-family: var(--font-brand);
  font-size: 1.35rem;
  text-transform: uppercase;
  margin-bottom: 0.2rem;
}
.link-tile span { color: var(--steel); font-size: 0.92rem; }

.faq details {
  border-bottom: 1px solid var(--line);
  padding: 0.85rem 0;
}
.faq summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--ink);
}
.faq p {
  margin: 0.5rem 0 0;
  color: var(--steel);
  line-height: 1.5;
}

.prose {
  max-width: 40rem;
  color: var(--ink-soft);
  line-height: 1.55;
}
.prose h1 {
  font-family: var(--font-brand);
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  text-transform: uppercase;
  margin: 1.5rem 0 0.75rem;
  color: var(--ink);
}
.prose h2 {
  font-family: var(--font-brand);
  font-size: 1.5rem;
  text-transform: uppercase;
  margin: 1.75rem 0 0.5rem;
}
.prose p { margin: 0 0 1rem; color: var(--steel); }
.prose ul { color: var(--steel); padding-left: 1.2rem; }

/* Chart page */
.chart-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.btn-print {
  background: var(--ink);
  color: #fff;
}
.btn-print:hover { background: var(--ink-soft); }
.table-wrap {
  overflow-x: auto;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
}
table.pace-chart {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}
table.pace-chart th,
table.pace-chart td {
  padding: 0.55rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
  font-size: 0.95rem;
}
table.pace-chart th {
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--steel);
  background: var(--panel);
  position: sticky;
  top: 0;
}
table.pace-chart td:first-child,
table.pace-chart td:nth-child(2) {
  font-family: var(--font-num);
  font-weight: 500;
}
table.pace-chart tr:last-child td { border-bottom: 0; }
.effort-walk { color: var(--steel); }
.effort-jog { color: var(--ink-soft); }
.effort-run { color: var(--ok); font-weight: 600; }

.site-footer {
  padding: 1.5rem 0 2.5rem;
  font-size: 0.85rem;
  color: var(--steel);
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  justify-content: space-between;
  border-top: 1px solid rgba(20, 23, 28, 0.08);
  margin-top: 2rem;
}
.site-footer a { color: var(--ink-soft); }

.ad-slot {
  margin: 1.5rem 0;
  padding: 1rem;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--steel);
  font-size: 0.8rem;
  text-align: center;
  background: rgba(255, 255, 255, 0.5);
}

@media print {
  body::before { display: none; }
  .top .nav,
  .ad-slot,
  .btn-print,
  .chip,
  .site-footer a:not(:first-child) { display: none !important; }
  body { background: #fff; }
  .tool, .table-wrap { border: 0; }
}
