/* OSWorld-Science page 2: design tokens, typography, navigation, hero, masthead, section frame and footer.
   Loaded after every template stylesheet; the section files in this folder build on these tokens.

   Palette   ink #101419 on a cool lab-paper ground #f3f4f0, white surfaces, night bands #0b0f14,
             one accent (cobalt #2344c4) for links and active controls. Domain colours appear only as data.
   Type      Instrument Sans (display and interface), Newsreader (reading text), IBM Plex Mono (labels, numbers). */

body.minimal-home.p2 {
  --p2-ink: #101419;
  --p2-ink-2: #343b44;
  --p2-muted: #666e78;
  --p2-faint: #9aa1a9;
  --p2-paper: #f3f4f0;
  --p2-surface: #ffffff;
  --p2-surface-2: #f8f9f6;
  --p2-line: #dcdfd8;
  --p2-line-strong: #c3c7bf;
  --p2-night: #0b0f14;
  --p2-night-2: #141a22;
  --p2-night-line: rgba(255, 255, 255, 0.12);
  --p2-on-night: #eceee9;
  --p2-on-night-muted: #9aa3ad;
  --p2-accent: #2344c4;
  --p2-accent-soft: rgba(35, 68, 196, 0.07);
  --p2-accent-night: #a3b4ff;
  --p2-display: "Instrument Sans", "Helvetica Neue", Arial, sans-serif;
  --p2-serif: "Newsreader", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --p2-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --p2-wrap: 1200px;
  --p2-gutter: 32px;
  --p2-radius: 4px;
  --p2-radius-lg: 8px;
  --p2-section-y: 104px;

  /* the template's own variables, re-pointed at this theme */
  --display: var(--p2-display);
  --sans: var(--p2-display);
  --mono: var(--p2-mono);
  --font-title: var(--p2-display);
  --font-body: var(--p2-display);
  --font-code: var(--p2-mono);
  --font-mono: var(--p2-mono);
  --osw-body: var(--p2-display);
  --osw-title: var(--p2-display);
  --osw-serif: var(--p2-serif);
  --osw-link: var(--p2-accent);
  --osw-text: var(--p2-ink-2);
  --osw-heading: var(--p2-ink);
  --osw-soft: var(--p2-surface-2);
  --osw-border: var(--p2-line);

  background: var(--p2-paper);
  color: var(--p2-ink);
  font-family: var(--p2-display);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.p2 .benchmark-sweep {
  --bs-paper: var(--p2-surface-2);
  --bs-ink: var(--p2-ink);
  --bs-muted: var(--p2-muted);
  --bs-line: var(--p2-line);
  --bs-grid: rgba(16, 20, 25, 0.06);
  --bs-axis: var(--p2-ink-2);
  --bs-shadow: none;
}

html { scroll-padding-top: 76px; }

body.p2 ::selection { background: rgba(35, 68, 196, 0.16); }

body.p2 a { color: var(--p2-accent); text-underline-offset: 3px; }
body.p2 a:focus-visible,
body.p2 button:focus-visible,
body.p2 [tabindex]:focus-visible {
  outline: 2px solid var(--p2-accent);
  outline-offset: 2px;
  border-radius: 2px;
}

body.p2 .title,
body.p2 .subtitle,
body.p2 .content,
body.p2 .button { font-family: var(--p2-display) !important; }

body.p2 code,
body.p2 pre,
body.p2 kbd { font-family: var(--p2-mono) !important; }

/* ---------- shared frame ---------- */
body.p2 .p2-wrap {
  max-width: var(--p2-wrap);
  margin: 0 auto;
  padding: 0 var(--p2-gutter);
}

body.p2 main > .section {
  padding: var(--p2-section-y) 0;
  background: var(--p2-paper);
  border-top: 1px solid var(--p2-line);
}

body.p2 main > .section > .container.is-max-desktop,
body.p2 main > .section > .container {
  max-width: var(--p2-wrap) !important;
  padding: 0 var(--p2-gutter);
}

body.p2 #results,
body.p2 #leaderboard,
body.p2 #side-by-side { background: var(--p2-surface); }

body.p2 #analysis,
body.p2 #citation {
  background: var(--p2-night);
  color: var(--p2-on-night);
  border-top-color: var(--p2-night);
}

/* ---------- section heading: left-aligned eyebrow, title and deck ---------- */
body.p2 .section-heading {
  justify-content: flex-start !important;
  text-align: left !important;
  margin: 0 0 48px !important;
}

