/* Pivolt video hub. Colours follow the marketing site (pivolt-website app/globals.css). */
:root {
  --surface: #ffffff; --surface-1: #f7f9fc; --surface-2: #eef3f9;
  --ink: #0a1b2a; --ink-2: #51616f; --ink-3: #8a97a6;
  --brand: #0a84e0; --brand-deep: #055a9e; --brand-soft: #e7f2fc;
  --cyan: #22c8e6; --violet: #7c6cf0; --pos: #10b981; --accent: #f7941d;
  --line: #e6ecf3; --line-strong: #d6deea;
  --navy: #0a1b2a;
  --shadow: 0 1px 2px rgba(10, 27, 42, .06), 0 8px 24px rgba(10, 27, 42, .06);
  --radius: 14px;
  --font: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --surface: #0f1f2e; --surface-1: #0b1825; --surface-2: #142838;
    --ink: #e8eef5; --ink-2: #a9b7c6; --ink-3: #7a8a9b;
    --brand-soft: #10314d; --line: #1d3346; --line-strong: #27445c;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --surface: #0f1f2e; --surface-1: #0b1825; --surface-2: #142838;
  --ink: #e8eef5; --ink-2: #a9b7c6; --ink-3: #7a8a9b;
  --brand-soft: #10314d; --line: #1d3346; --line-strong: #27445c;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--surface-1); color: var(--ink); font: 15px/1.55 var(--font); min-height: 100vh; display: flex; flex-direction: column; }
[hidden] { display: none !important; }
a { color: var(--brand); }
h1, h2, h3 { line-height: 1.2; margin: 0; letter-spacing: -.01em; }
.muted { color: var(--ink-2); }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.btn { display: inline-flex; align-items: center; gap: 8px; border: 1px solid transparent; border-radius: 10px; padding: 11px 18px;
  font-weight: 600; text-decoration: none; cursor: pointer; transition: background .15s, border-color .15s; }
.btn.primary { background: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-deep); }
.btn.ghost { background: transparent; border-color: var(--line-strong); color: var(--ink); }
.btn.ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn.small { padding: 6px 12px; font-size: 13px; }
.link { background: none; border: 0; padding: 0; color: var(--brand); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }

