/* Signl training site. Colours are the product's Classic palette (packages/ui/src/tokens.css), light and dark. */
@font-face { font-family: "Bricolage Grotesque"; font-style: normal; font-display: swap; font-weight: 200 800; src: url("fonts/bricolage-grotesque-latin-opsz-normal.woff2") format("woff2-variations"); }
@font-face { font-family: "Instrument Sans"; font-style: normal; font-display: swap; font-weight: 400 700; src: url("fonts/instrument-sans-latin-wght-normal.woff2") format("woff2-variations"); }

:root, [data-theme="light"] {
  --bg: #F4F6F8; --surface: #FFFFFF; --raised: #FFFFFF; --line: #DDE3EA;
  --text: #111827; --muted: #5B6676; --accent: #2E5BFF; --accent-ink: #FFFFFF;
  --earn: #F2B01E; --verified: #1F8F5F; --danger: #C8323E;
  --glow-1: #2E5BFF; --glow-2: #1FA8A0; --glow-3: #7B5CFF;
  --hover: color-mix(in srgb, var(--accent) 8%, transparent);
  --selected: color-mix(in srgb, var(--accent) 14%, transparent);
  --scroll-thumb: color-mix(in srgb, var(--accent) 38%, var(--line));
  --scroll-thumb-hover: var(--accent);
  --scroll-track: var(--bg);
  --shadow: 0 1px 2px rgb(17 24 39 / 6%), 0 8px 24px rgb(17 24 39 / 8%);
  --shadow-pop: 0 12px 40px rgb(17 24 39 / 18%);
  --radius-control: 8px; --radius-panel: 14px;
  --display: "Bricolage Grotesque", "Instrument Sans", system-ui, sans-serif;
  --body: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #0E1626; --surface: #162038; --raised: #1C2745; --line: #2A3654;
  --text: #E8ECF3; --muted: #98A3B8; --accent: #6C8CFF; --accent-ink: #0E1626;
  --earn: #F7C34C; --verified: #3DBE8A; --danger: #F06A74;
  --glow-1: #3D6BFF; --glow-2: #1FA8A0; --glow-3: #7B5CFF;
  --scroll-thumb: color-mix(in srgb, var(--accent) 45%, var(--line));
  --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 8px 24px rgb(0 0 0 / 30%);
  --shadow-pop: 0 12px 40px rgb(0 0 0 / 50%);
  color-scheme: dark;
}

/* Scroll bars in the Signl colours, on the page and on every scrolling panel. */
html { scrollbar-color: var(--scroll-thumb) var(--scroll-track); scrollbar-width: auto; }
.transcript, .dd__list, .chapters { scrollbar-color: var(--scroll-thumb) var(--surface); scrollbar-width: thin; }
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: var(--scroll-track); }
::-webkit-scrollbar-thumb { background: var(--scroll-thumb); border-radius: 999px; border: 3px solid var(--scroll-track); }
::-webkit-scrollbar-thumb:hover { background: var(--scroll-thumb-hover); }
.transcript::-webkit-scrollbar-track, .dd__list::-webkit-scrollbar-track { background: var(--surface); }
.transcript::-webkit-scrollbar-thumb, .dd__list::-webkit-scrollbar-thumb { border-color: var(--surface); }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); font: 16px/1.55 var(--body); transition: background-color .2s, color .2s; }
img, video { max-width: 100%; display: block; }
a { color: var(--accent); }
h1, h2, h3 { font-family: var(--display); line-height: 1.15; margin: 0; letter-spacing: -0.01em; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: -48px; z-index: 50; background: var(--accent); color: var(--accent-ink); padding: 8px 12px; border-radius: var(--radius-control); }
.skip:focus { top: 12px; }
.wrap { width: min(1200px, 100% - 32px); margin-inline: auto; }

.glow { position: fixed; inset: 0 0 auto 0; height: 520px; z-index: -1; pointer-events: none; opacity: .5;
  background: radial-gradient(40% 60% at 12% 0%, color-mix(in srgb, var(--glow-1) 22%, transparent), transparent 70%),
              radial-gradient(35% 55% at 55% 0%, color-mix(in srgb, var(--glow-2) 16%, transparent), transparent 70%),
              radial-gradient(35% 60% at 92% 0%, color-mix(in srgb, var(--glow-3) 18%, transparent), transparent 70%); }

/* Top bar */
.topbar { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.topbar--bare { position: static; background: transparent; border: 0; backdrop-filter: none; }
.topbar__inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 64px; }
.topbar__actions { display: flex; align-items: center; gap: 8px; }
.topbar__actions form { margin: 0; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.lockup { display: inline-flex; align-items: center; gap: 6px; }
.lockup img:first-child { width: 32px; height: 32px; }
.lockup img:last-child { width: 62px; height: auto; }
.lockup--dark { display: none; }
[data-theme="dark"] .lockup--light { display: none; }
[data-theme="dark"] .lockup--dark { display: inline-flex; }
.brand__tag { font: 600 12px/1 var(--body); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); border-left: 1px solid var(--line); padding-left: 10px; }