body.p2 .section-heading > .column {
  flex: none !important;
  width: 100% !important;
  max-width: 900px;
  margin: 0 !important;
  padding-top: 0;
  padding-bottom: 0;
}

body.p2 .p2-eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 16px !important;
  font: 500 12px/1.4 var(--p2-mono) !important;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--p2-muted) !important;
  text-align: left !important;
}

body.p2 .p2-eyebrow::before {
  content: "";
  flex: none;
  width: 24px;
  height: 2px;
  background: currentColor;
  opacity: 0.8;
}

body.p2 .section-heading .title.is-2 {
  margin: 0 0 16px !important;
  font: 600 clamp(2.15rem, 3.3vw, 3rem)/1.05 var(--p2-display) !important;
  font-stretch: 94%;
  letter-spacing: -0.024em !important;
  color: var(--p2-ink) !important;
  text-align: left !important;
}

body.p2 .section-deck {
  max-width: 64ch;
  margin: 0 !important;
  font: 400 1.2rem/1.55 var(--p2-serif) !important;
  color: var(--p2-ink-2) !important;
  text-align: left !important;
}

body.p2 #analysis .title.is-2,
body.p2 #citation .title.is-2 { color: #fff !important; }
body.p2 #analysis .p2-eyebrow,
body.p2 #citation .p2-eyebrow { color: var(--p2-on-night-muted) !important; }
body.p2 #analysis .section-deck,
body.p2 #citation .section-deck { color: var(--p2-on-night-muted) !important; }

/* ---------- buttons ---------- */
body.p2 .p2-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: var(--p2-radius);
  font: 600 14px/1 var(--p2-display);
  letter-spacing: 0.005em;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

