/* SPDX-License-Identifier: AGPL-3.0-or-later */
/* Colours, type and components follow ridrs Scenic (web/scenic/site/style.css): cyan/lime accents, italic display caps,
   mono eyebrows, pills and pill buttons, panels with a shadow. The interface is always dark. */
@import url("vendor/fonts/fonts.css");

:root {
  color-scheme: dark;
  --bg: #07090e; --surface: #0d121c; --surface-raised: #131b2a; --border: #1b2a3c;
  --cyan: #00f0ff; --lime: #ccff00; --amber: #e8a838; --red: #ff4d6d;
  --text: #f1f5f9; --muted: #8b9bb4; --faint: #5b6b82; --focus: #5aa9e6;
  --hi: var(--lime); --link: var(--cyan); --on-lime: #07090e;
  --shadow: 0 10px 30px rgb(0 0 0 / .55), 0 0 0 1px var(--border); --chip-shadow: 0 4px 14px rgb(0 0 0 / .45);
  --sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --display: 'Chakra Petch', 'Plus Jakarta Sans', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  /* interval types */
  --warmup: #3b7ddd; --work: #ff4d6d; --recovery: #2fb344; --cooldown: #5b6b82;
  /* power zones of the generator (Coggan, sweet spot split out) */
  --z-z1: #5b6b82; --z-z2: #3b7ddd; --z-tempo: #2fb344; --z-ss: #a3d12a; --z-thr: #e8c33a; --z-z5: #f08a3a; --z-z6: #ff4d6d; --z-z7: #b46cf0;
}

* { box-sizing: border-box; }
body { margin: 0; font: 400 15px/1.45 var(--sans); color: var(--text); -webkit-font-smoothing: antialiased;
  background: radial-gradient(70rem 32rem at 75% -12rem, rgb(0 240 255 / .09), transparent 70%), var(--bg); background-attachment: fixed; }
a { color: var(--link); }
::selection { background: var(--cyan); color: var(--bg); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
input, select, button { font: inherit; color: inherit; }
input[type=search], input[type=number], select { padding: .45rem .6rem; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-raised); min-width: 0; }
h1 { font: italic 700 clamp(1.5rem, 4vw, 2.2rem)/1.1 var(--display); text-transform: uppercase; margin: .2rem 0 .3rem; }
.eyebrow { margin: 0; font: 600 .7rem/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--link); }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
main, .top, .foot { max-width: 1100px; margin: 0 auto; padding: 0 16px; }

.top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-top: 14px; padding-bottom: 14px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--text); }
.brand img { height: 1.3rem; display: block; }
.brand span { font: italic 700 1rem/1 var(--display); text-transform: uppercase; padding-left: .6rem; border-left: 1px solid var(--border); }
.ftp { font: 600 .8rem var(--mono); color: var(--muted); display: flex; align-items: center; gap: .4rem; }
.ftp input { width: 5.5rem; text-align: right; color: var(--text); }

.listhead { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 1rem; margin-top: 1rem; }
.tools { display: flex; gap: .5rem; flex-wrap: wrap; }
.tools input { width: min(260px, 60vw); }
.cards { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.card { display: flex; flex-direction: column; gap: .5rem; height: 100%; padding: 14px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); color: var(--text); text-decoration: none; transition: border-color .15s, transform .15s; }
.card:hover { border-color: var(--cyan); transform: translateY(-1px); }
.card b { font-weight: 700; }
.spark { display: flex; align-items: end; gap: 2px; height: 28px; }
.spark i { flex: 2; height: 100%; background: var(--work); border-radius: 2px; }
.spark s { flex: 1; height: 35%; background: var(--recovery); border-radius: 2px; }
.chips { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: auto; }
.chips span { font: 500 .72rem var(--mono); padding: .15rem .45rem; border-radius: 999px; background: var(--surface-raised); color: var(--muted); }

