/* Бајкерот и Кросфитерот — site styles
   Design tokens first; change colours/typography here and the whole site follows. */

:root {
  --paper: #fbf8fe;        /* faint lilac page */
  --paper-2: #f3eafb;      /* lilac disc from the illustration */
  --ink: #17181c;          /* ink lines */
  --ink-2: #4a4c55;        /* secondary text */
  --ink-3: #7b7d88;        /* muted text */
  --sky: #8ec3e0;          /* brush-stroke blue */
  --sky-2: #d7eaf5;
  --blue: #2a6c9c;         /* links & buttons (AA on paper) */
  --sand: #eedbc5;         /* skin tone accent */
  --line: #17181c;
  --hair: #e1d9ea;

  --f-display: "Unbounded", "Arial Rounded MT Bold", system-ui, sans-serif;
  --f-body: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;

  --s-1: clamp(2.6rem, 6.2vw, 5.2rem);
  --s-2: clamp(1.7rem, 3.4vw, 2.6rem);
  --s-3: clamp(1.25rem, 2vw, 1.55rem);
  --s-4: 1.08rem;
  --s-body: 1.0625rem;
  --s-small: .875rem;

  --r-lg: 22px;
  --r-md: 12px;
  --r-sm: 8px;
  --w: 1180px;
  --gut: clamp(16px, 4vw, 40px);
  --header-h: 68px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation: none !important; transition: none !important; } }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 var(--s-body)/1.6 var(--f-body);
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: var(--blue); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--f-display); font-weight: 700; line-height: 1.12; letter-spacing: -.01em; margin: 0 0 .5em; text-wrap: balance; }
h1 { font-size: var(--s-1); font-weight: 800; letter-spacing: -.025em; }
h2 { font-size: var(--s-2); }
h3 { font-size: var(--s-3); font-weight: 600; }
p { margin: 0 0 1em; }
.wrap { max-width: var(--w); margin: 0 auto; padding: 0 var(--gut); }
.muted { color: var(--ink-2); }
.small { font-size: var(--s-small); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: var(--r-sm); z-index: 99; }
.skip:focus { left: 8px; }