body.p2 .p2-btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
body.p2 .p2-btn-solid { background: var(--p2-ink); color: #fff; }
body.p2 .p2-btn-solid:hover { background: #000; color: #fff; }
body.p2 .p2-btn-ghost { border-color: var(--p2-line-strong); background: transparent; color: var(--p2-ink); }
body.p2 .p2-btn-ghost:hover { border-color: var(--p2-ink); color: var(--p2-ink); }
body.p2 .p2-btn-light { background: #fff; color: var(--p2-night); }
body.p2 .p2-btn-light:hover { background: #dfe4ff; color: var(--p2-night); }
body.p2 .p2-btn-outline-light { border-color: rgba(255, 255, 255, 0.26); background: transparent; color: var(--p2-on-night); }
body.p2 .p2-btn-outline-light:hover { border-color: #fff; color: #fff; }

/* ---------- navigation ---------- */
body.p2 .p2-nav {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(243, 244, 240, 0.86);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--p2-line);
}

body.p2 .p2-nav-inner {
  display: flex;
  align-items: center;
  gap: 28px;
  max-width: 1320px;
  height: 58px;
  margin: 0 auto;
  padding: 0 var(--p2-gutter);
}

body.p2 .p2-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font: 650 15px/1 var(--p2-display);
  letter-spacing: -0.01em;
  color: var(--p2-ink);
  text-decoration: none;
  white-space: nowrap;
}

body.p2 .p2-brand-mark {
  display: inline-block;
  flex: none;
  width: 24px;
  height: 8px;
  border-radius: 1px;
}

body.p2 .p2-nav-links {
  display: flex;
  gap: 20px;
  margin-left: auto;
}

body.p2 .p2-nav-links a {
  padding: 19px 0 17px;
  border-bottom: 2px solid transparent;
  font: 500 13.5px/1 var(--p2-display);
  color: var(--p2-muted);
  text-decoration: none;
  white-space: nowrap;
}

body.p2 .p2-nav-links a:hover { color: var(--p2-ink); }
body.p2 .p2-nav-links a.is-active { color: var(--p2-ink); border-bottom-color: var(--p2-ink); }

body.p2 .p2-nav-actions { display: flex; gap: 8px; }

/* ---------- hero ---------- */
body.p2 .p2-hero {
  position: relative;
  padding: 96px 0 80px;
  background: var(--p2-night);
  color: var(--p2-on-night);
}

body.p2 .p2-hero-top {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  column-gap: 64px;
  align-items: end;
}

/* kicker and title span the row; subtitle and the lede/buttons share the row below */
body.p2 .p2-hero-heading { display: contents; }
body.p2 .p2-kicker,
body.p2 .p2-title { grid-column: 1 / -1; }
body.p2 .p2-subtitle { grid-column: 1; grid-row: 3; align-self: start; }
body.p2 .p2-hero-side { grid-column: 2; grid-row: 3; align-self: start; padding-top: 6px; }

body.p2 .p2-kicker {
  margin: 0 0 24px;
  font: 500 12px/1.4 var(--p2-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--p2-on-night-muted);
}

body.p2 .p2-title {
  margin: 0 0 30px;
  font: 600 clamp(3.4rem, 8.2vw, 7.6rem)/0.92 var(--p2-display);
  white-space: nowrap;
  font-stretch: 90%;
  letter-spacing: -0.038em;
  color: #fff;
}

body.p2 .p2-subtitle {
  max-width: 24ch;
  margin: 0;
  font: 400 clamp(1.35rem, 2.1vw, 1.8rem)/1.25 var(--p2-serif);
  font-style: italic;
  color: #d6dad4;
  text-wrap: balance;
}

body.p2 .p2-lede {
  max-width: 44ch;
  margin: 0 0 26px;
  font: 400 1.08rem/1.6 var(--p2-serif);
  color: var(--p2-on-night-muted);
}

body.p2 .p2-cta { display: flex; flex-wrap: wrap; gap: 10px; }

body.p2 .p2-composition { margin: 64px 0 36px; }

body.p2 .p2-comp-bar { display: flex; gap: 2px; height: 10px; }
body.p2 .p2-comp-seg { display: block; min-width: 3px; height: 100%; }

body.p2 .p2-comp-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  font: 400 12.5px/1.3 var(--p2-mono);
  color: var(--p2-on-night-muted);
}

body.p2 .p2-comp-legend b { margin-left: 5px; font-weight: 500; color: #fff; }
body.p2 .p2-dot { display: inline-block; width: 8px; height: 8px; margin-right: 8px; vertical-align: 0; }

body.p2 .p2-hero-video { margin: 0; }

body.p2 .p2-hero-video video {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--p2-night-line);
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 48px 96px -48px rgba(0, 0, 0, 0.75);
}

body.p2 .p2-hero-video figcaption {
  margin-top: 14px;
  font: 400 12px/1.4 var(--p2-mono);
  color: var(--p2-on-night-muted);
}

body.p2 .p2-readouts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 64px;
}

body.p2 .p2-readout {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 22px 24px 0;
  border-top: 1px solid var(--p2-night-line);
  border-left: 1px solid var(--p2-night-line);
}

body.p2 .p2-readout:first-child { padding-left: 0; border-left: 0; }

body.p2 .p2-readout-value {
  font: 600 2.7rem/1 var(--p2-display);
  letter-spacing: -0.025em;
  color: #fff;
  font-variant-numeric: tabular-nums;
}

body.p2 .p2-readout-label {
  font: 400 11.5px/1.35 var(--p2-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--p2-on-night-muted);
}

/* ---------- masthead: authors, affiliations, institutions ---------- */
body.p2 .p2-masthead {
  padding: 60px 0 52px;
  background: var(--p2-surface);
  border-bottom: 1px solid var(--p2-line);
}

body.p2 .p2-masthead-grid {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 40px;
}

body.p2 .p2-masthead .p2-eyebrow { align-self: start; margin-top: 8px !important; }

body.p2 .p2-authors {
  margin: 0;
  font: 500 16.5px/1.95 var(--p2-display);
  color: var(--p2-ink);
}

body.p2 .p2-author { display: inline-block; margin-right: 16px; white-space: nowrap; }
body.p2 .p2-author sup { margin-left: 1px; font: 500 10px/1 var(--p2-mono); color: var(--p2-muted); }

body.p2 .p2-affiliations {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  margin: 18px 0 10px;
  padding: 0;
  list-style: none;
  font: 400 13.5px/1.55 var(--p2-display);
  color: var(--p2-muted);
}

body.p2 .p2-affiliations sup { margin-right: 3px; font-family: var(--p2-mono); }

body.p2 .p2-footnote { margin: 0; font-size: 13px; color: var(--p2-muted); }

body.p2 .p2-logos { margin: 32px 0 0; }

body.p2 .p2-logos img {
  display: block;
  width: 100%;
  max-width: 1040px;
  height: auto;
  filter: grayscale(1) contrast(1.05);
  opacity: 0.7;
  transition: filter 0.35s ease, opacity 0.35s ease;
}

body.p2 .p2-logos:hover img { filter: none; opacity: 1; }

/* ---------- footer ---------- */
body.p2 .p2-footer {
  background: var(--p2-night);
  border-top: 1px solid var(--p2-night-line);
  color: var(--p2-on-night-muted);
  font: 400 12.5px/1.4 var(--p2-mono);
}

body.p2 .p2-footer-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-top: 28px;
  padding-bottom: 32px;
}

