/* ============================================================
   Q-GeoMem project page
   Design tokens, layout, components, interactive-demo styling.
   ============================================================ */

:root {
  /* Brand + accents (aligned with the paper figures) */
  --brand: #0071bc;
  --brand-2: #6d5ef6;
  --rel: #e8590c;      /* question relevance (orange) */
  --rel-soft: #fb923c;
  --nov: #0e9488;      /* memory novelty (teal)        */
  --nov-soft: #2dd4bf;
  --util: #8b5cf6;     /* evidence utility (violet)    */
  --evict: #ef4444;    /* eviction (red)               */

  /* Neutral surfaces */
  --bg: #ffffff;
  --bg-tint: #f6f8fc;
  --surface: #ffffff;
  --surface-2: #f3f5fa;
  --border: #e6e9f2;
  --border-strong: #d3d9e6;

  --text: #0e1320;
  --text-soft: #43506b;
  --text-mut: #7785a0;

  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05), 0 1px 3px rgba(16, 24, 40, 0.06);
  --shadow-md: 0 8px 24px rgba(16, 24, 40, 0.08);
  --shadow-lg: 0 24px 60px rgba(16, 24, 40, 0.12);

  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 24px;

  --maxw: 1120px;
  --maxw-narrow: 820px;

  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ------------------------- base ------------------------- */
* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

h1, h2, h3 { line-height: 1.15; letter-spacing: 0; margin: 0; }

code {
  font-family: var(--mono);
  font-size: 0.86em;
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 0.05em 0.4em;
  border-radius: 6px;
  color: var(--text-soft);
}

sup { font-size: 0.62em; font-weight: 600; }

.container {
  width: min(100% - 40px, var(--maxw));
  margin-inline: auto;
}
.container--narrow { width: min(100% - 40px, var(--maxw-narrow)); }

.grad-text {
  background: linear-gradient(100deg, var(--brand), var(--brand-2) 60%, var(--rel));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ------------------------- navbar ------------------------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: saturate(1.6) blur(14px);
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease);
}
.nav.is-scrolled { border-bottom-color: var(--border); box-shadow: var(--shadow-sm); }

