/* Pikabuk demo. Look follows the Pikabuk staging site: dark cinematic hero, cream shelves,
   heavy rounded sans for titles, mint call-to-action, warm highlighter yellow for reading. */
:root {
  --night: #15131a;
  --night-2: #201d27;
  --cream: #fffbef;
  --cream-2: #f6f0de;
  --ink: #1f1b17;
  --ink-2: #5a5249;
  --ink-3: #8b8277;
  --line: #e7dfca;
  --mint: #45d99b;
  --mint-ink: #0e3b29;
  --mark: #ffd666;
  --coral: #f06a3b;
  --radius: 14px;
  --ui: "Outfit", system-ui, -apple-system, "Segoe UI", sans-serif;
  --read: "Literata", Georgia, "Times New Roman", serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --pad: clamp(16px, 4vw, 56px);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--cream); color: var(--ink); font: 400 16px/1.5 var(--ui); }
a { color: inherit; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
svg { width: 1.25em; height: 1.25em; flex: none; }
:focus-visible { outline: 3px solid var(--mint); outline-offset: 3px; border-radius: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- top bar ---------- */
.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 30; height: 64px;
  display: flex; align-items: center; gap: 28px; padding: 0 var(--pad);
  color: #fff; background: linear-gradient(to bottom, rgba(12, 10, 16, .78), rgba(12, 10, 16, 0));
  transition: background .3s var(--ease);
}
.topbar.solid { background: var(--night); }
.logo { color: #fff; display: flex; text-decoration: none; }
.logo svg { width: auto; height: 26px; }
.topnav { display: flex; gap: 22px; }
.topnav a { text-decoration: none; font-weight: 500; opacity: .78; padding: 6px 0; border-bottom: 2px solid transparent; }
.topnav a:hover, .topnav a.on { opacity: 1; }
.topnav a.on { border-color: var(--mint); }
.who { margin-left: auto; display: flex; align-items: center; gap: 12px; font-size: 14px; }
.ctx { opacity: .85; max-width: 28ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-weight: 700;
  background: var(--coral); color: #fff; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 10px; padding: 12px 22px; border-radius: 10px; border: 0;
  font: 600 17px/1 var(--ui); text-decoration: none; cursor: pointer; transition: transform .15s var(--ease), background .2s; }
.btn:active { transform: translateY(1px) scale(.98); }
.btn.primary { background: #fff; color: var(--ink); }
.btn.primary:hover { background: #f1ede2; }
.btn.mint { background: var(--mint); color: var(--mint-ink); }
.btn.mint:hover { background: #5ee5ab; }
.btn.glass { background: rgba(255, 255, 255, .18); color: #fff; backdrop-filter: blur(8px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18); }
.btn.glass:hover { background: rgba(255, 255, 255, .28); }
.btn.ghost { background: transparent; color: #fff; padding-inline: 8px; }
.btn.ghost:hover { text-decoration: underline; text-underline-offset: 4px; }
.btn.dark { background: var(--ink); color: #fff; }
.btn.dark:hover { background: #38312a; }
.btn.line { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }
.btn.line:hover { background: rgba(0, 0, 0, .05); }
.btn[disabled] { opacity: .5; cursor: default; }

/* ---------- hero carousel ---------- */
.hero { position: relative; height: min(88vh, 760px); min-height: 520px; background: var(--night); overflow: hidden; color: #fff; }
.slide { position: absolute; inset: 0; opacity: 0; visibility: hidden; transition: opacity .9s var(--ease), visibility .9s; }
.slide.on { opacity: 1; visibility: visible; }
.slide-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 70% 40%;
  transform: scale(1.06); transition: transform 9s linear; }
.slide.on .slide-art { transform: scale(1); }
.slide-shade { position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(14, 12, 20, .88) 0%, rgba(14, 12, 20, .55) 34%, rgba(14, 12, 20, 0) 62%),
              linear-gradient(0deg, rgba(14, 12, 20, .75) 0%, rgba(14, 12, 20, 0) 32%); }
.slide-copy { position: absolute; left: var(--pad); bottom: clamp(70px, 14vh, 130px); max-width: min(560px, 86vw); }
.slide-copy h1 { margin: 0 0 14px; font: 800 clamp(36px, 5.2vw, 64px)/1 var(--ui); letter-spacing: -.02em; }
.slide-copy p { margin: 0 0 16px; font-size: clamp(16px, 1.5vw, 19px); line-height: 1.45; color: rgba(255, 255, 255, .9);
  max-width: 46ch; }
.slide.on .slide-copy > * { animation: rise .8s var(--ease) both; }
.slide.on .slide-copy > :nth-child(2) { animation-delay: .06s; }
.slide.on .slide-copy > :nth-child(3) { animation-delay: .12s; }
.slide.on .slide-copy > :nth-child(4) { animation-delay: .18s; }
.slide.on .slide-copy > :nth-child(5) { animation-delay: .24s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
.due { display: inline-block; margin-bottom: 14px; padding: 6px 12px; border-radius: 999px; font-weight: 600; font-size: 14px;
  background: var(--mint); color: var(--mint-ink); }
.hero-dots { position: absolute; right: var(--pad); bottom: 36px; display: flex; gap: 8px; }
.hero-dots button { width: 44px; height: 20px; border: 0; background: none; padding: 8px 0; cursor: pointer; }
.hero-dots i { display: block; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .32); overflow: hidden; position: relative; }
.hero-dots button[aria-selected="true"] i::after { content: ""; position: absolute; inset: 0; background: #fff;
  transform-origin: left; animation: fill var(--slide-ms, 8000ms) linear forwards; }
.hero.paused .hero-dots button[aria-selected="true"] i::after { animation-play-state: paused; }
@keyframes fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* ---------- meta line ---------- */
.meta { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 12px; font-weight: 600; font-size: 15px; color: var(--ink-2); }
.meta.light { color: #fff; }
.meta .orig { font-weight: 700; }
.meta .age { padding: 1px 8px; border: 1.5px solid currentColor; border-radius: 7px; font-size: 13px; }

/* ---------- shelves ---------- */
.shelves { position: relative; z-index: 2; padding: 34px 0 70px; }
.row { margin: 0 0 30px; }
.row-head { display: flex; align-items: center; justify-content: space-between; padding: 0 var(--pad); margin-bottom: 12px; }
.row-head h2 { margin: 0; font: 700 clamp(20px, 2vw, 25px)/1.2 var(--ui); letter-spacing: -.01em; }
.row-nav { display: flex; gap: 8px; }
.arrow { width: 40px; height: 40px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer;
  background: var(--cream-2); color: var(--ink); transition: background .2s; }
.arrow:hover { background: var(--line); }
.arrow[disabled] { opacity: .35; cursor: default; }
.rail { display: grid; grid-auto-flow: column; grid-auto-columns: clamp(220px, 23vw, 330px); gap: 16px;
  overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scroll-padding: 0 var(--pad);
  padding: 8px var(--pad) 24px; scrollbar-width: none; }
.rail::-webkit-scrollbar { display: none; }

/* cards */
.card { position: relative; scroll-snap-align: start; }
.card-art { display: block; position: relative; aspect-ratio: 3 / 2; border-radius: var(--radius); overflow: hidden;
  background: var(--cream-2); box-shadow: 0 10px 24px -14px rgba(60, 40, 10, .45); text-decoration: none;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease); }
.card-art img { width: 100%; height: 100%; object-fit: cover; }
.card-title { position: absolute; left: 0; right: 0; bottom: 0; padding: 34px 14px 12px; color: #fff; font-weight: 700; font-size: 17px;
  line-height: 1.15; background: linear-gradient(0deg, rgba(10, 8, 14, .78), rgba(10, 8, 14, 0)); }
.flag { position: absolute; top: 10px; left: 10px; padding: 4px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700;
  background: var(--mint); color: var(--mint-ink); }
.flag.score { left: auto; right: 10px; background: #fff; color: var(--ink); }
.bar { position: absolute; left: 12px; right: 12px; bottom: 8px; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .35); }
.bar i { display: block; height: 100%; border-radius: 4px; background: var(--coral); }
.card:has(.bar) .card-title { bottom: 8px; }
.card-pop { position: absolute; left: 0; right: 0; top: calc(100% - 12px); z-index: 3; padding: 16px 14px 14px;
  background: #fff; border-radius: 0 0 var(--radius) var(--radius); box-shadow: 0 22px 40px -18px rgba(60, 40, 10, .5);
  opacity: 0; visibility: hidden; transform: translateY(-6px); transition: opacity .25s var(--ease), transform .3s var(--ease), visibility .25s; }
.pop-actions { display: flex; gap: 8px; margin-bottom: 10px; }
.round { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; text-decoration: none;
  box-shadow: inset 0 0 0 1.5px #cfc6b2; color: var(--ink); transition: background .2s; }
.round:hover { background: var(--cream-2); }
.round.solid { background: var(--ink); color: #fff; box-shadow: none; }
.round.solid:hover { background: #3a332c; }
.round.push { margin-left: auto; }
.pop-blurb { margin: 0 0 10px; font-size: 14px; line-height: 1.4; color: var(--ink-2);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card .card-pop { display: none; }
.float-card { position: absolute; z-index: 25; border-radius: var(--radius); overflow: hidden; background: #fff;
  box-shadow: 0 34px 60px -24px rgba(40, 25, 5, .6); opacity: 0; transform: scale(.82); transform-origin: center 30%;
  pointer-events: none; transition: opacity .22s var(--ease), transform .32s var(--ease); }
.float-card.on { opacity: 1; transform: none; pointer-events: auto; }
.float-card .card-art { border-radius: 0; box-shadow: none; }
.float-card .card-pop { display: block; position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; border-radius: 0; }

/* teacher strip and promo */
.teacher-strip { margin: 0 var(--pad) 34px; padding: 22px 26px; border-radius: 18px; background: #fff;
  display: grid; grid-template-columns: 1fr auto; gap: 18px; align-items: center; box-shadow: inset 0 0 0 1px var(--line); }
.teacher-strip h2 { margin: 0 0 4px; font-size: 21px; }
.teacher-strip p { margin: 0; color: var(--ink-2); max-width: 70ch; }
.promo { margin: 10px var(--pad) 40px; border-radius: 22px; overflow: hidden; background: var(--night); color: #fff;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); min-height: 300px; }
.promo-copy { padding: clamp(26px, 4vw, 52px); align-self: center; }
.promo .kicker { color: var(--mark); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; font-size: 13px; }
.promo h2 { margin: 8px 0 10px; font: 800 clamp(26px, 3vw, 38px)/1.05 var(--ui); letter-spacing: -.015em; }
.promo p { margin: 0 0 22px; color: rgba(255, 255, 255, .82); max-width: 46ch; }
.promo img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- title page ---------- */
.title-hero { position: relative; min-height: 560px; color: #fff; background: var(--night); overflow: hidden; }
.title-hero > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 70% 40%; }
.title-hero .slide-shade { background: linear-gradient(90deg, rgba(14, 12, 20, .92) 0%, rgba(14, 12, 20, .62) 40%, rgba(14, 12, 20, .05) 75%),
  linear-gradient(0deg, rgba(14, 12, 20, .8) 0%, rgba(14, 12, 20, 0) 40%); }
.title-copy { position: relative; padding: 130px var(--pad) 54px; max-width: 700px; }
.title-copy h1 { margin: 0 0 8px; font: 800 clamp(34px, 5vw, 60px)/1 var(--ui); letter-spacing: -.02em; }
.title-copy .by { margin: 0 0 16px; opacity: .85; }
.title-copy .blurb { margin: 16px 0 0; font-size: 18px; line-height: 1.5; max-width: 52ch; }
.title-body { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, 1fr); gap: clamp(24px, 4vw, 56px);
  padding: 40px var(--pad) 10px; align-items: start; }
.panel { background: #fff; border-radius: 18px; padding: 24px; box-shadow: inset 0 0 0 1px var(--line); }
.panel h2 { margin: 0 0 6px; font-size: 21px; }
.panel .sub { margin: 0 0 18px; color: var(--ink-2); }
.formats { display: grid; gap: 10px; }
.format { display: grid; grid-template-columns: 46px 1fr auto; gap: 14px; align-items: center; padding: 12px 14px; border-radius: 14px;
  text-decoration: none; background: var(--cream); box-shadow: inset 0 0 0 1px var(--line); transition: background .2s, transform .15s; }
.format:hover { background: var(--cream-2); }
.format:active { transform: scale(.99); }
.format .ico { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--ink); color: #fff; }
.format b { display: block; font-size: 17px; }
.format span { color: var(--ink-2); font-size: 14px; }
.format .pct { font-weight: 700; color: var(--ink); }
.quiz-box .score-line { display: flex; align-items: baseline; gap: 10px; margin: 6px 0 16px; }
.quiz-box .big { font: 800 44px/1 var(--ui); letter-spacing: -.02em; }
.tries { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 6px; font-size: 14px; color: var(--ink-2); }
.tries li { display: flex; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 6px; }
.pages-strip { display: grid; grid-auto-flow: column; grid-auto-columns: 180px; gap: 10px; overflow-x: auto; padding-bottom: 6px; }
.pages-strip img { border-radius: 10px; aspect-ratio: 3 / 2; object-fit: cover; }
.credit { color: var(--ink-3); font-size: 14px; margin-top: 14px; }
.assign-box { margin-top: 18px; }
.assign-box label { display: block; font-weight: 600; margin-bottom: 6px; }
.assign-box .hint { font-size: 13.5px; color: var(--ink-3); margin: 8px 0 0; }
.field { display: flex; gap: 10px; flex-wrap: wrap; }
.field input { font: inherit; padding: 10px 12px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--cream); }
.note { padding: 12px 14px; border-radius: 12px; background: var(--cream-2); color: var(--ink-2); font-size: 14.5px; }
.note.ok { background: #e3f8ee; color: #0e5b3a; }
.note.err { background: #fdeae4; color: #8a2b10; }

/* ---------- full-screen players ---------- */
.stage { position: fixed; inset: 0; background: #0f0d13; color: #fff; display: flex; flex-direction: column; }
.stage-top { display: flex; align-items: center; gap: 14px; padding: 14px 18px; z-index: 4; }
.stage-top h1 { margin: 0; font-size: 17px; font-weight: 600; opacity: .92; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn { width: 44px; height: 44px; border-radius: 12px; border: 0; display: grid; place-items: center; cursor: pointer;
  background: rgba(255, 255, 255, .1); color: #fff; text-decoration: none; flex: none; transition: background .2s; }
.icon-btn:hover { background: rgba(255, 255, 255, .2); }
.icon-btn.on { background: var(--mark); color: var(--ink); }
.stage-top .spacer { flex: 1; }
.pill-btn { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 16px; border-radius: 12px; border: 0;
  background: rgba(255, 255, 255, .1); color: #fff; font-weight: 600; cursor: pointer; text-decoration: none; }
.pill-btn:hover { background: rgba(255, 255, 255, .2); }
.pill-btn.on { background: var(--mark); color: var(--ink); }

/* video */
.video-wrap { position: relative; flex: 1; display: flex; flex-direction: column; min-height: 0; }
.video-wrap video { flex: 1; min-height: 0; width: 100%; object-fit: contain; background: #000; cursor: pointer; }
.vctl { padding: 10px 20px 14px; background: #0f0d13; }
.stage-top { transition: opacity .3s; }
.stage.idle .stage-top { opacity: .25; }
.scrub { position: relative; height: 22px; cursor: pointer; margin-bottom: 8px; touch-action: none; }
.scrub .track { position: absolute; left: 0; right: 0; top: 9px; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .25); }
.scrub .seen { position: absolute; top: 0; bottom: 0; background: rgba(255, 255, 255, .35); }
.scrub .fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; background: var(--mint); }
.scrub .knob { position: absolute; top: 3px; width: 16px; height: 16px; margin-left: -8px; border-radius: 50%; background: #fff; }
.scrub .tick { position: absolute; top: 6px; width: 2px; height: 10px; background: rgba(255, 255, 255, .55); }
.vrow { display: flex; align-items: center; gap: 10px; }
.vrow .time { font-variant-numeric: tabular-nums; font-size: 15px; opacity: .9; }
.vrow .grow { flex: 1; }
.vrow .page-label { font-size: 14px; opacity: .8; }
.endcard { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(12, 10, 16, .82); backdrop-filter: blur(6px);
  opacity: 0; visibility: hidden; transition: opacity .4s; z-index: 5; }
.endcard.on { opacity: 1; visibility: visible; }
.endcard .box { text-align: center; max-width: 520px; padding: 24px; }
.endcard h2 { font: 800 40px/1.05 var(--ui); margin: 0 0 10px; }
.endcard p { color: rgba(255, 255, 255, .8); margin: 0 0 24px; }
.countdown { width: 120px; height: 120px; margin: 0 auto 22px; position: relative; display: grid; place-items: center; font: 800 52px/1 var(--ui); }
.countdown svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.countdown circle { fill: none; stroke-width: 7; }
.countdown .bg { stroke: rgba(255, 255, 255, .15); }
.countdown .fg { stroke: var(--mint); stroke-linecap: round; stroke-dasharray: 339.3; transition: stroke-dashoffset 1s linear; }
.endcard .cta { justify-content: center; }

/* flipbook */
.book-wrap { flex: 1; display: grid; place-items: center; padding: 6px 18px 0; min-height: 0; perspective: 2400px; }
.book { position: relative; width: min(94vw, calc((100vh - 190px) * 1.5)); aspect-ratio: 3 / 2; }
.spread { position: absolute; inset: 0; border-radius: 10px; overflow: hidden; background: #fff;
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .7); }
.spread img { width: 100%; height: 100%; object-fit: cover; }
.spread::after { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 60px; margin-left: -30px; pointer-events: none;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0), rgba(0, 0, 0, .16) 48%, rgba(255, 255, 255, .08) 52%, rgba(0, 0, 0, 0)); }
.leaf { position: absolute; top: 0; bottom: 0; width: 50%; transform-style: preserve-3d; z-index: 3; pointer-events: none;
  transition: transform .9s cubic-bezier(.45, .05, .25, 1); }
.leaf.fwd { left: 50%; transform-origin: left center; }
.leaf.back { left: 0; transform-origin: right center; }
.leaf .face { position: absolute; inset: 0; backface-visibility: hidden; overflow: hidden; background-size: 200% 100%; }
.leaf .face.b { transform: rotateY(180deg); }
.leaf .face::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0, 0, 0, .18), rgba(0, 0, 0, 0) 40%); }
.leaf.back .face::after { background: linear-gradient(270deg, rgba(0, 0, 0, .18), rgba(0, 0, 0, 0) 40%); }
.textbox { position: absolute; z-index: 2; left: 3.2%; top: 6%; width: 40%; padding: clamp(12px, 1.6vw, 22px) clamp(14px, 1.8vw, 26px);
  border-radius: 14px; background: rgba(255, 251, 239, .94); color: var(--ink); box-shadow: 0 12px 30px -16px rgba(0, 0, 0, .55);
  font: 400 clamp(14px, 1.45vw, 21px)/1.55 var(--read); transition: opacity .3s; }
.textbox.low { top: auto; bottom: 6%; }
.w { border-radius: 5px; transition: background .12s, color .12s; padding: 0 1px; }
.w.done { color: var(--ink); }
.reading .w { color: #8a8073; }
.reading .w.done { color: var(--ink); }
.w.now { background: var(--mark); color: var(--ink); box-shadow: 0 0 0 2px var(--mark); }
.book-nav { position: absolute; top: 50%; translate: 0 -50%; z-index: 5; width: 52px; height: 52px; border-radius: 50%; border: 0;
  background: rgba(255, 255, 255, .92); color: var(--ink); display: grid; place-items: center; cursor: pointer; box-shadow: 0 8px 20px -8px rgba(0, 0, 0, .5); }
.book-nav.prev { left: -26px; }
.book-nav.next { right: -26px; }
.book-nav[disabled] { opacity: 0; pointer-events: none; }
.thumbs { display: flex; gap: 8px; justify-content: center; padding: 14px 18px 18px; overflow-x: auto; }
.thumbs button { flex: none; width: 92px; aspect-ratio: 3 / 2; border-radius: 8px; overflow: hidden; padding: 0; border: 2px solid transparent;
  cursor: pointer; opacity: .55; transition: opacity .2s, border-color .2s; background: #222; }
.thumbs button.on { opacity: 1; border-color: var(--mint); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.thumbs .done-tile { display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 13px; background: #2b2734; }
.book-progress { height: 4px; background: rgba(255, 255, 255, .12); }
.book-progress i { display: block; height: 100%; background: var(--mint); transition: width .5s var(--ease); }
.finale { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; background: var(--cream); color: var(--ink);
  border-radius: 10px; padding: 24px; }
.finale h2 { font: 800 clamp(28px, 4vw, 46px)/1.05 var(--ui); margin: 0 0 8px; }
.finale p { color: var(--ink-2); margin: 0 0 22px; }

/* story reader */
.reader-stage { background: var(--cream); color: var(--ink); }
.reader-stage .stage-top { border-bottom: 1px solid var(--line); background: var(--cream); }
.reader-stage .icon-btn, .reader-stage .pill-btn { background: var(--cream-2); color: var(--ink); }
.reader-stage .icon-btn:hover, .reader-stage .pill-btn:hover { background: var(--line); }
.reader-stage .pill-btn.on { background: var(--mark); }
.paper { flex: 1; min-height: 0; overflow: hidden; position: relative; }
.columns { height: 100%; padding: clamp(24px, 4vh, 48px) clamp(24px, 6vw, 96px); column-gap: clamp(40px, 6vw, 110px);
  column-fill: auto; font: 400 var(--rs, 21px)/1.7 var(--read); transition: transform .45s var(--ease); }
.columns h2 { font: 600 clamp(26px, 3vw, 36px)/1.15 var(--read); margin: 0 0 6px; letter-spacing: .01em; }
.columns .story-by { text-indent: 0; text-align: left; color: var(--ink-3); font: 500 15px/1.4 var(--ui); margin: 0 0 22px; }
.columns p { margin: 0 0 .9em; text-indent: 1.4em; text-align: justify; hyphens: auto; }
.columns p.first { text-indent: 0; }
.columns p.first::first-letter { float: left; font-size: 3.2em; line-height: .9; padding: 6px 8px 0 0; font-weight: 600; color: var(--coral); }
.reader-foot { display: flex; align-items: center; gap: 16px; padding: 10px 22px 16px; font-size: 14px; color: var(--ink-2); }
.reader-foot .track { flex: 1; height: 4px; border-radius: 4px; background: var(--line); }
.reader-foot .track i { display: block; height: 100%; border-radius: 4px; background: var(--ink); transition: width .4s var(--ease); }
.page-btn { position: absolute; top: 0; bottom: 0; width: 70px; border: 0; background: none; cursor: pointer; color: var(--ink-3); z-index: 2; }
.page-btn:hover { color: var(--ink); }
.page-btn.prev { left: 0; }
.page-btn.next { right: 0; }
.page-btn[disabled] { visibility: hidden; }

/* quiz */
.quiz-stage { background: var(--cream); color: var(--ink); overflow-y: auto; }
.quiz-stage .stage-top { background: var(--cream); }
.quiz-stage .icon-btn { background: var(--cream-2); color: var(--ink); }
.quiz-main { width: min(760px, 100%); margin: 0 auto; padding: 12px 20px 60px; }
.qprog { display: flex; gap: 6px; margin: 4px 0 26px; }
.qprog i { flex: 1; height: 6px; border-radius: 6px; background: var(--line); transition: background .3s; }
.qprog i.ok { background: var(--mint); }
.qprog i.bad { background: #f3a68c; }
.qprog i.cur { background: var(--ink); }
.q-count { font-weight: 600; color: var(--ink-3); margin: 0 0 8px; }
.q-text { font: 700 clamp(24px, 3.2vw, 34px)/1.2 var(--ui); letter-spacing: -.01em; margin: 0 0 24px; }
.opts { display: grid; gap: 12px; }
.opt { display: grid; grid-template-columns: 40px 1fr 28px; align-items: center; gap: 14px; text-align: left; padding: 16px 18px;
  border-radius: 16px; border: 0; background: #fff; box-shadow: inset 0 0 0 2px var(--line); cursor: pointer; font-size: 18px;
  transition: box-shadow .2s, background .2s, transform .12s; }
.opt:hover:not([disabled]) { box-shadow: inset 0 0 0 2px var(--ink); }
.opt:active:not([disabled]) { transform: scale(.99); }
.opt .k { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-weight: 700; background: var(--cream-2); }
.opt .mark { opacity: 0; }
.opt.right { background: #e3f8ee; box-shadow: inset 0 0 0 2px var(--mint); }
.opt.right .k { background: var(--mint); color: var(--mint-ink); }
.opt.right .mark { opacity: 1; color: #0e7a4c; }
.opt.wrong { background: #fdeee8; box-shadow: inset 0 0 0 2px #f3a68c; }
.opt.wrong .k { background: #f3a68c; }
.opt[disabled] { cursor: default; }
.why { margin: 18px 0 0; padding: 16px 18px; border-radius: 16px; background: #fff; box-shadow: inset 0 0 0 1px var(--line);
  font-size: 17px; animation: rise .4s var(--ease) both; }
.why b { display: block; margin-bottom: 4px; }
.q-next { margin-top: 22px; display: flex; justify-content: flex-end; }
.result { text-align: center; padding-top: 4vh; animation: rise .6s var(--ease) both; }
.ring { width: 190px; height: 190px; margin: 0 auto 18px; position: relative; display: grid; place-items: center; }
.ring svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 12; }
.ring .bg { stroke: var(--line); }
.ring .fg { stroke: var(--mint); stroke-linecap: round; stroke-dasharray: 534; stroke-dashoffset: 534; transition: stroke-dashoffset 1.2s var(--ease); }
.ring b { font: 800 50px/1 var(--ui); letter-spacing: -.02em; }
.result h2 { font: 800 34px/1.1 var(--ui); margin: 0 0 8px; }
.result p { color: var(--ink-2); margin: 0 0 6px; }
.sync { display: inline-flex; align-items: center; gap: 8px; margin: 14px 0 26px; padding: 8px 14px; border-radius: 999px; font-weight: 600; font-size: 14.5px; }
.sync.synced { background: #e3f8ee; color: #0e5b3a; }
.sync.local { background: var(--cream-2); color: var(--ink-2); }
.sync.failed { background: #fdeae4; color: #8a2b10; }
.result .cta { justify-content: center; }

/* misc pages */
.plain { min-height: 100vh; display: grid; place-items: center; padding: 100px var(--pad) 40px; text-align: center; background: var(--night); color: #fff; }
.plain h1 { font: 800 clamp(32px, 5vw, 54px)/1.05 var(--ui); margin: 0 0 12px; letter-spacing: -.02em; }
.plain p { color: rgba(255, 255, 255, .8); max-width: 52ch; margin: 0 auto 26px; }
.plain .cta { justify-content: center; }

@media (max-width: 860px) {
  .title-body { grid-template-columns: 1fr; }
  .promo { grid-template-columns: 1fr; }
  .promo img { max-height: 240px; }
  .teacher-strip { grid-template-columns: 1fr; }
  .ctx { display: none; }
  .book-nav.prev { left: 6px; }
  .book-nav.next { right: 6px; }
  .textbox { width: 46%; }
}
@media (max-width: 560px) {
  .topnav { gap: 14px; }
  .hero { min-height: 560px; }
  .slide-art { object-position: 62% 30%; }
  .slide-shade { background: linear-gradient(0deg, rgba(14, 12, 20, .95) 0%, rgba(14, 12, 20, .6) 48%, rgba(14, 12, 20, .1) 75%); }
  .slide-copy { bottom: 64px; }
  .hero-dots { left: var(--pad); right: auto; bottom: 22px; }
  .btn { padding: 11px 16px; font-size: 16px; }
  .textbox { position: static; width: auto; margin: 10px 0 0; border-radius: 12px; }
  .book { width: 94vw; }
  .columns { column-count: 1 !important; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- teacher: class progress ---------- */
.page-class .topbar, .page-class .topbar.solid { background: var(--night); }
.class-wrap { padding: 96px var(--pad) 60px; }
.class-head { display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: end; margin-bottom: 26px; }
.class-head h1 { margin: 2px 0 6px; font: 800 clamp(30px, 4vw, 46px)/1.05 var(--ui); letter-spacing: -.02em; }
.class-head .sub { margin: 0; color: var(--ink-2); max-width: 70ch; }
.kicker-dark { margin: 0; font-weight: 700; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--coral); }
.stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 22px; }
.stat { background: #fff; border-radius: 16px; padding: 16px 18px; box-shadow: inset 0 0 0 1px var(--line); }
.stat b { display: block; font: 800 32px/1.1 var(--ui); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat span { color: var(--ink-2); font-size: 14px; }
.stat.warn { background: #fff4e8; box-shadow: inset 0 0 0 1px #f4d2b0; }
.class-wrap .note { margin: 0 0 14px; }
.empty { background: #fff; border-radius: 18px; padding: 34px; box-shadow: inset 0 0 0 1px var(--line); max-width: 680px; }
.empty h2 { margin: 0 0 8px; }
.empty p { color: var(--ink-2); margin: 0 0 18px; }
.grid-scroll { overflow-x: auto; background: #fff; border-radius: 18px; box-shadow: inset 0 0 0 1px var(--line); }
table.progress { border-collapse: collapse; width: 100%; min-width: 720px; font-size: 15px; }
.progress th, .progress td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.progress thead th { font-weight: 600; color: var(--ink-2); font-size: 13.5px; vertical-align: top; background: var(--cream); }
.progress thead a { display: grid; gap: 6px; text-decoration: none; color: var(--ink); width: 150px; }
.progress thead img { width: 150px; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 9px; }
.progress thead small { display: block; color: var(--ink-3); font-weight: 500; margin-top: 2px; }
.progress tbody th { font-weight: 600; white-space: nowrap; }
.progress tbody th em { display: block; font-style: normal; font-weight: 500; font-size: 13px; color: #b0571f; margin-left: 38px; }
.initial { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; margin-right: 10px;
  background: var(--cream-2); font-weight: 700; font-size: 13px; }
.progress tr.never th .initial { background: #fde3cf; }
.chip { display: inline-block; padding: 4px 10px; border-radius: 999px; font-weight: 700; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.chip.good { background: #dcf5e9; color: #0e5b3a; }
.chip.mid { background: #fff1c9; color: #7a5300; }
.chip.low { background: #fde3d9; color: #8a2b10; }
.chip.prog { background: #e6eefc; color: #23468f; }
.chip.none { background: var(--cream-2); color: var(--ink-3); }
.progress td small { margin-left: 6px; color: var(--ink-3); }
.mini { display: block; margin-top: 4px; color: var(--ink-3); font-size: 12.5px; }
.progress td.last { color: var(--ink-2); white-space: nowrap; }

/* ---------- deep linking picker ---------- */
.dl-wrap { padding: 28px var(--pad) 50px; }
.dl-head { display: flex; gap: 22px; align-items: center; margin-bottom: 10px; }
.logo-dark { color: var(--ink); }
.logo-dark svg { height: 26px; width: auto; }
.dl-head h1 { margin: 0; font: 800 26px/1.15 var(--ui); }
.dl-head .sub { margin: 4px 0 0; color: var(--ink-2); }
.dl-group { font-size: 19px; margin: 26px 0 12px; }
.dl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.dl-card { display: grid; grid-template-columns: 120px 1fr; gap: 14px; align-items: center; background: #fff; border-radius: 16px; padding: 10px;
  box-shadow: inset 0 0 0 1px var(--line); }
.dl-card img { width: 120px; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 10px; }
.dl-card b { display: block; }
.dl-card span { display: block; color: var(--ink-2); font-size: 13.5px; margin: 2px 0 10px; }
.dl-card .btn { padding: 8px 14px; font-size: 15px; }
@media (max-width: 860px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .class-head { grid-template-columns: 1fr; }
}
.assigned-list { margin: 0; padding-left: 20px; color: var(--ink-2); }