body.p2 .p2-footer a { margin-left: auto; color: var(--p2-on-night); text-decoration: none; }
body.p2 .p2-footer a:hover { color: #fff; }

/* ---------- reveal on scroll (script adds html.p2-js; reduced motion disables it) ---------- */
html.p2-js body.p2 .p2-reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

html.p2-js body.p2 .p2-reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html.p2-js body.p2 .p2-reveal { opacity: 1; transform: none; transition: none; }
  body.p2 .p2-logos img { transition: none; }
}

/* ---------- narrower desktops ---------- */
@media (max-width: 1240px) {
  body.p2 .p2-nav-links { gap: 14px; }
  body.p2 .p2-nav-links a[data-p2-nav="side-by-side"],
  body.p2 .p2-nav-links a[data-p2-nav="showcase"] { display: none; }
}

@media (max-width: 1080px) {
  body.p2 .p2-nav-links { display: none; }
  body.p2 .p2-nav-actions { margin-left: auto; }
  body.p2 .p2-hero-top { grid-template-columns: minmax(0, 1fr); row-gap: 28px; }
  body.p2 .p2-subtitle,
  body.p2 .p2-hero-side { grid-column: 1; grid-row: auto; }
}

@media (max-width: 720px) {
  body.minimal-home.p2 { --p2-gutter: 18px; --p2-section-y: 64px; }
  body.p2 .p2-nav-actions .p2-btn-ghost { display: none; }
  body.p2 .p2-readouts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.p2 .p2-readout:nth-child(3) { padding-left: 0; border-left: 0; }
  body.p2 .p2-masthead-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
}

/* ---------- template overrides ----------
   stylesheets/index.css and osworld-official-match.css style .section and .section-heading with body.minimal-home selectors
   and !important; these rules outrank them. Section files may still refine their own section with id selectors. */
html body.minimal-home.p2 main > section.section {
  padding: var(--p2-section-y) 0 !important;
  border: 0 !important;
  border-top: 1px solid var(--p2-line) !important;
  background: var(--p2-paper) !important;
}

html body.minimal-home.p2 main > section.section#results,
html body.minimal-home.p2 main > section.section#leaderboard,
html body.minimal-home.p2 main > section.section#side-by-side { background: var(--p2-surface) !important; }

html body.minimal-home.p2 main > section.section#analysis,
html body.minimal-home.p2 main > section.section#citation {
  background: var(--p2-night) !important;
  border-top-color: var(--p2-night) !important;
}

html body.minimal-home.p2 main > section.section > .container {
  max-width: var(--p2-wrap) !important;
  margin: 0 auto !important;
  padding: 0 var(--p2-gutter) !important;
}

html body.minimal-home.p2 main .section-heading.columns,
html body.minimal-home.p2 main .section-heading.has-text-centered {
  display: flex !important;
  justify-content: flex-start !important;
  margin: 0 0 48px !important;
  text-align: left !important;
}

html body.minimal-home.p2 main .section-heading.columns > .column,
html body.minimal-home.p2 main .section-heading .column.is-four-fifths {
  flex: none !important;
  width: 100% !important;
  max-width: 900px !important;
  margin: 0 !important;
  padding: 0 !important;
}

html body.minimal-home.p2 main .section-heading .title.is-2 {
  margin: 0 0 16px !important;
  font: 600 clamp(2.15rem, 3.3vw, 3rem)/1.05 var(--p2-display) !important;
  letter-spacing: -0.024em !important;
  color: var(--p2-ink) !important;
  text-align: left !important;
}

html body.minimal-home.p2 main .section-heading .section-deck {
  max-width: 64ch !important;
  margin: 0 !important;
  text-align: left !important;
}

html body.minimal-home.p2 main > section.section#analysis .section-heading .title.is-2,
html body.minimal-home.p2 main > section.section#citation .section-heading .title.is-2 { color: #fff !important; }

/* the paper figure continues the abstract: no divider and no top padding of its own */
html body.minimal-home.p2 main > section.section.main-figure-section {
  padding-top: 0 !important;
  border-top: 0 !important;
}
