/* HERMESS documentation stylesheet: Latin Modern typography and the ETH Blue
 * accent on top of the Shibuya theme. The fonts are self-hosted (see
 * fonts/LICENSE-fonts.txt). */

@font-face {
  font-family: "Latin Modern Roman";
  src: url("fonts/LM-regular.woff2") format("woff2");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Latin Modern Roman";
  src: url("fonts/LM-bold.woff2") format("woff2");
  font-weight: bold;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Latin Modern Roman";
  src: url("fonts/LM-italic.woff2") format("woff2");
  font-weight: normal;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Latin Modern Roman";
  src: url("fonts/LM-bold-italic.woff2") format("woff2");
  font-weight: bold;
  font-style: italic;
  font-display: swap;
}

:root {
  /* Prose and headings in the LaTeX serif; code keeps the theme monospace
   * stack (--sy-f-mono untouched). */
  --sy-f-text: "Latin Modern Roman", "Latin Modern", Georgia, "Times New Roman", serif;
  --sy-f-heading: "Latin Modern Roman", "Latin Modern", Georgia, "Times New Roman", serif;
}

/* Latin Modern is optically sized for print and reads small on screen. */
.yue {
  font-size: 1.0625rem;
}

/* Front page, set like the title page of a technical report: centered title
 * and subtitle, justified abstract, a quiet link row, a numbered-figure
 * look, and capabilities as a two-column list rather than cards. */
section.front-page > h1 {
  text-align: center;
  font-size: 3.4rem;
  letter-spacing: 0.02em;
  margin: 1.2rem 0 0.4rem;
}
section.front-page > h1::after {
  content: "";
  display: block;
  width: 5.5rem;
  border-bottom: 2px solid var(--accent-9);
  margin: 1rem auto 0;
}
p.front-subtitle {
  text-align: center;
  font-size: 1.2rem;
  margin: 0 0 2.2rem;
}
p.front-abstract {
  max-width: 44rem;
  margin: 0 auto 1.5rem;
  text-align: justify;
  hyphens: auto;
}
p.front-links {
  text-align: center;
  font-size: 1.05rem;
  margin: 0 0 2.4rem;
}
figure.front-figure {
  margin: 0 auto 1.5rem;
}
figure.front-figure figcaption {
  max-width: 40rem;
  margin: 0.4rem auto 0;
  font-size: 0.92rem;
}
dl.front-capabilities {
  display: grid;
  grid-template-columns: minmax(9rem, 13rem) 1fr;
  column-gap: 1.4rem;
  row-gap: 0.55rem;
}
dl.front-capabilities dt {
  font-weight: bold;
  text-align: right;
}
dl.front-capabilities dd {
  margin: 0;
}
dl.front-capabilities dd p {
  margin: 0;
}
@media (max-width: 640px) {
  dl.front-capabilities {
    grid-template-columns: 1fr;
    row-gap: 0.2rem;
  }
  dl.front-capabilities dt {
    text-align: left;
  }
  dl.front-capabilities dd {
    margin-bottom: 0.6rem;
  }
}
p.front-cite {
  font-size: 0.95rem;
  opacity: 0.8;
  border-top: 1px solid var(--accent-a3);
  padding-top: 1.1rem;
  margin-top: 2.6rem;
}

/* Book-style article pages (compact layout): one centered reading column,
 * no side rails. The empty right rail and the buttons that toggled the
 * removed rails are hidden. */
.sy-rside,
.rside-overlay,
button[aria-controls="rside"],
button[aria-controls="lside"] {
  display: none !important;
}
.sy-page main > .flex > div {
  max-width: 100%;
}
/* The theme treats breadcrumbs as a mobile-only bar; in the book layout they
 * are the wayfinding on every width, like a running head. */
@media (min-width: 1280px) {
  .sy-breadcrumbs {
    display: block;
  }
}

