/* Gerne: calm paper, one action colour, and the story pictures as the only decoration. */
:root {
  --bg: #F7F6F2; --surface: #FFFFFF; --sunk: #EFEDE6; --ink: #1B1D3A; --muted: #5C5E74; --line: #E2DFD5;
  --night: #1E2158; --raised: #1E2158; --cta: #1E2158; --cta-hover: #2E3380; --cta-ink: #FFFFFF;
  --sun: #F4B740; --sun-ink: #2B1E00; --sun-text: #8A5800; --note: #FFE07A; --note-ink: #3A2C05;
  --good: #13794B; --bad: #B93434;
  --shadow: 0 1px 2px rgba(22, 20, 50, .05), 0 10px 26px -16px rgba(22, 20, 50, .28);
  --shadow-lift: 0 2px 6px rgba(22, 20, 50, .06), 0 24px 44px -22px rgba(22, 20, 50, .42);
  --script: "Noto Sans";
  --font-display: "Bricolage Grotesque", var(--script), "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --font-ui: "Instrument Sans", var(--script), "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --font-read: "Literata", var(--script), Georgia, "Times New Roman", serif;
  --bar: 60px; --book: #3438A8;
  --gut-l: max(20px, env(safe-area-inset-left, 0px)); --gut-r: max(20px, env(safe-area-inset-right, 0px));
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0F1022; --surface: #181A33; --sunk: #222445; --ink: #EFEFF7; --muted: #A6A8C4; --line: #2C2E52;
    --raised: #2F3275; --cta: #F4B740; --cta-hover: #FFC960; --cta-ink: #241900; --sun-text: #F4B740; --good: #4CC48E; --bad: #FF8A8A;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 28px -16px rgba(0, 0, 0, .75);
    --shadow-lift: 0 2px 6px rgba(0, 0, 0, .3), 0 26px 46px -22px rgba(0, 0, 0, .85); color-scheme: dark;
  }
}
:root[data-theme="dark"], body[data-look="dark"] {
  --bg: #0F1022; --surface: #181A33; --sunk: #222445; --ink: #EFEFF7; --muted: #A6A8C4; --line: #2C2E52;
  --raised: #2F3275; --cta: #F4B740; --cta-hover: #FFC960; --cta-ink: #241900; --sun-text: #F4B740; --good: #4CC48E; --bad: #FF8A8A;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 28px -16px rgba(0, 0, 0, .75);
  --shadow-lift: 0 2px 6px rgba(0, 0, 0, .3), 0 26px 46px -22px rgba(0, 0, 0, .85); color-scheme: dark;
}
body[data-look="light"] {
  --bg: #F7F6F2; --surface: #FFFFFF; --sunk: #EFEDE6; --ink: #1B1D3A; --muted: #5C5E74; --line: #E2DFD5;
  --raised: #1E2158; --cta: #1E2158; --cta-hover: #2E3380; --cta-ink: #FFFFFF; --sun-text: #8A5800; --good: #13794B; --bad: #B93434;
  --shadow: 0 1px 2px rgba(22, 20, 50, .05), 0 10px 26px -16px rgba(22, 20, 50, .28);
  --shadow-lift: 0 2px 6px rgba(22, 20, 50, .06), 0 24px 44px -22px rgba(22, 20, 50, .42); color-scheme: light;
}
body[data-look="sepia"] {
  --bg: #F4ECDD; --surface: #FBF6EC; --sunk: #EADFCA; --ink: #33281A; --muted: #6A5A43; --line: #DDCFB5;
  --raised: #3B2F5E; --cta: #3B2F5E; --cta-hover: #4D3F78; --cta-ink: #FFFFFF; --sun-text: #855300; --good: #2F7044; --bad: #B23A2E;
  --shadow: 0 1px 2px rgba(60, 40, 10, .06), 0 10px 26px -16px rgba(60, 40, 10, .3);
  --shadow-lift: 0 2px 6px rgba(60, 40, 10, .07), 0 24px 44px -22px rgba(60, 40, 10, .42); color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--bar) + 24px); }
body { margin: 0; min-height: 100dvh; background: var(--bg); color: var(--ink); font: 400 16px/1.55 var(--font-ui); -webkit-font-smoothing: antialiased; overflow-x: clip; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 60; background: var(--bg); }
h1, h2, h3, p, ol, ul, dl, dd, figure { margin: 0; padding: 0; }
ol, ul { list-style: none; }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
canvas { display: block; }
svg { display: block; flex: none; }
img { max-width: 100%; }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; border-radius: 8px; }
.wrap { width: 100%; max-width: 1200px; margin-inline: auto; padding-left: var(--gut-l); padding-right: var(--gut-r); }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.eyebrow { color: var(--sun-text); font-weight: 700; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; }
.meta { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--muted); font-size: 14.5px; font-variant-numeric: tabular-nums; }

