/* User Provided Stylesheet */

/* uPrime site styles (site.options.style in myst.yml).
 *
 * Everything here is scoped to the home page's own classes (up-*) or to an
 * article that contains the hero, so chapter pages keep the stock book theme.
 * Colours follow the hand-written landing page (index.html): green primary
 * button, grey secondary buttons, #58a6ff accent, muted italic tagline.
 *
 * Icons are Heroicons v2 (MIT licence, https://heroicons.com), the icon set
 * the MyST theme itself uses, embedded as CSS masks so they take the accent
 * colour in both themes. MyST has no icon role, and no raw SVG is needed.
 */

:root {
  --up-muted: #57606a;
  --up-border: #d0d7de;
  --up-border-soft: #e4e8ec;
  --up-accent: #0969da;
  --up-chip-bg: rgba(9, 105, 218, 0.1);
  --up-card-bg: #ffffff;
  --up-panel-bg: #f6f8fa;
  --up-tag-bg: #fff1d6;
  --up-tag-fg: #8a5300;
  --up-code-bg: #f6f8fa;
  --up-code-fg: #1f2328;
  --up-btn-bg: #f6f8fa;
  --up-btn-bg-hover: #eaeef2;
  --up-btn-fg: #1f2328;
  --up-primary: #1f883d;
  --up-primary-hover: #1a7f37;
  --up-shadow: 0 1px 3px rgba(31, 35, 40, 0.12), 0 8px 24px rgba(66, 74, 83, 0.12);
}

html.dark {
  --up-muted: #8b949e;
  --up-border: #30363d;
  --up-border-soft: #262c34;
  --up-accent: #58a6ff;
  --up-chip-bg: rgba(56, 139, 253, 0.15);
  --up-card-bg: #161b22;
  --up-panel-bg: #161b22;
  --up-tag-bg: rgba(187, 128, 9, 0.2);
  --up-tag-fg: #e3b341;
  --up-code-bg: #0d1117;
  --up-code-fg: #e6edf3;
  --up-btn-bg: #21262d;
  --up-btn-bg-hover: #30363d;
  --up-btn-fg: #e6edf3;
  --up-primary: #238636;
  --up-primary-hover: #2ea043;
  --up-shadow: 0 1px 3px rgba(0, 0, 0, 0.5), 0 8px 24px rgba(0, 0, 0, 0.45);
}

/* ---- width: the wide blocks use the theme's own grid class col-page-right
   (body start to page end) in index.md. Running prose stays in the body
   column; this keeps it at a readable measure. ---------------------------- */
article:has(.up-hero) {
  padding-top: 0;
  margin-top: 0;
}

article:has(.up-hero) p,
article:has(.up-hero) li {
  max-width: 80ch;
}

/* ---- hero ---------------------------------------------------------------- */
/* padding, not margin: the theme resets the top margin of article children */
.up-hero {
  text-align: center;
  padding-top: 1.75rem;
  margin: 0 0 1.5rem;
}

/* every hero line centres on the hero's own axis: the readable-measure rule
   above (article:has(.up-hero) p) must not narrow these paragraphs, so this
   selector is deliberately more specific than that one */
article:has(.up-hero) .up-hero p {
  max-width: none;
}

.up-hero p {
  margin: 0;
}

/* MyST writes style="margin-left:auto;margin-right:auto" on every image,
   which spreads flex rows apart, and the theme's prose styles add 2em above
   and below every image; the hero lays its images out itself */
.up-hero img,
.up-shot-wrap img {
  margin: 0 !important;
}

/* no external-link arrows inside the hero (badges and buttons) */
.up-hero a > svg {
  display: none;
}

/* logo mark and wordmark on one line. The wordmark is the page's top
   heading; MyST renders it as an h2 because the frontmatter holds the title */
.up-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 0.3rem;
}

.up-brand img.up-mark {
  height: 3.25rem;
  width: auto;
}