.nav__inner {
  width: min(100% - 40px, var(--maxw));
  margin-inline: auto;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 20px;
}
.nav__brand { display: flex; align-items: center; gap: 8px; }
.nav__mark {
  width: 34px;
  height: 34px;
  object-fit: contain;
  flex: 0 0 auto;
}
.nav__logo {
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: 0;
  background: linear-gradient(100deg, var(--brand), var(--brand-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.nav__links {
  display: flex;
  gap: 4px;
  margin-left: auto;
}
.nav__links a {
  color: var(--text-soft);
  font-weight: 500;
  font-size: 0.92rem;
  padding: 8px 12px;
  border-radius: 999px;
  transition: color 0.2s, background 0.2s;
}
.nav__links a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
/* ------------------------- hero ------------------------- */
.hero { position: relative; overflow: hidden; padding-top: 56px; background: #fff; }

.hero__content { text-align: center; padding-bottom: 8px; }

.hero__title {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}
.hero__brandline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
}
.hero__logo {
  width: clamp(96px, 11vw, 148px);
  height: clamp(96px, 11vw, 148px);
  object-fit: contain;
  flex: 0 0 auto;
}
.hero__model {
  font-size: 4.25rem;
  font-weight: 900;
  letter-spacing: 0;
  background: linear-gradient(110deg, var(--brand), var(--brand-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero__subtitle {
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--text);
  max-width: none;
  white-space: nowrap;
}

.authors {
  list-style: none;
  display: flex; flex-wrap: wrap;
  justify-content: center;
  gap: 4px 18px;
  padding: 0; margin: 28px auto 10px;
  font-size: 1.02rem;
  font-weight: 600;
}
.authors li { white-space: nowrap; }
.authors a { color: var(--text); }
.authors sup { color: var(--brand); font-weight: 700; }

.affils {
  list-style: none; padding: 0; margin: 6px auto 0;
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 2px 16px;
  font-size: 0.9rem; color: var(--text-mut);
}
.affils sup { color: var(--text-soft); }
.contrib-note { font-size: 0.82rem; color: var(--text-mut); margin: 6px 0 0; }

.cta-row { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 30px; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 600; font-size: 0.95rem;
  padding: 11px 20px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: transform 0.2s var(--ease), box-shadow 0.2s, border-color 0.2s, background 0.2s;
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); text-decoration: none; border-color: var(--brand); }
.btn svg { opacity: 0.85; }
.btn--primary {
  background: linear-gradient(110deg, var(--brand), var(--brand-2));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 8px 20px color-mix(in srgb, var(--brand) 35%, transparent);
}
.btn--primary:hover { box-shadow: 0 12px 28px color-mix(in srgb, var(--brand) 45%, transparent); border-color: transparent; }

.hero__teaser { margin-top: 48px; padding-bottom: 20px; }

/* ------------------------- figures ------------------------- */
.figure-card {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px;
  box-shadow: var(--shadow-lg);
}
.figure-card img { width: 100%; display: block; border-radius: var(--radius); }
.figure-card figcaption {
  font-size: 0.9rem; color: var(--text-soft);
  padding: 14px 12px 6px; line-height: 1.55;
}
.figure-card--wide { max-width: 1000px; margin-inline: auto; }

/* ------------------------- sections ------------------------- */
.section { padding: 84px 0; }
.section--tint { background: var(--bg-tint); }
.section__title { font-size: clamp(1.7rem, 3.6vw, 2.5rem); font-weight: 800; }

.section__head { text-align: center; max-width: 760px; margin: 0 auto 48px; }
.eyebrow {
  display: inline-block;
  font-size: 0.8rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--brand);
  margin-bottom: 12px;
}
.section__lead { color: var(--text-soft); font-size: 1.08rem; margin-top: 14px; }

.abstract { font-size: 1.12rem; color: var(--text-soft); margin-top: 22px; }
.abstract strong { color: var(--text); }

.tag { font-weight: 700; }
.tag--rel { color: var(--rel); }
.tag--nov { color: var(--nov); }

/* ------------------------- contribution cards ------------------------- */
.cards-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s var(--ease), box-shadow 0.25s, border-color 0.25s;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.card h3 { font-size: 1.18rem; margin-bottom: 8px; }
.card p { color: var(--text-soft); font-size: 0.96rem; margin: 0; }
.card__icon {
  width: 48px; height: 48px; border-radius: 13px;
  display: grid; place-items: center;
  margin-bottom: 16px; color: #fff;
}
.card__icon[data-variant="blue"]   { background: linear-gradient(135deg, var(--brand), #3b82f6); }
.card__icon[data-variant="violet"] { background: linear-gradient(135deg, var(--brand-2), #a78bfa); }
.card__icon[data-variant="orange"] { background: linear-gradient(135deg, var(--rel), var(--rel-soft)); }

/* ------------------------- demo shell ------------------------- */
@media (min-width: 1180px) {
  #demo > .container {
    width: min(100% - 64px, 1500px);
  }
}

.demo-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 30px;
  box-shadow: var(--shadow-md);
  margin-bottom: 30px;
}
.demo-card__head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 24px;
  margin-bottom: 22px;
}
.demo-card__title { font-size: 1.4rem; font-weight: 800; display: flex; align-items: center; gap: 12px; }
.demo-card__num {
  font-family: var(--mono);
  font-size: 0.95rem; font-weight: 600;
  color: var(--brand);
  background: color-mix(in srgb, var(--brand) 12%, transparent);
  padding: 4px 9px; border-radius: 8px;
}
.demo-card__desc { color: var(--text-soft); font-size: 0.97rem; margin: 8px 0 0; max-width: 70ch; }

.switch-inline {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.85rem; color: var(--text-soft); cursor: pointer; white-space: nowrap;
  user-select: none;
}
.switch-inline input { accent-color: var(--brand); width: 16px; height: 16px; }

/* question chips */
.question-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.question-chips { margin-bottom: 14px; }
.qchip {
  font-size: 0.92rem; font-weight: 600;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-soft);
  cursor: pointer;
  transition: all 0.22s var(--ease);
}
.qchip:hover { border-color: var(--rel); color: var(--rel); transform: translateY(-1px); }
.qchip.is-active {
  background: linear-gradient(110deg, var(--rel), var(--rel-soft));
  border-color: transparent; color: #fff;
  box-shadow: 0 6px 16px color-mix(in srgb, var(--rel) 35%, transparent);
}

.active-question-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  gap: 12px;
  margin-bottom: 18px;
}
.active-question {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: start;
  gap: 10px 14px;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--rel) 5%, var(--surface-2));
}
.active-question__label {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--rel);
  text-transform: uppercase;
  letter-spacing: 0;
}
.active-question__text {
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.45;
}
.active-question__answer {
  color: var(--text-soft);
  font-size: 0.9rem;
  font-weight: 700;
  white-space: nowrap;
}
.switch-inline--question {
  justify-content: center;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.rel-main {
  display: grid;
  gap: 22px;
}
.rel-main--compact-media {
  --rel-video-width: 310px;
  --rel-video-mobile-width: 260px;
  --rel-video-column: 310px;
}
.rel-main + .rel-main {
  margin-top: 30px;
  padding-top: 30px;
  border-top: 1px solid var(--border);
}
.rel-workspace {
  min-width: 0;
}

.rel-video {
  display: grid;
  place-items: center;
  margin: 2px 0 0;
}
.rel-video video {
  width: min(100%, var(--rel-video-width, 340px));
  aspect-ratio: var(--video-aspect, 3 / 4);
  object-fit: cover;
  display: block;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: #000;
  box-shadow: var(--shadow-sm);
}

@media (min-width: 1180px) {
  .rel-main {
    grid-template-columns: var(--rel-video-column, 340px) minmax(0, 1fr);
    align-items: center;
  }
  .rel-video {
    position: sticky;
    top: 92px;
  }
}

/* relevance plot */
.rel-plot {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 18px 12px;
  background: var(--surface-2);
}
.rel-plot__title {
  text-align: center;
  color: var(--text-soft);
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.45;
  margin-bottom: 8px;
}
.rel-svg { width: 100%; height: 280px; display: block; overflow: visible; }

.frame-strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 5px;
  margin-top: 26px;
}

