/* Zatopek reader. One dark, quiet instrument; tokens live here so a design tool can read them. */
:root {
  color-scheme: dark;
  --bg: #131416;
  --panel: #1a1c1f;
  --panel-2: #202327;
  --ink: #e9e6df;
  --muted: #9b9891;
  --faint: #6b6963;
  --line: #2b2e33;
  --accent: #e2a53b;
  --done: #c9ccd1;
  --race: #e2a53b;
  --ok: #6fb083;
  --warn: #e2a53b;
  --error: #e0605a;
  --phase-0: #3f6a99;
  --phase-1: #4e8a7a;
  --phase-2: #8a6a4e;
  --phase-3: #7a5e8a;
  --sans: 'IBM Plex Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --measure: 72ch;
  --pad: 20px;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  font-synthesis: none;
  -webkit-text-size-adjust: 100%;
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; font-weight: 600; line-height: 1.2; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
b { font-weight: 600; }
code, .num, .day-min, .bar-num, .week-num, time { font-family: var(--mono); font-variant-numeric: tabular-nums; }
small { font-size: 0.86em; color: var(--muted); }
.skip { position: absolute; left: -999px; }
.skip:focus { left: var(--pad); top: var(--pad); background: var(--panel); padding: 8px 12px; z-index: 2; }
main, .mast, .foot { max-width: 1120px; margin: 0 auto; padding: 0 var(--pad); }

/* masthead */
.mast { padding-top: 28px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.brand { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; font-family: var(--mono); font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.brand a { padding: 6px 10px; border: 1px solid var(--accent); border-radius: 999px; font-size: 12px; }
.mast h1 { font-size: clamp(26px, 4vw, 36px); margin-top: 14px; }
.span { color: var(--muted); margin-top: 6px; }
.status { margin-top: 14px; max-width: var(--measure); }
.fresh { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--muted); }
.fresh code { color: var(--faint); }

/* sections */
main > section, main > details { padding: 28px 0; border-bottom: 1px solid var(--line); }
.section-head { display: flex; flex-direction: column; gap: 6px; max-width: var(--measure); margin-bottom: 16px; }
.section-head h2 { font-size: 20px; }
.section-head h3 { font-size: 16px; }
.section-head p { color: var(--muted); }
.muted { color: var(--muted); }

/* arc */
.arc-scroll { overflow-x: auto; padding-bottom: 6px; }
.arc svg { display: block; min-width: 560px; max-width: 100%; height: auto; }
.arc .baseline { stroke: var(--line); }
.arc .hit { fill: transparent; }
.arc .col:hover .hit, .arc .col.current .hit { fill: rgba(255, 255, 255, 0.04); }
.arc .bar-plan { fill: var(--phase-0); opacity: 0.55; }
.arc .bar-plan.phase-1 { fill: var(--phase-1); }
.arc .bar-plan.phase-2 { fill: var(--phase-2); }
.arc .bar-plan.phase-3 { fill: var(--phase-3); }
.arc .bar-done { fill: var(--done); }
.arc .col.past .bar-done { fill: var(--faint); }
.arc .bar-num { font-size: 10px; fill: var(--muted); }
.arc .bar-num.done { fill: var(--faint); }
.arc .col-label { font-family: var(--mono); font-size: 10px; fill: var(--muted); }
.arc .col.current .col-label { fill: var(--accent); font-weight: 500; }
.arc .race-mark { fill: var(--race); }
.arc .race-label { font-size: 9px; fill: var(--race); font-family: var(--mono); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 10px; font-size: 13px; color: var(--muted); }
.key { display: inline-flex; align-items: center; gap: 6px; }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 2px; background: var(--phase-0); opacity: 0.7; }
.swatch.phase-1 { background: var(--phase-1); }
.swatch.phase-2 { background: var(--phase-2); }
.swatch.phase-3 { background: var(--phase-3); }
.swatch.done { background: var(--done); opacity: 1; }
.swatch.race { background: var(--race); opacity: 1; clip-path: polygon(0 0, 100% 0, 50% 100%); }

/* assumptions */
.assume-list { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 28px; }
.assume-list div { display: flex; flex-direction: column; gap: 4px; }
.assume-list dt { font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); font-family: var(--mono); }
.assume-list dd { margin: 0; }
.told { margin-top: 22px; padding: 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; }
.told h3 { font-size: 15px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.notes { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.notes li { display: grid; grid-template-columns: 5ch auto 1fr; gap: 10px; align-items: baseline; }
.notes time { color: var(--muted); font-size: 12px; }
.notes b { text-transform: capitalize; }
.pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-family: var(--mono); border: 1px solid var(--line); color: var(--muted); }
.pill.warn { border-color: var(--warn); color: var(--warn); }
.pill.race { border-color: var(--race); color: var(--race); }
.verdict { margin-top: 18px; padding: 12px 14px; border-left: 3px solid var(--warn); background: var(--panel); }
.verdict.ok { border-left-color: var(--ok); }
.verdict.warn { border-left-color: var(--warn); }

/* flags */
.flags { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.flag { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: baseline; font-size: 14px; color: var(--muted); }
.flag .code { font-family: var(--mono); font-size: 11px; padding: 1px 6px; border-radius: 3px; border: 1px solid var(--warn); color: var(--warn); white-space: nowrap; }
.flag.error .code { border-color: var(--error); color: var(--error); }

/* weeks */
.weeks { display: flex; flex-direction: column; gap: 0; }
.week { padding: 28px 0; border-bottom: 1px solid var(--line); scroll-margin-top: 12px; }
.week:last-child { border-bottom: 0; }
.week.current { box-shadow: inset 3px 0 0 var(--accent); padding-left: 16px; }
.week-head { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.week-meta { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: baseline; font-size: 13px; color: var(--muted); }
.week-num { color: var(--ink); font-weight: 500; }
.phase { text-transform: uppercase; letter-spacing: 0.06em; font-size: 11px; font-family: var(--mono); }
.week h2 { font-size: 22px; }
.numbers { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 22px; color: var(--muted); font-size: 14px; }
.numbers b { color: var(--ink); font-family: var(--mono); font-size: 16px; }
.adjust { padding: 14px 16px; margin-bottom: 16px; background: var(--panel); border: 1px solid var(--warn); border-radius: 6px; display: flex; flex-direction: column; gap: 6px; }
.adjust h3 { font-size: 14px; color: var(--warn); text-transform: capitalize; }
.ceilings { font-family: var(--mono); font-size: 13px; }
.source { font-size: 13px; color: var(--muted); }
.reason { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px 24px; margin-bottom: 16px; }
.reason h3, .choice h3 { font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); font-family: var(--mono); margin-bottom: 4px; }
.reason p { font-size: 14px; }
.choice { margin-bottom: 20px; padding: 14px 16px; background: var(--panel); border-radius: 6px; display: flex; flex-direction: column; gap: 6px; }
.picked { font-weight: 500; }
.alt { color: var(--muted); font-size: 14px; }
.alt .why { display: block; margin-top: 2px; }

/* days */
.days { list-style: none; margin: 0 0 22px; padding: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.day { display: flex; flex-direction: column; gap: 4px; padding: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; min-height: 120px; }
.day.weekend { background: var(--panel-2); }
.day.off { opacity: 0.7; }
.day.today { border-color: var(--accent); }
.day-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 12px; color: var(--muted); }
.day-name { font-weight: 500; color: var(--ink); }
.day.today .day-name { color: var(--accent); }
.day-min { font-size: 28px; line-height: 1.1; margin-top: 2px; }
.day-min small { font-size: 12px; margin-left: 3px; color: var(--muted); }
.day-title { font-weight: 500; font-size: 14px; }
.effort, .detail, .care { font-size: 13px; color: var(--muted); }
.care { margin-top: auto; padding-top: 6px; color: var(--faint); }

/* lifting */
.lift .stage { font-weight: 400; font-size: 13px; color: var(--muted); margin-left: 8px; }
.sessions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.session { padding: 12px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; display: flex; flex-direction: column; gap: 6px; }
.session.off { opacity: 0.7; }
.session-head { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); }
.session-head b { color: var(--ink); }
.session-title { font-size: 14px; }
.session table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 4px; }
.session th { text-align: left; font-weight: 500; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; padding: 4px 0; border-bottom: 1px solid var(--line); }
.session td { padding: 8px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.session tr:last-child td { border-bottom: 0; }
.session td small { display: block; }
.session .move { font-weight: 500; }
.session .num { text-align: right; white-space: nowrap; }
.session .rpe { font-weight: 500; font-size: 16px; }

/* fine print */
.fine summary { cursor: pointer; font-weight: 500; }
.fine h3 { font-size: 15px; margin: 18px 0 6px; }
.fine h3 small { font-weight: 400; margin-left: 8px; }
.fine p { max-width: var(--measure); margin-bottom: 8px; color: var(--muted); font-size: 14px; }
.bounds { margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 20px; font-size: 13px; }
.bounds div { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px dotted var(--line); padding: 4px 0; }
.bounds dt { color: var(--muted); }
.bounds dd { margin: 0; font-family: var(--mono); }
.sources { margin: 0; padding-left: 18px; font-size: 14px; }
.sources li { margin-bottom: 8px; }
.sources p { margin: 0; }
.foot { padding: 24px var(--pad) 40px; color: var(--faint); font-size: 13px; }

@media (max-width: 900px) {
  .reason { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .days { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sessions { grid-template-columns: 1fr; }
  .bounds { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  :root { --pad: 16px; font-size: 15px; }
  .assume-list, .reason { grid-template-columns: 1fr; }
  .days { grid-template-columns: 1fr; gap: 6px; }
  .day { min-height: 0; display: grid; grid-template-columns: 5ch 1fr; grid-template-areas: 'head head' 'min title' 'min effort' 'min detail' 'min care'; column-gap: 12px; row-gap: 2px; }
  .day-head { grid-area: head; justify-content: flex-start; gap: 10px; }
  .day-min { grid-area: min; font-size: 24px; }
  .day-title { grid-area: title; }
  .effort { grid-area: effort; }
  .detail { grid-area: detail; }
  .care { grid-area: care; margin-top: 0; }
  .week.current { padding-left: 12px; }
}
