:root {
  --navy: #1e2459;
  --navy-deep: #151a45;
  --paper: #faf7f1;
  --card: #ffffff;
  --ink: #24273a;
  --muted: #6b6e80;
  --line: #e7e2d8;
  --magenta: #c8287a;
  --orange: #e8742a;
  --gold: #e9b630;
  --teal: #1f9aa6;
  --violet: #6a4bc4;
  /* Darker shades of the cover colours, for small text on white */
  --orange-text: #b4521c;
  --gold-text: #8a6500;
  --teal-text: #15727c;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Source Sans 3", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  /* Keep the footer at the bottom of short pages */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
body > main { flex: 1 0 auto; }
.wrap { max-width: 1080px; width: 100%; margin: 0 auto; padding: 0 20px; }
h1, h2, h3 { font-family: "Roboto", Arial, sans-serif; text-wrap: balance; }
.nowrap { white-space: nowrap; }

/* Header */
header {
  background: linear-gradient(160deg, var(--navy) 0%, var(--navy-deep) 100%);
  color: #fff;
  padding: 56px 0 64px;
}
.hero { display: flex; gap: 44px; align-items: center; }
.cover {
  flex: 0 0 auto;
  width: 128px;
  /* follows the book's slanted edge, unlike box-shadow */
  filter: drop-shadow(0 16px 22px rgba(0,0,0,.4));
}
.eyebrow {
  font-size: 13px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--gold); font-weight: 600; margin: 0 0 10px;
}
h1 {
  font-weight: 700; font-size: clamp(30px, 4.4vw, 46px);
  line-height: 1.12; letter-spacing: -.01em; margin: 0 0 14px;
}
.editors { margin: 0 0 18px; color: #d9dbef; font-size: 17px; }
.editors strong { color: #fff; font-weight: 600; }
.intro { margin: 0; max-width: 560px; color: #c7cae4; }
.spectrum { display: flex; height: 4px; }
.spectrum span { flex: 1; }

/* Chapter grid */
main { padding: 52px 0 72px; }
.section-head {
  display: flex; justify-content: space-between; align-items: baseline;
  flex-wrap: wrap; gap: 8px; margin-bottom: 26px;
  border-bottom: 1px solid var(--line); padding-bottom: 14px;
}
h2 { font-size: 28px; font-weight: 700; margin: 0; color: var(--navy); }
.count { color: var(--muted); font-size: 15px; }
.grid {
  display: grid; gap: 26px;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}
.chapter {
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  overflow: hidden; display: flex; flex-direction: column;
  scroll-margin-top: 20px; color: inherit; text-decoration: none;
}
a.chapter { transition: box-shadow .2s, transform .2s, border-color .2s; }
a.chapter:hover { box-shadow: 0 12px 30px rgba(30,36,89,.12); transform: translateY(-2px); border-color: #d6d0c3; }
a.chapter:focus-visible { outline: 3px solid var(--magenta); outline-offset: 3px; }
.thumb { position: relative; aspect-ratio: 16 / 9; min-height: 0; overflow: hidden; background: var(--navy-deep); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .playicon {
  position: absolute; left: 50%; top: 50%;
  width: 64px; height: 64px; margin: -32px 0 0 -32px; border-radius: 50%;
  background: rgba(21,26,69,.82) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M8 5v14l11-7z' fill='%23fff'/%3E%3C/svg%3E") 54% 50% / 28px no-repeat;
  transition: transform .2s, background-color .2s;
}
a.chapter:hover .playicon, a.chapter:focus-visible .playicon { transform: scale(1.08); background-color: var(--magenta); }
.duration {
  position: absolute; right: 8px; bottom: 8px;
  background: rgba(0,0,0,.72); color: #fff; font-size: 13px;
  padding: 1px 7px; border-radius: 4px;
}
.soon {
  height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; color: #b9bcd8; font-size: 15px; letter-spacing: .04em;
  background: repeating-linear-gradient(135deg, #1b2152 0 14px, #1e2459 14px 28px);
}
.soon svg { width: 30px; height: 30px; opacity: .7; }
.body { padding: 18px 20px 22px; }
.num {
  display: inline-block; font-size: 13px; font-weight: 600; letter-spacing: .14em;
  text-transform: uppercase; margin-bottom: 6px;
}
h3 { font-size: 19px; line-height: 1.3; font-weight: 500; margin: 0 0 8px; color: var(--navy); }
a.chapter:hover h3 { color: var(--magenta); }
.speaker { margin: 0; color: var(--muted); font-size: 16px; }
.chapter.pending h3 { color: var(--muted); }

/* Chapter page */
.topbar { background: var(--navy-deep); color: #fff; }
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 14px; padding-bottom: 14px; }
.topbar a { color: #fff; text-decoration: none; }
.back {
  display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 16px;
  min-height: 44px; padding: 0 12px 0 0;
}
.back:hover { color: var(--gold); }
.back:focus-visible, .pager a:focus-visible, .notfound a:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 4px; }
.book-name { color: #a9acc9; font-size: 14px; text-align: right; }
.watch { padding: 36px 0 72px; }
.watch .wrap { max-width: 980px; }
.video {
  position: relative; aspect-ratio: 16 / 9; background: #000;
  border-radius: 10px; overflow: hidden; box-shadow: 0 18px 44px rgba(21,26,69,.22);
}
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.details { margin-top: 30px; }
.details h1 { color: var(--navy); font-size: clamp(26px, 3.6vw, 36px); margin-bottom: 10px; }
.meta { color: var(--muted); font-size: 17px; margin: 0; }
.meta strong { color: var(--ink); font-weight: 600; }
.desc {
  margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line);
  font-size: 18px; line-height: 1.7; max-width: 760px;
}
.desc p { margin: 0 0 1em; }
.pager {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
  margin-top: 40px; padding-top: 26px; border-top: 1px solid var(--line);
}
.pager a {
  display: block; padding: 14px 18px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--card); color: inherit; text-decoration: none; transition: border-color .2s, box-shadow .2s;
}
.pager a:hover { border-color: #d6d0c3; box-shadow: 0 8px 22px rgba(30,36,89,.1); }
.pager .label { display: block; font-size: 13px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--magenta); }
.pager .t { display: block; font-family: "Roboto", Arial, sans-serif; font-weight: 500; color: var(--navy); line-height: 1.35; margin-top: 4px; text-wrap: balance; }
.pager .next { grid-column: 2; text-align: right; }
.notfound { text-align: center; padding: 60px 0; }
.notfound a {
  display: inline-block; padding: 10px 18px; margin-top: 6px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--card);
  color: var(--magenta); font-weight: 600; text-decoration: none;
}
.notfound a:hover { border-color: var(--magenta); }
.noscript-msg { text-align: center; padding: 20px; }

footer {
  background: var(--navy-deep); color: #a9acc9; font-size: 14px;
  padding: 26px 0; text-align: center;
}
footer p { margin: 0; }

@media (max-width: 640px) {
  header { padding: 36px 0 44px; }
  .hero { flex-direction: column; align-items: flex-start; gap: 24px; }
  .cover { width: 112px; }
  .wrap { padding: 0 16px; }
  .grid { grid-template-columns: 1fr; }
  .watch { padding-top: 0; }
  .watch .wrap { padding: 0; }
  .video { border-radius: 0; }
  .details, .pager { padding-left: 16px; padding-right: 16px; }
  .pager { grid-template-columns: 1fr; }
  .pager .next { grid-column: 1; }
  .book-name { display: none; }
}