.frame-thumb {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  background:
    linear-gradient(135deg,
      color-mix(in srgb, var(--brand) 18%, var(--surface)),
      color-mix(in srgb, var(--brand-2) 22%, var(--surface)));
  display: grid; place-items: center;
  transition: transform 0.2s var(--ease), box-shadow 0.2s, outline-color 0.2s;
  outline: 2px solid transparent;
  cursor: zoom-in;
}
.frame-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.frame-thumb:focus-visible { outline-color: var(--brand); box-shadow: var(--shadow-md); }
.frame-thumb__id {
  font-family: var(--mono);
  font-size: 0.72rem; font-weight: 600;
  color: var(--text-soft);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  padding: 1px 6px; border-radius: 5px;
  position: absolute; bottom: 4px; left: 4px;
}
.frame-thumb.is-hot { outline-color: var(--rel); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.rel-plot .frame-thumb {
  aspect-ratio: 3 / 4;
  border-radius: 6px;
  overflow: visible;
}
.rel-plot .frame-thumb.is-hot {
  transform: none;
  outline-color: var(--rel);
  box-shadow: var(--shadow-md);
}
.rel-plot .frame-thumb:hover { box-shadow: var(--shadow-md); }
.rel-plot .frame-thumb img {
  border-radius: 6px;
  object-fit: cover;
}
.rel-main--compact-media .rel-plot .frame-thumb {
  transform: scale(0.94);
}
.rel-main--compact-media .rel-plot .frame-thumb.is-hot {
  transform: scale(0.94);
}
.rel-plot .frame-thumb__id {
  font-size: 0.64rem;
  line-height: 1;
  padding: 0;
  background: transparent;
  color: var(--text-soft);
  bottom: auto;
  left: 50%;
  top: -16px;
  transform: translateX(-50%);
}

.top-evidence {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.top-evidence__head {
  text-align: center;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 800;
  margin-bottom: 12px;
}
.top-evidence__sets {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: flex-start;
  gap: 18px;
}
.top-evidence__set {
  min-width: 0;
}
.top-evidence__set-title {
  color: var(--text-soft);
  font-size: 0.78rem;
  font-weight: 800;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0;
}
.top-evidence__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  justify-content: stretch;
}
.top-frame {
  margin: 0;
  min-width: 0;
  cursor: zoom-in;
}
.top-frame img,
.top-frame__placeholder {
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 7px;
  border: 1px solid var(--border-strong);
  object-fit: cover;
  display: block;
  box-shadow: var(--shadow-sm);
}
.top-frame:hover img,
.top-frame:hover .top-frame__placeholder,
.top-frame:focus-visible img,
.top-frame:focus-visible .top-frame__placeholder {
  outline: 2px solid var(--rel);
  outline-offset: 2px;
}
.top-frame:focus-visible { outline: none; }
.top-frame__placeholder {
  height: auto;
}
.top-frame__meta {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 5px;
  font-family: var(--mono);
  font-size: 0.64rem;
  line-height: 1.25;
  color: var(--text-soft);
  white-space: normal;
}
.top-frame__meta span {
  min-width: 0;
}

.frame-preview {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: color-mix(in srgb, var(--text) 68%, transparent);
}
.frame-preview[hidden] { display: none; }
.frame-preview__dialog {
  position: relative;
  display: grid;
  gap: 10px;
  justify-items: center;
  max-width: min(88vw, 560px);
}
.frame-preview__img {
  height: min(82vh, 760px);
  width: auto;
  max-width: min(88vw, 560px);
  max-height: 82vh;
  aspect-ratio: 3 / 4;
  object-fit: contain;
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}
.frame-preview__label {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--surface);
  background: color-mix(in srgb, var(--text) 64%, transparent);
  border: 1px solid color-mix(in srgb, var(--surface) 24%, transparent);
  border-radius: 999px;
  padding: 5px 10px;
}
.frame-preview__close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--surface) 40%, transparent);
  background: color-mix(in srgb, var(--text) 58%, transparent);
  color: var(--surface);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.frame-preview__close:hover,
