/* ============ Tokens ============ */
:root {
  --paper: #F5EFE6;
  --paper-2: #EBE3D6;
  --card: #FBF8F3;
  --glass: rgba(245, 239, 230, .78);
  --ink: #15120F;
  --ink-2: #4A433B;
  --muted: #7A7166;
  --line: rgba(21, 18, 15, .10);
  --line-strong: rgba(21, 18, 15, .22);
  --red: #C8102E;
  --night: #121110;
  --t1-bg: #121110;
  --t1-fg: #F3EADB;
  --cream: #F3EADB;
  --shadow: 0 1px 0 var(--line), 0 24px 48px -32px rgba(40, 20, 10, .35);

  --ease: cubic-bezier(.22, 1, .36, 1);
  --ease-in: cubic-bezier(.4, 0, 1, 1);
  --ease-curtain: cubic-bezier(.76, 0, .24, 1);

  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Switzer", "Segoe UI", system-ui, sans-serif;
  --serif: "Boska", "New York", ui-serif, Georgia, serif;
  --script: "Pinyon Script", "Snell Roundhand", cursive;

  --gutter: clamp(16px, 4vw, 40px);
  --max: 1200px;
  --nav-h: 52px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #121110;
    --paper-2: #1F1C19;
    --card: #1A1816;
    --glass: rgba(18, 17, 16, .72);
    --ink: #F3ECE1;
    --ink-2: #CFC6B9;
    --muted: #9A9083;
    --line: rgba(243, 236, 225, .10);
    --line-strong: rgba(243, 236, 225, .24);
    --red: #E8384A;
    --t1-bg: #F3EADB; /* inverted in dark mode so the tile still contrasts */
    --t1-fg: #121110;
    --shadow: 0 1px 0 var(--line), 0 24px 48px -32px rgba(0, 0, 0, .8);
    color-scheme: dark;
  }
}

/* ============ Base ============ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--paper); }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font: 400 17px/1.5 var(--sans);
  letter-spacing: -.011em;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
main { flex: 1; outline: none; }
img, svg, video, iframe { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; -webkit-tap-highlight-color: transparent; }
h1, h2, h3, p { margin: 0; }
h1:focus, h2:focus { outline: none; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; border-radius: 10px; }
::selection { background: var(--red); color: #fff; }

html.is-intro, html.is-intro body { overflow: hidden; }

.wrap {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-left: max(var(--gutter), env(safe-area-inset-left));
  padding-right: max(var(--gutter), env(safe-area-inset-right));
}

.skip {
  position: fixed; left: 12px; top: -80px; z-index: 80;
  padding: 10px 18px; border-radius: 999px;
  background: var(--ink); color: var(--paper); font-weight: 500;
  transition: top .2s var(--ease);
}
.skip:focus { top: 12px; }

/* ============ Intro ============ */
.intro {
  position: fixed; inset: 0; z-index: 70;
  display: grid; place-items: center;
  background: var(--night); color: var(--cream);
  transition: transform 1.05s var(--ease-curtain);
  cursor: pointer;
}
html:not(.is-intro) .intro:not(.is-done) { display: none; }
.intro__svg {
  width: min(82vw, 780px); height: auto; overflow: visible;
  transition: transform 1.05s var(--ease-curtain), opacity .7s ease;
}
.intro__text {
  font-family: var(--script);
  font-size: 200px;
  fill: currentColor; fill-opacity: 0;
  stroke: currentColor; stroke-width: 1.2;
  stroke-dasharray: 2400; stroke-dashoffset: 2400;
  opacity: 0;
}
.intro.is-ready .intro__text { opacity: 1; }
.intro.is-playing .intro__text {
  animation: ink-draw 2.4s cubic-bezier(.55, .05, .3, 1) forwards,
             ink-fill .9s ease 1.5s forwards;
}
.intro.is-playing .intro__sweep { animation: sweep 2s cubic-bezier(.5, 0, .3, 1) forwards; }
.intro__star { fill: var(--red); transform: scale(0) rotate(-90deg); transform-box: fill-box; transform-origin: center; }
.intro.is-playing .intro__star { animation: star 1s var(--ease) 2.05s forwards; }
.intro__skip {
  position: absolute; right: max(20px, env(safe-area-inset-right)); bottom: max(20px, env(safe-area-inset-bottom));
  padding: 10px 16px; border: 0; border-radius: 999px;
  background: rgba(243, 234, 219, .08); color: rgba(243, 234, 219, .7);
  font-size: 13px; cursor: pointer;
  opacity: 0; animation: fade-in .6s ease .8s forwards;
}
.intro.is-static .intro__text { fill-opacity: 1; stroke: none; }
.intro.is-static .intro__sweep { transform: translateX(var(--sweep, 1200px)); }
.intro.is-done { transform: translate3d(0, -100%, 0); pointer-events: none; }
.intro.is-done .intro__svg { transform: translate3d(0, 45vh, 0) scale(.92); opacity: 0; }

