/* Gym Workout Spinner: the shared style for every *.gymworkoutspinner.com
   site (recovery, and later privacy, terms and the marketing pages).
   Pages link it as /shared/site.css; see website/README.md. */

/* ── Fonts: Barlow, self-hosted (no third-party requests). OFL, see fonts/OFL.txt ── */
@font-face { font-family: "Barlow"; font-weight: 400; font-style: normal; font-display: swap; src: url("fonts/barlow-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 400; font-style: italic; font-display: swap; src: url("fonts/barlow-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 500; font-style: normal; font-display: swap; src: url("fonts/barlow-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 600; font-style: normal; font-display: swap; src: url("fonts/barlow-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 600; font-style: normal; font-display: swap; src: url("fonts/barlow-condensed-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 700; font-style: normal; font-display: swap; src: url("fonts/barlow-condensed-latin-700-normal.woff2") format("woff2"); }

/* ── Tokens ── */
:root {
  color-scheme: light dark;

  /* Brand: the app icon's blues */
  --blue: #0B5FFF;
  --blue-deep: #0848C2;
  --sky: #00C2FF;

  /* Surfaces and text */
  --ink: #12203F;          /* body text: the navy of the app's dark surfaces */
  --ink-soft: #4A5875;     /* secondary text */
  --paper: #FFFFFF;
  --mist: #EEF3FB;         /* panels, formulas */
  --line: #D5DEEC;
  --link: #0B5FFF;

  /* Recovery map colours. The bright ones are the app's fills; the -text
     ones are darker for text on light backgrounds (contrast 4.5:1+). */
  --red: #FF3B30;    --red-text: #C4170D;
  --amber: #FF9500;  --amber-text: #A65200;
  --green: #34C759;  --green-text: #1C7A35;

  --font-body: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Barlow Condensed", "Barlow", system-ui, sans-serif;

  /* Type scale: 18px base, major third */
  --step--1: 0.889rem;
  --step-0: 1.125rem;
  --step-1: 1.406rem;
  --step-2: 1.758rem;
  --step-3: 2.197rem;
  --step-4: clamp(2.6rem, 6vw + 1rem, 4.4rem);

  --measure: 66ch;
  --wide: 1080px;
  --gutter: clamp(16px, 4vw, 40px);
  --radius: 14px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #E4ECFA; --ink-soft: #A3B2CC;
    --paper: #0C1830; --mist: #14254A; --line: #26395F; --link: #6FA3FF;
    --red-text: #FF6B62; --amber-text: #FFB347; --green-text: #5CD97A;
  }
}
:root[data-theme="dark"] {
  --ink: #E4ECFA; --ink-soft: #A3B2CC;
  --paper: #0C1830; --mist: #14254A; --line: #26395F; --link: #6FA3FF;
  --red-text: #FF6B62; --amber-text: #FFB347; --green-text: #5CD97A;
}

/* ── Base ── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 var(--step-0)/1.6 var(--font-body);
  font-kerning: normal;
  font-variant-numeric: proportional-nums;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--link); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; border-radius: 4px; }
::selection { background: color-mix(in srgb, var(--sky) 35%, transparent); }
.skip { position: absolute; left: -999px; top: 8px; padding: 8px 14px; background: var(--paper); z-index: 10; }
.skip:focus { left: 8px; }

/* ── Layout ── */
.wrap { width: min(100% - 2 * var(--gutter), var(--wide)); margin-inline: auto; }
.measure { max-width: var(--measure); }
/* A plain page's content under the header (privacy, terms, not found) */
.page { padding-top: 56px; }

/* ── Site header: the brand band, the same on every subdomain ── */
.site-header {
  background: linear-gradient(120deg, var(--blue-deep) 0%, var(--blue) 55%, #1A8CFF 100%);
  color: #fff;
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; }
.brand img { width: 34px; height: 34px; border-radius: 8px; box-shadow: 0 0 0 1px rgba(255,255,255,0.25); }
.brand span { font: 700 1.35rem/1 var(--font-display); letter-spacing: 0.01em; }
.site-nav { display: flex; gap: 4px 20px; flex-wrap: wrap; }
.site-nav a { color: rgba(255,255,255,0.86); text-decoration: none; font-weight: 500; padding: 6px 0; }
.site-nav a:hover { color: #fff; text-decoration: underline; }
.site-nav a[aria-current="page"] { color: #fff; box-shadow: inset 0 -2px 0 var(--sky); }
.site-header :focus-visible { outline-color: #fff; }

/* ── Type ── */
h1, h2, h3 { color: var(--ink); text-wrap: balance; }
h1 { font: 700 var(--step-4)/0.98 var(--font-display); letter-spacing: -0.01em; margin: 0 0 0.35em; }
h2 { font: 600 var(--step-3)/1.05 var(--font-display); margin: 2.2em 0 0.5em; }
h3 { font: 600 var(--step-1)/1.25 var(--font-body); margin: 1.6em 0 0.4em; }
p, ul, ol { margin: 0 0 1em; }
li + li { margin-top: 0.35em; }
.lead { font-size: var(--step-1); line-height: 1.45; color: var(--ink-soft); max-width: 40ch; }
.small { font-size: var(--step--1); color: var(--ink-soft); }
strong { font-weight: 600; }
.num { font-variant-numeric: tabular-nums; }

/* ── Long-form text (explainers, privacy, terms) ── */
.prose { max-width: var(--measure); }
.prose h2:first-child { margin-top: 0; }
.prose ul, .prose ol { padding-left: 1.3em; }

/* A stepped section: only for content that really is a sequence */
.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; }
.steps > li { counter-increment: step; position: relative; padding-left: 64px; margin-top: 2.6em; }
.steps > li::before {
  content: counter(step);
  position: absolute; left: 0; top: 0.1em;
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--blue); color: #fff;
  font: 700 1.5rem/1 var(--font-display);
}
.steps > li > h2 { margin-top: 0; }
@media (max-width: 560px) {
  .steps > li { padding-left: 0; }
  .steps > li::before { position: static; margin-bottom: 12px; }
}

/* A formula, set like a worked line in a training log */
.formula {
  margin: 1.2em 0;
  padding: 14px 18px;
  background: var(--mist);
  border-left: 4px solid var(--blue);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  overflow-x: auto;
}
.formula var { font-style: normal; color: var(--blue); font-weight: 600; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .formula var { color: var(--link); } }
:root[data-theme="dark"] .formula var { color: var(--link); }

/* Tables of numbers */
.table-scroll { overflow-x: auto; margin: 1.2em 0; }
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 10px 14px 10px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 600; color: var(--ink-soft); font-size: var(--step--1); }
td.r, th.r { text-align: right; }

/* Recovery status: always a word as well as a colour */
.status { display: inline-flex; align-items: center; gap: 0.4em; font-weight: 600; white-space: nowrap; }
.status::before { content: ""; width: 0.72em; height: 0.72em; border-radius: 50%; background: currentColor; }
.status.red { color: var(--red-text); }
.status.amber { color: var(--amber-text); }
.status.green { color: var(--green-text); }

/* Callout for caveats and notes */
.note { padding: 16px 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.note > :last-child { margin-bottom: 0; }

/* ── Form controls ── */
input[type="number"] {
  font: inherit; color: var(--ink); background: var(--paper);
  width: 5.5em; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px;
  font-variant-numeric: tabular-nums;
}
input[type="range"] { width: 100%; accent-color: var(--blue); height: 28px; }
label { font-weight: 500; }

/* ── Store badges and footer ── */
.stores { display: flex; flex-wrap: wrap; gap: 12px; margin: 1em 0; }
.button {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: 999px;
  background: var(--blue); color: #fff; text-decoration: none; font-weight: 600;
}
.button:hover { background: var(--blue-deep); text-decoration: none; }
.button.secondary { background: transparent; color: var(--link); box-shadow: inset 0 0 0 1.5px currentColor; }

.site-footer { margin-top: 96px; padding: 32px 0 48px; border-top: 1px solid var(--line); color: var(--ink-soft); font-size: var(--step--1); }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 32px; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.site-footer a { color: var(--ink-soft); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* A list whose items each start with a status: the colour dot is the bullet */
.prose ul.rules, ul.rules { list-style: none; padding-left: 0; }

/* ── Questions and answers (support, FAQ): native <details>, no script ── */
.qa { border-top: 1px solid var(--line); max-width: var(--measure); }
.qa details { border-bottom: 1px solid var(--line); }
.qa summary {
  cursor: pointer; list-style: none;
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  padding: 16px 0; font-weight: 600;
}
.qa summary::-webkit-details-marker { display: none; }
.qa summary::after { content: "+"; font: 600 1.5rem/1 var(--font-display); color: var(--blue); flex: none; }
.qa details[open] summary::after { content: "–"; }
.qa details > :not(summary) { margin-top: 0; }
.qa details > :last-child { padding-bottom: 18px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .qa summary::after { color: var(--link); } }
:root[data-theme="dark"] .qa summary::after { color: var(--link); }

/* ── Contents list at the top of a long page ── */
.toc { margin: 1.5em 0 2.5em; padding: 18px 22px; background: var(--mist); border-radius: var(--radius); max-width: var(--measure); }
.toc h2 { font: 600 var(--step-0)/1.3 var(--font-body); margin: 0 0 8px; color: var(--ink-soft); }
.toc ol { margin: 0; padding-left: 1.3em; columns: 2 16em; column-gap: 32px; }
.toc li { break-inside: avoid; }

/* Section headings get room when reached from the contents list */
[id] { scroll-margin-top: 24px; }

/* ── A screenshot in a phone outline ── */
.phone {
  margin: 0; padding: 8px; border-radius: 34px;
  background: #0E1524; box-shadow: 0 0 0 1px rgba(255,255,255,0.08), 0 18px 40px rgba(8, 40, 110, 0.22);
  width: min(100%, 280px);
}
.phone img { width: 100%; height: auto; border-radius: 27px; }

/* ── An even grid of short items (features, help topics) ── */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 28px 32px; }
.grid h3 { margin-top: 0; }
.grid p { margin: 0; color: var(--ink-soft); }

/* A page title area on a plain page */
.page-head { padding: 48px 0 8px; }
.page-head .lead { max-width: 52ch; }
.updated { color: var(--ink-soft); font-size: var(--step--1); }