.frame-preview__close:focus-visible {
  background: color-mix(in srgb, var(--text) 78%, transparent);
  outline: none;
}
.has-frame-preview { overflow: hidden; }

.demo-legend {
  display: flex; gap: 18px; flex-wrap: wrap;
  margin-top: 16px; font-size: 0.85rem; color: var(--text-soft);
}
.demo-legend--col { flex-direction: column; gap: 8px; margin-top: 14px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: baseline; }
.dot--rel { background: var(--rel); }
.dot--nov { background: var(--nov); }
.dot--util { background: var(--util); }
.dot--evict { background: var(--evict); }

/* ------------------------- novelty / eviction module ------------------------- */
.player { display: inline-flex; align-items: flex-start; gap: 10px; }
.player__control {
  display: grid;
  justify-items: center;
  gap: 4px;
  min-width: 44px;
}
.player__control span {
  font-family: var(--mono);
  font-size: 0.62rem;
  line-height: 1;
  color: var(--text-mut);
  text-transform: uppercase;
  white-space: nowrap;
}
.player__btn {
  width: 40px; height: 40px; border-radius: 11px;
  display: grid; place-items: center;
  border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text);
  cursor: pointer;
  transition: transform 0.18s, border-color 0.2s, color 0.2s, background 0.2s;
}
.player__btn:hover { border-color: var(--nov); color: var(--nov); transform: translateY(-1px); }
.player__btn:disabled { opacity: 0.4; cursor: not-allowed; }
.ic-pause { display: none; }
.player.is-playing #nvPlay .ic-play { display: none; }
.player.is-playing #nvPlay .ic-pause { display: block; }