@keyframes ink-draw { to { stroke-dashoffset: 0; } }
@keyframes ink-fill { to { fill-opacity: 1; stroke-opacity: 0; } }
@keyframes sweep { to { transform: translateX(var(--sweep, 1200px)); } }
@keyframes star { to { transform: scale(1) rotate(0deg); } }
@keyframes fade-in { to { opacity: 1; } }

/* ============ Nav ============ */
.nav {
  position: sticky; top: 0; z-index: 40;
  view-transition-name: nav;
  padding-top: env(safe-area-inset-top);
  background: var(--glass);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
}
.nav__inner { height: var(--nav-h); display: flex; align-items: center; gap: 6px; }
.nav__back {
  width: 40px; height: 40px; margin-left: -10px;
  display: grid; place-items: center; border-radius: 50%;
  transition: background-color .2s;
}
.nav__back[hidden] { display: none; }
.nav__back svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.nav__logo { font-weight: 700; font-size: 19px; letter-spacing: -.035em; padding: 6px 0; }
.nav__logo em, .brand-plus { font-style: normal; color: var(--red); }
.nav__links { margin-left: auto; display: flex; gap: 4px; }
.nav__links a {
  padding: 8px 12px; border-radius: 999px;
  font-size: 14px; color: var(--ink-2);
  transition: color .2s, background-color .2s;
}
.nav__links a[aria-current] { color: var(--ink); background: var(--paper-2); }
@media (hover: hover) {
  .nav__links a:hover { color: var(--ink); }
  .nav__back:hover { background: var(--paper-2); }
}
@media (max-width: 760px) { .nav__links { display: none; } }

/* ============ Shared bits ============ */
.eyebrow { font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--red); }
.lede { margin-top: 16px; max-width: 46ch; font-size: clamp(17px, 1.5vw, 21px); line-height: 1.45; color: var(--ink-2); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 22px; border: 0; border-radius: 999px;
  background: var(--ink); color: var(--paper);
  font-size: 16px; font-weight: 500; letter-spacing: -.01em;
  cursor: pointer; user-select: none; -webkit-user-select: none;
  transition: transform .35s var(--ease), opacity .2s, background-color .2s;
}
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn--ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-strong); }
.btn--red { background: var(--red); color: #fff; }
.btn--light { background: var(--cream); color: var(--night); }
.btn:active { transform: scale(.96); }
.btn:disabled { opacity: .3; pointer-events: none; }
@media (hover: hover) {
  .btn:hover { opacity: .88; }
  .btn--ghost:hover { opacity: 1; background: var(--paper-2); }
}
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 28px; font-size: 14px; color: var(--muted); }
.crumbs a { transition: color .2s; }
.crumbs a:hover { color: var(--ink); }
.crumbs [aria-current] { color: var(--ink-2); }

/* Scroll reveal: transform + opacity only, so it stays on the compositor. */
[data-reveal] { opacity: 0; transform: translate3d(0, 28px, 0); }
[data-reveal].in {
  opacity: 1; transform: none;
  transition: opacity .9s var(--ease) calc(var(--d, 0) * 90ms),
              transform 1.1s var(--ease) calc(var(--d, 0) * 90ms);
}