/* top bar */
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 40; background: color-mix(in oklab, var(--bg) 86%, transparent); -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid color-mix(in oklab, var(--line) 75%, transparent); }
.top-in { height: var(--bar); display: flex; align-items: center; gap: 4px; }
.logo { display: inline-flex; align-items: center; gap: 10px; font: 800 21px/1 var(--font-display); letter-spacing: -.02em; text-decoration: none; }
.logo svg { width: 32px; height: 32px; border-radius: 9px; box-shadow: 0 0 0 1px color-mix(in oklab, var(--ink) 10%, transparent); }
.logo + * { margin-inline-start: auto; } /* the logo keeps its own direction, so the free space sits on the next item */
.navlink { display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 12px; border-radius: 10px; font-weight: 600; font-size: 15px; text-decoration: none; transition: background .15s; }
.navlink:hover { background: var(--sunk); }
.navlink svg { width: 19px; height: 19px; }
.navlink b { min-width: 21px; padding: 0 6px; border-radius: 999px; background: var(--sun); color: var(--sun-ink); font-size: 12.5px; line-height: 21px; text-align: center; }
.ib { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; text-decoration: none; font-weight: 700; transition: background .15s; }
.ib:hover { background: var(--sunk); }
.ib svg { width: 22px; height: 22px; }
.lang-now { max-width: 8.5em; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

/* buttons: one action colour, one quiet style */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 50px; padding: 10px 22px; border-radius: 12px; font-weight: 700; font-size: 16px; line-height: 1.22; text-decoration: none; transition: transform .12s, background .15s, box-shadow .15s; }
.btn:active { transform: translateY(1px) scale(.99); }
.btn svg { width: 19px; height: 19px; }
.btn.sun, .btn.solid { background: var(--cta); color: var(--cta-ink); box-shadow: 0 8px 18px -10px color-mix(in oklab, var(--cta) 80%, transparent); }
.btn.sun:hover, .btn.solid:hover { background: var(--cta-hover); }
.btn.line { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn.line:hover { box-shadow: inset 0 0 0 1.5px color-mix(in oklab, var(--ink) 30%, var(--line)); }
.btn.ghost { background: var(--sunk); color: var(--ink); }
.btn.ghost:hover { background: color-mix(in oklab, var(--sunk) 86%, var(--ink)); }

/* home: a clear start for new visitors, the next chapter first for everyone else */
.hero-in { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); align-items: center; gap: clamp(28px, 5vw, 72px); padding-block: clamp(28px, 5vw, 72px) clamp(24px, 3.4vw, 44px); }
.hero-copy { display: grid; justify-items: start; gap: 18px; min-width: 0; }
.hero h1 { font: 800 clamp(36px, 4.6vw, 60px)/1.03 var(--font-display); letter-spacing: -.035em; text-wrap: balance; overflow-wrap: anywhere; }
.hero .eyebrow { margin-bottom: -8px; }
.hero-sub { max-width: 34rem; color: var(--muted); font-size: clamp(17px, 1.4vw, 19px); line-height: 1.5; }
.hero-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.hero-facts { display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--muted); font-size: 14px; font-weight: 500; }
.hero-facts li { display: inline-flex; align-items: center; gap: 6px; }
.hero-facts svg { width: 15px; height: 15px; color: var(--good); }
.hero-where { color: var(--muted); font-size: 15.5px; font-weight: 500; font-variant-numeric: tabular-nums; }
.hero-meter { width: min(100%, 24rem); height: 6px; overflow: hidden; border-radius: 99px; background: var(--sunk); }
.hero-meter i { display: block; height: 100%; border-radius: inherit; background: var(--sun); }
.hero-stats { display: flex; flex-wrap: wrap; gap: 8px 28px; width: 100%; margin-top: 4px; padding-top: 16px; border-top: 1px solid var(--line); }
.hero-stats div { display: flex; flex-direction: column-reverse; }
.hero-stats dt { color: var(--muted); font-size: 13px; }
.hero-stats dd { font: 800 22px/1.1 var(--font-display); font-variant-numeric: tabular-nums; }
.hero-demo { position: relative; min-width: 0; padding-bottom: 60px; }
.hero.is-back .hero-demo, .hero.is-static .hero-demo { padding-bottom: 0; }
.hero-stage { position: relative; display: block; aspect-ratio: 3 / 2; max-width: 100%; overflow: hidden; border-radius: 22px; background: var(--night); box-shadow: var(--shadow-lift); }
.hero-stage img { display: block; width: 100%; height: 100%; object-fit: cover; }
.hero-art { position: absolute; inset: 0; }
.hero-play { position: absolute; z-index: 3; inset-inline-end: 14px; bottom: 14px; display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--sun); color: var(--sun-ink); box-shadow: 0 8px 20px -6px rgba(10, 8, 40, .6); transition: transform .16s; }
.hero-play svg { width: 23px; height: 23px; }
a.hero-stage:hover .hero-play { transform: scale(1.08); }
/* the demo line: a real sentence from the course, tappable like in the reader */
.note-wrap { position: absolute; left: -26px; bottom: 0; z-index: 4; width: min(86%, 440px); animation: settle .6s cubic-bezier(.2, .9, .3, 1) both; }
[dir="rtl"] .note-wrap { left: auto; right: -26px; }
@keyframes settle { from { opacity: 0; transform: translateY(18px); } }
.note { padding: 14px 18px 16px; border-radius: 18px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lift), 0 0 0 1px var(--line); }
.note-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; color: var(--muted); font-weight: 600; font-size: 13px; }
.note-play { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 13px 0 10px; border-radius: 999px; background: var(--cta); color: var(--cta-ink); font-weight: 700; font-size: 13.5px; text-decoration: none; }
.note-play:hover { background: var(--cta-hover); }
.note-play svg { width: 15px; height: 15px; }
.note-line { font: 700 clamp(19px, 1.7vw, 23px)/1.2 var(--font-display); letter-spacing: -.012em; text-wrap: balance; }
.note .w { --hl: var(--sun); --hl-ink: var(--sun-ink); }
.note-tr { margin-top: 5px; color: var(--muted); font-size: 14.5px; line-height: 1.4; }
.how { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding-block: 4px 8px; }
.how li { display: flex; align-items: flex-start; gap: 12px; min-width: 0; padding: 16px 18px; border-radius: 16px; background: var(--surface); box-shadow: 0 0 0 1px var(--line); }
.how-n { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--sun); color: var(--sun-ink); font: 800 15px/1 var(--font-display); }
.how b { display: block; font-size: 15.5px; line-height: 1.3; }
.how small { display: block; margin-top: 2px; color: var(--muted); font-size: 14px; line-height: 1.35; }
/* returning visitors: one card that says where they stopped */
.hero.is-back { padding-top: clamp(16px, 2.6vw, 32px); }
.hero.is-back .hero-in { grid-template-columns: minmax(0, 11fr) minmax(0, 10fr); padding: clamp(14px, 1.8vw, 22px); border-radius: 26px; background: var(--surface); box-shadow: var(--shadow), 0 0 0 1px var(--line); }
.hero.is-back .hero-demo { order: -1; }
.hero.is-back .hero-copy { gap: 14px; padding: 6px clamp(4px, 1.4vw, 20px) 6px 0; }
[dir="rtl"] .hero.is-back .hero-copy { padding: 6px 0 6px clamp(4px, 1.4vw, 20px); }
.hero.is-back h1 { font-size: clamp(32px, 3.6vw, 48px); }
@media (max-width: 760px) {
  .hero-in, .hero.is-back .hero-in { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .hero-demo { padding-bottom: 0; }
  .note-wrap, [dir="rtl"] .note-wrap { position: relative; left: auto; right: auto; bottom: auto; width: auto; margin: -34px 12px 0; }
  .hero.is-back .hero-copy, [dir="rtl"] .hero.is-back .hero-copy { padding: 0 4px 6px; }
}
@media (max-width: 640px) {
  .how { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .how li { padding: 13px 15px; }
  .hero-cta, .hero:not(.is-back) .hero-cta .btn { width: 100%; }
  .hero.is-back .hero-cta { flex-wrap: nowrap; }
  .hero.is-back .hero-cta .sun { flex: 1; min-width: 0; }
  .hero.is-back .hero-cta .line { flex: none; padding-inline: 18px; }
  .hero.is-back .hero-stage { aspect-ratio: 16 / 9; border-radius: 18px; }
  .hero.is-back .hero-in { border-radius: 22px; padding: 10px; }
  .hero.is-back h1 { font-size: 30px; }
}

/* course */
.section { padding-block: 48px 72px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
h1.big, h2.big { font: 800 clamp(30px, 3.4vw, 42px)/1.06 var(--font-display); letter-spacing: -.025em; text-wrap: balance; }
.section-head span { color: var(--muted); font-size: 15px; }
.section.shelves { display: grid; gap: 14px; padding-block: 36px 64px; scroll-margin-top: 8px; }
.course-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 16px; }
.course-head h2 { font: 800 clamp(25px, 2.6vw, 32px)/1.1 var(--font-display); letter-spacing: -.024em; text-wrap: balance; }
.course-head span { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.lvl-tabs { position: sticky; top: calc(env(safe-area-inset-top, 0px) + var(--bar)); z-index: 30; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding-block: 8px; background: var(--bg); box-shadow: 0 0 0 100vmax var(--bg); clip-path: inset(0 -100vmax); }
.lvl-tab { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 60px; padding: 8px 14px 10px 10px; overflow: hidden; border-radius: 14px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); color: inherit; text-align: start; text-decoration: none; transition: background .16s, color .16s, box-shadow .16s; }
[dir="rtl"] .lvl-tab { padding: 8px 10px 10px 14px; }
.lvl-tab:hover { box-shadow: inset 0 0 0 1.5px color-mix(in oklab, var(--ink) 28%, var(--line)); }
.lvl-tab:is([aria-selected="true"], .is-on) { background: var(--raised); color: #fff; box-shadow: none; }
.lvl-ico { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 11px; background: var(--sunk); }
.lvl-tab:is([aria-selected="true"], .is-on) .lvl-ico { background: rgba(255, 255, 255, .14); }
.lvl-ico svg { width: 30px; height: 30px; }
.lvl-tab-txt { display: grid; min-width: 0; line-height: 1.15; }
.lvl-tab-txt b { font: 800 18px/1.1 var(--font-display); }
.lvl-tab-name { overflow: hidden; color: var(--muted); font-size: 13px; white-space: nowrap; text-overflow: ellipsis; }
.lvl-tab:is([aria-selected="true"], .is-on) .lvl-tab-name { color: rgba(255, 255, 255, .78); }
.lvl-tab-n { color: var(--muted); font-weight: 700; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.lvl-tab:is([aria-selected="true"], .is-on) .lvl-tab-n { color: #fff; }
.lvl-tab-bar { position: absolute; inset: auto 0 0; height: 3px; background: transparent; }
.lvl-tab-bar i { display: block; height: 100%; background: var(--sun); }
.lvl-panel { display: grid; gap: 14px; min-width: 0; scroll-margin-top: 92px; }
.lvl-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; padding-top: 4px; }
.lvl-name { font: 700 18px/1.25 var(--font-display); }
.lvl-goal { color: var(--muted); font-size: 14.5px; }
.lvl-ready { margin-inline-start: auto; color: var(--muted); font-size: 13.5px; font-variant-numeric: tabular-nums; }
@media (max-width: 640px) {
  .lvl-tab, [dir="rtl"] .lvl-tab { grid-template-columns: auto minmax(0, 1fr); gap: 0 7px; min-height: 56px; padding: 7px 8px 9px; }
  .lvl-ico { grid-row: span 2; width: 34px; height: 34px; }
  .lvl-ico svg { width: 25px; height: 25px; }
  .lvl-tab-name { display: none; }
  .lvl-tab-n { font-size: 12.5px; line-height: 1.15; }
  .lvl-head { display: grid; }
  .lvl-ready { margin-inline-start: 0; }
}

/* lesson cards: the scene first, then the numbered German title and the grammar */
.books { display: grid; gap: 16px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.bcard, .chap { --book-ink: color-mix(in oklab, var(--book) 62%, var(--ink)); position: relative; display: flex; flex-direction: column; min-width: 0; height: 100%; overflow: hidden; border-radius: 16px; background: var(--surface); color: inherit; text-decoration: none; box-shadow: 0 0 0 1px var(--line); transition: transform .18s, box-shadow .18s; }
.bcard:hover, .chap:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift), 0 0 0 1px var(--line); }
.bcard.is-next, .chap.is-next { box-shadow: 0 0 0 2px var(--sun), var(--shadow); }
.bcard-art, .chap-art { position: relative; display: block; overflow: hidden; background: var(--night); }
.bcard-art { aspect-ratio: 40 / 21; }
.chap-art { aspect-ratio: 16 / 10; }
.bcard-art img, .chap-art img, .chap-art .art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .45s cubic-bezier(.2, .8, .3, 1); }
.bcard:hover .bcard-art img, .chap:hover .chap-art img, .chap:hover .chap-art .art { transform: scale(1.04); }
.bcard-body, .chap-body { display: flex; flex: 1; flex-direction: column; gap: 3px; min-width: 0; padding: 12px 14px 14px; }
.bcard-body h3, .chap-body b { font: 700 17px/1.22 var(--font-display); letter-spacing: -.01em; overflow-wrap: anywhere; hyphens: auto; }
.bcard-body h3[data-no]::before, .chap-body b[data-no]::before { content: attr(data-no) ". "; }
.bcard-body p, .chap-body small { color: var(--muted); font-size: 14px; line-height: 1.34; }
.bcard-body p bdi:last-child { white-space: nowrap; } /* keeps "4 minutes" on one line */
.bcard-foot { position: absolute; inset: 0; pointer-events: none; }
.bcard .meter { position: absolute; inset: auto 0 0; height: 4px; background: rgba(14, 12, 44, .5); }
.bcard .meter i { display: block; height: 100%; background: var(--sun); }
.bcard-count, .bcard-go, .chap-st { position: absolute; top: 8px; inset-inline-end: 8px; display: inline-flex; align-items: center; gap: 4px; min-height: 26px; padding-inline: 10px; border-radius: 999px; background: rgba(14, 12, 44, .82); color: #fff; font-weight: 700; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.bcard-count svg, .chap-st svg { width: 14px; height: 14px; }
.bcard.is-done .bcard-count, .chap.is-done .chap-st { padding-inline: 6px; background: #13794B; }
.chap.is-done .chap-st span { display: none; }
.bcard-go, .chap.is-next .chap-st { background: var(--sun); color: var(--sun-ink); }
[dir="rtl"] .bcard-body h3, [dir="rtl"] .chap-body b { text-align: right; }
@media (max-width: 1000px) { .books { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) {
  .books { gap: 10px; }
  .bcard, .chap { border-radius: 14px; }
  .bcard-body, .chap-body { padding: 9px 10px 11px; }
  .bcard-body h3, .chap-body b { font-size: 15px; }
  .bcard-body p, .chap-body small { font-size: 12.5px; }
  .bcard-count, .bcard-go, .chap-st { top: 6px; inset-inline-end: 6px; min-height: 24px; padding-inline: 8px; font-size: 12px; }
}

/* footer */
.foot { margin-top: 8px; padding-block: 26px 34px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.foot-in { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 28px; }
.foot-all { display: inline-flex; align-items: center; min-height: 36px; font-weight: 600; }
.legal-links { display: flex; flex-wrap: wrap; gap: 0 4px; margin-inline: -8px; }
.legal-links a { display: inline-flex; align-items: center; min-height: 36px; padding-inline: 8px; border-radius: 8px; font-weight: 600; text-decoration: none; }
.legal-links a:hover { background: var(--sunk); color: var(--ink); }
.legal-links.in-reader { justify-content: center; margin-block: 8px 18px; color: var(--muted); font-size: 13.5px; }
.boot-image .boot-shell .hero-copy, .boot-blank .boot-shell .hero-copy, .boot-blank .boot-shell .hero-stage { visibility: hidden; }
.boot-shell .hero-demo { padding-bottom: 0; }

/* story page and end page: picture and the one next step side by side */
.s-crumbs { display: flex; flex-wrap: wrap; gap: 2px 7px; color: var(--muted); font-size: 14px; font-weight: 500; }
.s-crumbs a { color: inherit; text-decoration: none; }
.s-crumbs a:hover { color: var(--ink); text-decoration: underline; }
.s-crumbs li + li::before { content: "/"; margin-inline-end: 7px; opacity: .6; }
.bhero { --book-ink: color-mix(in oklab, var(--book) 62%, var(--ink)); padding-block: clamp(18px, 3vw, 40px) 0; }
.bhero-in { display: grid; grid-template-columns: minmax(0, 10fr) minmax(0, 11fr); align-items: center; gap: clamp(24px, 4.5vw, 64px); }
.bhero-art { position: relative; order: 2; aspect-ratio: 3 / 2; overflow: hidden; border-radius: 22px; background: var(--night); box-shadow: var(--shadow-lift); }
.bhero-art .art, .bhero-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.bhero-copy { display: grid; justify-items: start; gap: 14px; min-width: 0; }
.bhero-copy nav + small { margin-top: -10px; }
.bhero small { color: var(--muted); font-weight: 600; font-size: 14.5px; font-variant-numeric: tabular-nums; }
.bhero h1 { font: 800 clamp(38px, 5vw, 66px)/1 var(--font-display); letter-spacing: -.035em; text-wrap: balance; overflow-wrap: anywhere; }
.bhero-sub { color: var(--muted); font-family: var(--font-read); font-style: italic; font-size: clamp(17px, 1.6vw, 20px); line-height: 1.4; }
.lead { max-width: 36rem; font-family: var(--font-read); font-size: clamp(17px, 1.45vw, 19px); line-height: 1.58; text-wrap: pretty; }
.b-go { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin-top: 4px; }
.b-prog { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 14.5px; font-variant-numeric: tabular-nums; }
.b-prog svg { width: 24px; height: 24px; transform: rotate(-90deg); }
.b-prog circle { fill: none; stroke-width: 6; }
.b-prog .r0 { stroke: var(--sunk); }
.b-prog .r1 { stroke: var(--sun); stroke-linecap: round; }
.b-free { color: var(--muted); font-size: 14.5px; }
.bbody { --book-ink: color-mix(in oklab, var(--book) 62%, var(--ink)); display: grid; grid-template-columns: minmax(0, 1fr); gap: 48px; padding-block: clamp(36px, 4vw, 56px) 72px; }
h2.sub { margin-bottom: 14px; font: 800 clamp(22px, 2vw, 26px)/1.2 var(--font-display); letter-spacing: -.018em; }
.chapters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.chapters li { min-width: 0; }
.gcards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 12px; }
.gcard { --lens-ink: color-mix(in oklab, var(--lens) 62%, var(--ink)); display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 16px 18px 17px; border-radius: 16px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line), inset 0 4px 0 var(--lens); }
.gcard h3 { color: var(--lens-ink); font: 700 18px/1.2 var(--font-display); }
[dir="rtl"] .gcard h3 { text-align: right; }
.g-forms { display: flex; flex-wrap: wrap; gap: 5px; }
.g-forms span { padding: 3px 9px; border-radius: 8px; background: color-mix(in oklab, var(--lens) 14%, var(--surface)); font: 600 14.5px/1.38 var(--font-read); }
.gcard p { color: var(--muted); font-size: 14.5px; line-height: 1.45; }
.cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.score { display: flex; flex-wrap: wrap; gap: 10px 36px; }
.score div { display: flex; flex-direction: column; }
.score b { font: 800 clamp(36px, 4.4vw, 50px)/1 var(--font-display); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.score span { color: var(--muted); font-size: 14.5px; }
@media (max-width: 860px) {
  .bhero-in { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .bhero-art { order: -1; border-radius: 18px; }
  .chapters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bbody { gap: 38px; }
}
@media (max-width: 620px) {
  .chapters { gap: 10px; }
  .gcards { display: flex; gap: 10px; margin-inline: calc(var(--gut-l) * -1) calc(var(--gut-r) * -1); padding-inline: var(--gut-l) var(--gut-r); padding-block: 1px; overflow-x: auto; scroll-snap-type: x proximity; scroll-padding-inline: var(--gut-l); scrollbar-width: none; }
  .gcards::-webkit-scrollbar { display: none; }
  .gcard { flex: 0 0 min(82%, 300px); scroll-snap-align: start; }
  .b-go, .b-go .btn, .cta-row, .cta-row .btn { width: 100%; }
  .b-prog { justify-content: center; width: 100%; }
}

/* new words */
.vsec { min-width: 0; scroll-margin-top: calc(var(--bar) + 16px); }
.v-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px; margin-bottom: 14px; }
.v-head h2.sub { margin-bottom: 0; }
.v-filter { display: flex; flex-wrap: wrap; gap: 6px; }
.v-pill[data-g="der"], .vt[data-g="der"] { --g: #2563A8; }
.v-pill[data-g="die"], .vt[data-g="die"] { --g: #C2334D; }
.v-pill[data-g="das"], .vt[data-g="das"] { --g: #14794C; }
.v-pill { display: inline-flex; align-items: center; gap: 7px; min-height: 38px; padding-inline: 14px 12px; border-radius: 999px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); font-weight: 600; font-size: 14.5px; transition: background .15s, color .15s; }
.v-pill:hover { background: var(--sunk); }
.v-pill i { color: var(--muted); font-size: 13px; font-style: normal; font-variant-numeric: tabular-nums; }
.v-pill[aria-pressed="true"] { background: var(--ink); color: var(--bg); box-shadow: none; }
.v-pill[aria-pressed="true"] i { color: inherit; opacity: .8; }
.vgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.vt { --g: var(--muted); --g-ink: color-mix(in oklab, var(--g) 70%, var(--ink)); display: grid; grid-template-columns: minmax(0, 1fr) 42px; align-items: center; min-height: 68px; border-radius: 14px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); transition: background .15s, box-shadow .15s; }
.vt[hidden] { display: none; }
.vt:hover, .vt.on { background: color-mix(in oklab, var(--g) 7%, var(--surface)); box-shadow: inset 0 0 0 1.5px color-mix(in oklab, var(--g) 50%, var(--line)); }
.vt-open { align-self: stretch; min-width: 0; padding-block: 10px; padding-inline: 14px 2px; border-radius: 14px; text-align: start; }
.vt-open b { font: 700 16.5px/1.25 var(--font-display); overflow-wrap: break-word; hyphens: auto; }
.v-art { color: var(--g-ink); font-weight: 800; }
.v-mean { display: block; margin-top: 2px; color: var(--muted); font-size: 14px; line-height: 1.32; overflow-wrap: anywhere; }
.v-more { display: none; width: 100%; min-height: 46px; margin-top: 10px; border-radius: 12px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); font-weight: 700; font-size: 15px; }
.v-more:hover { background: var(--sunk); }
@media (max-width: 860px) { .vgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 620px) {
  .vgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .vt { grid-template-columns: minmax(0, 1fr) 36px; }
  .vt-open { padding-inline: 12px 0; }
  .vt-open b { font-size: 15px; }
  .vt.over { display: none; }
  .v-more:not([hidden]) { display: block; }
}
.star { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; color: var(--muted); transition: background .15s, color .15s; }
.star:hover { background: var(--sunk); }
.star svg { width: 21px; height: 21px; }
.star[aria-pressed="true"] { color: #D68F00; }
.star[aria-pressed="true"] svg path { fill: currentColor; }

/* reader: the scene stays in view, the text is the page, the player is always in reach */
.rbar { --book-ink: color-mix(in oklab, var(--book) 62%, var(--ink)); position: sticky; top: env(safe-area-inset-top, 0px); z-index: 40; background: color-mix(in oklab, var(--bg) 88%, transparent); -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid var(--line); }
.rbar-in { height: var(--bar); display: flex; align-items: center; gap: 6px; padding-left: max(8px, env(safe-area-inset-left, 0px)); padding-right: max(8px, env(safe-area-inset-right, 0px)); }
.rbar-title { min-width: 0; line-height: 1.2; }
.rbar-title b { display: block; overflow: hidden; font: 700 16px/1.2 var(--font-display); white-space: nowrap; text-overflow: ellipsis; }
.rbar-title span { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.segs { display: flex; gap: 4px; flex: 1; justify-content: center; min-width: 0; }
.segs a { display: flex; align-items: center; width: clamp(22px, 3.6vw, 44px); height: 32px; }
.segs a i { display: block; width: 100%; height: 5px; border-radius: 9px; background: var(--line); transition: background .2s, height .15s; }
.segs a:hover i { height: 8px; }
.segs a.done i { background: color-mix(in oklab, var(--sun) 60%, var(--line)); }
.segs a.here i { background: var(--sun); }
.tools { display: flex; align-items: center; gap: 4px; margin-inline-start: auto; flex: none; }
.tool { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-width: 42px; height: 40px; padding: 0 11px; border-radius: 10px; color: var(--muted); font-weight: 600; font-size: 14.5px; transition: background .15s, color .15s, box-shadow .15s; }
.tool:hover { background: var(--sunk); color: var(--ink); }
.tool svg { width: 21px; height: 21px; }
.tool[aria-pressed="true"] { background: color-mix(in oklab, var(--sun) 24%, transparent); color: var(--ink); box-shadow: inset 0 0 0 1.5px color-mix(in oklab, var(--sun) 70%, transparent); }
.tool .lbl { display: none; }
.reader { --book-ink: color-mix(in oklab, var(--book) 62%, var(--ink)); --hl: var(--sun); --hl-ink: var(--sun-ink); display: grid; grid-template-columns: minmax(0, 1fr); align-items: start; }
.stage { position: relative; z-index: 20; width: 100%; padding: 12px max(12px, env(safe-area-inset-right, 0px)) 10px max(12px, env(safe-area-inset-left, 0px)); background: var(--bg); }
.frame { position: relative; width: 100%; max-width: min(100%, calc(38svh * 1.5)); margin: 0 auto; overflow: hidden; border-radius: 18px; background: var(--night); box-shadow: var(--shadow); }
.stage .art { position: relative; width: 100%; aspect-ratio: 3 / 2; }
.page { min-width: 0; padding: 18px var(--gut-r) 20px var(--gut-l); }
.column { width: 100%; max-width: 38rem; margin-inline: auto; }
.chap-head { display: grid; gap: 3px; margin-bottom: 20px; }
.chap-head small { color: var(--sun-text); font-weight: 700; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; }
.chap-head h1 { font: 800 clamp(28px, 3vw, 40px)/1.08 var(--font-display); letter-spacing: -.026em; text-wrap: balance; }
.stage-tr { color: var(--muted); font-size: 16px; }
.lensbar { margin: -4px 0 20px; }
.lensbar[hidden] { display: none; }
.lens-chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.lens-chips::-webkit-scrollbar { display: none; }
.lens-chip { --lt: color-mix(in oklab, var(--lens) 62%, var(--ink)); display: inline-flex; flex: none; align-items: center; gap: 7px; height: 34px; padding: 0 12px 0 10px; border-radius: 999px; color: var(--muted); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); font-weight: 600; font-size: 14px; transition: background .15s, color .15s; }
.lens-chip i { width: 10px; height: 10px; border-radius: 3px; background: var(--lens); opacity: .45; }
.lens-chip[aria-pressed="true"] { background: color-mix(in oklab, var(--lens) 16%, var(--surface)); color: var(--lt); box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--lens) 40%, var(--line)); }
.lens-chip[aria-pressed="true"] i { opacity: 1; }
.lens-hint { margin-top: 8px; color: var(--muted); font-size: 14px; }
@media (max-width: 1039px) and (min-height: 600px) {
  /* on phones and tablets the scene stays pinned, so you can watch who is speaking */
  .stage { position: sticky; top: calc(var(--bar) + env(safe-area-inset-top, 0px)); }
  .stage::after { content: ""; position: absolute; inset: 100% 0 auto; height: 14px; background: linear-gradient(var(--bg), transparent); pointer-events: none; }
}

.prose { font-family: var(--font-read); font-size: var(--read, 20px); line-height: 1.75; color: var(--ink); }
.prose.sans { font-family: var(--font-ui); line-height: 1.68; }
.prose p + p { margin-top: .72em; }
.prose:not(.bi) p:first-child::first-letter { float: left; margin: .09em .1em 0 0; font: 800 3.15em/.82 var(--font-display); color: var(--book-ink); }
.s { border-radius: 6px; -webkit-box-decoration-break: clone; box-decoration-break: clone; transition: background .2s, box-shadow .2s; }
.s.now { background: color-mix(in oklab, var(--sun) 20%, transparent); box-shadow: 0 0 0 4px color-mix(in oklab, var(--sun) 20%, transparent); }
.w { border-radius: 5px; cursor: pointer; -webkit-tap-highlight-color: transparent; transition: background .12s, color .12s, box-shadow .12s; }
@media (hover: hover) { .w:hover { background: color-mix(in oklab, currentColor 12%, transparent); box-shadow: 0 0 0 2px color-mix(in oklab, currentColor 12%, transparent); } }
.w.now, .w.picked { background: var(--hl); color: var(--hl-ink); box-shadow: 0 0 0 2px var(--hl); }
.w.now .end, .w.picked .end { color: inherit; }
.en { display: none; }
.prose.bi p { display: grid; gap: .55em; }
.prose.bi p + p { margin-top: .55em; }
.prose.bi .pair { display: block; }
.prose.bi .s { display: inline; }
.prose.bi .en { display: block; margin-top: .05em; font-family: var(--font-ui); font-size: .78em; line-height: 1.45; color: var(--muted); }
.end { font-weight: inherit; }
.gm { --lt: color-mix(in oklab, var(--lens) 76%, var(--ink)); }
.gm.on { padding: 1px 2px; border-radius: 5px; background: color-mix(in oklab, var(--lens) 17%, transparent); -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.gm.on:not(.has-end) { color: var(--lt); font-weight: 600; }
.gm.on .end { color: var(--lt); font-weight: 800; }
.who { display: block; margin-bottom: 1px; color: var(--book-ink); font: 700 13.5px/1.3 var(--font-ui); letter-spacing: .01em; }
.prose.course p + p { margin-top: .62em; }
.prose.course p:first-child::first-letter { float: none; margin: 0; font: inherit; color: inherit; }
.prose.bi p .who { margin-bottom: -.35em; }
.prose[hidden], .player[hidden], .quiz[hidden], .pager[hidden], .btn[hidden] { display: none; }

/* player */
.player { position: sticky; bottom: max(12px, env(safe-area-inset-bottom, 0px)); z-index: 10; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 2px 10px; margin-top: 28px; padding: 8px 10px; border-radius: 18px; background: color-mix(in oklab, var(--surface) 94%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); box-shadow: var(--shadow-lift), 0 0 0 1px var(--line); }
.p-ctl { display: flex; align-items: center; gap: 2px; }
.pbtn { display: grid; place-items: center; width: 40px; height: 44px; border-radius: 10px; color: var(--muted); font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; transition: background .15s, color .15s; }
.pbtn:hover { background: var(--sunk); color: var(--ink); }
.pbtn svg { width: 21px; height: 21px; }
.pbtn[aria-pressed="true"] { color: var(--ink); background: color-mix(in oklab, var(--sun) 26%, transparent); }
.pplay { display: grid; place-items: center; width: 50px; height: 50px; margin-inline: 2px; border-radius: 50%; background: var(--cta); color: var(--cta-ink); transition: transform .12s, background .15s; }
.pplay:hover { background: var(--cta-hover); }
.pplay:active { transform: scale(.94); }
.pplay svg { width: 22px; height: 22px; }
.p-track { position: relative; min-width: 0; height: 44px; display: flex; align-items: center; }
.bars { display: flex; gap: 2px; width: 100%; height: 6px; }
.bars i { position: relative; display: block; flex-basis: 0; min-width: 2px; overflow: hidden; border-radius: 3px; background: var(--line); }
.bars i u { position: absolute; inset: 0; background: var(--sun); transform: scaleX(0); transform-origin: left; }
.p-track input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.p-track:has(input:focus-visible) { outline: 3px solid var(--sun); outline-offset: 1px; border-radius: 6px; }
.p-time { position: absolute; right: 0; top: 2px; color: var(--muted); font-size: 11.5px; line-height: 15px; font-variant-numeric: tabular-nums; pointer-events: none; }
.p-right { display: flex; align-items: center; gap: 2px; }

/* question after each chapter */
.quiz { margin-top: 40px; padding: 22px; border-radius: 20px; background: var(--surface); box-shadow: 0 0 0 1px var(--line); }
.quiz h2 { margin-block: 6px 16px; font: 700 clamp(21px, 2.4vw, 26px)/1.2 var(--font-display); letter-spacing: -.016em; text-wrap: balance; }
.opts { display: grid; gap: 8px; }
.opt { display: grid; grid-template-columns: 28px minmax(0, 1fr); align-items: center; gap: 12px; width: 100%; min-height: 54px; padding: 9px 14px; border-radius: 13px; background: var(--bg); box-shadow: inset 0 0 0 1px var(--line); font-weight: 600; font-size: 16.5px; text-align: start; transition: background .15s, box-shadow .15s, transform .12s; }
.opt:hover:not(:disabled) { background: var(--sunk); box-shadow: inset 0 0 0 1.5px color-mix(in oklab, var(--ink) 25%, var(--line)); }
.opt:disabled { cursor: default; }
.opt .mk { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); color: var(--muted); font: 700 13.5px/1 var(--font-display); }
.opt .mk svg { width: 17px; height: 17px; }
.opt.right { background: color-mix(in oklab, var(--good) 14%, var(--surface)); box-shadow: inset 0 0 0 1.5px var(--good); color: var(--good); }
.opt.right .mk { background: var(--good); box-shadow: none; color: var(--surface); }
.opt.wrong { background: color-mix(in oklab, var(--bad) 11%, var(--surface)); box-shadow: inset 0 0 0 1.5px var(--bad); color: var(--bad); animation: shake .32s; }
.opt.wrong .mk { background: var(--bad); box-shadow: none; color: var(--surface); }
@keyframes shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.explain { margin-top: 13px; font-family: var(--font-read); font-size: 16.5px; color: var(--muted); }
.explain b { font-family: var(--font-ui); color: var(--good); }
.explain.no b { color: var(--bad); }
.tr-q { display: block; margin-top: 2px; color: var(--muted); font-weight: 400; font-size: 14.5px; }
p.tr-q { margin: -9px 0 14px; font-size: 16px; }
[dir="rtl"] .opt span[lang="de"] { display: block; text-align: right; }
.pager { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; margin-block: 22px 26px; }
.pager .btn { min-width: 0; }
.pager .btn span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

@media (min-width: 720px) { .tool .lbl { display: inline; } }
@media (min-width: 1040px) {
  .reader { grid-template-columns: minmax(0, 46fr) minmax(0, 54fr); }
  .stage { position: sticky; top: calc(var(--bar) + env(safe-area-inset-top, 0px)); display: flex; align-items: center; justify-content: center; height: calc(100dvh - var(--bar) - env(safe-area-inset-top, 0px)); padding: 28px clamp(20px, 2.6vw, 40px); background: color-mix(in oklab, var(--book) 6%, var(--sunk)); border-inline-end: 1px solid var(--line); }
  .frame { max-width: calc((100dvh - var(--bar) - 80px) * 1.5); border-radius: 22px; box-shadow: var(--shadow-lift); }
  .page { padding-top: 44px; }
}
@media (max-width: 620px) {
  .segs { display: none; }
  .rbar-title { flex: 1; }
  .navlink span { display: none; }
  .navlink { padding: 0 10px; }
  .player { grid-template-columns: auto minmax(0, 1fr); padding: 4px 8px 6px; }
  .p-track { grid-column: 1 / -1; grid-row: 1; height: 26px; }
  .p-time { top: -1px; }
  .p-right { justify-self: end; }
  .quiz { padding: 20px 16px; }
  .lang-now { display: none; }
}

/* end page */
.flips { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); gap: 10px; }
.flip { min-height: 92px; perspective: 700px; }
.flip-in { position: relative; display: block; width: 100%; height: 100%; min-height: 92px; transform-style: preserve-3d; transition: transform .38s cubic-bezier(.3, .8, .3, 1); }
.flip[aria-pressed="true"] .flip-in { transform: rotateY(180deg); }
.flip-f { position: absolute; inset: 0; display: grid; place-items: center; padding: 8px 12px; border-radius: 14px; backface-visibility: hidden; -webkit-backface-visibility: hidden; text-align: center; font-weight: 700; background: var(--surface); box-shadow: 0 0 0 1px var(--line); }
.flip-b { transform: rotateY(180deg); background: var(--raised); color: #fff; font-weight: 600; font-size: 15px; box-shadow: none; }
.end-tap { margin: -6px 0 14px; }

/* saved words */
.saved { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.saved li { display: grid; grid-template-columns: minmax(0, 1fr) 40px; gap: 8px; padding: 16px 12px 16px 18px; border-radius: 16px; background: var(--surface); box-shadow: 0 0 0 1px var(--line); }
.saved b { font: 700 21px/1.2 var(--font-display); }
.saved .mean { display: block; color: var(--muted); }
.saved a { display: block; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); font-family: var(--font-read); font-size: 15px; line-height: 1.45; text-decoration: none; }
.saved a:hover { text-decoration: underline; }
.empty { display: grid; gap: 16px; justify-items: start; max-width: 32rem; padding: 26px; border-radius: 20px; background: var(--surface); box-shadow: 0 0 0 1px var(--line); }
.empty p { color: var(--muted); font-size: 17px; }
@media (max-width: 860px) { .saved { grid-template-columns: minmax(0, 1fr); } .section { padding-block: 36px 52px; } }

/* word card and settings */
#scrim { position: fixed; inset: 0; z-index: 70; background: rgba(14, 12, 44, .4); animation: fade .16s; }
@keyframes fade { from { opacity: 0; } }
#card, #sheet { position: fixed; z-index: 80; background: var(--surface); color: var(--ink); box-shadow: 0 0 0 1px var(--line), 0 24px 56px -14px rgba(10, 10, 50, .5); }
#card { --book-ink: color-mix(in oklab, var(--book) 62%, var(--ink)); width: min(370px, calc(100vw - 24px)); padding: 16px 16px 16px 20px; border-radius: 18px; animation: pop .15s cubic-bezier(.2, .9, .3, 1.15); }
@keyframes pop { from { opacity: 0; transform: translateY(5px) scale(.97); } }
#card.as-sheet, #sheet { left: 0; right: 0; bottom: 0; top: auto; width: 100%; max-height: 84dvh; overflow-y: auto; padding: 10px max(20px, env(safe-area-inset-right, 0px)) calc(20px + env(safe-area-inset-bottom, 0px)) max(20px, env(safe-area-inset-left, 0px)); border-radius: 22px 22px 0 0; animation: rise .22s cubic-bezier(.2, .9, .3, 1); }
@keyframes rise { from { transform: translateY(100%); } }
.grab { display: none; width: 40px; height: 5px; margin: 0 auto 10px; border-radius: 9px; background: var(--line); }
#card.as-sheet .grab, #sheet .grab { display: block; }
.c-head { display: flex; align-items: center; gap: 2px; }
.c-word { flex: 1; min-width: 0; overflow-wrap: anywhere; font: 800 28px/1.15 var(--font-display); letter-spacing: -.02em; }
.c-mean { margin-top: 2px; font-size: 18px; font-weight: 500; line-height: 1.35; }
.c-lens { --lt: color-mix(in oklab, var(--lens) 76%, var(--ink)); margin-top: 11px; padding: 9px 12px; border-radius: 11px; background: color-mix(in oklab, var(--lens) 13%, transparent); font-size: 14.5px; line-height: 1.4; }
.c-lens b { display: block; color: var(--lt); }
.c-lens span { display: block; }
.c-sent { margin-top: 12px; padding-top: 11px; border-top: 1px solid var(--line); font-family: var(--font-read); font-size: 16px; line-height: 1.45; }
.c-sent em { display: block; margin-top: 3px; color: var(--muted); font-family: var(--font-ui); font-size: 14.5px; font-style: normal; }
.c-sent mark { padding-inline: 2px; border-radius: 4px; background: color-mix(in oklab, var(--sun) 45%, transparent); color: inherit; font-weight: 600; }
.c-act { display: inline-flex; align-items: center; gap: 7px; height: 40px; margin-top: 12px; padding: 0 14px 0 12px; border-radius: 10px; background: var(--sunk); font-weight: 600; font-size: 14.5px; }
.c-act:hover { background: color-mix(in oklab, var(--sunk) 86%, var(--ink)); }
.c-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.c-acts .c-act { margin-top: 0; text-decoration: none; }
.c-acts a.c-act { padding-inline: 14px; }
.c-act svg { width: 17px; height: 17px; }
#sheet { --book-ink: var(--ink); }
#sheet h2 { margin: 0; font: 700 22px/1.2 var(--font-display); }
.set { display: grid; gap: 7px; margin-bottom: 16px; }
.set > label, .set > span { color: var(--muted); font-size: 14px; font-weight: 600; }
.set-row { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 52px; margin: 14px 0 16px; padding: 0 12px 0 14px; border-radius: 12px; background: var(--sunk); font-weight: 600; text-align: start; transition: background .15s; }
.set-row:hover { background: color-mix(in oklab, var(--sunk) 86%, var(--ink)); }
.set-row svg { width: 20px; height: 20px; }
.set-row b { margin-inline-start: auto; color: var(--muted); font-weight: 600; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 3px; padding: 3px; border-radius: 12px; background: var(--sunk); }
.seg button { min-height: 40px; padding: 0 6px; border-radius: 9px; font-weight: 600; font-size: 14.5px; }
.seg button[aria-pressed="true"] { background: var(--surface); box-shadow: 0 1px 3px rgba(10, 10, 50, .22); }
.sizer { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; align-items: center; gap: 8px; }
.sizer button { height: 40px; border-radius: 10px; background: var(--sunk); font-family: var(--font-read); font-weight: 600; }
.sizer input { width: 100%; accent-color: var(--ink); }
@media (hover: none) { .keys { display: none; } }
.keys { margin-top: 2px; color: var(--muted); font-size: 13.5px; }
.keys kbd { padding: 1px 6px; border-radius: 5px; background: var(--sunk); font: 600 12px var(--font-ui); }
#sheet.langs { max-height: min(86dvh, 720px); overflow-y: auto; }
.lang-sub { margin-block: 4px 12px; color: var(--muted); font-size: 14.5px; }
#lang-search { width: 100%; height: 46px; margin-bottom: 12px; padding: 0 14px; border: 0; border-radius: 12px; background: var(--sunk); color: var(--ink); font: 500 16px var(--font-ui); }
#lang-search::placeholder { color: var(--muted); }
.lang-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.lang-opt { position: relative; display: flex; flex-direction: column; align-items: flex-start; min-height: 58px; padding: 8px 34px 8px 12px; border-radius: 12px; background: var(--sunk); text-align: start; transition: background .15s, transform .12s; }
[dir="rtl"] .lang-opt { padding: 8px 12px 8px 34px; }
.lang-opt[hidden] { display: none; }
.lang-opt:hover { background: color-mix(in oklab, var(--sunk) 84%, var(--ink)); }
.lang-opt:active { transform: scale(.98); }
.lang-opt b { font-size: 16.5px; line-height: 1.3; }
.lang-opt span { color: var(--muted); font-size: 13px; }
.lang-opt svg { position: absolute; top: 50%; inset-inline-end: 10px; width: 19px; height: 19px; margin-top: -9.5px; color: var(--good); }
.lang-opt[aria-selected="true"] { background: color-mix(in oklab, var(--sun) 30%, var(--surface)); }
.lang-opt[aria-selected="true"] span { color: color-mix(in oklab, var(--muted) 55%, var(--ink)); }
.lang-none { padding-block: 16px; color: var(--muted); text-align: center; }
@media (min-width: 720px) {
  #sheet { left: auto; right: auto; inset-inline-end: max(14px, env(safe-area-inset-right, 0px)); top: calc(var(--bar) + 8px); bottom: auto; width: 360px; padding: 18px 20px; border-radius: 18px; animation: pop .15s; }
  #sheet.langs { width: 480px; }
}

/* pictures */
.art { overflow: hidden; background: var(--night); }
.art canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.hero-art.art { background: transparent; }
.art.is-live .art-flat { visibility: hidden; }
.stage-gl { z-index: 1; animation: fade .5s; }
.rise { animation: rise-in .6s cubic-bezier(.2, .8, .2, 1) var(--rise-delay, 0ms) backwards; }
@keyframes rise-in { from { opacity: .3; transform: translateY(16px); } }

/* moving between pages: a short cross-fade */
::view-transition-old(root) { animation: vt-out .14s ease-in both; }
::view-transition-new(root) { animation: vt-in .26s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: translateY(10px); } }
.burst { position: fixed; inset: 0; z-index: 95; width: 100%; height: 100%; pointer-events: none; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
  .bcard:hover, .chap:hover, .bcard:hover .bcard-art img, .chap:hover .chap-art img, .chap:hover .chap-art .art { transform: none; }
}

/* languages */
:root[data-script="arab"] { --script: "Vazirmatn"; }
:root[data-script="cyrl"] { --script: "Onest"; }
:root[data-script="deva"] { --script: "Noto Sans Devanagari"; }
:root[data-script="hans"] { --script: "Noto Sans SC", "PingFang SC", "Microsoft YaHei"; }
:root[data-script="arab"] *, :root[data-script="deva"] * { letter-spacing: 0 !important; }
:root[data-script="arab"] :is(.eyebrow, .chap-head small), :root[data-script="deva"] :is(.eyebrow, .chap-head small), :root[data-script="hans"] :is(.eyebrow, .chap-head small) { text-transform: none; font-size: 15px; }
:root[data-script="arab"] body { line-height: 1.75; }
:root[data-script="arab"] .hero h1, :root[data-script="deva"] .hero h1, :root[data-script="hans"] .hero h1 { line-height: 1.32; }
:root[data-script="arab"] .en, :root[data-script="arab"] .c-sent em, :root[data-script="arab"] .tr-q { line-height: 1.8; font-size: .86em; }
[dir="rtl"] svg.dir { transform: scaleX(-1); }
[dir="rtl"] .chap-head, [dir="rtl"] .bhero-copy { text-align: right; }
[dir="rtl"] .chap-head h1, [dir="rtl"] .bhero h1, [dir="rtl"] .rbar-title b { text-align: right; }