.nv-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 24px; align-items: start; }
.nv-left { display: flex; flex-direction: column; gap: 16px; }

.nv-incoming {
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 14px;
  background: var(--surface-2);
}
.nv-incoming__label { font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-mut); font-weight: 700; margin-bottom: 10px; }
.nv-incoming__body { display: flex; align-items: center; gap: 16px; min-height: 92px; }
.nv-incoming .hint { color: var(--text-mut); font-size: 0.92rem; }

.incoming-thumb { width: 92px; aspect-ratio: 3/4; flex-shrink: 0; }
.incoming-metrics { display: flex; flex-direction: column; gap: 7px; flex: 1; }
.metric { display: flex; align-items: center; gap: 10px; font-size: 0.85rem; }
.metric__name { width: 92px; color: var(--text-soft); font-weight: 600; }
.metric__bar { flex: 1; height: 8px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); overflow: hidden; }
.metric__fill { display: block; height: 100%; border-radius: 999px; width: 0; transition: width 0.5s var(--ease); }
.metric__fill--rel { background: var(--rel); }
.metric__fill--nov { background: var(--nov); }
.metric__fill--util { background: var(--util); }
.metric__val { width: 42px; text-align: right; font-family: var(--mono); font-size: 0.8rem; color: var(--text); }

.nv-bank {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  background: var(--surface-2);
}
.nv-bank__head { display: flex; justify-content: space-between; align-items: center; font-size: 0.85rem; font-weight: 700; color: var(--text-soft); margin-bottom: 6px; gap: 10px; }
.nv-bank__cap { font-weight: 500; color: var(--text-mut); }
.nv-bank__note { color: var(--text-mut); font-size: 0.76rem; margin-bottom: 10px; }
.nv-bank__slots {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}
.slot {
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 5px;
  display: flex; flex-direction: column; gap: 6px;
  transition: transform 0.3s var(--ease), box-shadow 0.3s, border-color 0.3s, opacity 0.3s;
}
.slot.is-empty { border-style: dashed; opacity: 0.55; min-height: 96px; }
.slot.is-new { border-color: var(--nov); box-shadow: 0 0 0 3px color-mix(in srgb, var(--nov) 22%, transparent); }
.slot.is-evicting { border-color: var(--evict); box-shadow: 0 0 0 3px color-mix(in srgb, var(--evict) 25%, transparent); }
.slot__util { font-family: var(--mono); font-size: 0.66rem; color: var(--util); font-weight: 600; text-align: center; }
.slot .frame-thumb { aspect-ratio: 3/4; }

.nv-status {
  min-height: 44px;
  font-size: 0.9rem;
  color: var(--text-soft);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
}
.nv-status .pill {
  font-size: 0.74rem; font-weight: 700; padding: 2px 9px; border-radius: 999px; white-space: nowrap;
}
.pill--write { background: color-mix(in srgb, var(--nov) 16%, transparent); color: var(--nov); }
.pill--skip  { background: color-mix(in srgb, var(--text-mut) 18%, transparent); color: var(--text-soft); }
.pill--evict { background: color-mix(in srgb, var(--evict) 16%, transparent); color: var(--evict); }

