:root {
  --bg: #0b0d10; --surface: #14181d; --line: #252b33; --ink: #f1f3f5; --muted: #9aa3ad;
  --accent: #7fd6e8; --on-accent: #06222a; --warn: #ffb86b;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --bar-h: 56px;
}
* { box-sizing: border-box }
html, body { height: 100% }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 var(--sans); display: flex; flex-direction: column; min-height: 100dvh }
a { color: inherit }
[hidden] { display: none !important }

.bar { height: var(--bar-h); flex: none; display: flex; align-items: center; justify-content: space-between; padding: 0 max(16px, env(safe-area-inset-left)); border-bottom: 1px solid var(--line) }
.brand { display: flex; align-items: baseline; gap: 8px; text-decoration: none }
.mark { font: 600 22px/1 var(--serif); letter-spacing: -0.01em }
.tag { font-size: 12px; text-transform: uppercase; letter-spacing: .14em; color: var(--accent) }
.bar-right { display: flex; align-items: center; gap: 14px }
.cta-link { font-size: 14px; color: var(--muted); text-decoration: none; border-bottom: 1px solid var(--line); padding-bottom: 1px }
.cta-link:hover { color: var(--ink) }
.clock { font: 600 15px/1 ui-monospace, SFMono-Regular, Menlo, monospace; font-variant-numeric: tabular-nums; padding: 7px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface) }
.clock.low { color: var(--warn); border-color: var(--warn) }

main { flex: 1; min-height: 0; width: 100%; max-width: 1080px; margin: 0 auto; padding: 28px 16px 20px }
.loading, .empty { color: var(--muted); text-align: center; margin-top: 18vh }

.hero h1 { font: 500 clamp(30px, 5.2vw, 52px)/1.08 var(--serif); letter-spacing: -0.02em; margin: 8px 0 12px; max-width: 16ch; text-wrap: balance }
.hero p { color: var(--muted); margin: 0 0 28px; max-width: 46ch }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; list-style: none; padding: 0; margin: 0 }
@media (max-width: 460px) { .grid { grid-template-columns: repeat(2, 1fr); gap: 10px } }
.tile { position: relative; display: block; aspect-ratio: 9 / 16; border-radius: 16px; overflow: hidden; background: var(--surface); border: 1px solid var(--line); text-decoration: none; transition: transform .2s ease, border-color .2s ease }
.tile:hover, .tile:focus-visible { transform: translateY(-3px); border-color: var(--accent); outline: none }
.tile img, .tile video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top center }
.tile video { opacity: 0; transition: opacity .3s ease }
.tile.playing video { opacity: 1 }
.tile .meta { position: absolute; inset: auto 0 0 0; padding: 44px 14px 14px; background: linear-gradient(to top, rgba(4, 6, 8, .92), rgba(4, 6, 8, 0)) }
.tile .name { font: 500 21px/1.15 var(--serif); display: block }
.tile .tagline { font-size: 13px; color: #c9d0d7; display: block; margin-top: 3px }
@media (prefers-reduced-motion: reduce) { .tile, .tile video { transition: none } .tile:hover { transform: none } }

body.chat main { padding: 0; max-width: none; display: flex; justify-content: center; background: #000 }
body.chat .foot { display: none }
.stage { position: relative; height: 100%; aspect-ratio: 9 / 16; max-width: 100vw; background: #000; overflow: hidden }
@media (max-aspect-ratio: 9/16) { .stage { width: 100%; height: 100%; aspect-ratio: auto } }
.stage > img.poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top center }
.stage iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000 }
.card { position: absolute; inset: auto 0 0 0; padding: 90px 22px max(26px, env(safe-area-inset-bottom)); background: linear-gradient(to top, rgba(4, 6, 8, .96) 55%, rgba(4, 6, 8, 0)); text-align: center }
.card h1 { font: 500 30px/1.1 var(--serif); margin: 0 0 8px; text-wrap: balance }
.card p { color: #c9d0d7; margin: 0 auto 18px; max-width: 34ch; font-size: 15px }
.card .fine { font-size: 12.5px; color: var(--muted); margin: 14px auto 0 }
.btn { display: inline-block; font: 600 16px/1 var(--sans); padding: 15px 22px; border-radius: 999px; border: 1px solid var(--accent); background: var(--accent); color: var(--on-accent); cursor: pointer; text-decoration: none }
.btn:disabled { opacity: .6; cursor: default }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); margin-left: 8px }
.btn:focus-visible, .cta-link:focus-visible, .brand:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px }
.card.over { inset: 0; display: flex; flex-direction: column; justify-content: center; background: rgba(4, 6, 8, .86); padding-top: 22px }

.foot { flex: none; display: flex; flex-wrap: wrap; gap: 4px 18px; justify-content: center; padding: 14px 16px max(18px, env(safe-area-inset-bottom)); color: var(--muted); font-size: 13px; border-top: 1px solid var(--line) }
.foot b { color: var(--ink); font-weight: 600 }