.up-brand h2 {
  margin: 0;
  font-size: 2.75rem;
  line-height: 1;
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* the hidden heading-anchor link (zero width, shown on hover) stays out of
   the flow so the wordmark sits right beside the mark */
.up-brand h2 > a[href^='#'] {
  position: absolute;
}

.up-tagline p {
  color: var(--up-muted);
  font-size: 1.1rem;
  margin-bottom: 0.65rem;
}

/* badges: one tight row of small shields */
.up-badges p {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 1.1rem;
  line-height: 1;
}

.up-badges img {
  display: block;
  height: 20px;
  width: auto;
}

.up-badges a,
.up-badges a .link-text {
  display: inline-flex;
}

/* ---- pip command: a MyST code block, so the theme's own copy button copies
   exactly the block's text. Sized to the command and centred; the copy
   button is always visible rather than only on hover. --------------------- */
.up-pip {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0 0 1.1rem;
}

.up-pip .myst-code {
  display: inline-block;
  width: auto;
  max-width: 100%;
  margin: 0;
  border: 1px solid var(--up-border);
  border-radius: 8px;
  background: var(--up-code-bg);
  box-shadow: none;
  text-align: left;
}

.up-pip .myst-code:hover {
  box-shadow: none;
}

.up-pip .myst-code-body {
  padding: 0.6rem 3.1rem 0.6rem 1.15rem;
  overflow: visible;
}

.up-pip .myst-code-body code {
  font-size: 1.15rem;
  line-height: 1.5;
  color: var(--up-code-fg);
}

.up-pip .myst-code-copy-icon {
  opacity: 1 !important;
  top: 50%;
  right: 0.65rem;
  transform: translateY(-50%);
  color: var(--up-muted);
}

.up-pip .myst-code-copy-icon:hover {
  color: var(--up-accent);
}

.up-pip-run p {
  margin-top: 0.35rem;
  color: var(--up-muted);
  font-size: 0.92rem;
}

.up-pip-run code {
  font-size: 0.92em;
}

/* ---- buttons: a single horizontal row. Three are plain links (a.button); the
   DOI one is rendered by MyST as a citation, <cite class="button"><a>. ----- */
.up-buttons p {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0;
}

.up-buttons cite.button {
  display: inline-block;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  font-style: normal;
}

.up-buttons a.button,
.up-buttons cite.button > a {
  display: inline-block;
  margin: 0;
  padding: 0.5rem 1.15rem;
  border: 1px solid var(--up-border);
  border-radius: 6px;
  background: var(--up-btn-bg);
  color: var(--up-btn-fg);
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.4;
  text-decoration: none;
  transition: background 0.15s;
}

.up-buttons a.button:hover,
.up-buttons cite.button > a:hover {
  background: var(--up-btn-bg-hover);
  color: var(--up-btn-fg);
  text-decoration: none;
}

.up-buttons p > a.button:first-child,
.up-buttons p > a.button:first-child:hover {
  background: var(--up-primary);
  border-color: var(--up-primary);
  color: #ffffff;
}

.up-buttons p > a.button:first-child:hover {
  background: var(--up-primary-hover);
}

/* ---- description under the screenshot: an ~80-character block centred on
   the same axis as the hero, with the slogan centred beneath it ------------ */
article:has(.up-hero) .up-intro p {
  margin-left: auto;
  margin-right: auto;
  max-width: 80ch;
}

article:has(.up-hero) .up-intro p:last-child {
  text-align: center;
}

/* ---- screenshot: full width of the wide column ---------------------------- */
.up-shot-wrap {
  margin: 0 0 2rem;
}

.up-shot-wrap img.up-shot {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--up-border);
  border-radius: 10px;
  box-shadow: var(--up-shadow);
}

/* ---- Key Features (two thirds) | Analysis Modules (one third) ------------- */
.up-split {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 1.75rem;
  align-items: start;
  margin: 1.5rem 0 1rem;
}