.nv-right {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  background: var(--surface-2);
  display: flex; flex-direction: column;
  align-self: start;
}
.nv-right__head { font-size: 0.85rem; font-weight: 700; color: var(--text-soft); margin-bottom: 6px; }
.nv-svg { width: 100%; height: 280px; flex: none; min-height: 0; display: block; overflow: visible; }

.demo-note {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.86rem; color: var(--text-mut);
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 16px;
}
.demo-note svg { flex-shrink: 0; color: var(--brand); }

/* ------------------------- method steps ------------------------- */
.method-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-top: 36px; }
.method-step {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}
.method-step h3 { font-size: 1.12rem; margin: 12px 0 8px; }
.method-step p { color: var(--text-soft); font-size: 0.94rem; margin: 0; }
.method-step__tag {
  display: inline-block; font-family: var(--mono); font-weight: 600; font-size: 0.78rem;
  padding: 4px 10px; border-radius: 8px; color: #fff;
}
.method-step__tag[data-variant="green"]  { background: linear-gradient(135deg, var(--nov), var(--nov-soft)); }
.method-step__tag[data-variant="blue"]   { background: linear-gradient(135deg, var(--brand), #3b82f6); }
.method-step__tag[data-variant="violet"] { background: linear-gradient(135deg, var(--util), #a78bfa); }

/* ------------------------- stats + tables ------------------------- */
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 44px; }
.stat {
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 16px;
  box-shadow: var(--shadow-sm);
}
.stat__num {
  font-size: 2.3rem; font-weight: 900; letter-spacing: 0;
  background: linear-gradient(120deg, var(--brand), var(--brand-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.stat__label { font-size: 0.9rem; font-weight: 600; color: var(--text); margin-top: 4px; }
.stat__delta { font-size: 0.8rem; color: var(--nov); font-weight: 600; margin-top: 4px; }

.table-title { font-size: 1.2rem; font-weight: 700; margin: 30px 0 14px; }
.table-note {
  color: var(--text-soft);
  font-size: 0.95rem;
  margin: -6px 0 14px;
}
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.rtable { width: 100%; border-collapse: collapse; font-size: 0.9rem; min-width: 720px; }
.rtable--compact { font-size: 0.84rem; min-width: 560px; }
.rtable th, .rtable td { padding: 12px 14px; text-align: center; white-space: nowrap; }
.rtable--compact th, .rtable--compact td { padding: 10px 12px; }
.rtable thead th {
  background: var(--surface-2);
  font-weight: 700; color: var(--text-soft);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0;
}
.rtable tbody tr { border-bottom: 1px solid var(--border); transition: background 0.2s; }
.rtable tbody tr:last-child { border-bottom: none; }
.rtable tbody tr:hover { background: var(--surface-2); }
.rtable__name { text-align: left !important; font-weight: 600; color: var(--text); }
.rtable__ours {
  background: color-mix(in srgb, var(--brand) 8%, transparent) !important;
  font-weight: 700;
}
.rtable__ours td { color: var(--text); }
.rtable__ours .rtable__name { color: var(--brand); }
.rtable__gain {
  color: var(--nov);
  font-weight: 700;
}
.rtable__gain .rtable__name { color: var(--nov); }

.result-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 0.8fr);
  gap: 18px;
  align-items: start;
}

.analysis-figures {
  display: grid;
  gap: 24px;
  margin-top: 34px;
}

/* ------------------------- bibtex ------------------------- */
.code-block {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-top: 22px;
}
.code-block pre {
  margin: 0; padding: 24px;
  font-family: var(--mono); font-size: 0.85rem; line-height: 1.7;
  color: var(--text-soft);
  overflow-x: auto;
}
.copy-btn {
  position: absolute; top: 12px; right: 12px;
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.8rem; font-weight: 600;
  padding: 7px 12px; border-radius: 9px;
  border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text-soft);
  cursor: pointer; transition: all 0.2s;
}
.copy-btn:hover { color: var(--brand); border-color: var(--brand); }
.copy-btn.is-copied { color: var(--nov); border-color: var(--nov); }

/* ------------------------- footer ------------------------- */
.footer { border-top: 1px solid var(--border); padding: 40px 0; background: var(--bg-tint); }
.footer__inner { text-align: center; }
.footer p { margin: 4px 0; font-size: 0.92rem; color: var(--text-soft); }

/* ------------------------- scroll reveal ------------------------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ------------------------- responsive ------------------------- */
@media (max-width: 900px) {
  .hero__brandline { gap: 18px; }
  .hero__logo {
    width: 104px;
    height: 104px;
  }
  .hero__model { font-size: 3.45rem; }
  .hero__subtitle { font-size: 1.34rem; }
  .cards-3, .method-steps { grid-template-columns: 1fr; }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .result-grid { grid-template-columns: 1fr; }
  .nv-grid { grid-template-columns: 1fr; }
  .demo-card__head { flex-direction: column; gap: 14px; }
  .top-evidence__sets { grid-template-columns: 1fr; }
  .top-evidence__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .hero__brandline {
    flex-direction: column;
    gap: 6px;
  }
  .hero__logo {
    width: 92px;
    height: 92px;
  }
  .hero__model { font-size: 2.55rem; }
  .hero__subtitle { font-size: 0.96rem; }
  .nav__links { display: none; }
  .section { padding: 60px 0; }
  .demo-card { padding: 20px; }
  .active-question-panel { grid-template-columns: 1fr; }
  .active-question { grid-template-columns: 1fr; }
  .active-question__answer { white-space: normal; }
  .rel-video video { width: min(100%, var(--rel-video-mobile-width, 280px)); }
  .nv-bank__slots { grid-template-columns: repeat(3, 1fr); }
  .incoming-thumb { width: 100px; }
}
@media (max-width: 760px) {
  .rel-plot .frame-thumb__id { display: none; }
  .frame-strip { margin-top: 12px; }
}
@media (max-width: 520px) {
  .top-evidence__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 460px) {
  .container { width: min(100% - 28px, var(--maxw)); }
  .container--narrow { width: min(100% - 28px, var(--maxw-narrow)); }
  .nav__inner { width: min(100% - 28px, var(--maxw)); }
  .hero__logo {
    width: 78px;
    height: 78px;
  }
  .hero__model { font-size: 2rem; }
  .hero__subtitle { font-size: 0.68rem; }
}

/* ------------------------- svg chart elements ------------------------- */
.chart-grid { stroke: var(--border); stroke-width: 1; }
.chart-label { fill: var(--text-mut); font-size: 11px; font-family: var(--mono); }
.chart-label--util { fill: var(--util); }

/* module 01 - relevance */
.rel-area { pointer-events: none; }
.rel-line { fill: none; stroke: var(--rel); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.rel-dot {
  fill: var(--surface); stroke: var(--rel); stroke-width: 2.5;
  transition: r 0.2s var(--ease);
  cursor: pointer;
}
.rel-dot:hover { r: 6.5; }
.rel-stop-top { stop-color: var(--rel); stop-opacity: 0.3; }
.rel-stop-bottom { stop-color: var(--rel); stop-opacity: 0.02; }

/* module 02 - novelty / utility */
.nv-line { fill: none; stroke: var(--nov); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.util-line { fill: none; stroke: var(--util); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; opacity: 0.85; }
.nv-dot { fill: var(--nov); }
.util-dot { fill: var(--util); }
.util-dot--clipped { stroke: var(--surface); stroke-width: 1.5; }
.evict-marker { fill: color-mix(in srgb, var(--evict) 18%, transparent); stroke: var(--evict); stroke-width: 2; }

.nv-incoming.is-skipped .incoming-thumb { filter: grayscale(1); opacity: 0.5; }

/* active nav link */
.nav__links a.is-active { color: var(--brand); background: color-mix(in srgb, var(--brand) 10%, transparent); }