/* header */
.top { background: var(--navy); color: #fff; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px max(16px, calc((100vw - 1240px) / 2)); position: sticky; top: 0; z-index: 10; border-bottom: 1px solid #1d3346; }
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; color: #fff; }
.brand img { height: 26px; display: block; }
.brand-sub { font-size: 13px; color: #a9c6e3; border-left: 1px solid #2a4258; padding-left: 14px; white-space: nowrap; }
.top-right { display: flex; align-items: center; gap: 18px; font-size: 13px; }
.lang { display: inline-flex; border: 1px solid #2a4258; border-radius: 8px; overflow: hidden; }
.lang button { background: none; border: 0; color: #a9c6e3; padding: 4px 10px; cursor: pointer; font-size: 12px; font-weight: 600; }
.lang button[aria-pressed="true"] { background: var(--brand); color: #fff; }
.who { display: flex; align-items: center; gap: 14px; }
.who-email { color: #cfe0f1; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who a, .who .link { color: #fff; }

main { flex: 1; width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 16px; }

/* sign-in */
.login { display: grid; place-items: center; min-height: calc(100vh - 140px); padding: 32px 0; }
.login-card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 32px; box-shadow: var(--shadow); }
.login-card h1 { font-size: 24px; margin-bottom: 8px; }
.login-card form { display: grid; gap: 10px; margin-top: 22px; }
.login-card label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.login-card input { width: 100%; padding: 12px 14px; font: inherit; color: var(--ink); background: var(--surface-1); border: 1px solid var(--line-strong); border-radius: 10px; }
.login-card input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.code-input { letter-spacing: 10px; font-size: 22px !important; text-align: center; font-weight: 700; }
.form-msg { min-height: 1.5em; color: #d64545; font-size: 14px; margin: 12px 0 0; }
.fineprint { font-size: 12px; color: var(--ink-3); margin: 6px 0 0; }

/* hero */
.hero { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 40px 0 28px; flex-wrap: wrap; }
.hero h1 { font-size: clamp(28px, 4vw, 42px); font-weight: 800; }
.grad { background: linear-gradient(100deg, var(--brand) 0%, var(--cyan) 55%, var(--violet) 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { font-size: 17px; color: var(--ink-2); margin: 10px 0 20px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.hero-progress { display: flex; align-items: center; gap: 12px; }
.ring { position: relative; width: 74px; height: 74px; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 3.2; }
.ring-bg { stroke: var(--line-strong); }
.ring-fg { stroke: var(--pos); stroke-dasharray: 0 100; stroke-linecap: round; transition: stroke-dasharray .5s; }
.ring-n { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 700; font-size: 15px; }

/* cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 20px; padding-bottom: 48px; }
.card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; text-decoration: none; color: inherit; box-shadow: var(--shadow); transition: transform .15s, border-color .15s; }
.card:hover { transform: translateY(-2px); border-color: var(--brand); }
.thumb { position: relative; aspect-ratio: 16 / 9; background: var(--navy); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dur { position: absolute; right: 10px; bottom: 10px; background: rgba(10, 27, 42, .85); color: #fff; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 6px; }
.badge { position: absolute; left: 10px; top: 10px; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 99px; text-transform: uppercase; letter-spacing: .04em; }
.badge.new { background: var(--accent); color: #fff; }
.badge.upd { background: var(--violet); color: #fff; }
.badge.done { background: var(--pos); color: #fff; }
.play { position: absolute; inset: 0; margin: auto; width: 54px; height: 54px; border-radius: 50%; background: rgba(10, 132, 224, .92);
  opacity: 0; transition: opacity .15s; }
.play::after { content: ""; position: absolute; left: 21px; top: 16px; border-style: solid; border-width: 11px 0 11px 17px; border-color: transparent transparent transparent #fff; }
.card:hover .play { opacity: 1; }
.card-body { padding: 16px 18px 14px; flex: 1; }
.kicker { font-size: 12px; font-weight: 700; color: var(--brand); text-transform: uppercase; letter-spacing: .06em; }
.card h3 { font-size: 18px; margin: 4px 0 6px; }
.card p { margin: 0; color: var(--ink-2); font-size: 14px; }
.bar { height: 4px; background: var(--surface-2); }
.bar span { display: block; height: 100%; background: var(--pos); }

/* watch */
.back { display: inline-block; margin: 22px 0 14px; text-decoration: none; font-weight: 600; font-size: 14px; }
.watch { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.player { position: relative; background: #000; border-radius: var(--radius); overflow: hidden; aspect-ratio: 16 / 9; }
.player video { width: 100%; height: 100%; display: block; background: #000; }
.player:fullscreen { border-radius: 0; aspect-ratio: auto; }
.mark { position: absolute; top: 12px; right: 16px; color: #fff; opacity: .28; font-size: 13px; pointer-events: none; text-shadow: 0 1px 2px #000; }
video::cue { font-family: var(--font); font-size: 0.95em; background: rgba(10, 27, 42, .78); }
.endcard { position: absolute; inset: 0; background: rgba(10, 27, 42, .92); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px; gap: 8px; }
.endcard-k { text-transform: uppercase; font-size: 12px; letter-spacing: .1em; color: #a9c6e3; margin: 0; }
.endcard-title { font-size: 26px; font-weight: 700; margin: 0 0 12px; }
.endcard-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.endcard .btn.ghost { color: #fff; border-color: #4a6178; }
.endcard .link { color: #a9c6e3; margin-top: 10px; }
.strip { display: flex; gap: 3px; margin-top: 10px; height: 8px; }
.seg { background: var(--line-strong); border-radius: 3px; cursor: pointer; overflow: hidden; }
.seg:hover { background: var(--ink-3); }
.seg span { display: block; height: 100%; width: 0; background: var(--brand); }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 12px 0 16px; flex-wrap: wrap; font-size: 13px; }
.cc { display: flex; align-items: center; gap: 6px; }
.cc button { background: var(--surface); border: 1px solid var(--line-strong); border-radius: 7px; padding: 3px 10px; cursor: pointer; font-size: 12px; font-weight: 600; }
.cc button[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }
.watch-title { font-size: 24px; }
.watch-blurb { margin: 6px 0 0; }
.chapters-col { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 10px 10px; box-shadow: var(--shadow); position: sticky; top: 76px; }
.chapters-col h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-2); padding: 0 8px 8px; }
.chapters { list-style: none; margin: 0; padding: 0; max-height: min(60vh, 520px); overflow-y: auto; }
.chapters button { display: flex; gap: 12px; width: 100%; text-align: left; background: none; border: 0; border-radius: 8px; padding: 7px 8px; cursor: pointer; font-size: 14px; }
.chapters button:hover { background: var(--surface-2); }
.chapters li.on button { background: var(--brand-soft); color: var(--brand-deep); font-weight: 600; }
.t { color: var(--ink-3); font-variant-numeric: tabular-nums; min-width: 34px; font-size: 13px; }
.transcript { margin: 28px 0 56px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.transcript-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.transcript-head h2 { font-size: 16px; }
#tsearch { padding: 7px 12px; border: 1px solid var(--line-strong); border-radius: 8px; font: inherit; font-size: 14px; background: var(--surface-1); color: var(--ink); width: min(280px, 100%); }
.transcript-body { max-height: 380px; overflow-y: auto; padding: 8px 20px 20px; position: relative; }
.transcript-body h3 { font-size: 14px; margin: 16px 0 4px; display: flex; gap: 8px; align-items: baseline; }
.transcript-body p { margin: 0; color: var(--ink-2); }
.s { cursor: pointer; border-radius: 4px; transition: background .15s; }
.s:hover { color: var(--ink); }
.s.on { background: var(--brand-soft); color: var(--ink); }
.s.dim { opacity: .25; }

.foot { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 18px max(16px, calc((100vw - 1240px) / 2)); border-top: 1px solid var(--line); font-size: 12px; color: var(--ink-3); }

@media (max-width: 900px) {
  .watch { grid-template-columns: 1fr; }
  .chapters-col { position: static; }
  .brand-sub, .who-email { display: none; }
}
