:root {
  --bg: #faf6f4;
  --surface: #ffffff;
  --text: #1f1a1d;
  --muted: #6c6267;
  --line: #ebe2df;
  --accent: #b3264c;
  --accent-ink: #ffffff;
  --accent-soft: #f8e4e9;
  --rest: #e6efe8;
  --rest-ink: #335c41;
  --beginner: #2f7a55;
  --intermediate: #b0640c;
  --advanced: #b3264c;
  --shadow: 0 1px 2px rgba(40, 20, 30, .06), 0 4px 16px rgba(40, 20, 30, .06);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141113;
    --surface: #1e1a1c;
    --text: #f2ecee;
    --muted: #a99ea3;
    --line: #342d30;
    --accent: #ff7b9c;
    --accent-ink: #2a0b14;
    --accent-soft: #3b1f28;
    --rest: #1c2a21;
    --rest-ink: #9fd3ae;
    --beginner: #6fd09c;
    --intermediate: #f2b05e;
    --advanced: #ff7b9c;
    --shadow: none;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #141113;
  --surface: #1e1a1c;
  --text: #f2ecee;
  --muted: #a99ea3;
  --line: #342d30;
  --accent: #ff7b9c;
  --accent-ink: #2a0b14;
  --accent-soft: #3b1f28;
  --rest: #1c2a21;
  --rest-ink: #9fd3ae;
  --beginner: #6fd09c;
  --intermediate: #f2b05e;
  --advanced: #ff7b9c;
  --shadow: none;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
h1, h2 { line-height: 1.15; letter-spacing: -0.01em; text-wrap: balance; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }
main.wrap { padding-top: 28px; padding-bottom: 32px; }
.eyebrow { margin: 0 0 6px; font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }

/* Calendar */
.hero { margin-bottom: 24px; }
.hero h1 { font-size: clamp(32px, 6vw, 48px); margin: 0 0 10px; }
.lede { margin: 0 0 14px; max-width: 46ch; color: var(--muted); }
.progress { margin: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: baseline; }
.today-link { font-weight: 600; }

.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.dow { font-size: 13px; color: var(--muted); padding: 0 4px 2px; }
.cell {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 112px;
  padding: 10px 10px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: transform .12s ease, border-color .12s ease;
}
.cell:hover { transform: translateY(-2px); border-color: var(--accent); }
.cell:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cell .num { font-size: 26px; font-weight: 700; line-height: 1; }
.cell .wd { display: none; }
.cell .t { font-size: 14px; line-height: 1.3; color: var(--muted); }
.cell.rest { background: var(--rest); border-color: transparent; box-shadow: none; }
.cell.rest .t { color: var(--rest-ink); font-weight: 600; }
.cell.today { border: 2px solid var(--accent); }
.cell.today .num { color: var(--accent); }
.cell.done .t { text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--muted) 50%, transparent); }
.tick {
  position: absolute; top: 8px; right: 8px;
  width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink);
  font-size: 13px; font-weight: 700;
}

@media (max-width: 680px) {
  .cal { grid-template-columns: 1fr; gap: 6px; }
  .dow, .blank { display: none; }
  .cell { flex-direction: row; align-items: center; min-height: 0; gap: 12px; padding: 12px 14px; }
  .cell .num { font-size: 20px; min-width: 1.6em; }
  .cell .wd { display: inline; font-size: 13px; color: var(--muted); min-width: 2.4em; }
  .cell .t { font-size: 16px; color: var(--text); padding-right: 28px; }
  .tick { top: 50%; transform: translateY(-50%); right: 12px; }
}

/* Day page */
.crumbs { margin-bottom: 18px; font-size: 15px; }
.crumbs a { text-decoration: none; font-weight: 600; }
.day-head h1 { font-size: clamp(30px, 5.5vw, 44px); margin: 0 0 14px; }
.today-badge { margin-left: 6px; padding: 2px 8px; border-radius: 99px; background: var(--accent); color: var(--accent-ink); letter-spacing: .04em; }
.health { margin: 0 0 20px; padding: 10px 14px; border-left: 3px solid var(--accent); background: var(--accent-soft); border-radius: 4px; font-size: 15px; }

main.wrap > section, .health, .tabs, .done-row, .pager { max-width: 720px; }

.tabs { display: flex; gap: 4px; padding: 4px; margin-bottom: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.tabs button {
  flex: 1;
  padding: 10px 8px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.tabs button[aria-selected="true"] { background: var(--accent); color: var(--accent-ink); }
.tabs button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.level, .rest-panel, .extra {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
}
.js .level:not(.active) { display: none; }
.level h2, .extra h2 { font-size: 22px; margin: 0 0 12px; }
.level-tag { display: block; margin-bottom: 4px; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; }
.level-tag.beginner { color: var(--beginner); }
.level-tag.intermediate { color: var(--intermediate); }
.level-tag.advanced { color: var(--advanced); }
.optional { font-size: 13px; font-weight: 600; color: var(--muted); border: 1px solid var(--line); border-radius: 99px; padding: 1px 8px; vertical-align: middle; }

.timing { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 0 0 16px; }
.timing li { padding: 4px 10px; border-radius: 99px; background: var(--accent-soft); font-size: 14px; font-weight: 600; }

.video { margin: 0 0 16px; }
.video-thumb, .video-frame {
  display: block;
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  background: #000;
  border: 0;
}
.video-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: .92; transition: opacity .15s; }
.video-thumb:hover img { opacity: 1; }
.play {
  position: absolute; inset: 0; margin: auto;
  width: 68px; height: 68px; border-radius: 50%;
  background: rgba(0, 0, 0, .62);
}
.play::after {
  content: ""; position: absolute; left: 27px; top: 21px;
  border-style: solid; border-width: 13px 0 13px 22px;
  border-color: transparent transparent transparent #fff;
}
.video figcaption { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; margin-top: 6px; font-size: 14px; color: var(--muted); }

.steps p { margin: 0 0 10px; }
.steps ul { margin: 0; padding-left: 1.2em; }
.steps li { margin-bottom: 6px; }
.steps li::marker { color: var(--accent); }
.note { margin: 0 0 14px; font-size: 15px; color: var(--muted); font-style: italic; }

.extra { border-style: dashed; box-shadow: none; }

.done-row { margin: 4px 0 28px; }
.done-toggle {
  width: 100%;
  padding: 14px;
  border: 2px solid var(--accent);
  border-radius: 12px;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.done-toggle[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pager a {
  display: flex; flex-direction: column; gap: 2px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
}
.pager a.next { text-align: right; }
.pager small { color: var(--muted); font-weight: 600; font-size: 13px; }
.pager a:hover { border-color: var(--accent); }

.foot { padding-bottom: 32px; font-size: 13px; color: var(--muted); }
.foot p { max-width: 720px; border-top: 1px solid var(--line); padding-top: 16px; margin: 0; }
.foot a { color: inherit; }
