/* ==========================================================================
   YANAMI project page
   Visual language follows the academic project-page template used by
   WEAVE (weichow23.github.io/weave) and the Nerfies/Bulma lineage it comes
   from: centred hero with a colour wordmark, alternating white / light-grey
   section bands, centred section headings, thin-bordered cards and tables,
   pill action buttons.
   Self-contained: no external CSS, web fonts or JS.
   ========================================================================== */

:root {
  /* Palette taken from 八奈見杏菜 (Anna Yanami, the character YANAMI is named
     after): sampled from her ribbon and bows in the cover art.
       ribbon blue  #5675a9 / hair navy #2d467b / bow yellow #ead66d
       cover type   magenta #be147d
     The wordmark alternates her two tie colours; the magenta is only an accent. */
  --y-blue: #5574a8;
  --y-blue-deep: #2d467b;
  --y-yellow: #d9ab2e;         /* bow yellow, deepened for contrast on white */
  --y-yellow-bright: #ead66d;  /* the sampled bow yellow, for dark surfaces */
  --y-magenta: #be147d;

  --bg: #ffffff;
  --bg-soft: #f5f5f5;      /* Bulma "is-light" band */
  --bg-sunk: #ededed;
  --surface: #ffffff;
  --border: #e6e6e6;
  --border-strong: #d4d4d4;

  --text: #363636;
  --text-soft: #4a4a4a;
  --text-mute: #7a7a7a;

  --link: #4a6da8;
  --brand: #4a6da8;
  --brand-soft: #eef2f9;
  --accent: #be147d;
  --accent-soft: #fdf4ea;
  --green: #24a06b;
  --green-soft: #eaf8f1;

  --radius: 8px;
  --radius-sm: 5px;
  --shadow-sm: 0 1px 2px rgba(10, 10, 10, .04);
  --shadow: 0 2px 8px rgba(10, 10, 10, .07);
  --maxw: 1080px;
  --font: "Noto Sans", "Google Sans", -apple-system, BlinkMacSystemFont,
          "Segoe UI", Roboto, "Helvetica Neue", "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

html[data-theme="dark"] {
  --bg: #17191d;
  --bg-soft: #1d2026;
  --bg-sunk: #24272e;
  --surface: #1e2128;
  --border: #2e323a;
  --border-strong: #3d434d;
  --text: #e6e8ec;
  --text-soft: #c2c7cf;
  --text-mute: #8b929c;
  --link: #8fb0e0;
  --brand: #8fb0e0;
  --brand-soft: #1e2735;
  --accent-soft: #2b2418;
  --green-soft: #14261f;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow: 0 2px 10px rgba(0, 0, 0, .45);
}

* { box-sizing: border-box; }

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

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

img { max-width: 100%; display: block; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; font-weight: 700; color: var(--text); }
h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); letter-spacing: -.01em; }
h3 { font-size: 1.15rem; }
h4 { font-size: 1rem; }
p { margin: 0 0 1em; }
code, pre, .mono { font-family: var(--mono); font-size: .87em; }
hr { border: 0; border-top: 1px solid var(--border); margin: 2.5rem 0; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }
.narrow { max-width: 860px; }

/* --------------------------------------------------------- colour wordmark */
.wordmark { font-variant: small-caps; font-weight: 800; letter-spacing: .04em; }
.wordmark span { color: var(--y-blue); }
.wordmark span:nth-child(even) { color: var(--y-yellow); }
/* the hero is dark, so the bows can use the brighter sampled yellow there */
.hero .wordmark span:nth-child(even) { color: var(--y-yellow-bright); }
footer .wordmark span:nth-child(even) { color: var(--y-yellow); }

