/* ==========================================================================
   MonoMV project page
   ========================================================================== */

:root {
  --ink:        #14161a;
  --ink-soft:   #3d434d;
  --ink-mute:   #6b7280;
  --line:       #e3e6ea;
  --line-soft:  #eef0f3;
  --bg:         #ffffff;
  --bg-alt:     #f7f8fa;
  --accent:     #1f4fd8;
  --accent-dk:  #16389b;
  --accent-wash:#eef2fe;
  --radius:     10px;
  --wrap:       1180px;
  --wrap-narrow: 780px;
  --shadow:     0 1px 2px rgba(20,22,26,.05), 0 8px 24px rgba(20,22,26,.06);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 72px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: 24px;
}
.wrap.narrow { max-width: var(--wrap-narrow); }

/* --------------------------------------------------------------- top nav */

.topnav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,.86);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line-soft);
}
.topnav-inner {
  max-width: var(--wrap);
  margin-inline: auto;
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  font-weight: 700;
  letter-spacing: -.02em;
  font-size: 18px;
  color: var(--ink);
}
.brand:hover { text-decoration: none; color: var(--accent); }
.navlinks {
  display: flex;
  gap: 22px;
  overflow-x: auto;
  scrollbar-width: none;
}
.navlinks::-webkit-scrollbar { display: none; }
.navlinks a {
  font-size: 14.5px;
  font-weight: 500;
  color: var(--ink-mute);
  white-space: nowrap;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
}
.navlinks a:hover { color: var(--ink); text-decoration: none; border-bottom-color: var(--accent); }

/* ------------------------------------------------------------------ hero */

.hero {
  padding: 64px 0 40px;
  text-align: center;
  background:
    radial-gradient(1100px 420px at 50% -140px, var(--accent-wash), transparent 70%);
  border-bottom: 1px solid var(--line-soft);
}

.venue {
  margin: 0 0 18px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
}

.title {
  font-family: "Newsreader", Georgia, "Times New Roman", serif;
  font-weight: 500;
  font-size: clamp(28px, 4.4vw, 48px);
  line-height: 1.16;
  letter-spacing: -.015em;
  margin: 0 auto 28px;
  max-width: 26ch;
  text-wrap: balance;
}

.authors, .affils {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 18px;
  padding: 0;
  margin: 0 auto;
  max-width: 900px;
}
.authors li { font-size: 17px; font-weight: 500; color: var(--ink-soft); }
.authors a { color: var(--ink-soft); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.authors a:hover { color: var(--accent); text-decoration-color: var(--accent); }
.authors sup, .affils sup { color: var(--accent); font-weight: 600; }

.affils { margin-top: 12px; gap: 2px 22px; }
.affils li { font-size: 15.5px; color: var(--ink-mute); }

.corresponding {
  margin: 8px 0 0;
  font-size: 13.5px;
  color: var(--ink-mute);
}

/* --------------------------------------------------------------- buttons */

.buttons {
  margin-top: 32px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 10px 20px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 15px;
  font-weight: 500;
  border: 1px solid var(--ink);
  transition: transform .12s ease, background .12s ease, box-shadow .12s ease;
}
.btn:hover {
  text-decoration: none;
  background: var(--accent);
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(31,79,216,.22);
}
.btn svg {
  width: 17px; height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}
.btn svg .fill { fill: currentColor; stroke: none; }

.btn-disabled {
  background: transparent;
  color: var(--ink-mute);
  border: 1px dashed #c9ced6;
  cursor: default;
}
.btn-disabled:hover { transform: none; box-shadow: none; background: transparent; border-color: #c9ced6; color: var(--ink-mute); }
.btn-disabled em { font-style: normal; opacity: .75; font-size: 13.5px; }

/* ---------------------------------------------------------------- teaser */

.teaser { padding: 52px 0 8px; }
.teaser figure { margin: 0; }
.teaser img {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}
figcaption {
  margin-top: 18px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-soft);
  max-width: 960px;
  margin-inline: auto;
  text-align: left;
}
figcaption strong { color: var(--ink); }
.tag {
  display: inline-block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent-dk);
  background: var(--accent-wash);
  border-radius: 5px;
  padding: 1px 7px;
  margin-right: 2px;
}

/* ------------------------------------------------------------ highlights */

.highlights { padding: 44px 0 8px; }
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
}
.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 20px 18px;
  background: var(--bg);
}
.card h3 {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -.01em;
}
.card p { margin: 0; font-size: 14.5px; line-height: 1.6; color: var(--ink-soft); }

/* -------------------------------------------------------------- sections */

.section { padding: 64px 0; }
.section.alt { background: var(--bg-alt); border-block: 1px solid var(--line-soft); }

