/* Flora-specific additions on top of the shared ASPIRE stylesheet. */

:root {
  --q3: #2f8f78;           /* normal */
  --q3-bg: #d9ebe5;
  --q2: #a8741a;           /* suboptimal */
  --q2-bg: #f1e3c8;
  --q1: #b9433f;           /* failure */
  --q1-bg: #f3d5d3;
}

/* ── Hero: endless honeycomb of robot-clip bubbles (drawn by main.js) ── */
.flora-hero { background: #05070a; }
.flora-bubbles {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}
.flora-bubbles canvas {
  display: block;
  width: 100%;
  height: 100%;
}
/* Source clips: kept in the DOM so they keep decoding, but invisible */
.hb-shelf {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}
.hb-shelf video { width: 1px; height: 1px; }
/* Clips stay at full brightness; only the side under the wordmark is shaded
   so it reads. */
.flora-hero .wall-vignette {
  background: linear-gradient(90deg, rgba(5, 7, 10, 0.82) 0%, rgba(5, 7, 10, 0.66) 30%, rgba(5, 7, 10, 0.2) 48%, transparent 58%);
}
.flora-hero.grid-hero .gh-content::before { display: none; }
@media (max-width: 860px) {
  .flora-hero .wall-vignette {
    background: radial-gradient(62% 70% at 50% 50%, rgba(5, 7, 10, 0.8) 0%, rgba(5, 7, 10, 0.55) 55%, transparent 100%);
  }
}
/* Let the pointer reach the bubbles through the wordmark and its scrim */
.flora-hero .gh-content,
.flora-hero .wall-vignette { pointer-events: none; }
.flora-hero .gh-title .gh-line-accent {
  font-size: 0.62em;
  margin: 0.25em 0;
  white-space: normal;
}

/* ── Buttons ── */
.btn-disabled {
  opacity: 0.55;
  cursor: default;
  pointer-events: none;
}
.btn-emoji { font-size: 1.05em; line-height: 1; }

/* ── Method components: text beside a paper figure ── */
.flora-component {
  grid-template-columns: 1fr 1.3fr;
  align-items: start;
}
.component-kicker {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--green-dim) !important;
  margin-bottom: 0.2rem;
}
.flora-component .component-text p + p { margin-top: 0.8rem; }
.component-figure { margin: 0; }
.component-figure img,
.flora-figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  padding: 0.75rem;
}
.flora-figure { max-width: 1100px; margin: 0 auto; }
.flora-figure .figure-caption {
  margin-top: 0.9rem;
  font-size: 0.86rem;
  line-height: 1.55;
  color: var(--muted);
}
.flora-list {
  margin: 0.7rem 0 0.8rem 1.1rem;
  line-height: 1.6;
  color: var(--muted);
}
.flora-list li { margin-bottom: 0.45rem; }
.flora-list strong { color: var(--text); }

/* Quality label chips and fills */
.q {
  display: inline-block;
  padding: 0 0.4em;
  border-radius: 4px;
  font-weight: 600;
  white-space: nowrap;
}
.q3 { color: var(--q3); background: var(--q3-bg); }
.q2 { color: var(--q2); background: var(--q2-bg); }
.q1 { color: var(--q1); background: var(--q1-bg); }
.q3-bg { background: var(--q3-bg); border-color: var(--q3) !important; }
.q2-bg { background: var(--q2-bg); border-color: var(--q2) !important; }
.q1-bg { background: var(--q1-bg); border-color: var(--q1) !important; }

/* ── Benchmarks ── */
.bench-grid > .chart-block { grid-column: 1 / -1; }
.chart-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.2rem 0 0.9rem;
}
.chart-toggle {
  font: inherit;
  font-size: 0.8rem;
  padding: 0.32rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.chart-toggle:hover { color: var(--text); border-color: var(--text); }
.chart-toggle.active {
  background: var(--text);
  border-color: var(--text);
  color: #fff;
}
.flora-group-legend { margin-top: 2rem; justify-content: center; }

/* Method: text on top, paper figure full width underneath */
.flora-component { grid-template-columns: 1fr; gap: 1.6rem; }
.flora-component .component-text { max-width: 52rem; }
.component-figure { max-width: 1100px; }


@media (max-width: 560px) {
  .intro-actions { flex-wrap: wrap; justify-content: center; gap: 0.5rem; }
  .intro-actions .btn { white-space: nowrap; padding: 0.5rem 0.85rem; font-size: 0.82rem; }
  .chart-toggle { font-size: 0.74rem; padding: 0.28rem 0.6rem; }
}


/* Overview video, between the model links and the abstract */
.flora-video {
  max-width: 960px;
  margin: 2rem auto 0;
}
.flora-video video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  background: #000;
}

