/* SpecKCast project page. Bulma (bulma.min.css) supplies the grid and typography base; this file adds the page's own
   components: hero, teaser, comparison videos, method steps, results tables, figures, BibTeX. */

:root {
  --text: #1f2430;
  --muted: #5b6475;
  --faint: #687183;       /* 4.9:1 on white, 4.6:1 on --bg-soft */
  --rule: #e4e7ec;
  --bg: #ffffff;
  --bg-soft: #f6f7f9;
  --accent: #2563c9;       /* SpecKCast */
  --accent-soft: #eaf1fc;
  --best: #1f2430;
  --warm: #c2410c;          /* compute steps in the method diagram */
}

body { font-family: "Noto Sans", system-ui, sans-serif; color: var(--text); background: var(--bg); }
.title, .subtitle, .publication-title, .section-title { font-family: "Google Sans", "Noto Sans", sans-serif; }
a { color: var(--accent); }
a:hover { color: #1748a0; }

/* ---------- hero ---------- */
.hero-body { padding-bottom: 1.5rem; }
.publication-title { font-size: clamp(1.9rem, 4.2vw, 3rem); line-height: 1.15; color: var(--text); margin-bottom: 1rem !important; }
.publication-title .name { font-weight: 800; }
.publication-title .rest { display: block; font-weight: 400; font-size: 0.72em; margin-top: 0.35rem; }
/* the parts of the name: Spec(tral) K(alman) (fore)cast(ing), blue -> violet -> magenta */
.nm-spec { color: #1d4ed8; }
.nm-k { color: #6d28d9; }
.nm-cast { color: #a21caf; }
.publication-title .rest .nm-spec, .publication-title .rest .nm-k, .publication-title .rest .nm-cast { font-weight: 600; }
/* where text can be painted with a gradient, the name runs through the same three colours */
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .publication-title .name { display: inline-block; background: linear-gradient(90deg, #1d4ed8 8%, #6d28d9 52%, #a21caf 92%);
    -webkit-background-clip: text; background-clip: text; color: transparent; }
  .publication-title .name > span { color: transparent; }
}
.publication-authors { font-family: "Google Sans", sans-serif; font-size: 1.15rem; }
.publication-authors .author-block { display: inline-block; margin: 0 0.45rem; }
.publication-authors a { color: var(--accent) !important; }
.publication-authors sup { font-size: 0.7em; }
.affiliations { margin-top: 0.4rem; color: var(--muted); font-size: 1rem; }
.affiliations span { display: inline-block; margin: 0 0.5rem; }
.footnote { margin-top: 1rem; color: var(--faint); font-size: 0.85rem; }

.publication-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; margin-top: 1rem; }
.link-btn { display: inline-flex; align-items: center; gap: 0.45rem; padding: 0.5rem 1.1rem; border-radius: 999px;
  background: #23262d; color: #fff !important; font-family: "Google Sans", sans-serif; font-size: 0.98rem; line-height: 1;
  transition: background 0.15s; }
.link-btn:hover { background: #3a3f4a; }
.link-btn svg, .link-btn .ai { width: 1.05em; height: 1.05em; font-size: 1.05em; }
.link-btn--soon { background: transparent; color: var(--muted) !important; border: 1px dashed #b7bdc8; cursor: default; }
.link-btn--soon:hover { background: transparent; }
.link-btn--soon em { font-style: normal; }

/* ---------- section scaffolding ---------- */
.section { padding: 2.75rem 1.25rem; }
.section.soft { background: var(--bg-soft); }
.section-title { font-size: 1.9rem; font-weight: 600; text-align: center; margin-bottom: 0.4rem; color: var(--text); }
.section-lede { max-width: 46rem; margin: 0 auto 1.6rem; text-align: center; color: var(--muted); font-size: 1.05rem; line-height: 1.6; }
/* beat Bulma's .container max-widths at 1216px+ */
.narrow, .container.narrow:not(.is-max-desktop):not(.is-max-widescreen) { max-width: 52rem; margin: 0 auto; }
.wide, .container.wide:not(.is-max-desktop):not(.is-max-widescreen) { max-width: 72rem; margin: 0 auto; }
/* the visual comparisons use more of the screen so the images are larger */
.container.wide.comparisons-wide:not(.is-max-desktop):not(.is-max-widescreen) { max-width: 88rem; }
.content p { line-height: 1.7; }
.caption { max-width: 52rem; margin: 0.8rem auto 0; text-align: center; color: var(--muted); font-size: 0.93rem; line-height: 1.55; }
.caption b { color: var(--text); }

/* segmented control (tables, teaser ratios) */
.seg { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.35rem; margin: 0 auto 1rem; }
.seg__btn { font: 500 0.92rem/1 "Google Sans", sans-serif; padding: 0.55rem 1rem; border-radius: 999px; cursor: pointer;
  border: 1px solid #cfd4dc; background: #fff; color: var(--muted); transition: all 0.15s; }
.seg__btn:hover { color: var(--text); border-color: #9aa3b2; }
.seg__btn[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: #fff; }

/* ---------- teaser: a reference / SpecKCast video pair ---------- */
.teaser-videos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.8rem; max-width: 64rem; margin: 0 auto; }
.teaser-videos .video-cell { flex: none; }
.teaser-videos .m { font-size: 1.05rem; }
.tldr { max-width: 50rem; margin: 2.4rem auto 0; text-align: center; font-size: 1.12rem; line-height: 1.6; }
/* key facts: title on top, detail underneath */
.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem 1.6rem; max-width: 70rem; margin: 2.4rem auto 0; text-align: center; }
.fact b, .fact span { text-wrap: balance; }
.fact b { display: block; font: 700 1.08rem/1.3 "Google Sans", sans-serif; color: var(--text); }
.fact span { display: block; margin-top: 0.25rem; color: var(--muted); font-size: 0.9rem; line-height: 1.4; }

/* ---------- arrow carousels (teaser, video and image comparisons) ---------- */
/* the arrows sit in a gutter on either side, so they never cover the content */
.carousel { position: relative; padding: 0 3.6rem; }
.carousel--teaser { max-width: calc(64rem + 7.2rem); margin: 0 auto; }
.carousel__nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; display: grid; place-items: center;
  width: 2.75rem; height: 2.75rem; padding: 0; border-radius: 50%; border: 1px solid #cfd4dc; background: #fff; color: var(--text);
  cursor: pointer; box-shadow: 0 4px 14px rgba(15, 18, 24, 0.12); transition: border-color 0.15s, transform 0.15s; }
.carousel__nav[hidden] { display: none; }
.carousel__nav svg { width: 1.15rem; height: 1.15rem; }
.carousel__nav:hover { border-color: #9aa3b2; }
.carousel__nav--prev { left: 0; }
.carousel__nav--next { right: 0; }
.carousel__nav--prev:hover { transform: translateY(-50%) translateX(-2px); }
.carousel__nav--next:hover { transform: translateY(-50%) translateX(2px); }
.carousel__nav:focus-visible, .carousel__dot:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.carousel__dots { display: flex; justify-content: center; gap: 0.5rem; margin-top: 0.8rem; }
.carousel__dots[hidden] { display: none; }
.carousel__dot { width: 0.6rem; height: 0.6rem; padding: 0; border-radius: 50%; border: 0; background: #cfd4dc; cursor: pointer; }
.carousel__dot[aria-pressed="true"] { background: var(--text); }

/* ---------- comparison videos ---------- */
/* sets have 3-8 clips: fixed-width tiles in centred rows, so tiles keep one size across sets */
.video-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.6rem; }
.video-cell { margin: 0; flex: 0 0 calc((100% - 3 * 0.6rem) / 4); min-width: 0; }
.video-cell video { display: block; width: 100%; height: auto; aspect-ratio: 832 / 480; border-radius: 8px; background: #000; }
.video-cell figcaption { margin-top: 0.35rem; text-align: center; line-height: 1.3; }
.video-cell .m { display: block; font: 600 0.95rem "Google Sans", sans-serif; color: var(--text); }
.video-cell .s { display: block; font-size: 0.8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.video-cell.ours video { outline: 3px solid var(--accent); outline-offset: -3px; }
.video-cell.ours .m { color: var(--accent); }
.video-cell.ref .m { color: var(--muted); }
.video-tools { display: flex; justify-content: center; gap: 0.5rem; margin-top: 0.9rem; }
.tool-btn { font: 500 0.88rem/1 "Google Sans", sans-serif; padding: 0.5rem 1rem; border-radius: 999px; border: 1px solid #cfd4dc;
  background: #fff; color: var(--text); cursor: pointer; }
.tool-btn:hover { border-color: #9aa3b2; }
.prompt-line { text-align: center; margin-bottom: 0.9rem; color: var(--muted); }
.prompt-line q { color: var(--text); font-style: italic; }

/* ---------- method ---------- */
.steps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-top: 1.4rem; }
.step { background: #fff; border: 1px solid var(--rule); border-radius: 12px; padding: 1.2rem 1.3rem; }
.step__n { display: inline-grid; place-items: center; width: 1.9rem; height: 1.9rem; border-radius: 50%; background: var(--accent);
  color: #fff; font: 700 0.9rem "Google Sans", sans-serif; margin-bottom: 0.6rem; }
.step h3 { font: 600 1.1rem "Google Sans", sans-serif; margin: 0 0 0.45rem; color: var(--text); }
.step p { margin: 0; color: var(--muted); line-height: 1.65; font-size: 0.97rem; }
.sub-title { margin: 2.2rem 0 0.2rem; text-align: center; font: 600 1.25rem "Google Sans", sans-serif; color: var(--text); }
.sub-title:first-of-type { margin-top: 1.2rem; }
/* the three-panel "How SpecKCast works" figure (SVGs) */
.method-figure { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; max-width: 68rem; margin: 1.4rem auto 0; }
.method-figure img { display: block; width: 100%; height: auto; }

/* ---------- text-to-image gallery (rebuilt Figures 3, 5, 7) ---------- */
.t2i-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 0.45rem; }
.t2i-cell { margin: 0; min-width: 0; }
.t2i-cell a { display: block; cursor: zoom-in; border-radius: 8px; }
.t2i-cell img { display: block; width: 100%; height: auto; aspect-ratio: 1 / 1; border-radius: 8px; background: #e9ecf0; }
.t2i-cell figcaption { margin-top: 0.3rem; text-align: center; line-height: 1.25; }
.t2i-cell .m { display: block; font: 600 0.85rem "Google Sans", sans-serif; color: var(--text); }
.t2i-cell .s { display: block; font-size: 0.74rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.t2i-cell.ours img { outline: 3px solid var(--accent); outline-offset: -3px; }
.t2i-cell.ours .m { color: var(--accent); }
.t2i-cell.ref .m { color: var(--muted); }
.t2i-cell a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---------- figures ---------- */
.figure { margin: 1.2rem auto 0; }
.figure a { display: block; cursor: zoom-in; }
.figure img { display: block; width: 100%; height: auto; border-radius: 8px; background: #fff; }
.figure.boxed img { border: 1px solid var(--rule); padding: 0.6rem; }
.figure .zoom-hint { display: block; margin-top: 0.3rem; text-align: center; font-size: 0.78rem; color: var(--faint); }
.lightbox { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 1rem; background: rgba(15, 18, 24, 0.9); overflow: auto; }
.lightbox[hidden] { display: none; }
.lightbox { overscroll-behavior: contain; }
/* fitted to the screen first; a click toggles full size */
.lightbox img { width: auto; max-width: 100%; max-height: calc(100vh - 2rem); height: auto; border-radius: 6px; background: #fff; cursor: zoom-in; }
.lightbox img { cursor: default; }
.lightbox.can-zoom img { cursor: zoom-in; }
.lightbox.is-zoomed { place-items: start; }
/* zoomed: the file at its own pixel size */
.lightbox.is-zoomed img { max-width: none; max-height: none; width: auto; cursor: zoom-out; }
.lightbox__close { position: fixed; top: 0.8rem; right: 0.9rem; width: 2.6rem; height: 2.6rem; border-radius: 50%; border: 0;
  background: rgba(255, 255, 255, 0.92); color: #111; font-size: 1.6rem; line-height: 1; cursor: pointer; }
.no-scroll, .no-scroll body { overflow: hidden; }

/* ---------- results tables ---------- */
.table-scroll { position: relative; overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--rule); border-radius: 10px; background: #fff; }
.results-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.results-table th, .results-table td { padding: 0.42rem 0.6rem; white-space: nowrap; text-align: left; border-bottom: 1px solid #eef0f3; }
.results-table th.num, .results-table td.num { text-align: right; }
.results-table thead th { background: var(--bg-soft); color: var(--text); font: 600 0.84rem "Google Sans", sans-serif; border-bottom: 1px solid var(--rule); }
.results-table thead .group-row th { font-weight: 500; color: var(--muted); text-align: center; border-bottom: 0; padding-bottom: 0; }
.results-table thead .group-row th.group { border-bottom: 1px solid var(--rule); }
.results-table .arrow { margin-left: 0.15em; color: var(--faint); }
.results-table tr.group-start td { border-top: 2px solid var(--rule); }
.results-table td.budget { color: var(--muted); font-weight: 600; }
.results-table td.best { font-weight: 700; color: var(--best); }
.results-table td.second { text-decoration: underline; text-underline-offset: 3px; }
.results-table tr.ours td { background: var(--accent-soft); }
.results-table tr.ours td.method { color: var(--accent); font-weight: 700; }
.narrow-table { max-width: 64rem; margin: 0 auto; }
.table-intro { margin: 0 auto 0.8rem; text-align: center; color: var(--muted); font-size: 0.95rem; }
.table-controls { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem 1.4rem; margin-bottom: 0.2rem; }
.table-controls .seg { margin-bottom: 0.7rem; }
.compact { max-width: 58rem; margin: 0 auto; }
.compact .results-table { font-size: 0.84rem; }
.compact .results-table th, .compact .results-table td { padding: 0.3rem 0.55rem; }
.compact .seg__btn { padding: 0.45rem 0.85rem; font-size: 0.86rem; }
.narrow-table .results-table th, .narrow-table .results-table td { padding-left: 0.5rem; padding-right: 0.5rem; }
.table-note { margin-top: 0.5rem; font-size: 0.82rem; color: var(--faint); text-align: center; }


/* ---------- BibTeX ---------- */
.bib { position: relative; }
.bib pre { background: var(--bg-soft); border: 1px solid var(--rule); border-radius: 10px; padding: 1.1rem 1.2rem; font-size: 0.85rem;
  line-height: 1.55; white-space: pre; overflow-x: auto; color: var(--text); }
.bib .tool-btn { position: absolute; top: 0.6rem; right: 0.6rem; }

.footer { padding: 2rem 1.5rem 2.5rem; background: var(--bg-soft); }
.footer p { text-align: center; color: var(--muted); font-size: 0.88rem; }

/* ---------- focus and screen-reader helpers ---------- */
.link-btn:focus-visible, .seg__btn:focus-visible, .tool-btn:focus-visible,
.figure a:focus-visible, .lightbox__close:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.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; }

/* ---------- small screens ---------- */
@media (max-width: 768px) {
  .section { padding: 2.1rem 1rem; }
  .teaser-videos { grid-template-columns: minmax(0, 1fr); }
  /* carousels: arrows move below the content */
  .carousel { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.7rem 1.2rem; padding: 0; }
  .carousel > :not(.carousel__nav) { flex: 0 0 100%; order: -1; min-width: 0; }
  .carousel__nav { position: static; transform: none; }
  .carousel__nav--prev:hover, .carousel__nav--next:hover { transform: none; }
  .method-figure { grid-template-columns: minmax(0, 1fr); max-width: 26rem; }
  .video-cell { flex-basis: calc((100% - 0.6rem) / 2); }
  .t2i-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .steps { grid-template-columns: minmax(0, 1fr); }
  .publication-authors { font-size: 1.02rem; }
  .content.has-text-justified p { text-align: left; }
  /* tables: keep the method column in view while the numbers scroll */
  .results-table th, .results-table td, .compact .results-table th, .compact .results-table td { padding: 0.3rem 0.45rem; }
  .results-table td.method, .results-table thead tr:last-child th:first-child { position: sticky; left: 0; z-index: 1; background: #fff; box-shadow: 1px 0 0 var(--rule); }
  .results-table thead tr:last-child th:first-child { background: var(--bg-soft); }
  .results-table tr.ours td.method { background: var(--accent-soft); }
  .tldr { text-align: left; font-size: 1.05rem; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.1rem 1rem; }
}
