/* ------------------------------------------------------------------
   MaRiO project page.
   Overlay on the Academic Project Page Template (bulma + index.css).
   Metrics follow the SignRR page; the accent triad is taken from the
   agent colour coding used in the paper's own figures.
   ------------------------------------------------------------------ */

:root {
  --ink: #17212B;
  --muted: #5A6672;
  --faint: #6E7781;
  --line: #E3E7EC;
  --surface: #F5F7FA;

  --a1: #2E5C8A;          /* agent 1 */
  --a2: #D98E2B;          /* agent 2 */
  --a3: #8B3A3A;          /* agent 3 */
  --a1-soft: #E8EFF7;
  --accent: #8A5D12;      /* 5.8:1 on white, 5.4:1 on surface */
  --gold: #D98E2B;        /* table row outline */

  --ok: #126A33;
  --ok-soft: #E9F4ED;
  --no: #B23A2E;
  --no-soft: #F9ECEA;

  --title-font: 'Google Sans', 'Noto Sans', sans-serif;
}

body { color: var(--ink); }
a { color: var(--a1); }
.hero, .footer { background: var(--surface); }
.section { background: #fff; padding: 48px 1.5rem; }
.section.is-light { background: var(--surface); }

/* ---------------------------------------------------------- hero */
.publication-title.is-1 {
  font-family: var(--title-font); font-size: 48px; font-weight: 700;
  line-height: 1.18; letter-spacing: -.015em; color: var(--ink);
  max-width: 17ch; margin: 0 auto .9rem;
}
.brand { color: var(--a1); }
.publication-authors { font-family: var(--title-font); font-size: 20px; line-height: 1.5; }
.publication-authors .author-block { display: inline-block; margin: 0 .1rem; }
.publication-authors.affiliations { font-size: 16px; color: var(--muted); margin-top: .25rem; }
.eql-cntrb { font-size: 13px; color: var(--faint); margin-top: .25rem; }
.logo-row { margin: 1.1rem 0 .9rem; }
.logo-row img { height: 52px; width: auto; }
.venue {
  font-family: var(--title-font); font-size: 18.4px; font-weight: 700;
  color: var(--ink); margin-bottom: 1.1rem;
}
.publication-links { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; }
.publication-links .button {
  font-family: var(--title-font); font-size: 16px; font-weight: 500;
  background: var(--a1); border-color: var(--a1); color: #fff;
  border-radius: 999px; padding: 7px 20px; height: auto;
}
.publication-links .button:hover { background: #24496e; border-color: #24496e; color: #fff; }
.publication-links .icon { margin-right: .3rem; }
.publication-links .icon .ico { width: 1em; height: 1em; display: block; }
.button.is-soon {
  background: #fff; border: 1px solid var(--line); color: var(--faint);
  cursor: default; pointer-events: none;
}
.button.is-soon .soon {
  font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
  background: var(--line); color: var(--muted);
  border-radius: 999px; padding: 1px 7px; margin-left: .45rem;
}

/* ------------------------------------------------------- teaser */
.teaser .hero-body { padding-top: 0; padding-bottom: 3rem; }
.teaser-line {
  font-family: var(--title-font); font-size: 22px; font-weight: 500;
  line-height: 1.4; color: var(--ink); text-align: center;
  max-width: 54ch; margin: 0 auto 1.8rem;
}

/* ------------------------------------------- section headings */
.section-head { text-align: center; margin-bottom: 2rem; }
.eyebrow {
  font-family: var(--title-font); font-size: 12.8px; font-weight: 700;
  letter-spacing: 1.536px; text-transform: uppercase;
  color: var(--accent); margin-bottom: .5rem;
}
.section-head h2 {
  font-family: var(--title-font); font-size: 26.6px; font-weight: 700;
  line-height: 1.25; color: var(--ink); max-width: 44ch; margin: 0 auto;
}
.section .title.is-3 { font-family: var(--title-font); }

/* ------------------------------------------------------- copy */
.lines p { font-size: 16px; line-height: 24px; margin-bottom: .85rem; }
.lines p:last-child { margin-bottom: 0; }
.lines strong { color: var(--ink); }
.lines.takeaway {
  border-left: 3px solid var(--a2); padding-left: 1rem; margin-top: 2.2rem;
}

/* ---------------------------------------------------- figures */
.figure { margin: 1.6rem auto 2.2rem; text-align: center; }
.figure img { max-width: 100%; height: auto; border-radius: 6px; }
.figure figcaption, .table-figure figcaption, .caption {
  font-size: 14.7px; line-height: 1.5; color: var(--muted);
  text-align: center; max-width: 74ch; margin: .9rem auto 0;
}

/* --------------------------------- paper tables, as in SignRR */
.table-figure { margin: 0 auto 1.8rem; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.hl-frame {
  position: relative; display: block; margin: 0 auto;
  border: 1px solid var(--line); border-radius: 6px;
  padding: 0; background: #fff; line-height: 0;
}
.hl-frame.narrow { max-width: var(--w, 760px); }
.hl-frame img { display: block; width: 100%; height: auto; }
.row-outline {
  position: absolute; pointer-events: none;
  border: 2px solid var(--gold); border-radius: 4px;
}

/* ------------------------------------------------- stat strip */
.stat-strip {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: .6rem;
  max-width: 820px; margin: 0 auto 2rem;
}
.stat { text-align: center; }
.stat b {
  display: block; font-family: var(--title-font); font-size: 26px;
  font-weight: 700; color: var(--a1); line-height: 1.1;
}
.stat span { display: block; margin-top: .15rem; font-size: 13px; color: var(--muted); }

/* --------------------------------------- augmentation pipeline */
.pipeline {
  list-style: none; margin: 0 0 .5rem; padding: 0;
  display: grid; grid-template-columns: 1fr 1fr; gap: 1.6rem 2rem;
}
.pipeline li { margin: 0; position: relative; }
.pipeline img { width: 100%; height: auto; display: block; border-radius: 6px; }
.step-title {
  font-family: var(--title-font); font-size: 14px; font-weight: 600;
  color: var(--ink); margin-bottom: .5rem;
}
.step-title .n {
  display: inline-grid; place-items: center; width: 20px; height: 20px;
  border-radius: 50%; background: var(--a1); color: #fff;
  font-size: 12px; margin-right: .45rem; vertical-align: -3px;
}

/* ---------------------------------------- the example explorer */
.explorer {
  margin: 2.4rem auto 0; max-width: 900px; background: #fff;
  border: 1px solid var(--line); border-radius: 10px; overflow: hidden;
}
.loading { padding: 2.5rem; text-align: center; color: var(--faint); }
.exp-tabs {
  display: flex; flex-wrap: wrap; gap: .25rem; padding: .6rem .6rem 0;
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.exp-tab {
  font-family: var(--title-font); font-size: 13.5px; font-weight: 500;
  border: 1px solid transparent; border-bottom: none; background: transparent;
  color: var(--muted); padding: .45rem .75rem; border-radius: 6px 6px 0 0;
  cursor: pointer; position: relative; top: 1px;
}
.exp-tab:hover { color: var(--ink); background: #EDF1F5; }
.exp-tab[aria-pressed="true"] {
  background: #fff; color: var(--ink); font-weight: 600;
  border-color: var(--line); border-bottom: 1px solid #fff;
}
.exp-tab .dot {
  display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  margin-right: .38rem; vertical-align: middle;
}
.exp-tab .dot.static { background: var(--a1); }
.exp-tab .dot.comp { background: var(--a2); }
.exp-panel { padding: 1.1rem 1.2rem 1.3rem; }

.exp-bar { display: flex; align-items: center; gap: .5rem; margin-bottom: .8rem; }
.seg { display: inline-flex; }
.seg button {
  font-family: var(--title-font); font-size: 12.5px; color: var(--ink);
  border: 1px solid var(--line); background: #fff; padding: .25rem .6rem; cursor: pointer;
}
.seg button:first-child { border-radius: 6px 0 0 6px; }
.seg button:last-child { border-radius: 0 6px 6px 0; margin-left: -1px; }
.seg button.is-on { background: var(--ink); border-color: var(--ink); color: #fff; cursor: default; }
.seg button:hover:not(.is-on) { background: #EDF1F5; }

.views { display: grid; gap: .5rem; margin-bottom: .9rem; }
.views.n2 { grid-template-columns: repeat(2, minmax(0, 320px)); justify-content: center; }
.views.n3 { grid-template-columns: 1fr 1fr 1fr; }
.view { margin: 0; }
.view img {
  width: 100%; height: auto; display: block;
  border-radius: 5px; border: 2px solid var(--line);
}
.view.a1 img { border-color: var(--a1); }
.view.a2 img { border-color: var(--a2); }
.view.a3 img { border-color: var(--a3); }
.view figcaption {
  font-family: var(--title-font); font-size: 11.5px; font-weight: 600;
  letter-spacing: .04em; text-transform: uppercase; margin-top: .28rem; text-align: center;
}
.view.a1 figcaption { color: var(--a1); }
.view.a2 figcaption { color: #9A6410; }
.view.a3 figcaption { color: var(--a3); }

.q-text { font-size: 16px; line-height: 1.45; margin-bottom: .75rem; }
.opts { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; }
.opt {
  display: flex; gap: .5rem; align-items: flex-start; text-align: left;
  font-size: 14.5px; line-height: 1.35; color: var(--ink);
  border: 1px solid var(--line); border-radius: 7px;
  padding: .45rem .6rem; background: #fff; width: 100%;
  font-family: inherit; cursor: pointer;
}
.opt:hover { border-color: #C3CAD2; background: #FAFBFC; }
.opt .letter { font-family: var(--title-font); font-weight: 700; color: var(--faint); flex: 0 0 auto; }
.revealed .opt { cursor: default; }
.revealed .opt:hover { border-color: var(--line); background: #fff; }
.opt.is-answer { background: var(--ok-soft); border-color: #A9CDB6; }
.opt.is-answer .letter { color: var(--ok); }
.opt.is-answer::after { content: "✓"; margin-left: auto; color: var(--ok); font-weight: 700; }
.opt.is-wrong { color: var(--muted); background: #FAFBFC; }
.opt.is-wrong .letter { color: var(--muted); }

.reveal-row { margin-top: .85rem; display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; }
.reveal {
  font-family: var(--title-font); font-size: 13.5px; font-weight: 500;
  background: var(--ink); color: #fff; border: 1px solid var(--ink);
  border-radius: 999px; padding: .35rem .95rem; cursor: pointer;
}
.reveal:hover { background: var(--a1); border-color: var(--a1); }
.reveal:disabled { background: #fff; color: var(--faint); border-color: var(--line); cursor: default; }
.answer-note { font-size: 13.5px; color: var(--muted); }

.preds { margin-top: 1rem; border-top: 1px solid var(--line); padding-top: .8rem; }
.preds h4 {
  font-family: var(--title-font); font-size: 11.5px; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: .5rem;
}
.pred {
  display: flex; gap: .55rem; align-items: baseline;
  padding: .32rem .55rem; border-radius: 6px; font-size: 14px;
  border: 1px solid transparent; margin-bottom: .2rem;
}
.pred.ok { background: #FBFCFB; }
.pred.bad { background: var(--no-soft); }
.pred .who { font-family: var(--title-font); font-weight: 600; font-size: 13px; flex: 0 0 9rem; }
.pred .ans { flex: 1 1 auto; }
.pred .mark { flex: 0 0 auto; font-weight: 700; }
.pred.ok .mark { color: var(--ok); }
.pred.bad .mark { color: var(--no); }


.footer { border-top: 1px solid var(--line); padding: 2.5rem 1.5rem; }
.footer .content p { font-size: 14px; color: var(--muted); }

/* -------------------------------------------------- responsive */
@media screen and (max-width: 1023px) {
  .stat-strip { grid-template-columns: repeat(3, 1fr); row-gap: 1.1rem; }
}
@media screen and (max-width: 768px) {
  .section { padding: 36px 1.1rem; }
  .publication-title.is-1 { font-size: 30px; max-width: none; }
  .publication-authors { font-size: 16px; }
  .publication-authors.affiliations { font-size: 14px; }
  .venue { font-size: 15px; }
  .teaser-line { font-size: 17px; }
  .section-head h2 { font-size: 21px; max-width: none; }
  .stat-strip { grid-template-columns: repeat(2, 1fr); }
  .stat b { font-size: 22px; }
  .pipeline { grid-template-columns: 1fr; gap: 1.2rem; }
  .opts { grid-template-columns: 1fr; }
  .views.n3 { grid-template-columns: repeat(3, 1fr); }
  .hl-frame { width: var(--w, 900px); max-width: none; }
  .hl-frame img { min-width: 0; }
  .pred { flex-wrap: wrap; }
  .pred .who { flex: 0 0 100%; }
  /* a wrapped tab strip breaks the "merge into the panel" trick, so use an accent bar */
  .exp-tab { top: 0; border-radius: 6px; }
  .exp-tab[aria-pressed="true"] { border-color: transparent; box-shadow: inset 0 -2px 0 var(--a1); }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* breathing room between the pipeline caption and the table that follows */
.pipeline + .caption { margin-bottom: 2.4rem; }

/* ------------------------------------------------- hero: try button */
.publication-links .button.is-try {
  background: var(--ink); border-color: var(--ink); color: #fff;
}
.publication-links .button.is-try:hover { background: var(--a1); border-color: var(--a1); }

/* --------------------------------------- teaser, rebuilt from crops */
.teaser-fig { margin: 0; }
.teaser-grid {
  display: grid; grid-template-columns: 220px 1fr; gap: 1rem; align-items: start;
}
.teaser-agents { display: grid; gap: .5rem; }
.teaser-agents img, .teaser-scene img {
  width: 100%; height: auto; display: block; border-radius: 6px;
}
.teaser-q {
  max-width: 900px; margin: 1.5rem auto 0; text-align: left;
}
.teaser-q .q {
  font-family: var(--title-font); font-size: 17px; font-weight: 600;
  color: var(--ink); margin-bottom: .7rem;
}
.teaser-opts {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: 1fr 1fr; gap: .4rem;
  counter-reset: opt;
}
.teaser-opts li {
  counter-increment: opt; font-size: 14.5px; line-height: 1.35; color: var(--ink);
  border: 1px solid var(--line); border-radius: 7px; padding: .45rem .6rem; background: #fff;
}
.teaser-opts li::before {
  content: counter(opt, upper-alpha) ") ";
  font-family: var(--title-font); font-weight: 700; color: var(--faint);
}
.teaser-opts li.is-answer { background: var(--ok-soft); border-color: #A9CDB6; }
.teaser-opts li.is-answer::before { color: var(--ok); }
.teaser-opts li.is-answer::after { content: " ✓"; color: var(--ok); font-weight: 700; }
.teaser-fig figcaption {
  font-size: 14.7px; line-height: 1.5; color: var(--muted);
  text-align: center; max-width: 74ch; margin: 1.4rem auto 0;
}

/* -------------------------- wide analysis strips stay legible on small screens */
.fig-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ------------------------------------------- motivation definition list */
.setups { margin: 0; display: grid; gap: .8rem; }
.setups div { display: grid; grid-template-columns: 8.5rem 1fr; gap: .8rem; align-items: baseline; }
.setups dt {
  font-family: var(--title-font); font-weight: 600; font-size: 15px; color: var(--ink);
  text-align: right; border-right: 2px solid var(--line); padding-right: .8rem;
}
.setups dd { margin: 0; font-size: 16px; line-height: 24px; }

/* ----------------------------------- explorer: legend, score, picked option */
.exp-legend {
  display: flex; gap: 1rem; align-items: center; flex-wrap: wrap;
  font-size: 12px; color: var(--muted); padding: .55rem 1.2rem 0;
}
.exp-legend .key { display: inline-flex; align-items: center; gap: .35rem; }
.exp-legend .dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.exp-legend .dot.static { background: var(--a1); }
.exp-legend .dot.comp { background: var(--a2); }
.exp-score {
  margin-left: auto; font-family: var(--title-font); font-size: 12.5px; font-weight: 600;
  border-radius: 999px; padding: .15rem .6rem;
}
.exp-score.none { background: var(--no-soft); color: var(--no); }
.exp-score.some { background: #FBF1E0; color: #8A5A0E; }
.exp-score.all  { background: var(--ok-soft); color: var(--ok); }
.opt.is-picked { border-color: var(--ink); border-width: 2px; }
.pick-note { font-size: 13.5px; color: var(--muted); }
.pick-note b { color: var(--ink); }

@media screen and (max-width: 768px) {
  .teaser-grid { grid-template-columns: 1fr; }
  .teaser-agents { grid-template-columns: repeat(3, 1fr); }
  .teaser-opts { grid-template-columns: 1fr; }
  .setups div { grid-template-columns: 1fr; gap: .15rem; }
  .setups dt { text-align: left; border-right: none; border-left: 2px solid var(--a2); padding: 0 0 0 .6rem; }
  .fig-scroll img { min-width: 620px; }
  .exp-legend { padding: .55rem .9rem 0; }
  .exp-score { margin-left: 0; }
}

/* ------------------------------------------------ a11y affordances */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--ink); color: #fff; padding: .6rem 1rem; border-radius: 0 0 6px 0;
  font-family: var(--title-font); font-size: 14px;
}
.skip-link:focus { left: 0; color: #fff; }
.table-scroll:focus-visible, .fig-scroll:focus-visible,
.exp-tab:focus-visible, .opt:focus-visible, .reveal:focus-visible,
.seg button:focus-visible, .button:focus-visible, a:focus-visible {
  outline: 3px solid var(--a1); outline-offset: 2px;
}

/* ------------- analysis: the figure carries the finding, the caption states it */
.agroup-title {
  font-family: var(--title-font); font-size: 20px; font-weight: 700;
  color: var(--ink); text-align: center; margin: 0 0 1.7rem;
}
.agrid + .agroup-title {
  margin-top: 3.2rem; padding-top: 2.6rem; border-top: 2px solid var(--line);
}
.agrid { display: grid; gap: 2.4rem 2rem; margin: 0; }
.agrid + .agrid { margin-top: 2.4rem; }
.agrid.one { grid-template-columns: minmax(0, 1fr); }
.agrid.two { grid-template-columns: repeat(2, auto); justify-content: center; align-items: start; }
/* a shared image height keeps the two captions on one line, as the reference page does */
.agrid.two .aitem { max-width: none; }
.agrid.two .aitem img { height: 310px; width: auto; max-width: 100%; }
.aitem { margin: 0; min-width: 0; max-width: var(--w, 100%); }
.aitem img { display: block; margin: 0 auto; width: 100%; height: auto; border-radius: 6px; }
.acap {
  margin: .75rem auto 0; max-width: 64ch;
  font-size: 14.4px; line-height: 1.45; color: var(--muted); text-align: center;
}
.acap b { color: var(--ink); font-weight: 700; }
.agrid.two .acap { max-width: 100%; }

@media screen and (max-width: 768px) {
  /* stack the pair so each figure gets the full column width and stays legible */
  .agrid.two { grid-template-columns: minmax(0, 1fr); }
  .agrid.two .aitem img { height: auto; width: 100%; }
}

/* source of each example, shown beside the task chip */
.chip.src {
  font-family: var(--title-font); font-size: 11.5px; font-weight: 600;
  line-height: 1.6; border-radius: 999px; padding: .1rem .6rem;
  background: var(--surface); color: var(--muted); border: 1px solid var(--line);
  white-space: nowrap;
}
.chip.src.real { background: var(--a1-soft); color: var(--a1); border-color: #CFDDEC; }