/* ------------------------------------------------------------------- nav */
.nav {
  position: sticky; top: 0; z-index: 60;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav-in {
  max-width: var(--maxw); margin: 0 auto; padding: 0 22px;
  height: 58px; display: flex; align-items: center; gap: 24px;
}
.brand { display: flex; align-items: center; gap: 9px; font-size: 1.05rem; color: var(--text); white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center;
  background: var(--y-blue); color: #fff; font-size: .72rem; font-weight: 800; flex: none;
}
.nav-links { display: flex; gap: 2px; margin-left: auto; align-items: center; }
.nav-links a {
  color: var(--text-soft); font-size: .88rem; font-weight: 600;
  padding: 6px 11px; border-radius: 5px; white-space: nowrap;
}
.nav-links a:hover { background: var(--bg-soft); color: var(--text); text-decoration: none; }
.nav-links a[aria-current="page"] { color: var(--brand); background: var(--brand-soft); }
.icon-btn {
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-mute);
  width: 32px; height: 32px; border-radius: 5px; cursor: pointer;
  display: grid; place-items: center; padding: 0; flex: none;
}
.icon-btn:hover { color: var(--text); border-color: var(--text-mute); }
.nav-toggle { display: none; }

/* ---------------------------------------------------------------- sections */
section { padding: 56px 0; }
section.tight { padding: 34px 0; }
section.soft { background: var(--bg-soft); border-block: 1px solid var(--border); }
.sec-head { margin-bottom: 30px; max-width: 800px; margin-inline: auto; text-align: center; }
.sec-head .eyebrow::after { margin-inline: auto; }
.sec-head.center { margin-inline: auto; text-align: center; }
.sec-head p { color: var(--text-soft); margin-bottom: 0; }
.eyebrow {
  display: inline-block; font-size: .76rem; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--text-mute); margin-bottom: 10px;
}
.eyebrow::after {
  content: ""; display: block; width: 30px; height: 3px; margin-top: 7px;
  background: var(--y-yellow); border-radius: 2px;
}
.sec-head.center .eyebrow::after { margin-inline: auto; }
.lead { font-size: 1.06rem; color: var(--text-soft); }
.muted { color: var(--text-mute); }
.small { font-size: .875rem; }
.center { text-align: center; }