.back { display: inline-block; margin: .5rem 0 .6rem; text-decoration: none; font-size: .85rem; }
/* Video left, workout panel right; stacked on narrow screens. */
.stage { display: grid; grid-template-columns: minmax(0, 2fr) minmax(220px, 1fr); gap: 12px; margin-top: .75rem; }
@media (max-width: 760px) { .stage { grid-template-columns: 1fr; } }
.vid { position: relative; aspect-ratio: 16 / 9; background: #000; border-radius: 14px; overflow: hidden; border: 1px solid var(--border); }
.slot, .slot > div, .slot iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.consent { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .8rem; padding: 1.5rem; text-align: center; background: var(--surface); z-index: 2; }
.consent p { max-width: 34rem; margin: 0; color: var(--muted); }
.btn { display: inline-flex; align-items: center; min-height: 2.5rem; padding: 0 1.1rem; border-radius: 999px; text-decoration: none; font-weight: 700; font-size: .92rem;
  color: var(--text); background: var(--surface-raised); border: 1px solid var(--border); cursor: pointer; transition: border-color .15s, background-color .15s; }
.btn-primary { background: var(--lime); color: var(--on-lime); border-color: transparent; }
@media (hover: hover) { .btn:hover { border-color: var(--link); } .btn-primary:hover { background: #dbff4d; border-color: transparent; } }
.consent .btn { background: var(--lime); color: var(--on-lime); border-color: transparent; }

/* Workout panel beside the video: phase, round, cue text, target and time left. */
.overlay { display: flex; flex-direction: column; justify-content: space-between; gap: .75rem; min-height: 220px; padding: 14px; font-family: var(--mono); background: var(--surface); border: 1px solid var(--border); border-radius: 14px; border-top: 4px solid var(--faint); transition: border-color .2s; }
.overlay.o-warmup { border-top-color: var(--warmup); } .overlay.o-work { border-top-color: var(--work); }
.overlay.o-recovery { border-top-color: var(--recovery); } .overlay.o-cooldown { border-top-color: var(--cooldown); }
.ov-top, .ov-bottom { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .5rem; }
#ov-round { color: var(--muted); }
#ov-phase { font: italic 700 1.3rem var(--display); text-transform: uppercase; }
#ov-watts b { font-size: 1.8rem; color: var(--lime); }
#ov-left { font-size: 1.8rem; font-weight: 600; }
.ov-cue { align-self: center; text-align: center; min-height: 1em; font: italic 700 clamp(3rem, 8vw, 6rem)/1 var(--display); color: #fff; }
.ov-cue.c-work { color: var(--lime); } .ov-cue.c-recovery { color: var(--recovery); } .ov-cue.c-cooldown { color: var(--cyan); }
.ov-cue.c-intro, .ov-cue.c-round, .ov-cue.c-callout { font-size: clamp(1.35rem, 2.8vw, 2.1rem); line-height: 1.15; text-transform: uppercase; letter-spacing: .02em; }
.ov-cue.c-intro, .ov-cue.c-round { color: var(--cyan); }
.ov-cue.c-callout { color: var(--amber); }
.ov-cue:not(:empty) { animation: pop .25s ease-out; }
@keyframes pop { from { transform: scale(1.3); opacity: .4; } }
@media (max-width: 760px) { .overlay { min-height: 0; } .ov-cue { font-size: 3rem; } .ov-cue.c-intro, .ov-cue.c-round, .ov-cue.c-callout { font-size: 1.5rem; } }

.recipes { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; margin: 1rem 0; }
.recipes button { display: flex; flex-direction: column; align-items: start; gap: .15rem; padding: .6rem .8rem; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; text-align: left; }
.recipes button span { font: 500 .75rem var(--mono); color: var(--muted); }
.recipes button .w { color: var(--text); }
.recipes button small { font-size: .72rem; color: var(--faint); line-height: 1.3; margin-top: .2rem; }
.recipes button[aria-checked=true] { border-color: var(--lime); box-shadow: inset 0 0 0 1px var(--lime); }

.timeline { position: relative; height: 96px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; cursor: pointer; overflow: hidden; }
.bar { position: absolute; bottom: 0; border-right: 1px solid var(--bg); opacity: .75; }
.bar.now { opacity: 1; }
.bar.t-warmup, .legend .t-warmup::before { background: var(--warmup); }
.bar.t-work, .legend .t-work::before { background: var(--work); }
.bar.t-recovery, .legend .t-recovery::before { background: var(--recovery); }
.bar.t-cooldown, .legend .t-cooldown::before { background: var(--cooldown); }
.tick { position: absolute; top: 0; width: 1px; height: 8px; background: var(--faint); }
.playhead { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--lime); box-shadow: 0 0 8px var(--lime); }
.legend { display: flex; flex-wrap: wrap; gap: 1rem; margin: .5rem 0; font: 500 .75rem var(--mono); color: var(--muted); }
.legend span::before { content: ""; display: inline-block; width: .7rem; height: .7rem; border-radius: 2px; margin-right: .35rem; vertical-align: -1px; }

.foot { margin-top: 2.5rem; padding-bottom: 2rem; font-size: .85rem; color: var(--faint); }
.foot a { color: var(--muted); }
.foot .lang { padding: .2rem .4rem; font-size: .8rem; color: var(--muted); }
[hidden] { display: none !important; }

/* ── Workouts: overview and workout page ── */
h2 { font: italic 700 1.2rem/1.15 var(--display); text-transform: uppercase; margin: 0; }
h3 { font: italic 700 1rem/1.2 var(--display); text-transform: uppercase; margin: 1.2rem 0 .4rem; }
h4 { font: 600 .68rem/1.9 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--faint); margin: 1.1rem 0 .3rem; }
.hero { padding: 1.5rem 0 .5rem; }
.hero h1 { font: italic 700 clamp(1.8rem, 5vw, 2.6rem)/1.05 var(--display); text-transform: uppercase; margin: 1rem 0 .6rem; }
.lead { font-size: 1.05rem; max-width: 68ch; color: var(--muted); margin: 0; }
.gen { margin-top: .25rem; }
#sources-all h2 { margin: 0 0 .5rem; }
.whead { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem 1rem; flex-wrap: wrap; }
.tags { margin: 0; display: flex; gap: .35rem; flex-wrap: wrap; justify-content: flex-end; }
.tag { display: inline-flex; align-items: center; border: 1px solid var(--border); background: var(--surface-raised); border-radius: 999px; padding: .2rem .65rem; font-size: .78rem; font-weight: 600; color: var(--muted); white-space: nowrap; }
.about { margin-top: 12px; }
.about h3:first-child { margin-top: 0; }
/* Focus filter: Scenic pills */
.filter { display: flex; flex-wrap: wrap; gap: .35rem; margin: 1rem 0 .4rem; }
.pill { display: inline-flex; align-items: center; gap: .35rem; border: 1px solid var(--border); background: var(--surface); color: var(--text);
  border-radius: 999px; padding: .32rem .7rem; font-size: .8rem; font-weight: 600; cursor: pointer; white-space: nowrap; box-shadow: var(--chip-shadow); transition: border-color .15s, background-color .15s; }
.pill small { font: 500 .7rem var(--mono); color: var(--muted); }
.pill[aria-pressed=true] { border-color: var(--hi); background: color-mix(in srgb, var(--lime) 14%, var(--surface)); }
.pill[aria-pressed=true] small { color: var(--hi); }
@media (hover: hover) { .pill:hover { border-color: var(--link); } }
.wcards { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.wcard { display: flex; flex-direction: column; gap: .4rem; height: 100%; padding: .85rem .95rem; border-radius: 16px; border: 1px solid transparent; background: var(--surface); box-shadow: var(--shadow); color: var(--text); text-decoration: none; transition: border-color .15s; }
@media (hover: hover) { .wcard:hover { border-color: var(--link); } }
.wcard b { font: italic 700 1rem/1.15 var(--display); text-transform: uppercase; }
.pk-class { font: 600 .66rem/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--link); }
.pk-range { font: 500 .72rem var(--mono); color: var(--muted); }
.pk-rec { font-size: .75rem; color: var(--faint); }
.pk-spark { width: 100%; height: 26px; display: block; }
/* Panels: Scenic's dialog surface */
.panel { background: var(--surface); border-radius: 18px; box-shadow: var(--shadow); padding: 1rem 1.1rem 1.1rem; }
.duration { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin-top: .9rem; }
.duration input[type=range] { flex: 1 1 240px; accent-color: var(--hi); height: 28px; }
.dlabel { font: italic 700 clamp(1.8rem, 5vw, 2.4rem)/1 var(--display); color: var(--hi); min-width: 5ch; text-align: center; font-variant-numeric: tabular-nums; }
.round { width: 2.2rem; height: 2.2rem; border-radius: 50%; border: 1px solid var(--border); background: var(--surface-raised); font-size: 1.2rem; line-height: 1; cursor: pointer; }
@media (hover: hover) { .round:hover { border-color: var(--link); } }
.ghost { display: inline-flex; align-items: center; padding: .4rem .9rem; border-radius: 999px; border: 1px solid var(--border); background: transparent; color: var(--text); text-decoration: none; cursor: pointer; font-size: .85rem; font-weight: 600; }
@media (hover: hover) { .ghost:hover { border-color: var(--link); } }
.status { margin: .6rem 0; padding: .5rem .7rem; border-radius: 0 10px 10px 0; font-size: .88rem; background: var(--surface-raised); }
.status.bad { border-left: 3px solid var(--amber); color: var(--amber); }
.chart { display: block; width: 100%; height: auto; margin-top: .5rem; }
.chart text { fill: var(--faint); font: 500 11px var(--mono); }
.chart .grid { stroke: var(--border); stroke-width: 1; }
.chart .seg { stroke: var(--surface); stroke-width: .6; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; margin: .8rem 0; }
.kpi { background: var(--surface-raised); border-radius: 12px; padding: .55rem .7rem; }
.kpi span { display: block; font: 600 .66rem/1.9 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }
.kpi b { display: block; font: 600 1.2rem var(--mono); color: var(--hi); font-variant-numeric: tabular-nums; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.actions .btn { font-family: var(--mono); }
.duration .ftp { margin-left: auto; }
.ftp-video { margin: 1rem 0 0; }
.prose p, .prose li { max-width: 75ch; color: var(--muted); }
.prose b { color: var(--text); }
.ref { font: 600 .7rem var(--mono); text-decoration: none; vertical-align: super; color: var(--link); }
.scroll { overflow-x: auto; }
.sources { font-size: .82rem; color: var(--muted); }
.sources li { margin-bottom: .35rem; }
.sources li:target { color: var(--text); }
#sources-all { margin-top: 2.5rem; }
/* Chart with the zone legend beside it, all zones stacked like the power axis. */
.chartrow { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: center; margin-top: .5rem; }
.chart .seg { cursor: pointer; }
.chart .seg:hover, .chart .seg:focus-visible { filter: brightness(1.25); outline: none; }
.chart .seg.sel { stroke: var(--text); stroke-width: 2; }
.steptip { position: absolute; z-index: 3; display: flex; flex-direction: column; gap: .1rem; min-width: 10rem; padding: .5rem .7rem; border-radius: 12px; background: var(--surface-raised); box-shadow: var(--shadow); font: 500 .8rem var(--mono); color: var(--muted); pointer-events: none; }
.steptip b { color: var(--text); font: italic 700 .9rem var(--display); text-transform: uppercase; }
.zstack { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.zstack li { display: flex; align-items: center; gap: .5rem; font-size: .8rem; }
.zstack i { width: .8rem; height: .8rem; border-radius: 2px; flex: none; }
.zstack small { display: block; font: 500 .68rem var(--mono); color: var(--faint); }
@media (max-width: 640px) { .chartrow { grid-template-columns: 1fr; } .zstack { flex-direction: row; flex-wrap: wrap; } }
/* Format page: examples and editor, each a JSON text beside its player */
.fsec { margin-top: 1.6rem; }
.fsec > .btn { margin-top: .5rem; }
.zinline { flex-direction: row; flex-wrap: wrap; gap: .3rem 1rem; margin: 1rem 0; }
.player { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 12px; background: var(--surface); border-radius: 18px; box-shadow: var(--shadow); padding: 12px; }
.player.big .code { min-height: 34rem; }
@media (max-width: 860px) { .player { grid-template-columns: 1fr; } }
.code { width: 100%; min-height: 16rem; resize: vertical; padding: .7rem .8rem; border-radius: 12px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font: 500 .8rem/1.5 var(--mono); tab-size: 2; }
.code:focus { border-color: var(--link); outline: none; }
.pview { min-width: 0; }
.pview.broken .pctl, .pview.broken .chartrow { opacity: .35; }
.pctl { display: flex; align-items: center; gap: .7rem; }
.pctl input { flex: 1; accent-color: var(--hi); }
.plen { font: italic 700 1.4rem/1 var(--display); color: var(--hi); min-width: 4.5ch; }
.psum { margin: .5rem 0 0; }
.pview .chartrow { grid-template-columns: 1fr; }
.problems { list-style: none; padding: 0; margin: .5rem 0 0; font-size: .8rem; }
.problems li { padding: .3rem .5rem; border-radius: 0 8px 8px 0; margin-bottom: .25rem; background: var(--surface-raised); }
.problems li.bad { border-left: 3px solid var(--amber); color: var(--amber); }
.problems li.note { border-left: 3px solid var(--faint); color: var(--muted); }
.problems code, .ftable code { font: 500 .78rem var(--mono); color: var(--link); }
.ftable { width: 100%; border-collapse: collapse; font-size: .88rem; }
.ftable td:first-child { white-space: nowrap; width: 1%; }
.ftable td, .ftable th { padding: .45rem .6rem; border-bottom: 1px solid var(--border); vertical-align: top; text-align: left; }
.ftable th { font: 600 .68rem var(--mono); text-transform: uppercase; color: var(--faint); }
.stable td:first-child { white-space: normal; width: auto; }
.link { border: 0; background: none; color: var(--link); cursor: pointer; padding: 0; font-size: .85rem; }
#format select { margin-left: .4rem; }
/* Tabata songs: a small strip at the end of the home page. */
.teaser { margin-top: 2.5rem; display: grid; grid-template-columns: minmax(200px, 1fr) minmax(0, 3fr); gap: 12px 16px; align-items: center; padding: 16px; border: 1px dashed var(--border); border-radius: 16px; }
.teaser h3 { margin: .2rem 0; }
.teaser p { margin: .2rem 0 0; }
.teaser .ghost { grid-column: 1 / -1; justify-self: start; }
.mini { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; }
.mini .card { padding: 10px; gap: .35rem; font-size: .85rem; }
.mini .spark { height: 18px; }
@media (max-width: 700px) { .teaser { grid-template-columns: 1fr; } }