/* BibTeX is now the last section on its own */

/* Animated cost-quality frontier */
.cost-block { max-width: 1100px; margin: 0 auto; }

/* ── Tighter vertical rhythm (the shared site CSS spaces sections ~240px apart) ── */
.section,
#benchmarks { padding: clamp(1.5rem, 2.5vw, 2rem) 0; }
.section-overview { padding-top: clamp(2rem, 3.5vw, 2.75rem); }
.section-header { margin-bottom: 1.25rem; padding-top: 1rem; }
.section-header.section-subhead { margin-top: 1.75rem; }
#benchmarks .section-subhead { margin-top: 1.75rem; }
.bench-grid { gap: 1.5rem; }
#bibtex #citation.section-subhead { margin-top: 0; }
#acknowledgements.section-subhead { margin-top: 2rem; }
#bibtex { padding-bottom: 2.5rem; }
.flora-video { margin-top: 1.25rem; }
@media (max-width: 720px) {
  .section,
  #benchmarks { padding: 1.25rem 0; }
  .section-overview { padding-top: 1.75rem; }
}

/* Scale section: the "From episodes to internet-scale data / Proven at scale" beats of the video */
.scale-block { text-align: center; max-width: 52rem; margin: 0 auto; }
.scale-block p { margin: 0; }
.scale-lead {
  font-family: "NVIDIA Sans", "Inter", system-ui, sans-serif;
  font-weight: 800;
  font-size: clamp(1.6rem, 3.6vw, 2.6rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text);
}
.scale-green { display: block; color: var(--green-dim); }
.scale-sub { margin-top: 0.6rem !important; color: var(--muted); font-size: 1rem; }
.scale-proof {
  margin: 1.75rem auto 0;
  padding: 1.5rem 1rem 1.6rem;
  max-width: 34rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8f4ef;
}
.scale-kicker { font-weight: 700; font-size: 1.05rem; color: var(--text); }
.scale-big {
  margin-top: 0.5rem !important;
  font-family: "NVIDIA Sans", "Inter", system-ui, sans-serif;
  font-weight: 800;
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--green-dim);
}
.scale-mid {
  font-family: "NVIDIA Sans", "Inter", system-ui, sans-serif;
  font-weight: 700;
  font-size: clamp(1.2rem, 2.8vw, 1.7rem);
  color: var(--text);
}
.scale-note { margin-top: 0.6rem !important; font-size: 0.86rem; color: var(--muted); }

/* ── Readable small text: notes, toggles, legends, navigation and code are
   kept close to body size on every screen. ── */
.page-authors { font-size: 1.02rem; }
.affiliation-line, .author-note-line { font-size: 1.02rem; }
.page-authors sup { font-size: 0.8em; }
.intro-actions .btn { font-size: 0.96rem; }
.nav-links .nav-link { font-size: 0.98rem; }
.nav-team { font-size: 0.86rem; }
.chart-toggle { font-size: 1rem; }
.chart-legend-text { font-size: 1rem; }
.bibtex-code { font-size: 0.96rem; }
.bibtex-copy { font-size: 0.92rem; }
.scale-note { font-size: 1rem; }
.hero-scroll-label { font-size: 0.8rem; }

/* Phones */
@media (max-width: 640px) {
  .hero-scroll-label { font-size: 0.74rem; }
  .page-authors { font-size: 1rem; }
  .affiliation-line, .author-note-line { font-size: 0.98rem; }
  .intro-actions .btn { font-size: 0.96rem; }
  .chart-toggle { font-size: 0.95rem; }
  .chart-legend-text { font-size: 0.98rem; }
  .bibtex-code { font-size: 0.86rem; padding-top: 2.9rem; } /* clear the Copy button */
  .bibtex-copy { font-size: 0.9rem; }
  .scale-note { font-size: 0.98rem; }
}