.up-split h3 {
  margin: 0 0 0.85rem;
}

.up-feat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
}

/* What's new | Input Formats: the same two-thirds / one-third split. The
   note in the right column starts level with the "What's new" heading. */
.up-split-news {
  margin-top: 2rem;
}

.up-news-col details.up-news:first-of-type {
  margin-top: 0;
}

/* Input Formats rows: the format on its own line, a short note below */
.up-formats li p {
  display: block;
}

.up-formats li strong {
  display: block;
}

.up-formats li p {
  color: var(--up-muted);
  font-size: 0.88rem;
  line-height: 1.4;
}

.up-formats li strong {
  color: var(--up-btn-fg);
  font-size: 0.95rem;
}

.up-formats li br {
  display: none;
}

/* each feature: an icon in a tinted chip, a bold title, one line of text */
.up-feat {
  position: relative;
  min-height: 3.6rem;
  padding: 0.6rem 0.85rem 0.6rem 3.35rem;
  border: 1px solid var(--up-border);
  border-radius: 8px;
  background: var(--up-card-bg);
}

.up-feat::before {
  content: '';
  position: absolute;
  top: 0.7rem;
  left: 0.75rem;
  width: 1.95rem;
  height: 1.95rem;
  border-radius: 7px;
  background: var(--up-chip-bg);
}

.up-feat::after {
  content: '';
  position: absolute;
  top: calc(0.7rem + 0.375rem);
  left: calc(0.75rem + 0.375rem);
  width: 1.2rem;
  height: 1.2rem;
  background-color: var(--up-accent);
  -webkit-mask: var(--up-icon) center / contain no-repeat;
  mask: var(--up-icon) center / contain no-repeat;
}

.up-feat p {
  margin: 0;
  line-height: 1.4;
}

.up-feat p + p {
  margin-top: 0.15rem;
  color: var(--up-muted);
  font-size: 0.9rem;
}

/* panels (Analysis Modules, Input Formats): one tight row each, with a
   check mark, in a light panel */
.up-panel {
  padding: 1rem 1.1rem 0.6rem;
  border: 1px solid var(--up-border);
  border-radius: 10px;
  background: var(--up-panel-bg);
}

.up-panel ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.up-panel li {
  position: relative;
  margin: 0;
  padding: 0.32rem 0 0.32rem 1.65rem;
  border-bottom: 1px solid var(--up-border-soft);
}

.up-panel li:last-child {
  border-bottom: 0;
}

.up-panel li::before {
  content: '';
  position: absolute;
  top: 0.62rem;
  left: 0.1rem;
  width: 1rem;
  height: 1rem;
  background-color: var(--up-accent);
  -webkit-mask: var(--up-icon-check) center / contain no-repeat;
  mask: var(--up-icon-check) center / contain no-repeat;
}

.up-panel li::marker {
  content: none;
}

.up-panel li p {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  font-size: 0.95rem;
}

.up-tag {
  display: inline-block;
  padding: 0.05rem 0.5rem;
  border-radius: 999px;
  background: var(--up-tag-bg);
  color: var(--up-tag-fg);
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
}

/* ---- credits footer: centred and compact --------------------------------- */
.up-footer {
  margin: 2.5rem auto 0;
  padding-top: 1.25rem;
  border-top: 1px solid var(--up-border);
  text-align: center;
  color: var(--up-muted);
  font-size: 0.9rem;
}

.up-footer p {
  margin: 0.35rem auto;
}