/* ------------------------------------------------------------------- hero */
.hero { padding: 46px 0 26px; text-align: center; }
.hero .wordmark { display: block; font-size: clamp(2.6rem, 7vw, 4.4rem); line-height: 1.05; margin-bottom: 8px; }
.hero .pub-title {
  font-size: clamp(1.6rem, 3.1vw, 2.3rem); font-weight: 700;
  letter-spacing: -.015em; line-height: 1.3; max-width: 900px; margin: 0 auto 16px;
}
.pub-authors { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; max-width: 900px; margin: 0 auto 12px; font-size: .95rem; color: var(--text-soft); }
.pub-author { white-space: nowrap; }
.pub-author a { color: inherit; }
.pub-author sup, .pub-affiliations sup { margin-left: 2px; font-size: .7em; }
.pub-affiliations { display: flex; flex-wrap: wrap; justify-content: center; gap: 3px 14px; max-width: 960px; margin: 0 auto 10px; font-size: .75rem; line-height: 1.5; }
.pub-notes { display: flex; flex-wrap: wrap; justify-content: center; gap: 3px 14px; margin: 0 auto 20px; font-size: .72rem; }
.pub-venue { font-size: .95rem; color: var(--text-mute); font-weight: 600; }
.hero .lead { max-width: 820px; margin: 0 auto 22px; }
.hero-meta {
  display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; justify-content: center;
  margin: 16px 0 22px; font-size: .9rem; color: var(--text-mute);
}
.hero-meta .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--border-strong); }
.venue {
  font-size: .8rem; font-weight: 700; color: #8a6a12;
  background: var(--accent-soft); padding: 4px 10px; border-radius: 999px;
}
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px; border-radius: 6px; font-weight: 600; font-size: .92rem;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-soft);
  cursor: pointer;
}
.btn:hover { text-decoration: none; border-color: var(--text-mute); color: var(--text); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: #3d5c90; border-color: #3d5c90; color: #fff; }
.btn svg { flex: none; }
.btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.resource-status { font-size: .68rem; font-weight: 500; }
.stats.result-highlights { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 24px; }
/* Homepage: scenario selection and complete chat transcripts. */
.dialogue-showcase { --dialogue-accent: #b9631c; --dialogue-tint: color-mix(in srgb, var(--dialogue-accent) 9%, var(--surface)); }
.dialogue-showcase[data-scenario="fusion"] { --dialogue-accent: #356bc0; }
.dialogue-showcase[data-scenario="modeling"] { --dialogue-accent: #bc435b; }
.dialogue-showcase[data-scenario="reasoning"] { --dialogue-accent: #187f69; }
[data-theme="dark"] .dialogue-showcase[data-scenario="editing"] { --dialogue-accent: #f5ae6b; }
[data-theme="dark"] .dialogue-showcase[data-scenario="fusion"] { --dialogue-accent: #94baff; }
[data-theme="dark"] .dialogue-showcase[data-scenario="modeling"] { --dialogue-accent: #f491a5; }
[data-theme="dark"] .dialogue-showcase[data-scenario="reasoning"] { --dialogue-accent: #6fd0b8; }
.dialogue-showcase { border: 1px solid var(--border); border-radius: 20px; overflow: hidden; background: var(--surface); box-shadow: 0 16px 48px rgba(15, 23, 42, .055); }
.dialogue-scenarios { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; padding: 0; background: var(--surface); border-bottom: 1px solid var(--border); }
.dialogue-scenarios button { position: relative; border: 0; border-radius: 0; background: transparent; color: var(--text-mute); padding: 22px 18px; text-align: left; font: inherit; font-size: .88rem; font-weight: 650; cursor: pointer; transition: background .15s, color .15s; }
.dialogue-scenarios button:hover { color: var(--text); background: var(--surface); }
.dialogue-scenarios button[aria-pressed="true"] { color: var(--dialogue-accent); background: var(--dialogue-tint); box-shadow: inset 0 -3px var(--dialogue-accent); }
.dialogue-scenario-name { display: block; }
.dialogue-scenario-detail { display: block; margin-top: 5px; color: var(--text-mute); font-size: .68rem; font-weight: 400; line-height: 1.4; }
.dialogue-capability-tag::before { content: ""; width: 4px; height: 4px; flex: none; border-radius: 50%; background: var(--capability-color, var(--text-mute)); }
.dialogue-capability-tag[data-capability="rr"] { --capability-color: #5276b5; }
.dialogue-capability-tag[data-capability="cr"] { --capability-color: #8a68b4; }
.dialogue-capability-tag[data-capability="ct"] { --capability-color: #338b79; }
.dialogue-capability-tag[data-capability="sp"] { --capability-color: #ae7136; }
.dialogue-capability-tag[data-capability="ck"] { --capability-color: #aa634a; }
.dialogue-capability-tag[data-capability="cu"] { --capability-color: #ac5b80; }
[data-theme="dark"] .dialogue-capability-tag { color: color-mix(in srgb, var(--capability-color, var(--text-soft)) 50%, var(--text)); }
.dialogue-cases { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; padding: 24px; border-bottom: 1px solid var(--border); background: var(--bg-soft); }
.dialogue-case { display: flex; flex-direction: column; align-items: stretch; gap: 0; min-width: 0; padding: 0; overflow: hidden; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text-soft); text-align: left; font: inherit; cursor: pointer; transition: border-color .15s, background .15s; }
.dialogue-case:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.dialogue-case[aria-pressed="true"] { border-color: var(--dialogue-accent); background: var(--surface); box-shadow: 0 0 0 1px var(--dialogue-accent); }
.dialogue-case > img { width: 100%; height: 104px; object-fit: contain; padding: 8px; border: 0; border-bottom: 1px solid var(--border); background: #fff; border-radius: 0; }
.dialogue-case-copy { display: grid; gap: 5px; min-width: 0; padding: 12px; }
.dialogue-case-number { color: var(--text-mute); font-size: .62rem; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; }
.dialogue-case-title { font-size: .8rem; font-weight: 650; line-height: 1.4; }
.dialogue-case-focus { font-size: .65rem; color: var(--text-mute); line-height: 1.35; }
.dialogue-case[aria-pressed="true"] .dialogue-case-number { color: var(--dialogue-accent); }
.dialogue-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; max-width: 940px; padding: 36px 32px 28px; margin: auto; }
.dialogue-group-label { display: block; margin-bottom: 9px; color: var(--dialogue-accent); font-size: .65rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.dialogue-heading h3 { font-size: clamp(1.4rem, 2.7vw, 1.85rem); letter-spacing: -.025em; line-height: 1.25; margin: 0 0 10px; }
.dialogue-heading p { max-width: 660px; font-size: .9rem; line-height: 1.65; color: var(--text-mute); margin: 0; }
.dialogue-heading .pill { flex-shrink: 0; margin-top: 2px; font-size: .65rem; }
.dialogue-message-capabilities { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 18px; padding-top: 0; }
.dialogue-capability-tag { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border: 1px solid color-mix(in srgb, var(--capability-color, var(--text-mute)) 20%, var(--border)); border-radius: 5px; font-size: .64rem; font-weight: 550; line-height: 1.5; color: color-mix(in srgb, var(--capability-color, var(--text-soft)) 78%, var(--text)); background: color-mix(in srgb, var(--capability-color, var(--text-mute)) 6%, var(--surface)); }
.dialogue-capability-tag.is-setting { color: var(--text-mute); border-style: dashed; }
.dialogue-qa { margin: 0; padding: 36px clamp(18px, 4vw, 48px); border-top: 1px solid var(--border); background: var(--bg-soft); }
.dialogue-qa h4 { margin: 8px 0 10px; font-size: 1.4rem; letter-spacing: -.02em; }
.dialogue-qa > p { max-width: 650px; margin: 0 0 24px; color: var(--text-mute); font-size: .85rem; line-height: 1.7; }
.dialogue-qa-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.dialogue-qa-card { min-width: 0; padding: 22px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); overflow-wrap: anywhere; }
.dialogue-qa-header { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.dialogue-qa-header > span:first-child { color: var(--text-mute); font-size: .6rem; font-weight: 700; letter-spacing: .07em; }
.dialogue-qa-question { margin: 0 0 18px; font-size: .88rem; line-height: 1.7; font-weight: 600; }
.dialogue-qa-answer-label { display: block; font-size: .6rem; color: var(--dialogue-accent); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 7px; }
.dialogue-qa-answer { margin: 0; padding: 12px 14px; background: var(--bg-soft); border-radius: 8px; color: var(--text-soft); font-size: .8rem; line-height: 1.8; white-space: pre-wrap; }
.dialogue-qa-reference { display: inline-block; margin-top: 14px; color: var(--dialogue-accent); font-size: .7rem; }
.dialogue-chat-turn, .dialogue-chat-image, .dialogue-qa { scroll-margin-top: 90px; }
@media (max-width: 760px) {
  .dialogue-qa-list { grid-template-columns: 1fr; }
  .dialogue-qa-card { padding: 18px; }
}
.dialogue-chat { padding: 8px clamp(16px, 4vw, 48px) 38px; background: color-mix(in srgb, var(--bg-soft) 65%, var(--surface)); border-top: 1px solid var(--border); }
.dialogue-chat-turn { display: flex; align-items: center; gap: 14px; max-width: 780px; margin: 28px auto; color: var(--text-mute); font-size: .66rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }
.dialogue-chat-turn::before, .dialogue-chat-turn::after { content: ""; height: 1px; background: var(--border); flex: 1; }
.dialogue-chat-row { display: flex; align-items: flex-start; gap: 12px; max-width: 860px; margin: 0 auto 20px; }
.dialogue-chat-user { flex-direction: row-reverse; }
.dialogue-avatar { flex: 0 0 30px; display: grid; place-items: center; width: 30px; height: 30px; margin-top: 5px; border-radius: 10px; color: var(--text-mute); background: var(--bg-soft); border: 1px solid var(--border); font-size: .65rem; font-weight: 750; }
.dialogue-chat-assistant .dialogue-avatar { color: var(--dialogue-accent); background: var(--dialogue-tint); border-color: transparent; }
.dialogue-bubble { min-width: 0; max-width: min(84%, 660px); padding: 18px 22px; border: 1px solid var(--border); border-radius: 4px 16px 16px; background: var(--surface); box-shadow: 0 2px 5px rgba(15, 23, 42, .02); }
.dialogue-chat-user .dialogue-bubble { border-radius: 16px 4px 16px 16px; border-color: color-mix(in srgb, var(--dialogue-accent) 12%, var(--border)); background: color-mix(in srgb, var(--dialogue-accent) 5%, var(--surface)); box-shadow: none; }
.dialogue-chat-speaker { color: var(--text-mute); font-size: .7rem; font-weight: 650; margin-bottom: 10px; }
.dialogue-chat-assistant .dialogue-chat-speaker { color: var(--dialogue-accent); }
.dialogue-chat-text { margin: 0 0 14px; color: var(--text-soft); font-size: .9rem; line-height: 1.8; white-space: pre-wrap; overflow-wrap: anywhere; }
.dialogue-chat-text:last-child { margin-bottom: 0; }
.dialogue-chat-image { display: inline-block; vertical-align: top; width: min(100%, 360px); margin: 10px 10px 4px 0; }
.dialogue-chat-image .figframe { background: #fff; border-radius: 10px; border-color: var(--border); }
.dialogue-chat-image img { display: block; width: 100%; height: auto; max-height: 380px; object-fit: contain; }
.dialogue-chat-image figcaption { margin-top: 7px; color: var(--text-mute); font-size: .6rem; }
.dialogue-chat-end { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 34px; color: var(--text-mute); font-size: .65rem; }
.dialogue-chat-end::before { content: ""; width: 5px; height: 5px; background: var(--dialogue-accent); border-radius: 50%; opacity: .65; }
.dialogue-source { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding: 18px 28px; border-top: 1px solid var(--border); color: var(--text-mute); font-size: .68rem; }
.dialogue-hf { color: var(--dialogue-accent); font-weight: 600; }
.dialogue-showcase button:focus-visible { outline: 3px solid var(--dialogue-accent); outline-offset: 3px; }
@media (max-width: 1100px) {
  .dialogue-cases { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(165px, 1fr); overflow-x: auto; scroll-snap-type: x proximity; }
  .dialogue-case { scroll-snap-align: start; }
}
@media (max-width: 720px) {
  .dialogue-showcase { border-radius: 16px; }
  .dialogue-scenarios { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 0; }
  .dialogue-scenarios button { padding: 14px; font-size: .8rem; }
  .dialogue-cases { grid-auto-columns: 152px; padding: 16px; gap: 10px; }
  .dialogue-case > img { height: 88px; }
  .dialogue-heading { padding: 24px 18px 16px; flex-direction: column; gap: 12px; }
  .dialogue-heading h3 { font-size: 1.3rem; }
  .dialogue-group-label { font-size: .6rem; }
  .dialogue-chat { padding: 4px 10px 28px; }
  .dialogue-chat-row { gap: 7px; margin-bottom: 18px; }
  .dialogue-avatar { flex-basis: 23px; width: 23px; height: 25px; font-size: .55rem; border-radius: 8px; }
  .dialogue-bubble { max-width: calc(100% - 34px); padding: 14px 16px; }
  .dialogue-chat-text { font-size: .85rem; line-height: 1.75; }
  .dialogue-chat-image { width: min(100%, 280px); margin-right: 0; }
  .dialogue-chat-turn { margin: 22px auto; }
  .dialogue-source { padding: 16px 18px; }
}

.hero-fig {
  margin: 26px auto 0; max-width: 1240px; border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; background: var(--surface);
}
.hero-fig img { width: 100%; height: auto; }
.figcap { font-size: .875rem; color: var(--text-mute); padding: 12px 16px; border-top: 1px solid var(--border); text-align: left; }
figcaption { font-size: .875rem; color: var(--text-mute); margin-top: 10px; }

/* ------------------------------------------------------------- stat strip */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 16px; text-align: center; }
.stat .num {
  font-size: clamp(1.4rem, 2.6vw, 1.9rem); font-weight: 700;
  letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.2;
}
.stat .lbl { font-size: .85rem; color: var(--text-mute); margin-top: 5px; }
.stat.accent .num { color: var(--brand); }

/* ------------------------------------------------------------------ grid */
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); }
.gap-lg { gap: 22px; }
.split { display: grid; grid-template-columns: 1.05fr .95fr; gap: 36px; align-items: center; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.card h3 { display: flex; align-items: center; gap: 9px; }
.card p:last-child { margin-bottom: 0; }
.card-hover { transition: border-color .15s ease, box-shadow .15s ease; }
.card-hover:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }

.pill {
  display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 600;
  padding: 3px 10px; border-radius: 999px; background: var(--bg-soft); color: var(--text-mute);
  border: 1px solid var(--border);
}
.pill.ours { background: var(--accent-soft); color: #8a6a12; border-color: #eddfae; }
.pill.closed { background: #f2eefe; color: #6a4fd0; border-color: #ddd5fb; }
.pill.edit { background: var(--green-soft); color: var(--green); border-color: #c3ead7; }
.pill.umm { background: var(--brand-soft); color: var(--brand); border-color: #cfe0fb; }

.icon-badge { width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; flex: none; color: #fff; font-size: .95rem; font-weight: 700; }

/* ----------------------------------------------------------------- table */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
table.data { width: 100%; border-collapse: collapse; font-size: .88rem; }
/* Only genuinely wide tables scroll; a narrow table must not, or its sticky first
   column ends up drawn over the start of the neighbouring cell. */
table.data.wide { min-width: 720px; }
table.data.wide th:first-child, table.data.wide td:first-child { box-shadow: 1px 0 0 var(--border); }
table.data th, table.data td { padding: 9px 12px; text-align: right; white-space: nowrap; }
table.data th:first-child, table.data td:first-child { text-align: left; position: sticky; left: 0; background: var(--surface); z-index: 2; }
table.data thead th {
  font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-mute);
  font-weight: 700; border-bottom: 2px solid var(--border-strong);
  background: var(--bg-soft); position: sticky; top: 0; z-index: 3;
}
table.data thead th:first-child { z-index: 4; background: var(--bg-soft); }
table.data tbody tr + tr td { border-top: 1px solid var(--border); }
table.data tbody tr:hover td { background: var(--bg-soft); }
table.data tbody tr.is-ours td { background: var(--accent-soft); font-weight: 600; }
table.data td.best { color: var(--brand); font-weight: 700; }
table.data .model-cell { display: flex; align-items: center; gap: 8px; }
table.data .rank {
  display: inline-grid; place-items: center; width: 21px; height: 21px; border-radius: 4px;
  background: var(--bg-sunk); color: var(--text-mute); font-size: .72rem; font-weight: 700;
}
table.data .rank.top { background: var(--y-yellow); color: #3a2c05; }  /* dark on yellow for contrast */
table.data tbody tr.is-ours .rank { background: var(--y-magenta); color: #fff; }
table.data th.ctr, table.data td.ctr { text-align: center; }

.legend-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }

/* ---------------------------------------------------------------- charts */
.chart-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.chart-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 6px; }
.chart-head h3 { margin: 0; }
.chart-sub { font-size: .85rem; color: var(--text-mute); margin: 0 0 16px; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid-line { stroke: var(--border); stroke-width: 1; }
.chart .axis-text { font-size: 11px; fill: var(--text-mute); font-family: var(--font); }
.chart .bar-label { font-size: 10.5px; font-weight: 700; fill: var(--text-soft); font-family: var(--font); }
.chart .bar { transition: opacity .15s ease; }
.chart .bar:hover { opacity: .78; }
.chart .marker-line { stroke: var(--border-strong); stroke-dasharray: 3 3; }

.seg { display: inline-flex; flex-wrap: wrap; max-width: 100%; background: var(--bg-sunk); border-radius: 6px; padding: 3px; gap: 2px; }
.seg button {
  border: 0; background: transparent; color: var(--text-soft); font: inherit; font-size: .82rem;
  font-weight: 600; padding: 5px 12px; border-radius: 4px; cursor: pointer; white-space: nowrap;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis;
}
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

/* ------------------------------------------------------------ comparison */
.cmp-controls { display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: flex-end; margin-bottom: 20px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: .74rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-mute); }
select {
  font: inherit; font-size: .9rem; padding: 8px 11px; border-radius: 5px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  max-width: 280px; cursor: pointer;
}
select:focus-visible, .btn:focus-visible, .icon-btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.imggrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(146px, 1fr)); gap: 12px; }
.imgcell { border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; background: var(--bg-soft); }
.imgcell img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; background: var(--bg-sunk); }
.imgcell .cap {
  font-size: .74rem; font-weight: 600; padding: 6px 8px; text-align: center;
  border-top: 1px solid var(--border); color: var(--text-soft); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.imgcell.is-gt { border-color: var(--green); }
.imgcell.is-gt .cap { color: var(--green); background: var(--green-soft); }
.refs { display: flex; flex-wrap: wrap; gap: 10px; margin: 8px 0 20px; }
.refs .imgcell { width: 104px; }

.checks { margin: 6px 0 0; padding: 0; list-style: none; }
.checks li { position: relative; padding-left: 22px; margin-bottom: 6px; font-size: .88rem; color: var(--text-soft); }
.checks li::before {
  content: ""; position: absolute; left: 5px; top: .58em; width: 6px; height: 6px;
  border-radius: 50%; background: var(--y-yellow);
}

/* ---------------------------------------------------------- transcript */
.transcript { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.turn { display: grid; grid-template-columns: 84px 1fr; gap: 14px; padding: 12px 16px; }
.turn + .turn { border-top: 1px solid var(--border); }
.turn .who { font-size: .72rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-mute); padding-top: 3px; }
.turn.user .who { color: var(--y-blue); }
.turn.assistant .who { color: var(--y-magenta); }
.turn .txt { font-size: .92rem; }
.turn .txt p { margin: 0 0 .5em; }
.turn .txt p:last-child { margin-bottom: 0; }
.turn .imgs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.turn .imgs img { width: 92px; height: 92px; object-fit: cover; border-radius: 5px; border: 1px solid var(--border); }
.turn.target { background: var(--accent-soft); }
.turn.target .who { color: #8a6a12; }

/* --------------------------------------------------------------- steps */
.steps { counter-reset: step; display: grid; gap: 14px; }
.step { display: grid; grid-template-columns: 32px 1fr; gap: 14px; }
.step .n {
  counter-increment: step; width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center; background: var(--bg-soft); color: var(--text-soft);
  font-weight: 700; font-size: .9rem;
}
.step .n::before { content: counter(step); }
.step h4 { margin: 4px 0 4px; }
.step p { margin: 0; color: var(--text-soft); font-size: .92rem; }

/* -------------------------------------------------------------- figures */
figure { margin: 0; }
.figframe { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.figframe img { width: 100%; height: auto; }

/* ---------------------------------------------------------------- misc */
.callout {
  border-left: 4px solid var(--y-yellow); background: var(--bg-soft);
  padding: 14px 18px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: .93rem; color: var(--text-soft);
}
.callout strong { color: var(--text); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 18px; font-size: .9rem; }
.kv dt { color: var(--text-mute); }
.kv dd { margin: 0; font-variant-numeric: tabular-nums; }

footer {
  border-top: 1px solid var(--border); background: var(--bg-soft);
  padding: 36px 0; font-size: .875rem; color: var(--text-mute); text-align: center;
}
footer .foot-in { display: grid; gap: 10px; justify-items: center; }
footer .wordmark { font-size: 1.4rem; }
footer a { color: var(--text-mute); }
footer a:hover { color: var(--text); }

.bibtex { position: relative; background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px 18px; overflow-x: auto; }
.bibtex pre { margin: 0; font-size: .82rem; line-height: 1.6; color: var(--text-soft); }
.copy-btn { position: absolute; top: 10px; right: 10px; font-size: .76rem; padding: 4px 10px; }

.to-top {
  position: fixed; right: 20px; bottom: 20px; z-index: 50;
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--border-strong);
  box-shadow: var(--shadow); display: grid; place-items: center; color: var(--text-mute);
  opacity: 0; pointer-events: none; transition: opacity .2s ease;
}
.to-top.show { opacity: 1; pointer-events: auto; }

/* --------------------------------------------------------------- reveal */
.reveal { opacity: 1; transform: none; }
html.js .reveal { opacity: 0; transform: translateY(10px); transition: opacity .45s ease, transform .45s ease; }
html.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html.js .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ------------------------------------------------------------ responsive */
@media (max-width: 980px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .g4, .g3 { grid-template-columns: repeat(2, 1fr); }
  .split { grid-template-columns: 1fr; gap: 26px; }
}
@media (max-width: 720px) {
  .stats.result-highlights { grid-template-columns: 1fr; }
  section { padding: 40px 0; }
  .nav-links {
    position: absolute; top: 58px; left: 0; right: 0; flex-direction: column;
    align-items: stretch; background: var(--bg); border-bottom: 1px solid var(--border);
    padding: 10px 16px 16px; gap: 2px; margin: 0; display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 10px 12px; }
  .nav-toggle { display: grid; margin-left: auto; }
  .g2, .g3, .g4 { grid-template-columns: 1fr; }
  .turn { grid-template-columns: 1fr; gap: 4px; }
  .turn .who { padding-top: 0; }
  .imggrid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
}
@media print {
  .nav, .to-top, .btn-row { display: none; }
  section { padding: 20px 0; }
}

/* Grid items must be allowed to shrink below their content's intrinsic width,
   otherwise wide tables and SVGs push the page horizontally on mobile. */
.split > *, .grid > *, .g2 > *, .g3 > *, .g4 > * { min-width: 0; }
.table-wrap { max-width: 100%; }
.chart svg, .chart-card svg { max-width: 100%; height: auto; }
img, figure, .figframe { max-width: 100%; }

/* ==========================================================================
   Academic banner hero (index) and centred page heads (sub-pages).
   Mirrors the reference project page: dark image banner, colour wordmark,
   white pill action buttons, centred headings.
   ========================================================================== */
.btn { border-radius: 999px; padding: 8px 18px; }

.hero {
  padding: 0; text-align: center; position: relative; overflow: hidden;
  background: #14171d; color: #fff;
}
.hero::before {
  content: ""; position: absolute; inset: -4px;
  /* a mosaic of real YANAMI ground-truth images (built by scripts/build assets),
     dimmed most in the middle where the text sits so the pictures still read */
  background:
    radial-gradient(ellipse 72% 92% at 50% 46%,
      rgba(11, 14, 19, .93) 0%, rgba(11, 14, 19, .86) 52%, rgba(11, 14, 19, .62) 100%),
    url("../img/figs/hero-collage.jpg") center / cover no-repeat;
  filter: blur(1px);
}
.hero > .wrap { position: relative; z-index: 1; padding-top: 36px; padding-bottom: 28px; }
.hero .wordmark { font-size: clamp(2.8rem, 7.5vw, 4.6rem); }
.hero .pub-title { color: #fff; }
.hero .pub-authors { color: rgba(255, 255, 255, .92); }
.hero .pub-affiliations, .hero .pub-notes { color: rgba(255, 255, 255, .8); }
.hero .pub-venue { color: rgba(255, 255, 255, .64); margin-bottom: 18px; }
.hero .lead { color: rgba(255, 255, 255, .85); }
.hero .hero-meta { color: rgba(255, 255, 255, .74); }
.hero .hero-meta .dot { background: rgba(255, 255, 255, .35); }
.hero .btn {
  background: #fff; color: #1a1d23; border-color: transparent;
  box-shadow: 0 3px 14px rgba(0, 0, 0, .3);
}
.hero .btn:hover { background: #f1f4f8; color: #000; border-color: transparent; }
.hero .btn.primary { background: var(--y-blue); color: #fff; }
.hero .btn.primary:hover { background: #6a8cc4; }

.page-head { padding: 46px 0 4px; text-align: center; }
.page-head h1 { max-width: 900px; margin: 0 auto 14px; font-size: clamp(1.6rem, 3.1vw, 2.3rem); }
.page-head .lead { max-width: 820px; margin: 0 auto; }
.page-head .eyebrow::after { margin-inline: auto; }
section.tight > .wrap > .hero-fig { margin-top: 0; }
@media (min-width: 1180px) {
  /* let the wide dense figure use the full window, not the text column */
  section.tight > .wrap:has(> .hero-fig) { max-width: 1320px; }
}

/* --------------------------------------------------------------- lightbox */
.figframe img, .imgcell img, .hero-fig img { cursor: zoom-in; }
.lightbox {
  position: fixed; inset: 0; z-index: 200; cursor: zoom-out;
  background: rgba(8, 10, 14, .93); display: grid; place-items: center; padding: 22px;
}
.lightbox img {
  max-width: 98vw; max-height: 92vh; width: auto; border-radius: 6px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .6); cursor: zoom-out;
}
.lightbox-hint {
  position: fixed; bottom: 14px; left: 0; right: 0; text-align: center;
  color: rgba(255, 255, 255, .62); font-size: .8rem;
}
