/* RPV Stories. Layout: midnight top bar; library = midnight hero with one featured story card, then a grid;
   story page = title, wide player, then chapters beside "what it teaches". RPV tokens only. */
@font-face { font-family: 'Inter'; src: url('fonts/Inter-Variable.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }
:root {
  --midnight: #0D1B2A; --slate: #1C3A52; --steel: #2E5F80; --terracotta: #C4622D; --terracotta-hover: #A8521F;
  --ember: #E07B45; --sand: #F0C89A; --cream: #FAF7F2; --mist: #EEF2F5; --charcoal: #2C3E4A; --white: #FFFFFF;
  --muted: #5A7080; --line: rgba(44, 62, 74, 0.14);
  --shadow: 0 1px 3px rgba(13,27,42,.08), 0 8px 28px rgba(13,27,42,.10);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { background: var(--cream); color: var(--charcoal); font: 400 16px/1.7 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--steel); }
img { max-width: 100%; display: block; }
.wrap { max-width: 1040px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
@media (min-width: 700px) { .wrap { padding-left: 32px; padding-right: 32px; } }

nav { background: var(--midnight); position: sticky; top: 0; z-index: 10; }
nav .wrap { min-height: 56px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.logo { color: var(--white); font-weight: 600; font-size: 20px; letter-spacing: -0.01em; text-decoration: none; display: flex; align-items: baseline; gap: 10px; }
.logo i { font-style: normal; color: var(--ember); }
.logo span { font-size: 13px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--sand); }
nav ul { list-style: none; display: flex; gap: 22px; flex-wrap: wrap; }
nav ul a { color: #B7C5D0; text-decoration: none; font-size: 14px; font-weight: 500; }
nav ul a:hover, nav ul a[aria-current] { color: var(--white); }

.eyebrow { font-size: 12px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--terracotta); }
h1, h2, h3 { color: var(--midnight); font-weight: 600; letter-spacing: .01em; text-wrap: balance; }
h1 { font-size: clamp(32px, 6vw, 48px); line-height: 1.1; }
h2 { font-size: clamp(22px, 3.4vw, 28px); line-height: 1.25; }
h3 { font-size: 18px; line-height: 1.35; }

/* library */
.hero { background: var(--midnight); color: var(--white); padding: 56px 0 150px; position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; width: 300px; height: 300px; right: -90px; top: -150px; border-radius: 50%; border: 38px solid rgba(224,123,69,.45); pointer-events: none; }
.hero .eyebrow { color: var(--sand); }
.hero h1 { color: var(--white); margin-top: 16px; max-width: 15ch; }
.hero p { color: #D5DEE5; font-size: 18px; margin-top: 16px; max-width: 52ch; }
.featured { margin-top: -110px; position: relative; padding-bottom: 8px; }
.card { display: grid; background: var(--white); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); text-decoration: none; color: inherit; }
@media (min-width: 820px) { .card.big { grid-template-columns: 1.45fr 1fr; } }
.card .shot { position: relative; background: var(--midnight); aspect-ratio: 16 / 9; }
.card .shot img { width: 100%; height: 100%; object-fit: cover; }
.play { position: absolute; left: 20px; bottom: 20px; width: 58px; height: 58px; border-radius: 50%; background: var(--terracotta); display: grid; place-items: center; box-shadow: 0 6px 18px rgba(13,27,42,.35); transition: transform .18s ease, background .18s ease; }
.play::before { content: ""; border-left: 18px solid var(--white); border-top: 11px solid transparent; border-bottom: 11px solid transparent; margin-left: 5px; }
.card:hover .play { transform: scale(1.07); background: var(--terracotta-hover); }
.card .body { padding: 26px 28px 28px; display: grid; gap: 10px; align-content: center; }
.card .meta { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.card p { color: var(--charcoal); max-width: 46ch; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; list-style: none; }
.tags li { font-size: 12px; font-weight: 500; background: var(--mist); color: var(--slate); padding: 4px 10px; border-radius: 9999px; }
.more { padding: 48px 0 8px; }
.more .grid { margin-top: 20px; display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.soon { border: 1.5px dashed var(--line); border-radius: 14px; padding: 26px 28px; color: var(--muted); }

/* story page */
.crumb { padding-top: 26px; font-size: 14px; }
.crumb a { text-decoration: none; }
.title { padding: 14px 0 26px; display: grid; gap: 12px; }
.title p { font-size: 18px; max-width: 60ch; }
.title .meta { font-size: 14px; color: var(--muted); }
.player { position: relative; background: var(--midnight); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); aspect-ratio: 16 / 9; }
.player:focus-visible { outline: 3px solid var(--steel); outline-offset: 3px; }
.player video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: var(--midnight); pointer-events: none; }
.shield { position: absolute; inset: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.bigplay { position: absolute; left: 50%; top: 50%; width: 84px; height: 84px; margin: -42px 0 0 -42px; border: 0; border-radius: 50%; background: var(--terracotta); color: var(--white); display: grid; place-items: center; cursor: pointer; box-shadow: 0 8px 24px rgba(13,27,42,.4); transition: opacity .2s ease, transform .2s ease, background .2s ease; }
.bigplay svg { width: 38px; height: 38px; fill: currentColor; margin-left: 4px; }
.bigplay:hover { background: var(--terracotta-hover); transform: scale(1.05); }
.bigplay:focus-visible { outline: 3px solid var(--white); outline-offset: 3px; }
.playing .bigplay { opacity: 0; pointer-events: none; }
.bar { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: 10px; padding: 30px 12px 10px; color: var(--white); background: linear-gradient(to top, rgba(13,27,42,.88), rgba(13,27,42,0)); transition: opacity .25s ease; }
.playing.idle .bar { opacity: 0; pointer-events: none; }
.playing.idle .shield { cursor: none; }
.bar button { all: unset; box-sizing: border-box; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 6px; cursor: pointer; flex: none; }
.bar button:hover { background: rgba(255,255,255,.16); }
.bar button:focus-visible { outline: 2px solid var(--white); outline-offset: -2px; }
.bar svg { width: 22px; height: 22px; fill: currentColor; }
.bar .time { font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; flex: none; }
.bar input[type=range] { flex: 1; min-width: 0; height: 22px; margin: 0; accent-color: var(--ember); background: transparent; cursor: pointer; }
.i-pause, .i-off { display: none; }
.playing .i-play { display: none; } .playing .i-pause { display: block; }
.muted .i-on { display: none; } .muted .i-off { display: block; }
.player:fullscreen { border-radius: 0; aspect-ratio: auto; width: 100vw; height: 100vh; }
.player:-webkit-full-screen { border-radius: 0; aspect-ratio: auto; width: 100vw; height: 100vh; }
@media (max-width: 480px) { .bar { gap: 4px; padding: 26px 6px 6px; } .bar .time { font-size: 12px; } .bigplay { width: 68px; height: 68px; margin: -34px 0 0 -34px; } .bigplay svg { width: 30px; height: 30px; } }
.cols { display: grid; gap: 40px; padding: 40px 0 8px; }
@media (min-width: 900px) { .cols { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); align-items: start; } }
.cols > * { min-width: 0; }
.act { margin-top: 22px; }
.act h3 { font-size: 13px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.chapters { list-style: none; margin-top: 8px; border-top: 1px solid var(--line); }
.chapters button { all: unset; box-sizing: border-box; width: 100%; display: grid; grid-template-columns: 48px 30px 1fr; gap: 6px; align-items: baseline; padding: 10px 8px; border-bottom: 1px solid var(--line); cursor: pointer; font-size: 15px; }
.chapters button:hover { background: var(--mist); }
.chapters button:focus-visible { outline: 2px solid var(--steel); outline-offset: -2px; }
.chapters .t { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.chapters .n { color: var(--terracotta); font-weight: 600; font-size: 13px; font-variant-numeric: tabular-nums; }
.chapters .l { color: var(--midnight); font-weight: 500; }
.chapters .d { display: block; color: var(--charcoal); font-weight: 400; font-size: 14px; line-height: 1.5; margin-top: 1px; }
.chapters .on { background: #F5E6D0; }
.chapters .on .l { font-weight: 600; }
.teach { background: var(--white); border-radius: 14px; box-shadow: var(--shadow); padding: 26px 26px 28px; display: grid; gap: 16px; }
.teach dl { display: grid; gap: 14px; }
.teach dt { font-weight: 600; color: var(--midnight); }
.teach dt::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--terracotta); margin-right: 10px; vertical-align: middle; }
.teach dd { color: var(--charcoal); font-size: 15px; padding-left: 18px; }
.script { padding: 40px 0 8px; }
.script details { background: var(--white); border-radius: 14px; box-shadow: var(--shadow); padding: 6px 26px; }
.script summary { cursor: pointer; padding: 16px 0; font-weight: 600; color: var(--midnight); }
.script ol { padding: 0 0 22px 26px; display: grid; gap: 12px; max-width: 70ch; }
.script li::marker { color: var(--terracotta); font-weight: 600; font-variant-numeric: tabular-nums; }
.script em { display: block; font-style: normal; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.invite { margin-top: 56px; background: var(--midnight); color: var(--white); padding: 52px 0; }
.invite h2 { color: var(--white); }
.invite p { color: #D5DEE5; margin: 10px 0 22px; max-width: 54ch; }
footer { padding: 28px 0 40px; font-size: 14px; color: var(--muted); }
footer .wrap { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .play { transition: none; } }