/* Buttons and fields */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 8px 16px; border-radius: var(--radius-control); border: 1px solid var(--line); background: var(--raised); color: var(--text); font-weight: 600; font-size: 15px; text-decoration: none; cursor: pointer; transition: background-color .15s, border-color .15s, transform .15s; }
.btn:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); background: color-mix(in srgb, var(--accent) 6%, var(--raised)); }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn--primary:hover { background: color-mix(in srgb, var(--accent) 88%, var(--text)); border-color: transparent; }
.btn--ghost { background: transparent; }
.btn--sm { min-height: 36px; padding: 6px 12px; font-size: 14px; }
.btn--block { width: 100%; }
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 999px; border: 1px solid var(--line); background: var(--raised); color: var(--text); cursor: pointer; }
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn .i-moon { fill: currentColor; stroke: none; }
.i-sun { display: none; }
[data-theme="dark"] .i-sun { display: block; }
[data-theme="dark"] .i-moon { display: none; }
.link-btn { background: none; border: 0; padding: 4px 0; color: var(--accent); font-weight: 600; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.field { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.input { width: 100%; min-height: 44px; padding: 10px 12px; border-radius: var(--radius-control); border: 1px solid var(--line); background: var(--raised); color: var(--text); }
.input::placeholder { color: var(--muted); }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }

/* Hero */
.hero { padding: 48px 0 24px; }
.eyebrow { margin: 0 0 10px; font-weight: 700; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.hero h1 { font-size: clamp(32px, 5vw, 52px); font-weight: 700; max-width: 18ch; }
.lede { max-width: 68ch; color: var(--muted); font-size: 18px; margin: 16px 0 0; }
.stats { display: flex; flex-wrap: wrap; gap: 10px; list-style: none; padding: 0; margin: 24px 0 0; }
.stats li { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: 14px; color: var(--muted); }
.stats b { color: var(--text); font-weight: 700; }

/* Filters */
.filters { position: sticky; top: 64px; z-index: 15; display: grid; grid-template-columns: minmax(200px, 260px) minmax(200px, 300px) minmax(200px, 1fr); gap: 12px 16px; align-items: end; padding: 16px; margin-top: 8px; margin-bottom: 8px; border: 1px solid var(--line); border-radius: var(--radius-panel); background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(10px); box-shadow: var(--shadow); }
.filters__meta { grid-column: 1 / -1; display: flex; gap: 16px; align-items: center; font-size: 14px; color: var(--muted); }
.search__box { position: relative; }
.search__box svg { position: absolute; left: 12px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; }
.search__box .input { padding-left: 38px; }

/* Dropdown: a button and a listbox, both in the Signl colours */
.dd { position: relative; }
.dd__button { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; min-height: 44px; padding: 10px 12px; border-radius: var(--radius-control); border: 1px solid var(--line); background: var(--raised); color: var(--text); text-align: left; cursor: pointer; }
.dd__button:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
.dd__button[aria-expanded="true"] { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.dd__button.is-set { border-color: color-mix(in srgb, var(--accent) 60%, var(--line)); background: color-mix(in srgb, var(--accent) 7%, var(--raised)); }
.dd__value { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.dd__chev { flex: none; width: 18px; height: 18px; fill: none; stroke: var(--accent); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transition: transform .15s; }
.dd__button[aria-expanded="true"] .dd__chev { transform: rotate(180deg); }
.dd__list { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 30; margin: 0; padding: 6px; list-style: none; max-height: min(360px, 60vh); overflow: auto; border-radius: var(--radius-panel); border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow-pop); min-width: 240px; }
.dd__list[hidden] { display: none; }
.dd__opt { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 10px; border-radius: 6px; cursor: pointer; font-size: 15px; }
.dd__opt small { color: var(--muted); font-size: 12px; white-space: nowrap; }
.dd__opt.is-active { background: var(--hover); }
.dd__opt[aria-selected="true"] { background: var(--selected); color: var(--accent); font-weight: 700; }
.dd__opt[aria-selected="true"]::after { content: ""; flex: none; width: 8px; height: 8px; border-radius: 99px; background: var(--accent); }
.dd__opt[aria-selected="true"] small { display: none; }

/* Episode list */
#list { padding-bottom: 24px; }
#list:focus { outline: none; }
.part { margin-top: 32px; }
.part__head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.part__k { font-weight: 700; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.part__head h2 { font-size: 24px; }
.playlist-note { margin: 28px 0 0; color: var(--muted); }
.playlist-note b { color: var(--text); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.card { display: flex; flex-direction: column; text-align: left; padding: 0; border: 1px solid var(--line); border-radius: var(--radius-panel); background: var(--surface); color: var(--text); overflow: hidden; cursor: pointer; box-shadow: var(--shadow); transition: transform .15s, border-color .15s; }
.card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }
.card__thumb { position: relative; aspect-ratio: 16 / 9; background: #0E1626; }
.card__thumb img { width: 100%; height: 100%; object-fit: cover; }
.badge { position: absolute; padding: 3px 8px; border-radius: 6px; font-size: 12px; font-weight: 700; }
.badge--dur { right: 8px; bottom: 8px; background: rgb(14 22 38 / 82%); color: #fff; }
.badge--ord { left: 8px; top: 8px; background: var(--earn); color: #111827; }
.card__body { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px 18px; }
.card__num { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.card h3 { font-size: 18px; }
.card p { margin: 0; color: var(--muted); font-size: 14px; }
.empty { margin: 40px 0; padding: 32px; text-align: center; border: 1px dashed var(--line); border-radius: var(--radius-panel); color: var(--muted); }
mark { background: color-mix(in srgb, var(--earn) 45%, transparent); color: inherit; border-radius: 3px; padding: 0 2px; }

/* Downloads */
.downloads { margin: 40px auto; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius-panel); background: var(--surface); }
.downloads h2 { font-size: 22px; }
.downloads p { color: var(--muted); margin: 8px 0 16px; }
.downloads__row { display: flex; flex-wrap: wrap; gap: 12px; }

.foot { border-top: 1px solid var(--line); padding: 24px 0 32px; color: var(--muted); font-size: 14px; }

/* Player */
.player { width: min(1200px, 100% - 32px); max-height: calc(100vh - 32px); padding: 0; border: 1px solid var(--line); border-radius: var(--radius-panel); background: var(--surface); color: var(--text); box-shadow: var(--shadow-pop); overflow: auto; scrollbar-color: var(--scroll-thumb) var(--surface); }
.player::backdrop { background: rgb(8 12 22 / 72%); backdrop-filter: blur(3px); }
.player video { width: 100%; aspect-ratio: 16 / 9; max-height: 64vh; background: #000; }
.player__bar { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--surface); }
.player__nav { display: flex; gap: 8px; }
.player__body { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(240px, 1fr); gap: 28px; padding: 22px 24px 28px; }
.player h2 { font-size: 26px; margin: 4px 0 6px; }
.lbl { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 18px 0 8px; }
.lbl--first { margin-top: 0; }
.lbl__note { text-transform: none; letter-spacing: 0; font-weight: 500; }
.who { color: var(--muted); font-size: 14px; }
.player ul.learn { margin: 0; padding-left: 20px; }
.player ul.learn li { margin: 2px 0; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.chapters { list-style: none; margin: 0; padding: 0; }
.chapters button, .transcript button { display: flex; gap: 12px; width: 100%; padding: 7px 8px; border: 0; border-radius: 6px; background: none; color: var(--text); text-align: left; cursor: pointer; }
.chapters button:hover, .transcript button:hover { background: var(--hover); }
.chapters button.is-now { background: var(--selected); color: var(--accent); font-weight: 700; }
.ts { flex: none; min-width: 3.2em; font-variant-numeric: tabular-nums; font-weight: 700; color: var(--earn); }
[data-theme="light"] .ts { color: #9A6B00; }
.transcript { max-height: 340px; overflow: auto; padding: 4px; border: 1px solid var(--line); border-radius: var(--radius-control); background: var(--bg); }
.transcript button { font-size: 14px; color: var(--muted); }
.transcript button span:last-child { color: var(--text); }

/* Sign-in page */
.login-page { display: flex; flex-direction: column; }
.login { flex: 1; display: grid; place-items: center; padding: 24px 16px 64px; }
.login__card { width: min(420px, 100%); padding: 32px; border: 1px solid var(--line); border-radius: var(--radius-panel); background: var(--surface); box-shadow: var(--shadow); }
.login__card h1 { font-size: 28px; }
.login__lede { color: var(--muted); margin: 10px 0 22px; }
.login__card .input { margin-bottom: 16px; }
.login__error { margin: 0 0 16px; padding: 10px 12px; border-radius: var(--radius-control); background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); font-weight: 600; font-size: 14px; }
.login__help { margin: 16px 0 0; color: var(--muted); font-size: 14px; text-align: center; }

@media (max-width: 860px) {
  .filters { grid-template-columns: 1fr 1fr; position: static; }
  .search { grid-column: 1 / -1; }
  .player__body { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .hide-sm { display: none; }
  .filters { grid-template-columns: 1fr; }
  .hero { padding-top: 32px; }
  .player { width: 100%; max-height: 100vh; border-radius: 0; }
  .player__body { padding: 18px 16px 24px; }
  .brand__tag { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