/* ============ Home ============ */
.hero {
  position: relative;
  min-height: calc(100vh - var(--nav-h));
  min-height: calc(100svh - var(--nav-h));
  display: grid; place-items: center;
  padding: 56px 0 104px; text-align: center;
}
.hero__inner { display: flex; flex-direction: column; align-items: center; }
.hero__title { display: flex; flex-direction: column; align-items: center; margin-top: 20px; }
.hero__welcome {
  display: block;
  font: italic 300 clamp(36px, 6.2vw, 80px)/1 var(--serif);
  letter-spacing: -.01em; color: var(--ink-2);
}
.hero__brand {
  display: block; margin-top: .06em;
  font-size: clamp(64px, 16.5vw, 214px); font-weight: 700;
  line-height: .9; letter-spacing: -.058em;
  padding-right: .04em; /* balances negative tracking on the last letter */
}
.hero__lede { margin: 30px auto 36px; max-width: 36ch; font-size: clamp(17px, 1.7vw, 21px); line-height: 1.45; color: var(--ink-2); }
.hero__cue {
  position: absolute; left: 50%; bottom: 32px;
  width: 1px; height: 48px; margin-left: -.5px;
  background: linear-gradient(var(--ink-2), transparent);
  transform-origin: top; animation: cue 2.4s var(--ease) infinite;
}
@keyframes cue { 0% { transform: scaleY(0); opacity: 1; } 60% { transform: scaleY(1); opacity: 1; } 100% { transform: scaleY(1); opacity: 0; } }

/* Hero gently recedes as you scroll — pure CSS, runs off the main thread where supported. */
@supports (animation-timeline: scroll()) {
  @media (prefers-reduced-motion: no-preference) {
    .hero__inner {
      animation: hero-recede linear both;
      animation-timeline: scroll(root);
      animation-range: 0 75vh;
    }
    @keyframes hero-recede { to { opacity: .1; transform: translate3d(0, -8vh, 0) scale(.94); } }
  }
}