/* The contents block hermess.js inserts after the page title. */
nav.page-contents {
  display: inline-block;
  min-width: 16rem;
  max-width: 100%;
  margin: 0.4rem 0 1.6rem;
  padding: 0.7rem 1.4rem 0.8rem;
  border: 1px solid var(--accent-a4);
  background: var(--accent-a2);
  border-radius: 2px;
}
nav.page-contents .page-contents-title {
  font-weight: bold;
  font-variant: small-caps;
  letter-spacing: 0.04em;
  margin: 0 0 0.3rem;
}
nav.page-contents ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
nav.page-contents > ul > li {
  margin: 0.12rem 0;
}
nav.page-contents ul ul {
  padding-left: 1.2rem;
  font-size: 0.95em;
}
nav.page-contents a {
  text-decoration: none;
}
nav.page-contents a:hover {
  text-decoration: underline;
}

/* Even vertical rhythm for display equations. The theme puts every equation
 * in a .math-wrapper with 2rem margins, so docstrings written as one
 * directive per equation get far more air than a single aligned block; a
 * moderate margin plus a collapsed gap between successive equations makes
 * both patterns read the same. */
.yue .math-wrapper {
  margin-top: 0.9rem;
  margin-bottom: 0.9rem;
}
/* The wrapper is its own formatting context (overflow-x), so the MathJax
 * margins sit inside it and need reducing as well. */
.yue .math-wrapper mjx-container[jax="CHTML"][display="true"] {
  margin: 0.35em 0;
}
.yue .math-wrapper + .math-wrapper {
  margin-top: 0.15rem;
}
.yue .math-wrapper:has(+ .math-wrapper) {
  margin-bottom: 0.15rem;
}

/* ETH Blue accent scale (seed #215CAF, hue 215). Shibuya resolves its accent
 * from the radix "blue" scale; these overrides replace that scale's role with
 * an ETH Blue ramp for both color modes. */
html[data-accent-color="blue"] {
  --accent-1: #fbfcfe;
  --accent-2: #f4f8fc;
  --accent-3: #e7effa;
  --accent-4: #d7e5f6;
  --accent-5: #c3d8f1;
  --accent-6: #aac7ea;
  --accent-7: #88b0e0;
  --accent-8: #5c92d2;
  --accent-9: #215caf;
  --accent-10: #1d53a0;
  --accent-11: #1a4a8f;
  --accent-12: #12294e;
  --accent-a1: rgba(33, 92, 175, 0.02);
  --accent-a2: rgba(33, 92, 175, 0.04);
  --accent-a3: rgba(33, 92, 175, 0.09);
  --accent-a4: rgba(33, 92, 175, 0.16);
  --accent-a5: rgba(33, 92, 175, 0.24);
  --accent-a6: rgba(33, 92, 175, 0.33);
  --accent-a7: rgba(33, 92, 175, 0.46);
  --accent-a8: rgba(33, 92, 175, 0.63);
  --accent-a9: rgba(33, 92, 175, 0.95);
  --accent-a10: rgba(25, 74, 143, 0.95);
  --accent-a11: rgba(21, 62, 122, 0.97);
  --accent-a12: rgba(14, 33, 63, 0.98);
  --accent-contrast: #ffffff;
  --color-surface-accent: rgba(238, 244, 251, 0.8);
}

html.dark[data-accent-color="blue"] {
  --accent-1: #0d1420;
  --accent-2: #101a29;
  --accent-3: #142340;
  --accent-4: #172c52;
  --accent-5: #1d3763;
  --accent-6: #244373;
  --accent-7: #2d5289;
  --accent-8: #3765a4;
  --accent-9: #3a6cb8;
  --accent-10: #4a7cc6;
  --accent-11: #91b6ea;
  --accent-12: #d6e4f9;
  --accent-a1: rgba(58, 108, 184, 0.05);
  --accent-a2: rgba(58, 108, 184, 0.1);
  --accent-a3: rgba(58, 108, 184, 0.18);
  --accent-a4: rgba(58, 108, 184, 0.26);
  --accent-a5: rgba(64, 114, 190, 0.34);
  --accent-a6: rgba(72, 122, 196, 0.42);
  --accent-a7: rgba(82, 132, 202, 0.53);
  --accent-a8: rgba(94, 144, 210, 0.66);
  --accent-a9: rgba(88, 138, 214, 0.95);
  --accent-a10: rgba(106, 154, 222, 0.95);
  --accent-a11: rgba(145, 182, 234, 0.97);
  --accent-a12: rgba(214, 228, 249, 0.98);
  --accent-contrast: #ffffff;
  --color-surface-accent: rgba(17, 32, 54, 0.5);
}
