/* ==========================================================================
   GaussianSelector project page.

   Design system lifted from lllab.org: Manrope headings over Inter body,
   large-radius panels distinguished by background tint rather than borders,
   pill buttons, and a compact 1.5 body leading.
   ========================================================================== */

:root {
  --page-bg:     #f8f9fa;
  --panel-bg:    #fefefe;
  --panel-tint:  #eef1f3;
  --line:        #e5e7eb;
  --ink:         #0a0a0a;
  --ink-mid:     #4b5563;
  --ink-soft:    #6b7280;
  --ink-faint:   #9ca3af;
  --accent:      #0a0a0a;

  --font-heading: "Manrope", "Inter", system-ui, sans-serif;
  --font-body:    "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono:    "JetBrains Mono", "SF Mono", ui-monospace, monospace;

  --radius-panel: 28px;
  --radius-media: 18px;
  --shadow-soft:  0 2px 10px rgba(0, 0, 0, .08);
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  background: var(--page-bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --- Panels ---------------------------------------------------------------
   Separation comes from the fill, not from an outline. Alternate sections
   pick up the tint so the page reads as a stack of cards.                   */

.hero.is-light,
.section.hero.is-light { background: transparent; }

.hero .container.is-max-desktop,
.section .container.is-max-desktop {
  /* Bulma's .hero is a flex container and .container carries margin: 0 auto,
     which suppresses stretching; without this a panel whose content has no
     intrinsic width (the video) collapses. */
  width: 100%;
  background: var(--panel-bg);
  border-radius: var(--radius-panel);
  padding: 2.75rem 3rem;
}

.hero.is-light .container.is-max-desktop,
.section.hero.is-light .container.is-max-desktop {
  background: var(--panel-tint);
}

/* The title block is the page header, not one card among many. */
body > section:first-of-type .container.is-max-desktop {
  background: transparent;
  padding: 1rem 1.5rem 0;
}

.section, .hero { padding: 0.5rem 1.25rem; }
.hero-body { padding: 1rem 0; }

/* --- Title block ---------------------------------------------------------- */

.publication-logo {
  display: block;
  width: 52px;
  height: auto;
  margin: 0 auto 1.25rem;
}

.publication-title {
  font-family: var(--font-heading) !important;
  font-weight: 700 !important;
  font-size: 2.75rem !important;
  line-height: 1.08 !important;
  letter-spacing: -0.02em;
  color: var(--ink) !important;
  margin-bottom: 1.5rem !important;
}

.publication-authors {
  font-family: var(--font-body) !important;
  font-size: 1rem !important;
  line-height: 1.6;
  color: var(--ink-mid);
  margin-bottom: 0.35rem;
  /* A flex row reads as a centred line on a wide screen. On a narrow one it
     becomes a column, so a name never breaks mid-way across two lines. */
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0 0.35rem;
}

.publication-authors a { color: var(--ink) !important; }
.publication-authors a:hover { text-decoration: underline; }
.author-block { display: inline-block; }

.eql-cntrb {
  font-family: var(--font-heading);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink-faint);
}

.dnerf { font-variant: small-caps; }

/* --- Buttons: full pills, matching the lab nav ---------------------------- */

.button.is-dark {
  background: var(--accent);
  border-color: var(--accent);
  border-radius: 999px !important;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: -0.005em;
  padding: 0.6rem 1.4rem;
  height: auto;
  box-shadow: var(--shadow-soft);
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.button.is-dark:hover { opacity: 0.88; transform: translateY(-1px); }

.link-block a { margin: 5px 5px; }

/* --- Section headings ----------------------------------------------------- */

.title.is-3 {
  font-family: var(--font-heading) !important;
  font-weight: 600 !important;
  font-size: 1.875rem !important;
  line-height: 1.25 !important;
  letter-spacing: -0.01em;
  color: var(--ink) !important;
  margin-bottom: 1.75rem !important;
}

.title.is-5 {
  font-family: var(--font-heading) !important;
  font-weight: 600 !important;
  letter-spacing: -0.005em;
  color: var(--ink) !important;
}

/* --- Body copy ------------------------------------------------------------ */

/* :not(.container) matters: the BibTeX panel carries both classes on one div,
   and the measure cap below would otherwise shrink the whole panel. */
.content:not(.container) {
  max-width: 60ch;
  margin-left: auto;
  margin-right: auto;
}

.content {
  color: var(--ink-mid);
  line-height: 1.55;
  font-size: 1rem;
  /* Justified text needs a wide measure to avoid rivers; at the ~40 characters
     a phone allows it falls apart, so the copy is ranged left instead. */
  text-align: left;
}

.content p:not(:last-child) { margin-bottom: 0.9rem; }
.content strong { color: var(--ink); font-weight: 600; }
.content em,
.subtitle em { color: inherit; font-style: italic; }

/* --- Figures -------------------------------------------------------------- */

.fig { margin: 0 0 2rem; }
.fig:last-child { margin-bottom: 0; }

.fig img {
  display: block;
  width: 100%;
  height: auto;
  margin: 0 auto;
  background: #fff;
  border-radius: var(--radius-media);
}

.fig .subtitle {
  margin: 1.1rem 0 0;
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--ink-soft);
}

.teaser .hero-body { padding: 0.5rem 0 1rem; }

/* --- Video ---------------------------------------------------------------- */

.publication-video {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--radius-media);
  background: #000;
}