/* ---- narrower screens ----------------------------------------------------- */
@media (max-width: 1023px) {
  .up-split {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 640px) {
  .up-brand img.up-mark {
    height: 2.5rem;
  }

  .up-brand h2 {
    font-size: 2.1rem;
  }

  .up-tagline p {
    font-size: 1rem;
  }

  .up-pip .myst-code-body code {
    font-size: 1rem;
  }

  .up-buttons p {
    gap: 0.45rem;
  }

  .up-buttons a.button,
  .up-buttons cite.button > a {
    padding: 0.45rem 0.8rem;
    font-size: 0.88rem;
  }

  .up-feat-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ---- icons (generated from Heroicons v2 outline 24px; check is 20px solid) */
.up-ic-convergence {
  /* presentation-chart-line */
  --up-icon: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 fill=%22none%22 viewBox=%220 0 24 24%22 stroke-width=%221.5%22 stroke=%22%23000%22%3E %3Cpath stroke-linecap=%22round%22 stroke-linejoin=%22round%22 d=%22M3.75 3v11.25A2.25 2.25 0 0 0 6 16.5h2.25M3.75 3h-1.5m1.5 0h16.5m0 0h1.5m-1.5 0v11.25A2.25 2.25 0 0 1 18 16.5h-2.25m-7.5 0h7.5m-7.5 0-1 3m8.5-3 1 3m0 0 .5 1.5m-.5-1.5h-9.5m0 0-.5 1.5m.75-9 3-3 2.148 2.148A12.061 12.061 0 0 1 16.5 7.605%22/%3E %3C/svg%3E");
}

.up-ic-large {
  /* circle-stack */
  --up-icon: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 fill=%22none%22 viewBox=%220 0 24 24%22 stroke-width=%221.5%22 stroke=%22%23000%22%3E %3Cpath stroke-linecap=%22round%22 stroke-linejoin=%22round%22 d=%22M20.25 6.375c0 2.278-3.694 4.125-8.25 4.125S3.75 8.653 3.75 6.375m16.5 0c0-2.278-3.694-4.125-8.25-4.125S3.75 4.097 3.75 6.375m16.5 0v11.25c0 2.278-3.694 4.125-8.25 4.125s-8.25-1.847-8.25-4.125V6.375m16.5 0v3.75m-16.5-3.75v3.75m16.5 0v3.75C20.25 16.153 16.556 18 12 18s-8.25-1.847-8.25-4.125v-3.75m16.5 0c0 2.278-3.694 4.125-8.25 4.125s-8.25-1.847-8.25-4.125%22/%3E %3C/svg%3E");
}

.up-ic-mask {
  /* eye-slash */
  --up-icon: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 fill=%22none%22 viewBox=%220 0 24 24%22 stroke-width=%221.5%22 stroke=%22%23000%22%3E %3Cpath stroke-linecap=%22round%22 stroke-linejoin=%22round%22 d=%22M3.98 8.223A10.477 10.477 0 0 0 1.934 12C3.226 16.338 7.244 19.5 12 19.5c.993 0 1.953-.138 2.863-.395M6.228 6.228A10.451 10.451 0 0 1 12 4.5c4.756 0 8.773 3.162 10.065 7.498a10.522 10.522 0 0 1-4.293 5.774M6.228 6.228 3 3m3.228 3.228 3.65 3.65m7.894 7.894L21 21m-3.228-3.228-3.65-3.65m0 0a3 3 0 1 0-4.243-4.243m4.242 4.242L9.88 9.88%22/%3E %3C/svg%3E");
}

.up-ic-export {
  /* arrow-down-tray */
  --up-icon: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 fill=%22none%22 viewBox=%220 0 24 24%22 stroke-width=%221.5%22 stroke=%22%23000%22%3E %3Cpath stroke-linecap=%22round%22 stroke-linejoin=%22round%22 d=%22M3 16.5v2.25A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75V16.5M16.5 12 12 16.5m0 0L7.5 12m4.5 4.5V3%22/%3E %3C/svg%3E");
}

.up-ic-exe {
  /* computer-desktop */
  --up-icon: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 fill=%22none%22 viewBox=%220 0 24 24%22 stroke-width=%221.5%22 stroke=%22%23000%22%3E %3Cpath stroke-linecap=%22round%22 stroke-linejoin=%22round%22 d=%22M9 17.25v1.007a3 3 0 0 1-.879 2.122L7.5 21h9l-.621-.621A3 3 0 0 1 15 18.257V17.25m6-12V15a2.25 2.25 0 0 1-2.25 2.25H5.25A2.25 2.25 0 0 1 3 15V5.25m18 0A2.25 2.25 0 0 0 18.75 3H5.25A2.25 2.25 0 0 0 3 5.25m18 0V12a2.25 2.25 0 0 1-2.25 2.25H5.25A2.25 2.25 0 0 1 3 12V5.25%22/%3E %3C/svg%3E");
}

.up-ic-transform {
  /* arrow-path */
  --up-icon: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 fill=%22none%22 viewBox=%220 0 24 24%22 stroke-width=%221.5%22 stroke=%22%23000%22%3E %3Cpath stroke-linecap=%22round%22 stroke-linejoin=%22round%22 d=%22M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0 3.181 3.183a8.25 8.25 0 0 0 13.803-3.7M4.031 9.865a8.25 8.25 0 0 1 13.803-3.7l3.181 3.182m0-4.991v4.99%22/%3E %3C/svg%3E");
}

.up-ic-pipeline {
  /* beaker */
  --up-icon: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 fill=%22none%22 viewBox=%220 0 24 24%22 stroke-width=%221.5%22 stroke=%22%23000%22%3E %3Cpath stroke-linecap=%22round%22 stroke-linejoin=%22round%22 d=%22M9.75 3.104v5.714a2.25 2.25 0 0 1-.659 1.591L5 14.5M9.75 3.104c-.251.023-.501.05-.75.082m.75-.082a24.301 24.301 0 0 1 4.5 0m0 0v5.714c0 .597.237 1.17.659 1.591L19.8 15.3M14.25 3.104c.251.023.501.05.75.082M19.8 15.3l-1.57.393A9.065 9.065 0 0 1 12 15a9.065 9.065 0 0 0-6.23-.693L5 14.5m14.8.8 1.402 1.402c1.232 1.232.65 3.318-1.067 3.611A48.309 48.309 0 0 1 12 21c-2.773 0-5.491-.235-8.135-.687-1.718-.293-2.3-2.379-1.067-3.61L5 14.5%22/%3E %3C/svg%3E");
}

.up-ic-cases {
  /* rectangle-stack */
  --up-icon: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 fill=%22none%22 viewBox=%220 0 24 24%22 stroke-width=%221.5%22 stroke=%22%23000%22%3E %3Cpath stroke-linecap=%22round%22 stroke-linejoin=%22round%22 d=%22M6 6.878V6a2.25 2.25 0 0 1 2.25-2.25h7.5A2.25 2.25 0 0 1 18 6v.878m-12 0c.235-.083.487-.128.75-.128h10.5c.263 0 .515.045.75.128m-12 0A2.25 2.25 0 0 0 4.5 9v.878m13.5-3A2.25 2.25 0 0 1 19.5 9v.878m0 0a2.246 2.246 0 0 0-.75-.128H5.25c-.263 0-.515.045-.75.128m15 0A2.25 2.25 0 0 1 21 12v6a2.25 2.25 0 0 1-2.25 2.25H5.25A2.25 2.25 0 0 1 3 18v-6c0-.98.626-1.813 1.5-2.122%22/%3E %3C/svg%3E");
}

.up-panel {
  /* check (20 solid) */
  --up-icon-check: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 20 20%22 fill=%22%23000%22%3E %3Cpath fill-rule=%22evenodd%22 d=%22M16.704 4.153a.75.75 0 0 1 .143 1.052l-8 10.5a.75.75 0 0 1-1.127.075l-4.5-4.5a.75.75 0 0 1 1.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 0 1 1.05-.143Z%22 clip-rule=%22evenodd%22/%3E %3C/svg%3E");
}