.options { padding-top: 24px; padding-bottom: 128px; }
.section-title { max-width: 14ch; margin-bottom: 44px; font-size: clamp(34px, 5vw, 60px); font-weight: 700; line-height: 1.04; letter-spacing: -.045em; }
.section-title em { font: italic 300 1.05em/1 var(--serif); letter-spacing: -.01em; color: var(--red); }
.bento { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.option {
  position: relative; isolation: isolate; overflow: hidden;
  display: flex; flex-direction: column; gap: 56px;
  height: 100%; min-height: 360px; padding: 32px;
  border-radius: 30px; background: var(--card); box-shadow: var(--shadow);
  transition: transform .6s var(--ease);
}
.option__num {
  position: absolute; right: 26px; top: 14px; z-index: -1;
  font: italic 300 clamp(88px, 10vw, 140px)/1 var(--serif);
  color: currentColor; opacity: .07;
}
.option__icon { width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center; background: var(--paper-2); }
.ico { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.option__title { display: block; font-size: clamp(28px, 3.1vw, 42px); font-weight: 700; line-height: 1.04; letter-spacing: -.04em; }
.option__blurb { display: block; margin-top: 12px; max-width: 32ch; color: var(--ink-2); }
.option__foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; font-size: 14px; font-weight: 500; color: var(--muted); }
.option__go {
  width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--ink); color: var(--paper);
  transition: transform .6s var(--ease);
}
.option__go svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
/* Tile variations — echoing the cream / crimson / black of the brand references. */
.option--1 { background: var(--t1-bg); color: var(--t1-fg); }
.option--1 .option__blurb, .option--1 .option__foot > span:first-child { color: inherit; opacity: .72; }
.option--1 .option__icon { background: rgba(128, 128, 128, .18); }
.option--1 .option__go { background: var(--t1-fg); color: var(--t1-bg); }
.option--2 { background: var(--red); color: #fff; }
.option--2 .option__blurb, .option--2 .option__foot { color: rgba(255, 255, 255, .8); }
.option--2 .option__icon { background: rgba(255, 255, 255, .16); }
.option--2 .option__go { background: #fff; color: var(--red); }
.option:active { transform: scale(.985); }
@media (hover: hover) {
  .option:hover { transform: translate3d(0, -6px, 0); }
  .option:hover .option__go { transform: translate3d(4px, 0, 0); }
}
@media (max-width: 760px) {
  .bento { grid-template-columns: 1fr; gap: 14px; }
  .option { min-height: 0; padding: 24px; gap: 36px; border-radius: 26px; }
  .option__icon { width: 50px; height: 50px; border-radius: 16px; }
}

/* ============ Category ============ */
.page-head { padding-top: 40px; padding-bottom: 40px; }
.page-title { font-size: clamp(42px, 7.4vw, 92px); font-weight: 700; line-height: .98; letter-spacing: -.05em; }
.switch {
  display: flex; gap: 4px; margin-top: 32px; padding: 4px;
  width: max-content; max-width: 100%;
  border-radius: 999px; background: var(--paper-2);
  overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.switch::-webkit-scrollbar { display: none; }
.switch a {
  flex: none; padding: 9px 16px; border-radius: 999px;
  font-size: 14px; font-weight: 500; white-space: nowrap; color: var(--ink-2);
  transition: color .25s, background-color .25s, box-shadow .25s;
}
.switch a[aria-current] { color: var(--ink); background: var(--card); box-shadow: 0 1px 3px rgba(0, 0, 0, .12), 0 0 0 .5px var(--line); }

.grid {
  list-style: none; margin: 0; padding: 0 0 128px;
  display: grid; gap: 44px 24px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
}
.grid--book { grid-template-columns: repeat(auto-fill, minmax(min(100%, 190px), 1fr)); }
@media (max-width: 560px) {
  .grid { gap: 32px; }
  .grid--book { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 14px; }
}
.card { display: block; }
.card__title { display: block; margin-top: 16px; font-size: 19px; font-weight: 600; line-height: 1.25; letter-spacing: -.022em; }
.card__meta { display: block; margin-top: 4px; font-size: 14px; color: var(--muted); }
.grid--book .card__title { font-size: 16px; }
.card .thumb { transition: transform .6s var(--ease); }
.card:active .thumb { transform: scale(.975); }
@media (hover: hover) { .card:hover .thumb { transform: scale(1.025); } }

/* Generated cover art: layered gradients from one hue, so every item looks designed with no image files. */
.thumb {
  --h: 8;
  position: relative; overflow: hidden;
  aspect-ratio: 16 / 10; border-radius: 22px;
  color: #FFF8EE;
  background:
    radial-gradient(110% 120% at 100% 0%, hsl(calc(var(--h) + 28) 90% 64% / .85), transparent 55%),
    radial-gradient(90% 120% at 0% 100%, hsl(calc(var(--h) - 18) 75% 24%), transparent 70%),
    hsl(var(--h) 62% 42%);
  transform: translateZ(0); /* own layer: keeps rounded-corner clipping cheap while scaling */
}
.thumb::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08); pointer-events: none; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb__mark {
  position: absolute; left: 7%; right: 7%; bottom: 7%;
  font: italic 300 clamp(40px, 4.6vw, 62px)/1 var(--serif);
  letter-spacing: -.02em;
  overflow-wrap: anywhere;
}
.thumb__play {
  position: absolute; right: 14px; top: 14px;
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(255, 248, 238, .18);
}
.thumb__play svg { width: 14px; height: 14px; margin-left: 2px; fill: currentColor; }
.thumb--book { aspect-ratio: 3 / 4; border-radius: 6px 16px 16px 6px; box-shadow: 0 24px 40px -28px rgba(0, 0, 0, .55); }
.thumb--book::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 12px;
  background: linear-gradient(90deg, rgba(0, 0, 0, .28), rgba(255, 255, 255, .1) 70%, transparent);
}
.thumb--book .thumb__mark { left: 14%; bottom: 9%; font-size: clamp(30px, 3.6vw, 46px); }

/* ============ Watch ============ */
.watch { padding-top: 28px; padding-bottom: 128px; }
.watch__grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 40px; align-items: start; }
.player {
  position: relative; overflow: hidden;
  aspect-ratio: 16 / 9; border-radius: 24px;
  background: #000;
  scroll-margin-top: calc(var(--nav-h) + 16px);
}
.player video, .player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }
.player__error {
  position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 16px;
  color: var(--cream); background: rgba(18, 17, 16, .92); text-align: center; padding: 24px;
}
.now { padding-top: 26px; }
.now__title { font-size: clamp(26px, 3.3vw, 40px); font-weight: 700; line-height: 1.1; letter-spacing: -.035em; margin-top: 10px; }
.now__course { margin-top: 8px; color: var(--muted); }
.now__nav { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.now__desc { margin-top: 32px; padding-top: 28px; border-top: 1px solid var(--line); max-width: 62ch; color: var(--ink-2); }

.episodes {
  position: sticky; top: calc(var(--nav-h) + 20px);
  max-height: calc(100vh - var(--nav-h) - 40px);
  overflow: auto; overscroll-behavior: contain;
  padding: 8px; border-radius: 24px; background: var(--card); box-shadow: var(--shadow);
}
.episodes__head { display: flex; justify-content: space-between; align-items: baseline; padding: 14px 14px 10px; font-size: 17px; font-weight: 600; letter-spacing: -.02em; }
.episodes__head span { font-size: 14px; font-weight: 500; color: var(--muted); }
.episodes__list { list-style: none; margin: 0; padding: 0; }
.ep {
  width: 100%; min-height: 56px; padding: 12px 14px;
  display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: 12px;
  border: 0; border-radius: 16px; background: none; text-align: left; cursor: pointer;
  transition: background-color .2s;
}
.ep__n { font-size: 14px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.ep__t { font-weight: 500; line-height: 1.3; }
.ep__d { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ep[aria-current] { background: var(--paper-2); }
.ep[aria-current] .ep__n { color: var(--red); }
.ep:active { background: var(--paper-2); }
@media (hover: hover) { .ep:hover { background: var(--paper-2); } }

@media (max-width: 980px) {
  .watch__grid { grid-template-columns: 1fr; gap: 32px; }
  .episodes { position: static; max-height: none; overflow: visible; }
}
@media (max-width: 640px) {
  .watch { padding-top: 16px; }
  .watch .crumbs { margin-bottom: 16px; }
  /* Edge-to-edge player on phones, like a native video app. */
  .player { margin-left: calc(-1 * max(var(--gutter), env(safe-area-inset-left))); margin-right: calc(-1 * max(var(--gutter), env(safe-area-inset-right))); border-radius: 0; }
  .now__nav .btn { flex: 1; }
}

/* ============ Book ============ */
.book { padding-top: 28px; padding-bottom: 128px; }
.book__grid { display: grid; grid-template-columns: minmax(220px, 380px) minmax(0, 1fr); gap: clamp(32px, 6vw, 88px); align-items: center; }
.book__author { margin-top: 12px; color: var(--muted); }
.book .page-title { margin-top: 14px; font-size: clamp(38px, 5.6vw, 72px); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
@media (max-width: 760px) {
  .book__grid { grid-template-columns: 1fr; }
  .book__cover { width: min(64%, 260px); }
  .actions .btn { flex: 1; }
}

/* ============ Video player (YouTube underneath, GetPlus on top) ============ */
.vp {
  --crop: max(72px, 14%);
  position: absolute; inset: 0; overflow: hidden;
  background: #000; color: #fff; outline: none;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
.vp:focus-visible { box-shadow: inset 0 0 0 2px var(--red); }
/* Taller than the frame and clipped: YouTube's title bar and logo land in the hidden bands, the video doesn't. */
.vp__frame { position: absolute; left: 0; right: 0; top: calc(-1 * var(--crop)); bottom: calc(-1 * var(--crop)); pointer-events: none; }
.vp__frame iframe { width: 100%; height: 100%; border: 0; display: block; }
.vp__cover, .vp__veil, .vp__shield { position: absolute; inset: 0; width: 100%; height: 100%; }
.vp__cover { object-fit: cover; transition: opacity .45s var(--ease); }
.vp__veil {
  opacity: 0; pointer-events: none;
  background: rgba(10, 9, 8, .35);
  -webkit-backdrop-filter: blur(22px) saturate(140%); backdrop-filter: blur(22px) saturate(140%);
  transition: opacity .35s var(--ease);
}
.vp__shield { cursor: pointer; }
.vp__big {
  position: absolute; left: 50%; top: 50%;
  width: clamp(64px, 11vw, 88px); height: clamp(64px, 11vw, 88px);
  margin: calc(clamp(64px, 11vw, 88px) / -2) 0 0 calc(clamp(64px, 11vw, 88px) / -2);
  display: grid; place-items: center;
  border: 0; border-radius: 50%; cursor: pointer;
  color: #fff; background: rgba(255, 255, 255, .2);
  -webkit-backdrop-filter: blur(16px) saturate(160%); backdrop-filter: blur(16px) saturate(160%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25), 0 12px 40px rgba(0, 0, 0, .35);
  transition: transform .4s var(--ease), opacity .3s var(--ease), background-color .2s;
}
.vp__big svg { width: 40%; height: 40%; margin-left: 6%; }
.vp.is-ended .vp__big svg { margin-left: 0; }
.vp__big:active { transform: scale(.92); }
@media (hover: hover) { .vp__big:hover { background: rgba(255, 255, 255, .3); transform: scale(1.05); } }

/* States */
.vp:not(.is-idle):not(.is-ended) .vp__cover { opacity: 0; pointer-events: none; }
.vp.is-playing .vp__big, .vp.is-buffering .vp__big, .vp.is-error .vp__big { opacity: 0; pointer-events: none; transform: scale(.85); }
.vp.is-paused .vp__veil { opacity: 1; }
/* Before the first play, taps fall through to the frame itself (see video-player.js). */
.vp.is-idle .vp__frame { pointer-events: auto; }
.vp.is-idle .vp__shield, .vp.is-idle .vp__cover, .vp.is-idle .vp__big, .vp.is-idle .vp__veil { pointer-events: none; }
.vp.is-idle .vp__bar { opacity: 0; visibility: hidden; }

.vp__spin {
  position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; margin: -22px 0 0 -22px;
  border-radius: 50%; border: 3px solid rgba(255, 255, 255, .25); border-top-color: #fff;
  opacity: 0; pointer-events: none; transition: opacity .2s;
  animation: vp-spin .8s linear infinite;
}
.vp.is-buffering .vp__spin { opacity: 1; transition-delay: .25s; }
@keyframes vp-spin { to { transform: rotate(360deg); } }

.vp__msg {
  position: absolute; inset: 0; z-index: 3;
  display: grid; place-content: center; justify-items: center; gap: 16px; padding: 24px;
  text-align: center; background: rgba(18, 17, 16, .94); color: var(--cream);
}
.vp__msg[hidden] { display: none; }

/* Control bar */
.vp__bar {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  padding: 36px clamp(10px, 2vw, 18px) max(8px, env(safe-area-inset-bottom));
  background: linear-gradient(transparent, rgba(0, 0, 0, .62));
  transition: opacity .35s var(--ease), transform .35s var(--ease), visibility .35s;
}
.vp.is-hide .vp__bar { opacity: 0; transform: translate3d(0, 8px, 0); visibility: hidden; }
.vp.is-hide { cursor: none; }
.vp__row { display: flex; align-items: center; gap: 2px; }
.vp__gap { flex: 1; }
.vp__btn {
  flex: none; min-width: 40px; height: 40px; padding: 0 8px;
  display: grid; place-items: center;
  border: 0; border-radius: 12px; background: none; color: #fff; cursor: pointer;
  font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums;
  transition: background-color .2s, transform .25s var(--ease);
}
.vp__btn svg { width: 22px; height: 22px; }
.vp__btn:active { transform: scale(.9); }
@media (hover: hover) { .vp__btn:hover { background: rgba(255, 255, 255, .14); } }
.vp__time { margin-left: 6px; font-size: 13px; font-weight: 500; font-variant-numeric: tabular-nums; opacity: .92; white-space: nowrap; }

/* Seek: drawn with transforms; the real (invisible) range input on top keeps it accessible and draggable. */
.vp__track { position: relative; height: 22px; margin: 0 6px 2px; }
.vp__track::before, .vp__buf, .vp__fill {
  content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 4px; margin-top: -2px;
  border-radius: 4px; transform-origin: left center;
  transition: height .2s var(--ease), margin-top .2s var(--ease);
}
.vp__track::before { background: rgba(255, 255, 255, .25); }
.vp__buf { background: rgba(255, 255, 255, .35); transform: scaleX(0); }
.vp__fill { background: #fff; transform: scaleX(0); }
.vp__track:hover::before, .vp__track:hover .vp__buf, .vp__track:hover .vp__fill,
.vp__track:focus-within::before, .vp__track:focus-within .vp__buf, .vp__track:focus-within .vp__fill { height: 6px; margin-top: -3px; }
.vp__seek, .vp__vol { -webkit-appearance: none; appearance: none; background: none; margin: 0; cursor: pointer; }
.vp__seek { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; }
.vp__seek:focus-visible { opacity: 1; outline: none; }
.vp__seek::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: #fff; }
.vp__seek::-moz-range-thumb { width: 16px; height: 16px; border: 0; border-radius: 50%; background: #fff; }
.vp__vol {
  --v: 100%;
  width: 76px; height: 4px; margin: 0 6px 0 2px; border-radius: 4px;
  background: linear-gradient(90deg, #fff var(--v), rgba(255, 255, 255, .3) var(--v));
}
.vp__vol::-webkit-slider-thumb { -webkit-appearance: none; width: 13px; height: 13px; border-radius: 50%; background: #fff; }
.vp__vol::-moz-range-thumb { width: 13px; height: 13px; border: 0; border-radius: 50%; background: #fff; }
/* Phones: the hardware buttons own volume; keep the bar uncluttered. */
@media (hover: none), (max-width: 520px) { .vp__vol { display: none; } }
@media (max-width: 420px) { .vp__btn[data-act="back"], .vp__btn[data-act="fwd"] { display: none; } }

/* Full screen (real, and the iPhone stand-in) */
.vp:fullscreen { border-radius: 0; }
.vp.is-fake-full { position: fixed; inset: 0; z-index: 200; }
html.vp-lock, html.vp-lock body { overflow: hidden; }
.player:has(.vp.is-fake-full) { transform: none; }

/* Watch page extras */
.now__sheets { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.now__sheets:empty { display: none; }
.sheet {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 40px; padding: 0 16px; border-radius: 999px;
  background: var(--paper-2); font-size: 14px; font-weight: 500;
  transition: background-color .2s, transform .3s var(--ease);
}
.sheet .ico { width: 18px; height: 18px; }
.sheet:active { transform: scale(.96); }
@media (hover: hover) { .sheet:hover { background: var(--line-strong); } }
.ep--img { grid-template-columns: 24px 88px minmax(0, 1fr) auto; }
.ep__img { width: 88px; aspect-ratio: 16 / 9; height: auto; border-radius: 8px; object-fit: cover; background: var(--paper-2); }
.ep--img .ep__t { font-size: 15px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ep--img .ep__n { font-size: 13px; }

/* Class cards inside a chapter */
.card__no { display: block; margin-top: 14px; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--red); }
.card--class .card__title { margin-top: 4px; font-size: 17px; line-height: 1.35; }
.card--class .thumb img { transition: transform .8s var(--ease); }

/* ============ Course tree (folder pages) ============ */
.folder { padding-top: 28px; padding-bottom: 128px; }
/* Each level above peeks out behind the header — a deck of cards, one inside another. */
.nest { display: flex; flex-direction: column; }
.nest__layer {
  position: relative; display: block;
  margin: 0 calc(var(--i) * 14px) -20px;
  padding: 11px 20px 30px;
  border-radius: 20px 20px 0 0;
  background: var(--card);
  box-shadow: inset 0 0 0 1px var(--line);
  filter: brightness(calc(1 - var(--i) * .035));
  font-size: 13px; font-weight: 600; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: transform .5s var(--ease), color .2s;
}
.nest__layer::before { content: "↑  "; opacity: .6; }
@media (hover: hover) { .nest__layer:hover { transform: translate3d(0, -4px, 0); color: var(--ink); } }
.nest__layer:active { transform: translate3d(0, -2px, 0); }
.nest__card {
  aspect-ratio: auto;
  min-height: clamp(220px, 28vw, 320px);
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: clamp(26px, 5vw, 52px);
  border-radius: 28px;
  box-shadow: 0 34px 60px -40px rgba(30, 10, 5, .6);
}
.nest__mark {
  position: absolute; right: -.02em; top: -.12em;
  font: italic 300 clamp(110px, 20vw, 260px)/1 var(--serif);
  white-space: nowrap; opacity: .14; pointer-events: none;
}
.nest__label { position: relative; font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; opacity: .8; }
.nest__title { position: relative; margin-top: 10px; font-size: clamp(32px, 5.4vw, 68px); font-weight: 700; line-height: 1.04; letter-spacing: -.045em; }
.nest__meta { position: relative; margin-top: 12px; opacity: .85; }
.folder__grid { margin-top: 48px; }

.rows { list-style: none; margin: 40px 0 0; padding: 0; border-top: 1px solid var(--line); }
.row {
  display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; align-items: center; gap: 16px;
  padding: 22px 10px; border-bottom: 1px solid var(--line);
  transition: background-color .25s;
}
.row__n { font: italic 300 30px/1 var(--serif); color: var(--muted); transition: color .25s; }
.row__t { font-size: clamp(18px, 2.1vw, 24px); font-weight: 600; line-height: 1.25; letter-spacing: -.022em; }
.row__t small { display: block; margin-top: 4px; font-size: 14px; font-weight: 400; letter-spacing: 0; color: var(--muted); }
.row__go {
  width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--paper-2);
  transition: transform .5s var(--ease), background-color .25s, color .25s;
}
.row__go svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.row:active { background: var(--paper-2); }
@media (hover: hover) {
  .row:hover .row__n { color: var(--red); }
  .row:hover .row__go { transform: translate3d(4px, 0, 0); background: var(--ink); color: var(--paper); }
}
@media (max-width: 560px) {
  .row { grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; padding: 18px 4px; }
  .row__n { font-size: 24px; }
  .row__go { width: 36px; height: 36px; }
}
.soon { margin-top: 40px; padding: 48px 28px; border-radius: 24px; background: var(--card); text-align: center; }
.soon .lede { margin-inline: auto; }

/* ============ Empty / 404 ============ */
.empty { padding-top: 96px; padding-bottom: 160px; text-align: center; }
.empty .lede { margin-inline: auto; }
.empty .btn { margin-top: 32px; }

/* ============ Footer ============ */
.foot { border-top: 1px solid var(--line); padding: 36px 0 calc(36px + env(safe-area-inset-bottom)); font-size: 14px; color: var(--muted); }
.foot__inner { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; }
.foot__sig { font-family: var(--script); font-size: 46px; line-height: 1; color: var(--ink); }

/* ============ Page transitions (View Transitions API) ============ */
::view-transition-old(root) { animation: vt-out .22s var(--ease-in) both; }
::view-transition-new(root) { animation: vt-in .5s var(--ease) both; }
::view-transition-group(hero) { animation-duration: .6s; animation-timing-function: var(--ease); }
::view-transition-old(hero), ::view-transition-new(hero) { width: 100%; height: 100%; object-fit: cover; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; } }

/* ============ Reduced motion ============ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
  [data-reveal] { opacity: 1; transform: none; }
  .hero__cue { display: none; }
}