.publication-video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* --- Equations ------------------------------------------------------------ */
/* A display equation can outrun the column on a narrow screen. Give it its own
   scroll track so the page itself never scrolls sideways. MathJax 3 cannot
   line-break display math, so scrolling is the only non-destructive option. */

.content mjx-container[display="true"] {
  margin: 1.4rem 0 !important;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 2px;
}

/* --- BibTeX --------------------------------------------------------------- */

#BibTeX .title {
  font-family: var(--font-heading) !important;
  font-weight: 600 !important;
  font-size: 1.875rem !important;
  letter-spacing: -0.01em;
  color: var(--ink) !important;
}

#BibTeX pre {
  background: var(--panel-tint);
  border: 0;
  border-radius: var(--radius-media);
  padding: 1.4rem 1.6rem;
  font-size: 0.78rem;
  line-height: 1.6;
  overflow-x: auto;
}

#BibTeX code {
  background: transparent;
  color: var(--ink);
  font-family: var(--font-mono);
}

/* --- Footer --------------------------------------------------------------- */

.footer {
  background: transparent;
  color: var(--ink-faint);
  font-size: 0.8rem;
  padding: 2rem 1.5rem 3rem;
}

.footer a { color: var(--ink-soft); text-decoration: underline; }
.footer a:hover { color: var(--ink); }

/* --- Narrow screens ------------------------------------------------------- */

@media screen and (max-width: 768px) {
  /* Reclaim horizontal room: the old 20px + 20px of section and panel padding
     ate 21% of a 375px screen, leaving roughly 35 characters per line. */
  .section, .hero { padding-left: 0.75rem; padding-right: 0.75rem; }

  .hero .container.is-max-desktop,
  .section .container.is-max-desktop {
    padding: 1.6rem 1rem;
    border-radius: 20px;
  }

  .publication-title { font-size: 1.75rem !important; }
  .title.is-3, #BibTeX .title { font-size: 1.4rem !important; }
  .publication-logo { width: 42px; }
  .fig .subtitle { font-size: 0.82rem; }

  /* One author per line, ranged left, so no name is split across a break. */
  .publication-authors {
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    font-size: 0.95rem !important;
    gap: 0.15rem 0;
  }

  .publication-authors .eql-cntrb { align-self: flex-start; }
}

/* --- Table crops ----------------------------------------------------------
   A table crop is not a figure: rendered at the full column width its type
   dwarfs the running text. These come from a 250pt paper column, so ~500px
   sets the table type just above the 16px body -- large enough to read as a
   distinct element, small enough not to shout. */

.fig--table img {
  max-width: 500px;
}

@media screen and (max-width: 768px) {
  .fig--table img { max-width: 100%; }
}