.section h2 {
  font-family: "Newsreader", Georgia, serif;
  font-weight: 500;
  font-size: clamp(26px, 3vw, 34px);
  letter-spacing: -.015em;
  margin: 0 0 14px;
}

.lede {
  margin: 0 0 28px;
  color: var(--ink-soft);
  font-size: 16px;
  max-width: 76ch;
}
.lede strong { color: var(--ink); font-weight: 600; }

.abstract {
  margin: 0;
  font-size: 17.5px;
  line-height: 1.75;
  color: var(--ink-soft);
  text-align: justify;
  hyphens: auto;
}

.keywords {
  margin: 24px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.keywords span {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-soft);
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 13px;
}
.section.alt .keywords span { background: #fff; }

/* ----------------------------------------------------------------- steps */

.steps { margin: 0; padding: 0; list-style: none; counter-reset: step; }
.steps li {
  counter-increment: step;
  position: relative;
  padding-left: 56px;
  padding-bottom: 28px;
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0; top: 2px;
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--accent-wash);
  color: var(--accent-dk);
  font-size: 15px;
  font-weight: 600;
}
.steps li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 17px; top: 44px; bottom: 10px;
  width: 1px;
  background: var(--line);
}
.steps h3 { margin: 4px 0 8px; font-size: 18px; font-weight: 600; letter-spacing: -.01em; }
.steps p { margin: 0; color: var(--ink-soft); font-size: 16px; }

/* ----------------------------------------------------------- video embed */

.embed {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}
.embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ---------------------------------------------------------------- player */

.player video {
  width: 100%;
  display: block;
  margin-inline: auto;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: #0b0c0e;
  box-shadow: var(--shadow);
}

/* Reserve the right box before metadata loads, and keep the tall 4-row RICH
   panel short enough to sit on screen next to its chapter list. */
.player[data-player="rich"] video  { aspect-ratio: 1100 / 1220; max-width: min(100%, max(68vh, 560px)); }
.player[data-player="h36m"] video  { aspect-ratio: 1400 / 758; }

.nowplaying {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 14px 0 10px;
  font-size: 14.5px;
  flex-wrap: wrap;
}
.np-label {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.np-name { font-weight: 600; color: var(--ink); }
.np-name .np-sub { font-weight: 400; color: var(--ink-mute); }

.chapters {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 8px;
  margin-top: 4px;
}
.chapters-dense { grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); }

.chapter {
  appearance: none;
  text-align: left;
  font: inherit;
  font-size: 13.5px;
  line-height: 1.35;
  padding: 9px 12px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  cursor: pointer;
  color: var(--ink-soft);
  display: flex;
  flex-direction: column;
  gap: 1px;
  transition: border-color .12s ease, background .12s ease, color .12s ease;
}
.chapter:hover { border-color: var(--accent); color: var(--ink); }
.chapter .ch-main { font-weight: 600; color: inherit; }
.chapter .ch-sub { font-size: 11.5px; color: var(--ink-mute); font-variant-numeric: tabular-nums; }
.chapter[aria-current="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.chapter[aria-current="true"] .ch-sub { color: rgba(255,255,255,.78); }

/* ---------------------------------------------------------------- bibtex */

.bibwrap { position: relative; }
.bibwrap pre {
  margin: 0;
  background: #14161a;
  color: #e6e9ef;
  border-radius: var(--radius);
  padding: 22px 22px;
  overflow-x: auto;
  font-size: 13.5px;
  line-height: 1.6;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}
.copybtn {
  position: absolute;
  top: 12px; right: 12px;
  font: inherit;
  font-size: 12.5px;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,.2);
  background: rgba(255,255,255,.08);
  color: #e6e9ef;
  cursor: pointer;
  transition: background .12s ease;
}
.copybtn:hover { background: rgba(255,255,255,.18); }

/* ---------------------------------------------------------------- footer */

.footer {
  padding: 40px 0 56px;
  border-top: 1px solid var(--line-soft);
}
.footer p {
  margin: 0;
  font-size: 13.5px;
  color: var(--ink-mute);
  text-align: center;
}

/* ---------------------------------------------------------------- mobile */

@media (max-width: 720px) {
  body { font-size: 16px; }
  .wrap { padding-inline: 18px; }
  .topnav-inner { padding-inline: 18px; }
  .hero { padding: 44px 0 32px; }
  .title { max-width: none; }
  .authors li { font-size: 15.5px; }
  .section { padding: 48px 0; }
  .abstract { text-align: left; }
  .chapters, .chapters-dense { grid-template-columns: repeat(auto-fill, minmax(142px, 1fr)); }
  .steps li { padding-left: 46px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