/* ---------- Header / footer ---------- */
.site-header { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--hair); min-height: var(--header-h); }
.site-header .wrap { display: flex; align-items: center; gap: 20px; min-height: var(--header-h); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font: 700 1rem/1.1 var(--f-display); letter-spacing: -.01em; }
.brand img { width: 40px; height: 40px; border-radius: 50%; border: 1.5px solid var(--ink); background: var(--paper-2); }
.brand span small { display: block; font: 500 .72rem/1.2 var(--f-body); color: var(--ink-3); letter-spacing: 0; }
.nav { margin-left: auto; display: flex; gap: 4px; align-items: center; }
.nav a { color: var(--ink); text-decoration: none; padding: 8px 12px; border-radius: 999px; font-weight: 500; white-space: nowrap; }
.nav a:hover { background: var(--paper-2); }
.nav a[aria-current="page"] { background: var(--ink); color: #fff; }
.nav-toggle { display: none; margin-left: auto; background: none; border: 1.5px solid var(--ink); border-radius: 999px; padding: 7px 14px; font: 600 .9rem var(--f-body); color: var(--ink); cursor: pointer; }
@media (max-width: 1180px) {
  .nav-toggle { display: inline-block; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: var(--header-h); flex-direction: column; align-items: stretch; background: var(--paper); border-bottom: 1px solid var(--hair); padding: 8px var(--gut) 16px; }
  .nav.open { display: flex; }
  .nav a { padding: 12px 14px; }
}

.site-footer { margin-top: 96px; background: var(--ink); color: #e9e6ee; padding: 56px 0 40px; }
.site-footer a { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
.footer-grid h2 { font-size: 1rem; color: #fff; margin-bottom: .8em; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.footer-note { margin-top: 40px; color: #a9a6b2; font-size: var(--s-small); }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; } }

/* ---------- Buttons & chips ---------- */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 20px; border-radius: 999px; border: 1.5px solid var(--ink); background: var(--ink); color: #fff; font: 600 1rem/1 var(--f-body); text-decoration: none; cursor: pointer; transition: transform .15s ease; }
.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.sky { background: var(--sky); color: var(--ink); }
.btn svg { width: 18px; height: 18px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1.5px solid var(--ink); background: transparent; color: var(--ink); border-radius: 999px; padding: 7px 14px; font: 500 .92rem/1 var(--f-body); cursor: pointer; text-decoration: none; }
.chip:hover { background: var(--paper-2); }
.chip[aria-pressed="true"] { background: var(--ink); color: #fff; }

/* ---------- Sections ---------- */
.section { padding-top: 88px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 28px; flex-wrap: wrap; }
.section-head h2 { margin: 0; }
.section-head p { margin: 6px 0 0; color: var(--ink-2); max-width: 60ch; }
.page-head { padding: 56px 0 8px; }
.page-head h1 { font-size: var(--s-2); margin-bottom: .35em; }
.page-head p { color: var(--ink-2); max-width: 62ch; font-size: 1.15rem; }

/* brush underline, echoing the lettering in the illustration */
.brush { background: linear-gradient(transparent 62%, var(--sky) 62%, var(--sky) 90%, transparent 90%); padding: 0 .08em; }

/* ---------- Hero ---------- */
.hero { padding: 40px 0 0; }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 40px; align-items: center; }
.hero h1 { margin-bottom: .3em; }
.hero h1 .amp { color: var(--blue); }
.hero .lead { font-size: clamp(1.1rem, 1.6vw, 1.3rem); color: var(--ink-2); max-width: 46ch; }
.hero-art { position: relative; aspect-ratio: 1 / 1; }
.hero-art::before { content: ""; position: absolute; inset: 9% 7% 7% 9%; border-radius: 50%; background: var(--paper-2); border: 1.5px solid var(--ink); }
.hero-art img { position: relative; width: 100%; height: 100%; object-fit: contain; animation: lift 1.1s cubic-bezier(.2,.8,.2,1) both; }
@keyframes lift { from { transform: translateY(18px) rotate(-2deg); opacity: 0; } to { transform: none; opacity: 1; } }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
@media (max-width: 860px) { .hero-grid { grid-template-columns: 1fr; } .hero-art { max-width: 460px; margin: 0 auto; order: -1; } }

.countdown { display: inline-flex; align-items: center; gap: 14px; margin-top: 24px; padding: 10px 16px 10px 12px; border: 1.5px solid var(--ink); border-radius: var(--r-md); background: #fff; }
.countdown .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--sky); box-shadow: 0 0 0 4px var(--sky-2); }
.countdown.live .dot { background: #d64545; box-shadow: 0 0 0 4px #f6d4d4; animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 8px transparent; } }
.countdown b { font: 700 1.1rem/1 var(--f-display); font-variant-numeric: tabular-nums; }
.countdown span { color: var(--ink-2); font-size: .95rem; }

/* ---------- Stats strip ---------- */
.stats { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; border-top: 1.5px solid var(--ink); border-bottom: 1.5px solid var(--ink); margin-top: 72px; }
.stats div { padding: 22px 18px; }
.stats div + div { border-left: 1px solid var(--hair); }
.stats b { display: block; font: 700 clamp(1.6rem, 3vw, 2.3rem)/1.1 var(--f-display); }
.stats span { color: var(--ink-2); font-size: .95rem; }
@media (max-width: 700px) { .stats { grid-auto-flow: row; grid-template-columns: 1fr 1fr; } .stats div:nth-child(odd) { border-left: 0; } .stats div:nth-child(n+3) { border-top: 1px solid var(--hair); } .stats div:last-child:nth-child(odd) { grid-column: span 2; } }

/* ---------- Episode cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 32px 24px; }
.ep { display: flex; flex-direction: column; gap: 10px; color: var(--ink); text-decoration: none; }
.ep:hover h3 { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: .15em; }
.thumb { position: relative; aspect-ratio: 16 / 9; border-radius: var(--r-md); overflow: hidden; border: 1.5px solid var(--ink); background: var(--paper-2); }
.thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.ep:hover .thumb img { transform: scale(1.03); }
.thumb .dur { position: absolute; right: 8px; bottom: 8px; background: var(--ink); color: #fff; font: 600 .78rem/1 var(--f-body); padding: 5px 7px; border-radius: 6px; }
.thumb .num { position: absolute; left: 8px; top: 8px; background: #fff; color: var(--ink); font: 700 .78rem/1 var(--f-display); padding: 6px 8px; border-radius: 6px; border: 1.5px solid var(--ink); }
.thumb .lock { position: absolute; left: 8px; bottom: 8px; background: var(--sand); color: var(--ink); font: 600 .78rem/1 var(--f-body); padding: 5px 8px; border-radius: 6px; border: 1.5px solid var(--ink); }
.ep h3 { font: 600 1.02rem/1.35 var(--f-body); margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.ep .meta { color: var(--ink-3); font-size: var(--s-small); display: flex; gap: 12px; flex-wrap: wrap; }

/* Featured (latest) episode */
.feature { display: grid; grid-template-columns: 1.25fr 1fr; gap: 36px; align-items: start; }
.feature .thumb { border-radius: var(--r-lg); border-width: 2px; }
.feature h3 { font: 700 var(--s-3)/1.25 var(--f-display); margin: 8px 0 12px; }
.feature .chapters { list-style: none; padding: 0; margin: 18px 0 0; border-top: 1px solid var(--hair); }
.feature .chapters li { display: flex; gap: 14px; padding: 8px 0; border-bottom: 1px solid var(--hair); font-size: .97rem; }
.feature .chapters time { font-variant-numeric: tabular-nums; color: var(--blue); min-width: 3.6em; font-weight: 600; }
@media (max-width: 860px) { .feature { grid-template-columns: 1fr; } }

/* Mood tabs */
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; }
.tab-panel[hidden] { display: none; }

/* Heroes strip / grid */
.heroes { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 24px 18px; }
.hero-card { color: var(--ink); text-decoration: none; display: block; }
.hero-card .pic { aspect-ratio: 4 / 5; border-radius: var(--r-md); overflow: hidden; border: 1.5px solid var(--ink); background: var(--paper-2); }
.hero-card .pic img { width: 100%; height: 100%; object-fit: cover; object-position: center 30%; filter: saturate(.9); transition: filter .2s; }
.hero-card:hover .pic img { filter: none; }
.hero-card b { display: block; margin-top: 10px; font: 600 1rem/1.3 var(--f-body); }
.hero-card span { color: var(--ink-3); font-size: var(--s-small); }
.strip { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(170px, 200px); gap: 18px; overflow-x: auto; padding-bottom: 12px; scroll-snap-type: x mandatory; }
.strip > * { scroll-snap-align: start; }

/* Library */
.shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 28px 20px; }
.book { color: var(--ink); text-decoration: none; display: flex; flex-direction: column; gap: 10px; }
.cover { aspect-ratio: 2 / 3; border: 1.5px solid var(--ink); border-radius: 4px 10px 10px 4px; padding: 16px 14px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; box-shadow: inset 8px 0 0 rgba(0,0,0,.08); }
.cover strong { font: 700 1.02rem/1.2 var(--f-display); letter-spacing: -.01em; overflow-wrap: break-word; hyphens: auto; }
.cover em { font-style: normal; font-size: .85rem; opacity: .85; }
.cover.c0 { background: var(--sky); } .cover.c1 { background: var(--paper-2); } .cover.c2 { background: var(--sand); }
.cover.c3 { background: var(--ink); color: #fff; } .cover.c4 { background: #fff; } .cover.c5 { background: var(--blue); color: #fff; }
.book .meta { color: var(--ink-3); font-size: var(--s-small); }
.book:hover .cover { transform: translateY(-3px) rotate(-.6deg); transition: transform .2s; }
.shelf-mini { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.shelf-mini .cover { padding: 12px 10px; }
.shelf-mini .cover strong { font-size: .82rem; }
.shelf-mini .cover em { font-size: .72rem; }
@media (max-width: 1000px) and (min-width: 761px), (max-width: 420px) { .shelf-mini > :nth-child(n+4) { display: none; } .shelf-mini { grid-template-columns: repeat(3, 1fr); } }

/* Callout panels */
.panel { border: 1.5px solid var(--ink); border-radius: var(--r-lg); padding: clamp(24px, 4vw, 44px); background: #fff; }
.panel.lilac { background: var(--paper-2); }
.panel.sky { background: var(--sky-2); }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
@media (max-width: 760px) { .split { grid-template-columns: 1fr; } }

.listen { display: flex; flex-wrap: wrap; gap: 10px; }
.partners { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.partner { border: 1.5px solid var(--ink); border-radius: var(--r-md); padding: 16px 18px; color: var(--ink); text-decoration: none; background: #fff; }
.partner b { display: block; font: 700 1.05rem/1.2 var(--f-display); margin-bottom: 6px; }
.partner span { color: var(--ink-2); font-size: .93rem; }
.partner .code { display: inline-block; margin-top: 10px; background: var(--sky); padding: 4px 10px; border-radius: 6px; font-weight: 700; letter-spacing: .04em; }
.partner.past { background: transparent; border-style: dashed; }

/* ---------- Archive ---------- */
.toolbar { display: grid; gap: 16px; padding: 20px; border: 1.5px solid var(--ink); border-radius: var(--r-lg); background: #fff; margin-bottom: 32px; }
.search { display: flex; gap: 10px; align-items: center; }
.search input { flex: 1; font: 500 1.1rem var(--f-body); padding: 14px 18px; border: 1.5px solid var(--ink); border-radius: 999px; background: var(--paper); color: var(--ink); min-width: 0; }
.search input::placeholder { color: var(--ink-3); }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
select { font: 500 .95rem var(--f-body); padding: 9px 12px; border: 1.5px solid var(--ink); border-radius: 999px; background: #fff; color: var(--ink); }
.result-count { color: var(--ink-2); margin: 0 0 18px; }
.empty { padding: 48px 0; text-align: center; color: var(--ink-2); }
.more { display: flex; justify-content: center; margin-top: 40px; }

/* ---------- Episode page ---------- */
.ep-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 40px; margin-top: 28px; align-items: start; }
@media (max-width: 960px) { .ep-layout { grid-template-columns: 1fr; } }
.player { position: relative; aspect-ratio: 16 / 9; border-radius: var(--r-lg); overflow: hidden; border: 2px solid var(--ink); background: #000; }
.player iframe, .player button { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.player button { padding: 0; cursor: pointer; background: #000; }
.player button img { width: 100%; height: 100%; object-fit: cover; opacity: .9; }
.player .play { position: absolute; left: 50%; top: 50%; width: 84px; height: 84px; margin: -42px 0 0 -42px; border-radius: 50%; background: var(--sky); border: 2px solid var(--ink); display: grid; place-items: center; }
.player .play svg { width: 32px; height: 32px; margin-left: 4px; }
.ep-title { font-size: clamp(1.5rem, 3vw, 2.2rem); margin: 22px 0 10px; }
.ep-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; color: var(--ink-2); margin-bottom: 18px; }
.ep-body p { max-width: 68ch; }
.side h2 { font-size: 1.1rem; margin-bottom: 10px; }
.chap-list { list-style: none; padding: 0; margin: 0 0 28px; border: 1.5px solid var(--ink); border-radius: var(--r-md); background: #fff; max-height: 520px; overflow: auto; }
.chap-list li + li { border-top: 1px solid var(--hair); }
.chap-list button { all: unset; box-sizing: border-box; display: flex; gap: 12px; width: 100%; padding: 10px 14px; cursor: pointer; }
.chap-list button:hover, .chap-list button:focus-visible { background: var(--paper-2); }
.chap-list time { color: var(--blue); font-weight: 600; font-variant-numeric: tabular-nums; min-width: 3.8em; }
.locked { padding: 28px; display: grid; gap: 14px; place-content: center; text-align: center; position: absolute; inset: 0; background: color-mix(in srgb, var(--ink) 78%, transparent); color: #fff; }
.locked h2 { color: #fff; font-size: 1.3rem; margin: 0; }
.tags { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 22px; }
.crumbs { margin-top: 28px; font-size: var(--s-small); color: var(--ink-3); }
.crumbs a { color: var(--ink-2); }

/* Hosts */
.hosts { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.host { border: 1.5px solid var(--ink); border-radius: var(--r-lg); overflow: hidden; background: #fff; }
.host .art { background: var(--paper-2); aspect-ratio: 4 / 3; display: grid; place-items: center; border-bottom: 1.5px solid var(--ink); overflow: hidden; }
.host .art img { width: 100%; height: 100%; object-fit: cover; }
.host .body { padding: 22px 24px 26px; }
.host h3 { margin-bottom: 4px; }
.host .nick { color: var(--blue); font-weight: 600; margin-bottom: 10px; }
@media (max-width: 760px) { .hosts { grid-template-columns: 1fr; } }
.feature .meta { color: var(--ink-3); font-size: var(--s-small); display: flex; gap: 14px; flex-wrap: wrap; }
@media (max-width: 560px) {
  .toolbar { padding: 14px; }
  .search { flex-wrap: wrap; }
  .search input { flex-basis: 100%; }
  .search .btn { width: 100%; justify-content: center; }
  .hero-art { max-width: 320px; }
}

/* ---------- Comments page (v0.5) ---------- */
.quotes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin: 8px 0 40px; }
@media (max-width: 900px) { .quotes { grid-template-columns: 1fr; } }
.wall { columns: 3 300px; column-gap: 20px; }
.comment { min-width: 0; break-inside: avoid; margin: 0 0 20px; border: 1.5px solid var(--ink); border-radius: var(--r-md); background: #fff; padding: 16px 18px 14px; }
.comment.big { background: var(--paper-2); border-radius: var(--r-lg); border-width: 2px; padding: 22px 24px 18px; margin: 0; display: flex; flex-direction: column; }
.comment.big .text { flex: 1; }
.comment.big .text { font: 500 1.12rem/1.5 var(--f-body); }
.comment header { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.comment header b { display: block; font-weight: 600; line-height: 1.2; }
.comment header time { color: var(--ink-3); font-size: var(--s-small); }
.avatar { width: 40px; height: 40px; border-radius: 50%; border: 1.5px solid var(--ink); background: var(--sky-2); display: grid; place-items: center; font: 700 1rem var(--f-display); flex: none; object-fit: cover; }
.comment .text { margin: 0 0 12px; overflow-wrap: anywhere; }
.comment footer { display: flex; flex-wrap: wrap; gap: 6px 14px; justify-content: space-between; align-items: baseline; font-size: var(--s-small); border-top: 1px solid var(--hair); padding-top: 10px; }
.comment footer .on { color: var(--ink-2); min-width: 0; flex: 1 1 12em; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.comment .row-end { display: flex; gap: 12px; align-items: baseline; margin-left: auto; }
.comment .likes { color: var(--ink-3); }
.linklike { background: none; border: 0; padding: 0; color: var(--blue); font: inherit; cursor: pointer; text-decoration: underline; }

/* external menu link (Мерч) */
.nav a.ext span[aria-hidden] { font-size: .85em; color: var(--ink-3); }

/* ---------- Partners (v0.8) ---------- */
.partner { display: flex; flex-direction: column; gap: 4px; }
.partner .code { align-self: flex-start; margin-top: 10px; }
.partner.big { padding: 22px 24px; border-width: 2px; border-radius: var(--r-lg); background: var(--paper-2); }
.partner.big b { font-size: 1.3rem; }
.partner:hover b { text-decoration: underline; text-underline-offset: .15em; }
