/* Layout: a quiet academic page (paper, serif headings, cobalt links) opened by a dark space hero.
   Tokens first; every colour below comes from them. */
:root {
  --bg: #f7f2e7;
  --bg-art:
    radial-gradient(900px 560px at 90% -6%, rgba(242, 145, 90, 0.26), transparent 62%),
    radial-gradient(820px 700px at -8% 106%, rgba(35, 66, 196, 0.12), transparent 60%),
    linear-gradient(180deg, #faf6ec 0%, #f3ecdc 100%);
  --surface: #ffffff;
  --sunken: #efe8d9;
  --hover: #f5efe2;
  --text: #0b1020;
  --muted: #465167;
  --line: #dbd2bf;
  --accent: #2342c4;
  --accent-ink: #ffffff;
  --hot: #c2410c;
  --focus: #2342c4;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 3px 10px rgba(15, 23, 42, 0.06);
  --sky: radial-gradient(ellipse closest-side at 50% 50%, #04060d 0%, #080d1c 58%, rgba(10, 16, 36, 0.9) 72%, rgba(10, 16, 36, 0.55) 84%, rgba(10, 16, 36, 0.2) 94%, rgba(10, 16, 36, 0) 100%);
  --space: #05070d;
  --space-line: #1a2133;
  --space-text: #eef1f8;
  --space-muted: #a5afc4;
  --serif: "Source Serif 4", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --radius: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg-art:
      radial-gradient(1000px 620px at 88% -8%, rgba(242, 145, 90, 0.14), transparent 60%),
      radial-gradient(900px 720px at -6% 108%, rgba(84, 108, 255, 0.17), transparent 62%),
      radial-gradient(760px 520px at 46% 52%, rgba(76, 52, 150, 0.11), transparent 70%),
      linear-gradient(180deg, #0a0e18 0%, #0d1019 100%);
    --bg: #0c1018;
    --surface: #131925;
    --sunken: #0a0d14;
    --hover: #0f1420;
    --shadow: none;
    --text: #e8ebf2;
    --muted: #9aa5ba;
    --line: #252d3e;
    --accent: #8ba5ff;
    --accent-ink: #0c1018;
    --hot: #f2915a;
    --focus: #8ba5ff;
    --sky: none;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg-art:
    radial-gradient(1000px 620px at 88% -8%, rgba(242, 145, 90, 0.14), transparent 60%),
    radial-gradient(900px 720px at -6% 108%, rgba(84, 108, 255, 0.17), transparent 62%),
    radial-gradient(760px 520px at 46% 52%, rgba(76, 52, 150, 0.11), transparent 70%),
    linear-gradient(180deg, #0a0e18 0%, #0d1019 100%);
  --bg: #0c1018;
  --surface: #131925;
  --sunken: #0a0d14;
  --hover: #0f1420;
  --shadow: none;
  --text: #e8ebf2;
  --muted: #9aa5ba;
  --line: #252d3e;
  --accent: #8ba5ff;
  --accent-ink: #0c1018;
  --hot: #f2915a;
  --focus: #8ba5ff;
  --sky: none;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 76px; }
body {
  margin: 0;
  background-color: var(--bg);
  background-image: var(--bg-art);
  background-attachment: fixed;
  color: var(--text);
  font: 400 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; line-height: 1.2; margin: 0; text-wrap: balance; }
h2 { font-size: clamp(1.45rem, 2.4vw, 1.9rem); letter-spacing: -0.01em; }
h3 { font-size: 1.15rem; }
h4 { font-family: var(--sans); font-size: 0.78rem; font-weight: 600; letter-spacing: 0.06em; color: var(--muted); margin: 16px 0 4px; }
p { margin: 0 0 12px; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
ul, ol { margin: 0; padding: 0; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
main:focus { outline: none; }
.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ico { width: 0.8em; height: 0.8em; margin-left: 0.3em; vertical-align: -0.05em; flex: none; }
.meta { color: var(--muted); font-size: 0.92rem; }
.sub { font-family: var(--sans); font-size: 0.78rem; font-weight: 600; letter-spacing: 0.06em; color: var(--muted); margin: 20px 0 8px; }

/* skip link */
.skip { position: absolute; left: 12px; top: -60px; z-index: 50; background: var(--accent); color: var(--accent-ink); border: 0; padding: 10px 14px; border-radius: 8px; font: inherit; }
.skip:focus { top: 10px; }

/* header */
#site-header { position: sticky; top: 0; z-index: 40; background: var(--bg); border-bottom: 1px solid var(--line); }
@supports (backdrop-filter: blur(8px)) {
  #site-header { background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(10px); }
}
.bar { display: flex; align-items: center; gap: 14px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); min-width: 0; flex: none; }
.brand__logo { display: inline-flex; width: 30px; height: 30px; color: var(--text); flex: none; }
.brand__logo svg { width: 100%; height: 100%; }
.brand__text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand__text b { font-family: var(--serif); font-size: 0.95rem; font-weight: 600; line-height: 1.15; white-space: normal; max-width: 250px; }
.brand__text small { font: 500 0.7rem/1.2 var(--mono); color: var(--muted); }
.nav { display: flex; gap: 2px; margin-left: auto; }
.nav a { color: var(--muted); text-decoration: none; font-size: 0.9rem; font-weight: 500; padding: 8px 9px; border-radius: 6px; position: relative; white-space: nowrap; }
.nav a:hover { color: var(--text); }
.nav a[aria-current="page"] { color: var(--text); }
.nav a[aria-current="page"]::after { content: ""; position: absolute; left: 9px; right: 9px; bottom: 2px; height: 2px; background: var(--hot); border-radius: 2px; }
.tools { display: flex; align-items: center; gap: 8px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--surface); }
.seg button { font: 500 0.78rem/1 var(--mono); border: 0; background: transparent; color: var(--muted); padding: 8px 9px; cursor: pointer; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.iconbtn { width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 8px; cursor: pointer; padding: 0; }
.iconbtn svg { width: 20px; height: 20px; }
.menubtn { display: none; }
@media (max-width: 1200px) {
  .menubtn { display: inline-flex; }
  .nav { display: none; position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; gap: 0; padding: 8px 14px 14px; background: var(--surface); border-bottom: 1px solid var(--line); }
  body.navopen .nav { display: flex; }
  .nav a { padding: 12px 8px; font-size: 1rem; }
  .nav a[aria-current="page"]::after { left: 8px; right: auto; width: 28px; bottom: 6px; }
  .tools { margin-left: auto; }
}
@media (max-width: 520px) {
  .bar { gap: 8px; }
  .brand { flex: 1 1 auto; gap: 8px; }
  .brand__logo { width: 26px; height: 26px; }
  .brand__text small { display: none; }
  .brand__text b { font-size: 0.86rem; line-height: 1.15; white-space: normal; overflow: visible; }
  .tools { gap: 6px; flex: none; }
  .seg button { padding: 8px 7px; }
  .iconbtn { width: 34px; height: 34px; }
}

/* buttons, chips, tags */
.btn { display: inline-flex; align-items: center; gap: 8px; font: 600 0.95rem/1 var(--sans); text-decoration: none; padding: 12px 18px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; }
.btn:hover { border-color: var(--text); }
.btn--sm { padding: 8px 12px; font-size: 0.85rem; }
.btn--hot { background: var(--hot); border-color: var(--hot); color: #fff; }
.btn--hot:hover { filter: brightness(1.08); border-color: var(--hot); }
.btn--ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font: 500 0.85rem/1 var(--sans); padding: 8px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; }
.chip:hover { border-color: var(--text); }
.chip[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.tag { display: inline-block; font: 500 0.72rem/1 var(--mono); padding: 5px 8px; border-radius: 6px; background: var(--sunken); color: var(--muted); }
.tag--solid { background: var(--accent); color: var(--accent-ink); }
ul.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.pill { display: inline-flex; align-items: center; font: 600 0.78rem/1 var(--mono); padding: 6px 9px; border-radius: 6px; border: 1px solid var(--line); text-decoration: none; background: var(--surface); }
.pill:hover { border-color: var(--accent); }
.inline { font-weight: 600; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); text-decoration: underline; cursor: pointer; }

/* hero */
.hero { background: transparent; color: var(--text); border-bottom: 1px solid var(--line); }
.hero__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 640px); gap: 32px; align-items: center; padding-top: 40px; padding-bottom: 32px; }
.eyebrow { font: 500 0.78rem/1.3 var(--mono); letter-spacing: 0.04em; color: var(--hot); margin: 0 0 14px; }
.hero h1 { font-size: clamp(2.2rem, 4.6vw, 3.6rem); letter-spacing: -0.02em; color: var(--text); margin: 0 0 16px; }
.hero__lead { color: var(--muted); font-size: 1.08rem; max-width: 52ch; margin-bottom: 24px; }
.cta { display: flex; flex-wrap: wrap; gap: 10px; }
.hero__fig { margin: 0; }
.bhwrap { position: relative; aspect-ratio: 5 / 4; width: 100%; background: var(--sky); -webkit-mask-image: radial-gradient(ellipse at 50% 50%, #000 82%, transparent 100%); mask-image: radial-gradient(ellipse at 50% 50%, #000 82%, transparent 100%); }
.bhwrap canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: ns-resize; touch-action: pan-y; background: transparent; }
.bhwrap canvas.dragging { cursor: grabbing; }
.bhfallback { display: none; position: absolute; inset: 0; }
.bhwrap.no-webgl .bhfallback { display: block; background: radial-gradient(circle at 50% 50%, #000 0 13%, #ffb35a 14%, #c2451a 20%, transparent 36%), radial-gradient(ellipse 48% 9% at 50% 50%, #e8762a 0%, transparent 100%); }
.bhwrap.no-webgl canvas { display: none; }
.incl { display: flex; align-items: center; gap: 12px; color: var(--muted); font: 500 0.78rem/1 var(--mono); max-width: 360px; margin: -6px auto 12px; }
.incl input { flex: 1; accent-color: var(--hot); min-width: 0; }
.incl output { min-width: 3ch; text-align: right; color: var(--text); }
.hero figcaption { font-size: 0.82rem; color: var(--muted); max-width: 52ch; margin: 0 auto; text-align: center; }
@media (max-width: 860px) {
  .hero__grid { grid-template-columns: 1fr; padding-top: 28px; }
  .hero__fig { max-width: 460px; margin: 0 auto; width: 100%; }
}

/* stats */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin-top: 28px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.stats div { padding: 18px 20px; display: flex; flex-direction: column; gap: 2px; }
.stats div + div { border-left: 1px solid var(--line); }
.stats b { font: 600 2rem/1.1 var(--serif); font-variant-numeric: tabular-nums; }
.stats span { font-size: 0.85rem; color: var(--muted); }
@media (max-width: 700px) { .stats { grid-template-columns: 1fr 1fr; } .stats div:nth-child(3) { border-left: 0; } .stats div:nth-child(n+3) { border-top: 1px solid var(--line); } }

/* sections */
.section { padding-top: 48px; padding-bottom: 8px; }
.sechead { margin-bottom: 20px; max-width: 70ch; }
.sechead p { color: var(--muted); margin: 8px 0 0; }
.pagehead { padding: 44px 0 4px; border-bottom: 1px solid var(--line); background: var(--surface); }
@supports (background: color-mix(in srgb, white 50%, transparent)) {
  .pagehead { background: color-mix(in srgb, var(--surface) 70%, transparent); }
}
.pagehead h1 { font-size: clamp(2rem, 4vw, 2.8rem); letter-spacing: -0.02em; }
.lead { color: var(--muted); font-size: 1.1rem; max-width: 68ch; margin: 12px 0 28px; }
.card { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; color: var(--text); text-decoration: none; }
a.card:hover { border-color: var(--accent); }
.grid5 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.theme { display: flex; flex-direction: column; gap: 8px; }
.theme h3 { font-size: 1.1rem; }
.theme p { color: var(--muted); font-size: 0.92rem; margin: 0; flex: 1; }
.theme__ico { display: inline-flex; width: 44px; height: 44px; color: var(--hot); }
.theme__ico svg { width: 100%; height: 100%; }
.more { font: 600 0.82rem/1 var(--sans); color: var(--accent); margin-top: 6px; }
.tool h3 { display: flex; align-items: center; font-size: 1rem; font-family: var(--sans); font-weight: 600; margin-bottom: 4px; }
.tool p { margin: 0; color: var(--muted); font-size: 0.9rem; }

.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.split--even { gap: 40px; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.panel h2 { margin-bottom: 10px; }
.panel--row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 20px; align-items: start; }
@media (max-width: 760px) { .panel--row { grid-template-columns: 1fr; } }
.minis { display: flex; flex-direction: column; gap: 8px; }
.mini { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text); padding: 8px; border-radius: 8px; border: 1px solid transparent; }
.mini:hover { border-color: var(--line); background: var(--hover); }
.mini span:last-child { display: flex; flex-direction: column; line-height: 1.3; }
.mini small { color: var(--muted); }
.avatar { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 44px; height: 44px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent); font: 600 0.95rem/1 var(--serif); object-fit: cover; }
.avatar.sm { width: 52px; height: 52px; }
.avatar.lg { width: 84px; height: 84px; font-size: 1.6rem; }
.newscol h2 { margin-bottom: 12px; }
.news { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 10px; }
.news time { font: 500 0.75rem/1 var(--mono); color: var(--muted); }
.news h3 { margin: 6px 0; font-size: 1.05rem; }
.news p { margin: 0 0 6px; color: var(--muted); font-size: 0.93rem; }

.feature { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 28px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
@media (max-width: 760px) { .feature { grid-template-columns: 1fr; padding: 20px; } }
.feature__text h2 { margin-bottom: 8px; }
.feature__play { position: relative; display: flex; align-items: flex-end; min-height: 190px; padding: 18px; border-radius: 8px; text-decoration: none; color: var(--space-text); background: radial-gradient(120px 90px at 70% 40%, #7a2d12 0%, transparent 70%), radial-gradient(circle at 70% 40%, #000 0 14%, transparent 15%), var(--space); overflow: hidden; }
.feature__cap { display: flex; flex-direction: column; gap: 2px; position: relative; z-index: 1; }
.feature__cap small { color: var(--space-muted); font: 500 0.75rem/1.3 var(--mono); }
.feature__cap b { font: 600 1.1rem/1.25 var(--serif); }
.playglyph { position: absolute; top: 16px; right: 16px; width: 44px; height: 44px; border-radius: 50%; background: var(--hot); color: #fff; display: inline-flex; align-items: center; justify-content: center; }
.playglyph .ico { width: 18px; height: 18px; margin: 0 0 0 2px; }

.cta-band { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--hot); border-radius: var(--radius); padding: 24px 28px; }
.cta-band h2 { margin-bottom: 6px; }
.cta-band p { margin: 0; color: var(--muted); max-width: 70ch; }

/* people */
.leaders { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr)); gap: 16px; margin-top: 16px; }
.leader { display: flex; gap: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
@media (max-width: 520px) { .leader { flex-direction: column; } }
.leader h3 { font-size: 1.4rem; }
.leader__body { min-width: 0; }
.leader__body p { margin-bottom: 6px; }
.badge { display: inline-block; font: 500 0.72rem/1 var(--mono); letter-spacing: 0.03em; color: var(--muted); margin: 0 0 6px; }
.badge--hot { color: var(--hot); }
.alt { color: var(--muted); font-size: 0.88rem; }
ul.plain { list-style: none; }
ul.plain li { padding: 2px 0; font-size: 0.93rem; }
ul.plain--books li small { display: block; color: var(--muted); }
.note { color: var(--muted); font-size: 0.82rem; }
.linklist { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; }
.notice { background: var(--sunken); border: 1px dashed var(--line); border-radius: 8px; padding: 10px 14px; color: var(--muted); font-size: 0.9rem; }
.filters { display: flex; flex-wrap: wrap; gap: 16px 28px; margin-bottom: 18px; align-items: flex-end; }
.filter { display: flex; flex-direction: column; gap: 6px; }
.filter--grow { flex: 1; min-width: 220px; }
.filter__label { font: 500 0.72rem/1 var(--mono); color: var(--muted); }
.members { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 12px; }
.member { display: flex; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.member.is-template { border-style: dashed; background: transparent; }
.member.is-template .avatar { background: var(--sunken); color: var(--muted); }
.member h3 { font-size: 1.05rem; margin-bottom: 4px; }
.member.is-template h3 { color: var(--muted); }
.topic { color: var(--muted); font-size: 0.9rem; margin-bottom: 8px; }
.empty { color: var(--muted); padding: 24px 0; }

/* research */
.theme-sec { padding-top: 48px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.theme-sec__grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 40px; align-items: start; padding-bottom: 40px; }
@media (max-width: 860px) { .theme-sec__grid { grid-template-columns: 1fr; gap: 24px; } }
.theme-sec__main h2 { margin: 10px 0 14px; }
.theme-sec__main p { max-width: 62ch; }
.eqbox { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px 6px; margin-bottom: 8px; }
.eqbox .sub { margin-top: 0; }
.eq { overflow-x: auto; padding: 10px 6px; }
math { font-family: "Latin Modern Math", "STIX Two Math", "Cambria Math", "Noto Sans Math", math; font-size: 1.3rem; }
.eqnote { color: var(--muted); font-size: 0.85rem; }
.reads { list-style: none; display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.reads li { font-size: 0.88rem; color: var(--muted); padding-left: 12px; border-left: 2px solid var(--line); }
.reads i { color: var(--text); font-style: italic; }

/* publications */
.profs { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.prof .linklist { flex-direction: column; gap: 4px; margin-top: 6px; }
.search { width: 100%; font: 400 1rem/1 var(--sans); padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); }
.count { font: 500 0.78rem/1 var(--mono); color: var(--muted); margin-bottom: 8px; }
.yeargroup { margin-bottom: 20px; }
.yr { font: 600 1.5rem/1 var(--serif); font-variant-numeric: tabular-nums; padding: 12px 0 10px; border-bottom: 1px solid var(--text); }
.pubs { list-style: none; }
.pub { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 20px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.pub__title { font-size: 1.05rem; font-weight: 600; margin-bottom: 4px; }
.pub__by, .pub__venue { margin: 0; font-size: 0.9rem; color: var(--muted); }
.pub__venue { margin-top: 4px; }
.pub__side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.pub__side { flex-flow: row wrap; justify-content: flex-end; align-content: flex-start; }
.pub__tags { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; width: 100%; }
@media (max-width: 640px) { .pub { grid-template-columns: 1fr; } .pub__side, .pub__tags { justify-content: flex-start; } }

/* lectures */
.lect { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 36px; align-items: start; }
@media (max-width: 980px) { .lect { grid-template-columns: 1fr; } .lect__side { order: -1; } }
.lect__side { position: sticky; top: 84px; }
@media (max-width: 980px) { .lect__side { position: static; } }
.course { margin-bottom: 36px; }
.course h2 { margin-bottom: 6px; }
.course > p { color: var(--muted); max-width: 66ch; }
.lecs { list-style: none; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.lecs li + li { border-top: 1px solid var(--line); }
.lec { position: relative; display: grid; grid-template-columns: 52px minmax(0, 1fr) auto auto; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 12px 16px; background: transparent; border: 0; color: var(--text); text-decoration: none; font: inherit; cursor: pointer; }
.lec:hover { background: var(--hover); }
.lec[aria-current="true"] { background: var(--sunken); box-shadow: inset 3px 0 0 var(--hot); }
.lec__n { font: 600 0.85rem/1 var(--mono); color: var(--hot); }
.lec__t { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.lec__t b { font-weight: 600; }
.lec__t small { color: var(--muted); font-size: 0.82rem; line-height: 1.4; }
.lec__d { font: 500 0.78rem/1 var(--mono); color: var(--muted); white-space: nowrap; }
.lec__go { color: var(--muted); }
.player { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; text-decoration: none; color: var(--text); }
.player__frame { position: relative; display: block; aspect-ratio: 16 / 9; background: var(--space); }
.player__frame iframe, .player__frame #ytHost { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.player__frame--poster { background: radial-gradient(160px 110px at 66% 45%, #7a2d12 0%, transparent 70%), radial-gradient(circle at 66% 45%, #000 0 11%, transparent 12%), var(--space); }
.player__frame--poster .playglyph { top: 50%; left: 50%; right: auto; margin: -22px 0 0 -22px; }
.player__meta { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; }
.player__meta span { color: var(--muted); font: 500 0.78rem/1.3 var(--mono); }
.player__meta .inline { font: 600 0.9rem/1.3 var(--sans); color: var(--accent); }
.notes { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.notes li { display: flex; flex-direction: column; }
.notes small { color: var(--muted); }

/* books */
.tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.tab { font: 500 0.92rem/1 var(--sans); padding: 12px 14px; border: 0; background: transparent; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; display: inline-flex; gap: 8px; align-items: center; }
.tab span { font: 500 0.7rem/1 var(--mono); background: var(--sunken); padding: 3px 6px; border-radius: 5px; }
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { color: var(--text); border-bottom-color: var(--hot); font-weight: 600; }
.featured { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--hot); border-radius: var(--radius); padding: 22px 24px; margin-bottom: 20px; }
.featured h3 { font-size: 1.35rem; margin: 4px 0 6px; }
.featured p { max-width: 70ch; }
.booklink { display: inline; }
details summary { cursor: pointer; font-weight: 600; font-size: 0.92rem; }
.chapters { columns: 2 260px; padding-left: 24px; margin-top: 10px; font-size: 0.92rem; }
.callout { display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; align-items: center; background: var(--sunken); border-radius: var(--radius); padding: 18px 22px; margin-bottom: 20px; }
.callout h3 { font-size: 1.05rem; margin-bottom: 4px; }
.callout p { margin: 0; color: var(--muted); max-width: 60ch; }
.books { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 480px), 1fr)); gap: 12px; }
.book { display: flex; flex-direction: column; justify-content: space-between; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.book__title { font-size: 1.05rem; margin-bottom: 4px; }
.book__by { color: var(--muted); font-size: 0.88rem; margin: 0 0 6px; }
.book__note { font-size: 0.92rem; margin: 0; }
.book__badges { display: flex; flex-wrap: wrap; gap: 6px; }
.lvl { font: 500 0.7rem/1 var(--mono); padding: 5px 8px; border-radius: 6px; border: 1px solid var(--line); color: var(--muted); }
.lvl--core { border-color: var(--accent); color: var(--accent); }
.lvl--adv { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.lvl--review { border-style: dashed; }
.lvl--free { background: var(--sunken); border-color: var(--sunken); color: var(--text); }

/* start & join */
.steps { list-style: none; display: flex; flex-direction: column; }
.step { position: relative; display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 16px; padding-bottom: 28px; }
.step:not(:last-child)::before { content: ""; position: absolute; left: 21px; top: 46px; bottom: 6px; width: 2px; background: var(--line); }
.step__n { width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--hot); color: var(--hot); display: inline-flex; align-items: center; justify-content: center; font: 600 1.1rem/1 var(--serif); background: var(--bg); position: relative; z-index: 1; }
.step__body h3 { font-size: 1.3rem; margin: 6px 0 8px; }
.step__body p { max-width: 66ch; }
.steps--compact .step { padding-bottom: 20px; }
.steps--compact .step__body h3 { font-size: 1.1rem; }
.acc { border-bottom: 1px solid var(--line); padding: 4px 0; }
.acc summary { padding: 12px 0; font: 600 1.1rem/1.3 var(--serif); list-style: none; display: flex; justify-content: space-between; }
.acc summary::-webkit-details-marker { display: none; }
.acc summary::after { content: "+"; font-family: var(--mono); color: var(--hot); }
.acc[open] summary::after { content: "−"; }
.cites { list-style: none; display: flex; flex-direction: column; gap: 8px; padding: 0 0 14px; }
.cites li { display: flex; justify-content: space-between; gap: 16px; align-items: baseline; font-size: 0.92rem; color: var(--muted); }
.cites i { color: var(--text); }
.cites .pill { flex: none; }
.contactname { margin-bottom: 12px; }
.email { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-family: var(--mono); }

/* footer */
#site-footer { margin-top: 72px; background: var(--surface); border-top: 1px solid var(--line); }
.foot { padding-top: 28px; padding-bottom: 36px; color: var(--muted); font-size: 0.88rem; }
.foot p { margin: 0 0 6px; }
.foot__brand { display: flex; align-items: center; gap: 10px; color: var(--text); margin-bottom: 10px; }
.foot__brand .brand__logo { width: 24px; height: 24px; }
.foot__law { max-width: 80ch; }

@media (prefers-reduced-motion: no-preference) {
  .btn, .chip, .card, .pill, .tab, .lec { transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease; }
}
@media print {
  #site-header, .hero, #site-footer, .tools { display: none; }
}

.split > div > h2 + .steps { margin-top: 20px; }

/* in-page lecture player */
.lect--embed { grid-template-columns: minmax(0, 1fr) minmax(0, 520px); }
@media (max-width: 1100px) { .lect--embed { grid-template-columns: minmax(0, 1fr) minmax(0, 420px); gap: 28px; } }
@media (max-width: 980px) { .lect--embed { grid-template-columns: 1fr; } #playerPanel { scroll-margin-top: 76px; } }
.lec__bar { position: absolute; left: 0; bottom: 0; height: 3px; width: var(--p, 0%); background: var(--hot); opacity: 0.85; }
.lec:not(.lec--part):not(.lec--done) .lec__bar { display: none; }
.lec--done .lec__bar { display: none; }
.lec--done .lec__d::after { content: " \2713"; color: var(--accent); font-weight: 600; }
.player__resume { color: var(--hot) !important; font-weight: 600 !important; }
.player__err { color: var(--hot) !important; font: 500 0.82rem/1.4 var(--sans) !important; }
.player__err[hidden] { display: none; }
.player__meta b { font-size: 1rem; }
.auto { display: flex; gap: 8px; align-items: center; margin-top: 12px; color: var(--muted); font-size: 0.88rem; cursor: pointer; }
.auto input { accent-color: var(--hot); width: 16px; height: 16px; }

/* Uzbek tile band (img/naqsh.png) */
.band { height: 40px; background: var(--space) url("../img/naqsh.png") repeat-x center / auto 100%; border-top: 1px solid var(--space-line); border-bottom: 1px solid var(--space-line); }
#site-footer .band { margin-bottom: 0; }

/* portraits and members banner */
.avatar.lg { object-position: center 18%; }
.leader .avatar.lg { width: 96px; height: 120px; border-radius: 14px; font-size: 1.9rem; }
@media (max-width: 520px) { .leader .avatar.lg { width: 104px; height: 130px; } }

/* ---------- covers (designed tile; a real cover image, when found, is laid over it) ---------- */
.cover { --c1: #1f2f6b; --c2: #0e1636; position: relative; flex: none; display: block; width: 72px; aspect-ratio: 2 / 3; font-size: 10px; border-radius: 3px 6px 6px 3px; overflow: hidden; background: linear-gradient(155deg, var(--c1), var(--c2)); box-shadow: 0 1px 2px rgba(5,7,13,0.35), 0 6px 14px -8px rgba(5,7,13,0.55); }
.cover::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 0.5em; background: linear-gradient(90deg, rgba(0,0,0,0.28), rgba(255,255,255,0.08) 60%, transparent); z-index: 2; pointer-events: none; }
.cover--lg { width: 132px; font-size: 14.5px; }
.cover__tile { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between; gap: 0.5em; padding: 1.1em 0.9em 0.9em 1.3em; color: #f1f4fb; overflow: hidden; }
.cover__tile::after { content: ""; position: absolute; right: -1.6em; bottom: -1.6em; width: 5.6em; height: 5.6em; border-radius: 50%; border: 0.18em solid rgba(255,255,255,0.14); box-shadow: 0 0 0 0.9em rgba(255,255,255,0.05); }
.cover__tile b { font: 600 1em/1.2 var(--serif); letter-spacing: 0.005em; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.cover__tile small { font: 500 0.82em/1.25 var(--sans); opacity: 0.8; position: relative; z-index: 1; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.cover__tile i { font: normal 500 0.72em/1 var(--mono); opacity: 0.7; }
.cover:not(.cover--lg) .cover__tile small { display: none; }
.cover__img { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; object-fit: cover; background: #fff; }
.cover--gr { --c1: #2b3f9e; --c2: #101a4a; }
.cover--mech { --c1: #1d7a72; --c2: #0b3a3c; }
.cover--em { --c1: #b4691f; --c2: #55280c; }
.cover--qm { --c1: #7440b0; --c2: #2c154d; }
.cover--bh { --c1: #2a2c34; --c2: #07080c; }
.cover--bh .cover__tile b { color: #ffb184; }
.cover--math { --c1: #4b5870; --c2: #1c2433; }
.cover--vt { --c1: #a8325e; --c2: #4a1229; }
.cover--other { --c1: #5b6470; --c2: #23272e; }

/* curated books and the featured card now carry a cover */
.book { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px; align-items: start; }
.book__body { display: flex; flex-direction: column; justify-content: space-between; gap: 10px; min-width: 0; height: 100%; }
.featured { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 22px; align-items: start; }
.featured__body { min-width: 0; }
@media (max-width: 560px) { .featured { grid-template-columns: 1fr; } .cover--lg { width: 112px; font-size: 12.5px; } }

/* ---------- sign-in, account and library dialogs ---------- */
body.modal-open { overflow: hidden; }
.modal { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(5, 7, 13, 0.62); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); overflow-y: auto; }
.modal__box { position: relative; width: 100%; max-width: 460px; max-height: calc(100vh - 32px); overflow-y: auto; background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 14px; padding: 28px 28px 24px; box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.6); }
.modal__box h2 { font-size: 1.4rem; margin: 0 28px 14px 0; }
.modal__box h3 { font-size: 1.02rem; margin: 18px 0 10px; }
.modal__x { position: absolute; top: 10px; right: 10px; width: 34px; height: 34px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font: 400 1.6rem/1 var(--sans); cursor: pointer; }
.modal__x:hover { background: var(--sunken); color: var(--text); }
.mform { display: flex; flex-direction: column; gap: 14px; }
.fld { display: flex; flex-direction: column; gap: 6px; }
.fld > span:first-child { font: 600 0.82rem/1.2 var(--sans); color: var(--muted); }
.fld input, .fld select { width: 100%; font: 400 1rem/1.3 var(--sans); color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 11px 12px; }
.fld input:hover, .fld select:hover { border-color: var(--muted); }
.fld input[type=file] { padding: 9px 10px; font-size: 0.9rem; }
.pw { position: relative; display: block; }
.pw input { padding-right: 46px; }
.pw__eye { position: absolute; top: 0; right: 0; bottom: 0; width: 44px; border: 0; background: transparent; cursor: pointer; font-size: 1.05rem; line-height: 1; color: var(--muted); opacity: 0.8; }
.pw__eye[aria-pressed="true"] { opacity: 1; color: var(--hot); }
.hint { margin: -4px 0 0; font-size: 0.82rem; color: var(--muted); }
.mform__err { margin: 0; padding: 9px 12px; border-radius: 8px; background: rgba(207, 84, 32, 0.1); border: 1px solid var(--hot); color: var(--hot); font-size: 0.9rem; font-weight: 500; }
.mform__ok { margin: 0; padding: 9px 12px; border-radius: 8px; background: var(--sunken); border: 1px solid var(--accent); color: var(--accent); font-size: 0.9rem; font-weight: 500; }
.mform__err[hidden], .mform__ok[hidden] { display: none; }
.mform .btn { align-self: flex-start; }
.btn:disabled, .modal__box input:disabled { opacity: 0.6; cursor: progress; }
.mswitch { margin: 18px 0 0; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.92rem; }
.linkbtn { border: 0; background: none; padding: 0; font: inherit; font-weight: 600; color: var(--accent); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.who { margin: 0 0 4px; color: var(--muted); }
.who::first-line { color: var(--text); }
.tag { display: inline-block; vertical-align: 1px; font: 600 0.68rem/1 var(--mono); letter-spacing: 0.04em; padding: 4px 7px; border-radius: 5px; background: var(--hot); color: #fff; }
.mrow { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.btn--danger { color: var(--hot); border-color: var(--hot); background: transparent; }
.btn--danger:hover { background: var(--hot); color: #fff; border-color: var(--hot); }
.btn--danger.is-armed { background: var(--hot); color: #fff; }
.demo-note { margin: 0 0 14px; padding: 9px 12px; border-radius: 8px; border: 1px dashed var(--hot); color: var(--muted); font-size: 0.86rem; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.mlist { display: flex; flex-direction: column; margin: 0 -4px; }
.mlist__row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 10px 4px; border-top: 1px solid var(--line); }
.mlist__row:first-child { border-top: 0; }
.mlist__act { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.uplist { display: flex; flex-direction: column; gap: 8px; }
.up { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; font-size: 0.88rem; }
.up span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up b { font: 500 0.78rem/1.6 var(--mono); color: var(--muted); }
.up__bar { grid-column: 1 / -1; height: 4px; border-radius: 3px; background: var(--sunken); overflow: hidden; }
.up__bar i { display: block; height: 100%; background: var(--accent); transition: width 0.2s ease; }
.up__bar i.bad { background: var(--hot); }

/* ---------- header account button and nav lock ---------- */
.acct { position: relative; color: var(--muted); }
.acct:hover { color: var(--text); border-color: var(--text); }
.acct--on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.acct--on:hover { color: var(--accent-ink); filter: brightness(1.08); }
.acct b { font: 600 0.74rem/1 var(--mono); letter-spacing: 0.02em; }
.nav__lock { width: 11px; height: 11px; margin-left: 5px; vertical-align: -1px; opacity: 0.55; }
.nav a:hover .nav__lock, .nav a[aria-current="page"] .nav__lock { opacity: 0.9; }

/* ---------- members-only page card ---------- */
.lock { display: flex; gap: 20px; align-items: flex-start; max-width: 720px; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--hot); border-radius: var(--radius); padding: 26px 28px; }
.lock__ico { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; border-radius: 12px; background: var(--sunken); color: var(--hot); }
.lock__ico svg { width: 24px; height: 24px; }
.lock h2 { font-size: 1.3rem; margin-bottom: 8px; }
.lock p { margin: 0 0 10px; }
.lock__act { margin: 16px 0 0 !important; display: flex; flex-wrap: wrap; gap: 10px; }
@media (max-width: 560px) { .lock { flex-direction: column; padding: 22px 20px; } }

/* ---------- members' library ---------- */
.lib__intro { max-width: 70ch; margin: 0 0 14px; }
.lib__bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 0 0 6px; }
.lib__bar .search { flex: 1 1 260px; width: auto; }
.cat { font-size: 1.15rem; margin: 26px 0 12px; display: flex; align-items: baseline; gap: 8px; }
.cat small { font: 500 0.75rem/1 var(--mono); color: var(--muted); background: var(--sunken); padding: 3px 6px; border-radius: 5px; }
.libgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 12px; }
.libcard { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px; align-items: start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.cover-link { display: block; text-decoration: none; }
.libcard__body { display: flex; flex-direction: column; gap: 4px; min-width: 0; height: 100%; }
.libcard h4 { font: 600 1rem/1.3 var(--serif); margin: 0; overflow-wrap: anywhere; }
.libcard .by { margin: 0; color: var(--muted); font-size: 0.88rem; }
.libcard .muted.small { margin: 0; }
.libcard__act { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 10px; }

/* ---------- members' playlists ---------- */
.pls__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.pls__head h2 { margin: 0; }
.mls li { position: relative; }
.mls .lec { width: 100%; text-align: left; font: inherit; color: inherit; background: transparent; border: 0; cursor: pointer; padding-right: 44px; }
.mls a.lec { text-decoration: none; }
.mls .lec__n svg { width: 18px; height: 18px; display: block; }
.mls__del { position: absolute; top: 50%; right: 8px; transform: translateY(-50%); width: auto; min-width: 30px; height: 30px; padding: 0 8px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font: 500 1.2rem/1 var(--sans); cursor: pointer; }
.mls__del:hover { color: var(--hot); background: var(--sunken); }
.mls__del.is-armed { background: var(--hot); color: #fff; font-size: 0.78rem; }

/* primary actions in dialogs and the lock card; the ghost button is for dark backgrounds, so restyle it on paper */
.mform .btn[type="submit"], .lock__act .btn:first-child { background: var(--hot); border-color: var(--hot); color: #fff; }
.mform .btn[type="submit"]:hover, .lock__act .btn:first-child:hover { filter: brightness(1.08); border-color: var(--hot); }
.lock .btn--ghost, .modal .btn--ghost { background: transparent; color: var(--text); border-color: var(--line); }
.lock .btn--ghost:hover, .modal .btn--ghost:hover { border-color: var(--text); }
.libcard h4 { color: var(--text); letter-spacing: normal; text-transform: none; font-size: 1rem; }
.tab { padding-left: 11px; padding-right: 11px; font-size: 0.9rem; }
.cover:not(.cover--lg) { font-size: 9px; }
.cover:not(.cover--lg) .cover__tile { padding: 1em 0.7em 0.8em 1.2em; }
.cover__tile b { hyphens: auto; -webkit-hyphens: auto; overflow-wrap: break-word; }
/* keep text on the orange accent readable in both themes */
.btn--hot, .mform .btn[type="submit"], .lock__act .btn:first-child, .tag, .btn--danger:hover, .btn--danger.is-armed, .mls__del.is-armed { color: var(--accent-ink); }

/* Books: direct PDF actions */
.book__act { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 0; }
.featured__body .book__act { margin-top: 14px; }
.btn--pdf .ico { width: 14px; height: 14px; margin-right: 6px; vertical-align: -2px; }
.books__legal { margin: 0 0 18px; padding: 10px 14px; border-left: 3px solid var(--accent); background: var(--sunken); border-radius: 0 var(--radius) var(--radius) 0; color: var(--muted); font-size: 0.92rem; max-width: 80ch; }
.book__act .btn--ghost, .featured .btn--ghost { background: transparent; color: var(--text); border-color: var(--line); }
.book__act .btn--ghost:hover, .featured .btn--ghost:hover { border-color: var(--text); }

/* Books: PDF library / reading list switch */
.bmode { display: inline-flex; gap: 4px; padding: 4px; margin-bottom: 22px; background: var(--sunken); border: 1px solid var(--line); border-radius: 10px; }
.bmode__b { font: 600 0.95rem/1 var(--sans); padding: 11px 18px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); cursor: pointer; display: inline-flex; gap: 8px; align-items: center; }
.bmode__b span { font: 500 0.72rem/1 var(--mono); background: var(--surface); padding: 3px 7px; border-radius: 5px; }
.bmode__b[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,0.12); }
.bmode__b:focus-visible { outline: 2px solid var(--hot); outline-offset: 2px; }
.shelf { margin: 0 0 30px; }
.shelf__h { font-size: 1.1rem; margin: 0 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line); color: var(--text); letter-spacing: 0; text-transform: none; }
@media (max-width: 520px) { .bmode { display: flex; } .bmode__b { flex: 1; justify-content: center; padding: 11px 10px; } }

/* Light theme: crisp cards on a white page */
.card, .panel, .news, .feature, .cta-band, .leader, .member, .eqbox, .lecs, .player, .featured, .book, .libcard, .lock, .stats { box-shadow: var(--shadow); }
a.card:hover { box-shadow: 0 2px 4px rgba(15, 23, 42, 0.08), 0 8px 22px rgba(15, 23, 42, 0.10); }
:root[data-theme="dark"] a.card:hover { box-shadow: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) a.card:hover { box-shadow: none; } }

/* ---------- books: subject row, group and internet resources ---------- */
.books__lab { margin: 0 0 6px; font: 600 0.74rem/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.subjects.tabs { margin-bottom: 18px; }
.bmode__lab { margin: 0 0 6px; font: 600 0.74rem/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.shelf__bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.shelf__bar .shelf__h { margin: 0; padding: 0; border: 0; }
.weblinks { list-style: none; display: grid; gap: 8px; margin: 12px 0 0; padding: 0; }
.weblink { position: relative; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.weblink__a { display: flex; align-items: center; gap: 12px; justify-content: space-between; padding: 12px 46px 12px 14px; color: inherit; text-decoration: none; border-radius: var(--radius); }
.weblink__a:hover { border-color: var(--accent); background: var(--sunken); }
.weblink__t { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.weblink__t b { font-weight: 600; overflow-wrap: anywhere; }
.weblink__t small { color: var(--muted); }
.weblink__go { color: var(--muted); flex: none; }
.weblink__go svg { width: 16px; height: 16px; display: block; }
.weblink .mls__del { right: 8px; }
.shelf .libgrid { margin-top: 4px; }

/* ---------- light theme backdrop: a sheet of spacetime (drawn by js/bg.js) ---------- */
#spacetime { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; display: none; }
:root[data-spacetime] #spacetime { display: block; }
@media print { #spacetime { display: none !important; } }

/* ---------- a members' playlist shown like a course ---------- */
.mpl { margin-top: 28px; }
.mpl__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.mpl__head h3 { font-size: 1.25rem; }
.mpl__head .mls__del { position: static; transform: none; flex: none; }
.mpl > .meta { margin: 2px 0 12px; }
.mpl .lec__n { min-width: 2.2em; }
.pls > .sub { margin-top: 18px; }

/* ---------- upload progress panel (stays when the dialog is closed) ---------- */
.updock { position: fixed; right: 16px; bottom: 16px; z-index: 150; width: min(340px, calc(100vw - 32px)); padding: 12px 14px; border-radius: var(--radius); background: var(--surface); color: var(--text); border: 1px solid var(--line); box-shadow: 0 8px 28px rgba(5, 7, 13, 0.28); }
.updock__row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 0.9rem; }
.updock__row b { flex: 1; min-width: 0; font-weight: 600; }
.updock__x { border: 0; background: transparent; color: var(--muted); font: 400 1.4rem/1 var(--sans); cursor: pointer; padding: 0 4px; }
.updock__x:hover { color: var(--text); }
.updock--ok { border-color: var(--accent); }
.updock--bad { border-color: var(--hot); }

/* ---------- first lecture's cover on the home page ---------- */
.feature__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
.feature__play--cover::after { content: ""; position: absolute; inset: 0; z-index: 0; background: linear-gradient(180deg, rgba(5, 7, 13, 0.05) 30%, rgba(5, 7, 13, 0.82) 100%); }
.feature__play--cover .playglyph { z-index: 1; }

/* Russian menu words are longer: switch to the compact menu earlier so the bar never overflows */
@media (max-width: 1400px) {
  html[lang="ru"] .menubtn { display: inline-flex; }
  html[lang="ru"] .nav { display: none; position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; gap: 0; padding: 8px 14px 14px; background: var(--surface); border-bottom: 1px solid var(--line); }
  html[lang="ru"] body.navopen .nav { display: flex; }
  html[lang="ru"] .nav a { padding: 12px 8px; font-size: 1rem; }
  html[lang="ru"] .nav a[aria-current="page"]::after { left: 8px; right: auto; width: 28px; bottom: 6px; }
  html[lang="ru"] .tools { margin-left: auto; }
}