/* ---------- the workout plan ---------- */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%) }
.linkbtn { display: block; margin: 18px auto 0; background: none; border: 0; color: var(--accent); font: 600 15px/1 var(--sans); cursor: pointer; text-decoration: underline; text-underline-offset: 4px }
body.chat main { position: relative }
.plan { --k: var(--accent); color: var(--ink); opacity: 0; transform: translateY(14px); transition: opacity .35s ease, transform .35s ease }
.plan.in { opacity: 1; transform: none }
.k-cardio { --k: #ff9f7a } .k-strength { --k: #7fd6e8 } .k-dance { --k: #f7cf5a } .k-stretch { --k: #9fe3a6 }
.plan-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px }
.plan .eyebrow { font-size: 11.5px; text-transform: uppercase; letter-spacing: .13em; color: var(--accent) }
.plan h2 { font: 500 26px/1.1 var(--serif); margin: 3px 0 0; letter-spacing: -0.01em }
.plan-toggle { flex: none; font: 600 13px/1 var(--sans); padding: 9px 13px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255, 255, 255, .06); color: var(--ink); cursor: pointer }
.plan-toggle:focus-visible, .linkbtn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px }
.facts { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 14px 0 0 }
.facts li { font-size: 12.5px; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line); color: #c9d0d7 }
.week { list-style: none; display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; padding: 0; margin: 14px 0 0 }
.week li { text-align: center; font: 600 12px/1 var(--sans); padding: 8px 0; border-radius: 9px; color: var(--muted); border: 1px solid var(--line) }
.week li.on { background: var(--k); border-color: var(--k); color: #10151a }
.days { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 10px }
.day { border: 1px solid var(--line); border-left: 3px solid var(--k); border-radius: 12px; padding: 12px 14px; background: rgba(255, 255, 255, .035) }
.day-when { font-size: 11.5px; text-transform: uppercase; letter-spacing: .12em; color: var(--k) }
.day h3 { font: 500 19px/1.15 var(--serif); margin: 2px 0 2px }
.day-meta { font-size: 12.5px; color: var(--muted) }
.day .step, .day .rounds { font-size: 13px; color: #c9d0d7; margin: 9px 0 0 }
.day .rounds { color: var(--k); font-weight: 600 }
.moves { list-style: none; padding: 0; margin: 9px 0 0; border-top: 1px solid var(--line) }
.moves li { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; padding: 6px 0; border-bottom: 1px solid var(--line) }
.moves b { font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap }
.tip { font-size: 13.5px; margin: 14px 0 0; padding: 10px 12px; border-radius: 10px; background: rgba(127, 214, 232, .09); color: #d7eef4 }
.plan-fine { font-size: 11.5px; color: var(--muted); margin: 10px 0 0 }

/* Wide screens: the plan sits beside him. */
@media (min-width: 900px) {
  .plan { flex: none; width: clamp(340px, 34vw, 430px); height: 100%; overflow-y: auto; padding: 22px 20px 26px; background: var(--bg); border-left: 1px solid var(--line) }
  .plan-toggle { display: none }
}

/* Phones: a short strip between his face and the chat box; "Full plan" opens it. */
@media (max-width: 899.98px) {
  .plan { position: absolute; z-index: 5; left: 8px; right: 8px; bottom: calc(222px + env(safe-area-inset-bottom)); padding: 10px 12px 12px; border-radius: 16px; border: 1px solid rgba(255, 255, 255, .14); background: rgba(12, 15, 19, .74); -webkit-backdrop-filter: blur(16px) saturate(140%); backdrop-filter: blur(16px) saturate(140%); box-shadow: 0 10px 30px rgba(0, 0, 0, .45) }
  .plan h2 { font-size: 20px }
  .plan:not(.open) .facts, .plan:not(.open) .tip, .plan:not(.open) .plan-fine, .plan:not(.open) .day .step, .plan:not(.open) .day .rounds, .plan:not(.open) .moves { display: none }
  .plan:not(.open) .eyebrow { display: none }
  .plan:not(.open) .plan-toggle { padding: 7px 11px }
  .plan:not(.open) .day-meta { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
  .plan:not(.open) .week { margin-top: 9px; gap: 4px }
  .plan:not(.open) .week li { padding: 5px 0; font-size: 11px }
  .plan:not(.open) .days { margin-top: 9px; display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; margin-right: -12px; padding-right: 12px }
  .plan:not(.open) .days::-webkit-scrollbar { display: none }
  .plan:not(.open) .day { flex: none; width: min(62%, 230px); scroll-snap-align: start; padding: 8px 11px }
  .plan:not(.open) .day h3 { font-size: 16px }
  .plan.open { top: 8px; bottom: 8px; overflow-y: auto; padding: 16px 16px 20px; background: rgba(12, 15, 19, .93) }
  .plan.after:not(.open) { display: none }
  .plan.after.open { z-index: 20 }
}
@media (prefers-reduced-motion: reduce) { .plan { transition: none; transform: none } }