/* ── Capability scorecard (Table 1 of the paper), same colour coding ── */
.scorecard-card {
  background: #fff;
  border: 1px solid var(--line, #e3ddd3);
  border-radius: 12px;
  padding: 1rem 1.1rem 0.9rem;
  margin: 0 0 2.4rem;
}
.scorecard-wrap {
  overflow-x: auto;
  margin: 0 0 0.8rem;
  -webkit-overflow-scrolling: touch;
}
.scorecard { table-layout: fixed; }
.scorecard col.c-side { width: 2.4rem; }
.scorecard col.c-metric { width: 15.5rem; }
.scorecard col.c-arrow { width: 2rem; }
.scorecard {
  --sc-text: #152019;
  --sc-muted: #5c6862;
  --sc-band: #f4f6f2;
  --sc-rule: #e1e6df;
  --sc-green: #466c27;
  --sc-flora-head: #edf3e6;
  --sc-flora-rule: #809b69;
  --sc-flora-best: #dce9ce;
  --sc-base-best: #e5e9e3;
  width: 100%;
  min-width: 760px;
  border-collapse: separate;
  border-spacing: 0;
  font-family: "NVIDIA Sans", "Inter", system-ui, sans-serif;
  font-size: 1.02rem;
  color: var(--sc-text);
  background: #fff;
  font-variant-numeric: tabular-nums;
}
.scorecard th, .scorecard td { padding: 0.5rem 0.6rem; font-weight: 400; }
.scorecard thead th {
  color: var(--sc-text);
  font-weight: 500;
  font-size: 0.95rem;
  line-height: 1.3;
  text-align: center;
  vertical-align: bottom;
  border-bottom: 1px solid var(--sc-rule);
  background: #fff;
}
.scorecard .sc-groups th { border-bottom: 0; }
.scorecard .sc-models th { white-space: nowrap; padding-left: 0.3rem; padding-right: 0.3rem; }
.scorecard .sc-group,
.scorecard .sc-metric-head {
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--sc-muted);
}
.scorecard .sc-metric-head { text-align: left; vertical-align: top; padding-top: 0.9rem; }
.scorecard .sc-flora-head {
  color: var(--sc-green);
  font-weight: 700;
  font-size: 1.1rem;
  background: var(--sc-flora-head);
  border-top: 3px solid var(--sc-flora-rule);
  vertical-align: middle;
}
.scorecard .sc-side {
  width: 2.4rem;
  padding: 0;
  background: var(--sc-band);
  border-bottom: 0;
  vertical-align: middle;
}
.scorecard thead .sc-side { background: #fff; }
.scorecard .sc-side span {
  display: block;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  margin: 0 auto;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sc-muted);
  white-space: nowrap;
}
.scorecard tbody + tbody .sc-bench:first-child th { border-top: 0.6rem solid #fff; }
.scorecard tbody + tbody .sc-side { border-top: 0.6rem solid #fff; }
.scorecard .sc-bench th {
  text-align: left;
  font-weight: 600;
  background: var(--sc-band);
  border-left: 0.6rem solid #fff;
  padding-top: 0.55rem;
  padding-bottom: 0.55rem;
}
.scorecard .sc-subset { margin-left: 0.8rem; font-size: 0.86rem; font-weight: 400; color: var(--sc-muted); }
.scorecard .sc-metric { text-align: left; white-space: nowrap; padding-left: 1.2rem; }
.scorecard .sc-arrow { color: var(--sc-muted); text-align: center; padding-left: 0; padding-right: 0; }
.scorecard td { text-align: center; border-bottom: 1px solid var(--sc-rule); white-space: nowrap; }
.scorecard tbody tr:not(.sc-bench) .sc-metric { border-bottom: 1px solid var(--sc-rule); }
.scorecard tbody tr:not(.sc-bench) .sc-metric { border-left: 0.6rem solid #fff; }
.scorecard td.sc-flora { color: var(--sc-green); }
.scorecard td.sc-best { background: var(--sc-base-best); font-weight: 700; }
.scorecard td.sc-flora.sc-best { background: var(--sc-flora-best); color: var(--sc-green); }
.sc-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 2rem;
  margin: 0;
  font-family: "NVIDIA Sans", "Inter", system-ui, sans-serif;
  font-size: 0.95rem;
  color: var(--sc-text, #152019);
}
.sc-legend-flora { color: #466c27; font-weight: 600; }
.sc-legend-best { display: inline-flex; align-items: center; gap: 0.25rem; }
.sc-legend-best .sw { display: inline-block; width: 1rem; height: 1rem; }
.sc-legend-best .sw-flora { background: #dce9ce; }
.sc-legend-best .sw-base { background: #e5e9e3; margin-right: 0.4rem; }
.sc-legend-note { margin-left: auto; color: #5c6862; }
@media (max-width: 1100px) {
  .scorecard col.c-metric { width: 13.5rem; }
  .scorecard { min-width: 720px; }
}
@media (max-width: 640px) {
  .scorecard { font-size: 0.95rem; min-width: 620px; }
  .scorecard .sc-side, .scorecard col.c-side { display: none; }
  .scorecard col.c-metric { width: 11.5rem; }
  .scorecard .sc-metric { white-space: normal; padding-left: 0.7rem; }
  .scorecard-card { padding: 0.75rem 0.6rem 0.7rem; }
  .sc-legend-note { margin-left: 0; }
}

/* Scorecard hover: row + column crosshair, focused cell outlined */
.scorecard td, .scorecard .sc-metric, .scorecard .sc-models th, .scorecard .sc-flora-head {
  transition: background-color 0.15s ease, box-shadow 0.15s ease, color 0.15s ease;
}
.scorecard td[data-col] { cursor: default; }
.scorecard .sc-row-hover td,
.scorecard .sc-row-hover .sc-metric,
.scorecard td.sc-col-hover { background: #eff2eb; }
.scorecard .sc-row-hover td.sc-flora,
.scorecard td.sc-flora.sc-col-hover { background: #e8f0de; }
.scorecard .sc-row-hover td.sc-best,
.scorecard td.sc-best.sc-col-hover { background: #d9dfd6; }
.scorecard .sc-row-hover td.sc-flora.sc-best,
.scorecard td.sc-flora.sc-best.sc-col-hover { background: #cfe2bb; }
.scorecard .sc-row-hover .sc-metric { color: var(--sc-text); font-weight: 600; }
.scorecard td.sc-cell-hover { box-shadow: inset 0 0 0 2px #9aa59f; font-weight: 700; }
.scorecard td.sc-flora.sc-cell-hover { box-shadow: inset 0 0 0 2px var(--sc-flora-rule); }
.scorecard .sc-models th.sc-col-hover { box-shadow: inset 0 -3px 0 #9aa59f; color: var(--sc-text); }
.scorecard .sc-flora-head.sc-col-hover { background: #e2edd5; }

/* Hero: Flora's live caption beside an open bubble */
.hb-caption {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 4;
  width: min(22rem, calc(100% - 20px));
  padding: 0.75rem 0.95rem 0.7rem;
  border-radius: 12px;
  background: rgba(8, 11, 15, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.45);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: #fff;
  font-family: "NVIDIA Sans", "Inter", system-ui, sans-serif;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s linear;
  will-change: transform, opacity;
}
.hb-cap-head { display: flex; flex-direction: column; gap: 0.1rem; margin-bottom: 0.45rem; }
.hb-cap-kind {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #8fd11f;
}
.hb-cap-title { font-size: 1.02rem; font-weight: 700; }
.hb-cap-text { margin: 0 !important; font-size: 0.98rem; line-height: 1.4; color: rgba(255, 255, 255, 0.92); }
.hb-cap-foot {
  margin-top: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: rgba(255, 255, 255, 0.55);
}
@media (max-width: 640px) {
  .hb-caption { width: min(16rem, calc(100% - 20px)); padding: 0.55rem 0.7rem; }
  .hb-cap-title { font-size: 0.92rem; }
  .hb-cap-text { font-size: 0.86rem; }
  .hb-cap-head { margin-bottom: 0.3rem; }
}

/* Hero: reward prediction cards (outcome score, dense quality, rubric) */
.hb-caption { --q-normal: #76b900; --q-suboptimal: #e3a72f; --q-failure: #ec5b52; }
.hb-reward .hb-cap-kind { color: #f0b84a; }
.hb-score { display: flex; align-items: baseline; gap: 0.35rem; margin: 0.1rem 0 0.35rem; }
.hb-score b { font-size: 2.2rem; line-height: 1; font-weight: 800; color: var(--q-normal); }
.hb-score.q-suboptimal b { color: var(--q-suboptimal); }
.hb-score.q-failure b { color: var(--q-failure); }
.hb-score span { font-size: 1rem; color: rgba(255, 255, 255, 0.6); }
.hb-timeline {
  position: relative;
  height: 0.7rem;
  margin: 0.2rem 0 0.55rem;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
}
.hb-timeline i { position: absolute; top: 0; bottom: 0; min-width: 2px; }
.hb-timeline .q-normal { background: color-mix(in srgb, var(--q-normal) 55%, transparent); }
.hb-timeline .q-suboptimal { background: var(--q-suboptimal); }
.hb-timeline .q-failure { background: var(--q-failure); }
.hb-now {
  position: absolute;
  top: -2px;
  bottom: -2px;
  width: 3px;
  margin-left: -1.5px;
  border-radius: 2px;
  background: #fff;
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.8);
}
.hb-quality { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.35rem; }
.hb-chip {
  padding: 0.12rem 0.55rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: capitalize;
  color: #0b0f14;
}
.hb-chip.q-normal { background: var(--q-normal); }
.hb-chip.q-suboptimal { background: var(--q-suboptimal); }
.hb-chip.q-failure { background: var(--q-failure); color: #fff; }
.hb-at { font-family: var(--font-mono); font-size: 0.74rem; color: rgba(255, 255, 255, 0.6); }
.hb-rubric { list-style: none; margin: 0.1rem 0 0.4rem; padding: 0; display: grid; gap: 0.32rem; }
.hb-rubric li { display: flex; justify-content: space-between; align-items: baseline; gap: 0.75rem; font-size: 0.88rem; line-height: 1.3; }
.hb-rubric li span { color: rgba(255, 255, 255, 0.92); }
.hb-rubric li em { display: block; font-style: normal; font-size: 0.76rem; color: rgba(255, 255, 255, 0.55); }
.hb-rubric li b { font-family: var(--font-mono); font-size: 0.8rem; white-space: nowrap; }
.hb-rubric li b.full { color: var(--q-normal); }
.hb-rubric li b.part { color: var(--q-suboptimal); }
.hb-rubric li b.none { color: var(--q-failure); }
.hb-total { font-size: 0.86rem; color: rgba(255, 255, 255, 0.75); }
.hb-total b { color: #fff; font-size: 1rem; }
@media (max-width: 640px) {
  .hb-score b { font-size: 1.7rem; }
  .hb-rubric li { font-size: 0.8rem; }
  .hb-rubric li em { display: none; }
}

/* ── Hero: overview video behind the wordmark ── */
/* The header takes the video's own 16:9 shape (up to the screen height),
   so the whole frame is visible and nothing is cropped. On windows wider
   than 16:9 the video is centred with black at the sides. */
.flora-hero.hero {
  height: min(56.25vw, 100svh);
  min-height: 0;
}
/* Full brightness: nothing sits on top of the video but the scroll cue. */
.flora-hero .wall-vignette { display: none; }
.hero-bg-video {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  pointer-events: none;
}

/* ── Explore: full-width band of world bubbles under the abstract ── */
.flora-explore { padding-bottom: 0 !important; }
.explore-stage {
  position: relative;
  height: clamp(450px, 73vh, 730px);
  background: #05070a;
  overflow: hidden;
  isolation: isolate;
}

/* Explore filters: captions, reward within an episode, success given language */
.explore-filters { justify-content: center; margin: 0.4rem 0 0.5rem; }
.explore-hint {
  text-align: center;
  color: var(--muted);
  max-width: 46rem;
  margin: 0 auto 1.1rem;
}
.flora-bubbles canvas { transition: opacity 0.2s ease; }
.flora-bubbles canvas.hb-swap { opacity: 0; }
.hb-pair {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.15rem 0.6rem;
  align-items: center;
  margin-top: 0.6rem;
  padding-top: 0.55rem;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}
.hb-pair-kind { grid-column: 1 / -1; font-size: 0.72em; letter-spacing: 0.06em; text-transform: uppercase; opacity: 0.7; }
.hb-pair-task { font-size: 0.92em; }
