/*
 * Reslumen theme machinery: the components this theme adds to Shibuya's page,
 * and the brand's treatment of the chrome around it.
 *
 * Kept apart from reslumen.css, which is the role mapping. Everything here
 * spends the roles rather than defining them, so a change to the brand's colours
 * needs no edit in this file.
 */

/* Scrollbars ---------------------------------------------------------------
   The browser's default paints a heavy bar that reads as window chrome sitting
   on top of the page rather than as part of it. `global.css` in the website
   says exactly that where it declares its own, and this is the same intent at
   the documentation's roles: a transparent track and a thumb the colour of a
   hairline, so a scrollbar is as quiet as the borders it runs beside. Reading
   `--sy-c-border` rather than the website's literal `base-300` is what carries
   it into dark mode, where the same role is already a step that shows against a
   dark ground instead of glaring off it.

   The bar keeps its own width. A thinner one is harder to catch with a pointer,
   and the width is not what made the default loud.

   A pane only shows its bar while the reader is over that pane. `scrollbar-
   color` is inherited, so the pair below says it twice rather than once: every
   element starts with a bar it cannot see, and every element under the pointer
   takes the hairline back. Hover matches ancestors, so the pane containing the
   pointer is lit and the panes beside it are not — and the page itself, being
   an ancestor of everything, keeps its bar for as long as the pointer is in the
   window. Only the colour changes, so a bar appearing costs no reflow.

   The website pairs this with a `::-webkit-scrollbar` block. That block is
   inert wherever `scrollbar-color` is set — a browser that understands the
   standard property stops consulting the pseudo-elements — so the semantics
   transfer and the second copy does not.

   A surface that wants no bar at all — the sections bar, a code block — still
   says so with `scrollbar-width`, which this leaves alone. */

* {
  scrollbar-color: transparent transparent;
}

*:hover {
  scrollbar-color: var(--sy-c-border) transparent;
}

/* Page actions -------------------------------------------------------------
   A quiet row above the page title: present when wanted, never competing with
   the heading. */

/* Website shell and reading type ------------------------------------------
   The website's frame, at the website's widths. `BaseLayout.astro` paints the
   stripe field on a bounded, centred element — `bg-stripes max-w-7xl mx-auto
   border-x border-base-200` — over a plain white body, and `Wrapper` nests a
   second white column inside it at `max-w-6xl`. The header, the sections bar,
   the document and the footer all sit in that inner column, which is what makes
   the page one framed column rather than four separately centred bands.

   Compact inherits the same frame and column; its inherited Shibuya layout
   continues to decide its denser navigation geometry. */

:root {
  /* The website's arrangement at documentation widths.

     `BaseLayout.astro` frames at `max-w-7xl` over a `max-w-6xl` column — 80rem
     over 72rem — which is the measure of a two-column marketing page. A
     documentation page has three: an 18rem navigation tree, a 16rem contents
     column, and prose between them. At 72rem that leaves the reading column
     38rem, which is narrower than the prose it replaced.

     So the arrangement is the website's and the widths are the documentation's.
     The website's own widest column — `Wrapper` variant `standard` widens to
     `2xl:max-w-[1400px]`, which is 87.5rem — still spends most of a wide
     display on margin once three panes are taken out of it, so the column goes
     to 100rem and the frame stays the column plus the 8rem the website leaves
     between its two pairs of hairlines. The reading column comes out at 66rem,
     against Shibuya's own 52rem reading measure.

     This is the one measurement that is deliberately not the website's. The
     website is measuring a two-column marketing page and this is measuring a
     three-pane documentation page; matching its number here would be matching
     the wrong thing. */
  --rl-w-column: 100rem;
  --rl-w-frame: calc(var(--rl-w-column) + 8rem);

  /* The chrome that stays over the page, in two measures the rest of the
     stylesheet reads: what the header occupies, and what the sections bar adds
     under it. The bar's height is declared rather than left to the sum of its
     padding, because the sidebars and the anchor jumps are positioned against
     it and a measure that drifts with a font is a measure they cannot use. */
  --rl-s-chrome-top: calc(var(--sy-s-navbar-height) + var(--sy-s-banner-height));
  --rl-s-subnav-height: 2.75rem;

  /* Upstream's own offset — where a sticky sidebar starts and how tall its
     scrolling region may be — counts the header alone. Both bars are pinned
     here, so both are counted. */
  --sy-s-offset-top: calc(var(--rl-s-chrome-top) + var(--rl-s-subnav-height));
}

body {
  background-color: var(--sy-c-background);
  font-family: var(--rl-f-prose);
}

/* The frame's own margin, which is what the field is seen in. The website gets
   it from the 8rem between its 80rem frame and its 72rem column, and it is
   therefore a margin that only exists on a display wide enough for both — below
   1280px the website's two elements are the same width and the field has
   nowhere to show.

   That is the one part of the arrangement not worth carrying over. The frame is
   this brand's signature, and a signature that appears on displays wider than
   the frame and on no other is not one. So the gap is stated as padding on the
   frame rather than as the difference between two maximum widths: the inner
   columns are inset by it at every width, the two pairs of uprights and the
   stripe between them are always drawn, and the 4rem ceiling is exactly the
   margin the website's own numbers produce once a display is wide enough to
   show it. It gives way on a narrow one, where a reading column is worth more
   than a margin. */
.rl-frame {
  max-width: var(--rl-w-frame);
  margin-inline: auto;
  padding-inline: clamp(0.5rem, 4vw, 4rem);
  border-inline: 1px solid var(--sy-c-divider);
  background-image: var(--rl-image-stripe-field);
}

.rl-document-shell {
  padding-block: 1.5rem;
}

.rl-document-column {
  max-width: var(--rl-w-column);
  margin-inline: auto;
  border-inline: 1px solid var(--sy-c-divider);
  background: var(--sy-c-background);
}

/* A landing page is a marketing composition the width of the frame. The column
   is what a documentation page reads in, and boxing a hero in it would be a
   redesign of the hero, so the landing layout stands the column down and keeps
   only the frame. The composition then paints its own white and its own
   uprights, band by band, the way the website's sections do — see the landing
   rules at the end of this file. */
.rl-document-column.rl-unboxed {
  max-width: none;
  border-inline: 0;
  background: transparent;
}

/* Text selection and anchor jumps, which the website states on `html` and the
   theme so far has not. */
::selection {
  background-color: var(--rl-c-selection-background);
  color: var(--rl-c-selection-text);
}

html {
  scroll-behavior: smooth;
}

.yue {
  font-family: var(--rl-f-prose);
}

.yue :is(h1, h2, h3, h4, h5, h6) {
  color: var(--sy-c-heading);
  font-family: var(--rl-f-prose);
  font-weight: 600;
  letter-spacing: normal;
}

/* Upstream reaches weight 800 on a page title, 700 on a section heading, and
   900 on a word emphasised inside one. The brand stops at 600 everywhere and
   lets size and tracking carry the hierarchy instead, so the heading and
   anything strong inside it are held at the one weight the system has. The
   heading itself is set above; this is the half of the rule upstream states
   separately. */
.yue :is(h1, h2, h3, h4, h5, h6) strong {
  font-weight: 600;
}

/* Tracking is the other half of that hierarchy. Every heading at the brand's
   Title size and above is set at -0.05em; Subtitle and below stay at normal,
   which is the ladder above. Upstream's page title is 2.25em and its section
   heading 1.5em — Metric and Title — so those two reach it, and h3 at 1.25em
   does not. */
.yue :is(h1, h2) {
  letter-spacing: var(--rl-tracking-heading);
}

/* The website marks an unordered item with a hollow ring rather than a disc,
   at every level of nesting. It is a small thing and it is the single most
   recognisable difference between a page of Reslumen prose and a page of
   anyone else's. Lists that are really menus — the tocs below — turn it off
   again. */
.yue ul {
  list-style-type: "○";
}

/* A link in prose is drawn the way the website draws one. `Wrapper.astro`'s
   `prose` variant states the whole contract — `prose-a:border-b
   prose-a:border-dashed prose-a:border-base-500 prose-a:no-underline
   prose-a:hover:border-solid prose-a:hover:bg-teal-200`, over
   `transition-colors duration-200` — and the text keeps the prose ink
   throughout. Nothing distinguishes a visited link, because nothing on the
   website does.

   `inherit` rather than the text role, so that a link inside a heading takes
   the heading's ink rather than reverting to the body's.

   The rule is a border rather than an underline because the website's is one,
   and a border sits at the bottom of the inline box rather than skipping ink.
   Its offset is therefore the font's descent metric, and was checked against
   Geist rather than assumed: Geist descends furthest at `g`, to -0.162em, and
   its descent metric is -0.295em by `hhea` and -0.262em by `usWinDescent`, so
   the rule clears the deepest descender by at least 0.100em whichever metric
   the platform picks. No nudge is needed, and adding one would only weaken the
   affordance by moving it away from the word. */
.yue a:not(.rl-action, .sd-btn) {
  border-bottom: 1px dashed var(--rl-c-prose-link-rule);
  color: inherit;
  text-decoration: none;
  transition:
    border-color var(--rl-d-link) ease-in-out,
    background-color var(--rl-d-link) ease-in-out;
}

/* The keyboard reaches the same state as the pointer, on top of the focus ring
   below: the ring says which element, and the ground says what kind. */
.yue a:not(.rl-action, .sd-btn):hover,
.yue a:not(.rl-action, .sd-btn):focus-visible {
  background-color: var(--rl-c-prose-link-ground);
  border-bottom-style: solid;
}

/* Sphinx hangs two anchors off a heading that are not links in prose. The `¶`
   copies a permalink, and a heading collected by a contents directive becomes
   a backref to the entry that names it — so the anchor is the whole heading.
   Neither is a phrase in a sentence, and a rule drawn under an entire heading
   reads as a mistake rather than as an affordance, so both keep the ink they
   inherit and drop the rule. */
.yue a.headerlink,
.yue a.headerlink:hover,
.yue a.headerlink:focus-visible,
.yue a.toc-backref,
.yue a.toc-backref:hover,
.yue a.toc-backref:focus-visible {
  background-color: transparent;
  border-bottom: none;
  display: inline;
}

.yue a:focus-visible {
  outline: 2px solid var(--rl-c-focus);
  outline-offset: 2px;
}

.rl-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.5rem;
  margin-bottom: 1rem;
}

/* Shibuya parks its "Copy page" control in the top right of the same band from
   the large breakpoint up, so the row stops short of it rather than running
   underneath it. */
@media (min-width: 64rem) {
  .rl-actions {
    max-width: calc(100% - 12rem);
  }
}

/* Two class names deep, because these sit inside the article, where prose link
   styling would otherwise underline and colour them. Every state is the shared
   control contract's; what is said here is the size and the muted fill. */
.rl-actions .rl-action {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.625rem;
  border-radius: var(--rl-r-md);
  background: var(--rl-c-control-muted);
  color: var(--sy-c-text);
  font-size: var(--rl-t-caption);
  line-height: 1.5;
  text-decoration: none;
}

.rl-actions .rl-action svg {
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* At narrow widths the labels would wrap into a wall of text, so the actions
   become icons; each keeps its accessible name in the markup. */
@media (max-width: 40rem) {
  .rl-actions .rl-action span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
}

/* Fullscreen ---------------------------------------------------------------
   Hides the chrome around the page rather than the window's own. */

body.rl-fullscreen .sy-lside,
body.rl-fullscreen .sy-rside,
body.rl-fullscreen .sy-head,
body.rl-fullscreen .rl-subnav {
  display: none;
}

/* The sections bar's retreat ------------------------------------------------
   Upstream pins the header to the top of the window and it stays there: it is
   the mark, the search field and the way back to the product, and those are
   worth their band of every screen. The bar under it is not. A documentation
   page is read downwards, and a reader moving down it has already chosen their
   section, so the sections bar retires while they read and comes back the
   moment they scroll up — the moment they are looking for somewhere else to go.

   It slides its own height upwards, which parks it behind the header rather
   than off the top of the window: the header's inner column is the same width
   and opaque, and it sits a step above in the stacking order, so the bar is
   covered for the whole of the movement.

   The state is a class on the body rather than a style on the bar, so that the
   one place that clears it covers every reason to: reaching the top of the
   page, or tabbing into a bar that is away. `reslumen.js` is what sets and
   clears it.

   This is the one thing in this stylesheet that moves: it is a strip of chrome
   leaving and returning, not a control reacting to a pointer, and the website
   moves no control either way.

   `scroll-padding-top` is the other half of pinned chrome: an anchor jump would
   otherwise land its heading underneath it. */

html {
  scroll-padding-top: calc(var(--sy-s-offset-top) + 1rem);
}

body.rl-subnav-hidden .rl-subnav {
  transform: translateY(calc(-1 * var(--rl-s-subnav-height)));
}

/* Section navigation -------------------------------------------------------
   A bar of the documentation's top-level sections, pinned under the header and
   retiring on its own — see the retreat above. Shibuya's sticky sidebars
   measure themselves against the navbar's height alone, so a second pinned
   strip would sit on top of what they expect to be able to reach;
   `--sy-s-offset-top` above is raised by this bar's height, which is what moves
   them down out of its way. They keep that room while the bar is away, so that
   its return moves nothing else on the page.

   Below the header's own breakpoint the bar stands down entirely — see the
   takeover — and the offset goes back to the header alone there. */

/* The bar itself is transparent: the field has to show beside the column, and
   the white and the rule belong to the inner column with the rest of them. */
.rl-subnav {
  position: sticky;
  top: var(--rl-s-chrome-top);
  /* Under the header, which is 20, and over the page it now passes across. */
  z-index: 19;
  background-color: transparent;
  transition: transform var(--rl-d-control) ease-in-out;
}

.rl-subnav-inner {
  height: var(--rl-s-subnav-height);
  overflow-x: auto;
  scrollbar-width: none;
}

.rl-subnav-inner::-webkit-scrollbar {
  display: none;
}

.rl-subnav ul {
  display: flex;
  align-items: stretch;
  gap: 1.5rem;
  height: 100%;
  margin: 0;
  padding: 0 1.5rem;
  list-style: none;
}

/* `Navigation.astro` rests its links at base-800 in medium weight and hovers
   them to base-600 — quieter, never teal. */
.rl-subnav a {
  display: flex;
  align-items: center;
  height: 100%;
  border-bottom: 2px solid transparent;
  color: var(--rl-c-nav-link);
  font-size: var(--rl-t-caption);
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: color var(--rl-d-link) ease-in-out;
}

.rl-subnav a:hover,
.rl-subnav a:focus-visible {
  color: var(--rl-c-nav-link-hover);
}

/* The reader's own section, marked in the markup with aria-current as well as
   here with colour, so the location does not depend on seeing it. It is the
   darkest ink on the page rather than the accent: see the navigation trees
   below, where the same three steps are spent on every navigation surface. */
.rl-subnav a.current {
  border-bottom-color: var(--rl-c-nav-link-current);
  color: var(--rl-c-nav-link-current);
  font-weight: 500;
}

/* Upstream parks the contents column at a literal `xl:top-16` — the header's
   height and 8px of air — rather than at its own offset. Both bars are over the
   page now, so the column takes the offset and keeps the air. */
.sy-rside .sy-rside-inner {
  top: calc(var(--sy-s-offset-top) + 0.5rem);
}

/* Local table of contents --------------------------------------------------
   A page whose headings nest four deep produces a right-hand column that is
   longer than the screen and impossible to scan. Three levels is as deep as an
   overview stays an overview; the headings themselves are still there to read,
   and the page's own contents list, where an author writes one, is unaffected. */

.sy-rside .localtoc ul ul ul ul {
  display: none;
}

/* Announcement bar ---------------------------------------------------------
   The bar runs the width of the window, so its text sits centred over the page
   rather than hung off the left edge. Both ends keep the close control's room,
   so a long announcement stays clear of it instead of running underneath. */

.announcement-inner {
  padding-inline: 1.5rem;
  text-align: center;
}

/* Chrome inside the frame --------------------------------------------------
   The website has no bracket around its header and footer. It has one white
   column, `border-x` down both sides for the height of the page, a `border-b`
   under the navigation's Wrapper and a `border-t` over the footer's. The header,
   the sections bar and the footer are therefore the same column as the document,
   painted the same white, and the uprights simply continue through them. */

.sy-head-blur {
  /* Nothing left to paint: the header's own inner column carries the white, and
     the drop shadow Shibuya used to lift the bar is not a website treatment. */
  background-color: transparent;
  backdrop-filter: none;
  box-shadow: none;
}

.sy-head-inner,
.sy-foot-inner,
.rl-subnav-inner,
.rl-document-column {
  max-width: var(--rl-w-column);
  border-inline: 1px solid var(--sy-c-divider);
  background-color: var(--sy-c-background);
}

.sy-head-inner {
  border-bottom: 1px solid var(--sy-c-divider);
}

.rl-subnav-inner {
  border-bottom: 1px solid var(--sy-c-divider);
}

/* Upstream paints the footer's ground across the whole page. The website's
   footer element carries none — the Wrapper inside it is what is white — so the
   field runs behind it to the frame's edges. */
.sy-foot {
  border-top: none;
  background-color: transparent;
}

.sy-foot-inner {
  border-top: 1px solid var(--sy-c-foot-divider);
  padding-top: 1.5rem;
}

/* Footer type, at the website's scale: section headings in the base size at
   medium weight, links a step smaller, and the copyright line smaller again. */
.sy-foot :is(h2, h3, h4) {
  color: var(--sy-c-foot-text);
  font-size: var(--rl-t-body);
  font-weight: 500;
}

.sy-foot a {
  font-size: var(--rl-t-caption);
  font-weight: 500;
  text-decoration: none;
  transition: color var(--rl-d-link) ease-in-out;
}

/* The website hovers a footer link to teal-600, which is 1.78:1 on white and
   unreadable as text. The link role — the accent's text step, 5.58:1 — is the
   nearest step that clears 4.5:1, and it is the teal the rest of the
   documentation already uses for a link. */
.sy-foot a:hover {
  color: var(--sy-c-link);
  text-decoration: none;
}

.sy-foot a:focus-visible {
  outline: 2px solid var(--rl-c-focus);
  outline-offset: 2px;
}

/* The mark and the copyright are one block, at the website's `text-xs
   font-medium text-base-800`. */
.sy-foot .sy-foot-copyright {
  color: var(--sy-c-foot-text);
  font-size: var(--rl-t-label);
  font-weight: 500;
}

.sy-foot .rl-foot-brand {
  margin-bottom: 0.5rem;
}

.sy-foot .rl-foot-brand img {
  height: 1.5rem;
  width: auto;
}


/* One control-state model --------------------------------------------------
   `Button.astro` states the website's whole interaction language for a control,
   and states it once: `border-transparent` with a 1px `ring` in the variant's
   colour, `shadow-bottom` at rest, an `inset-shadow-white/30` top edge,
   `hover:opacity-90 hover:shadow-none`, `active:inset-shadow-transparent`,
   `focus:outline-2 outline-offset-4`, all over `transition-all duration-300
   ease-in-out`. Hover changes no colour. Nothing translates in any state.

   Every control the theme draws opts into this rule rather than restating a
   model of its own. The ring is the one per-variant value, and it is a variable
   the variant sets.

   A control is never underlined, whether or not it happens to be an anchor. The
   website's buttons carry none, and the ones inside an article otherwise take
   upstream's `.yue a` underline — the label of a button is not a phrase in a
   sentence, and the shape already says it can be pressed. Said here rather than
   beside each control, because it is the same claim as the rest of the
   contract. */

.rl-cta,
.rl-actions .rl-action,
.yue .sd-btn,
.searchform input[name="q"]+button,
.yue button.copybtn,
.yue div.sphx-glr-download a,
.rl-menu-close {
  border: 1px solid transparent;
  border-radius: var(--rl-r-lg);
  text-decoration: none;
  box-shadow:
    0 0 0 1px var(--rl-c-control-ring),
    inset 0 1px 0 var(--rl-c-control-inset),
    var(--shadow-bottom);
  cursor: pointer;
  transition:
    opacity var(--rl-d-control) ease-in-out,
    box-shadow var(--rl-d-control) ease-in-out;
}

.rl-cta:hover,
.rl-actions .rl-action:hover,
.yue .sd-btn:hover,
.searchform input[name="q"]+button:hover,
.yue button.copybtn:hover,
.yue div.sphx-glr-download a:hover,
.rl-menu-close:hover {
  box-shadow:
    0 0 0 1px var(--rl-c-control-ring),
    inset 0 1px 0 var(--rl-c-control-inset);
  opacity: 0.9;
}

.rl-cta:active,
.rl-actions .rl-action:active,
.yue .sd-btn:active,
.searchform input[name="q"]+button:active,
.yue button.copybtn:active,
.yue div.sphx-glr-download a:active,
.rl-menu-close:active {
  box-shadow: 0 0 0 1px var(--rl-c-control-ring);
}

/* The website's focus ring, geometry and colour both: `focus:outline-2
   outline-offset-4 focus:outline-teal-300`.

   teal-300 is 1.29:1 against the white page and 1.05:1 against the base-200
   band a control sits on, so this ring does not meet the 3:1 that WCAG 2.1
   SC 1.4.11 asks of a focus indicator, and a keyboard user will have more
   difficulty telling which control they are on than a stronger ring would have
   cost them. That is a decided trade for exact parity with the product's
   controls rather than an oversight — `.scratch/website-design-parity/` ticket
   10, and the demo site's "Role mapping" page, which is where a reader running
   an accessibility audit should land.

   Two things bound the cost. It is controls only: prose links, navigation
   entries, breadcrumbs and the takeover all keep `--rl-c-focus`, and the
   control's own fill still moves under the ring. And a forced-colours
   rendering substitutes the system's focus colour, so the ring survives there
   regardless. The search field is the one other place the same trade was made,
   in its own role and for the same reason. */
.rl-cta:focus-visible,
.rl-actions .rl-action:focus-visible,
.yue .sd-btn:focus-visible,
.searchform input[name="q"]+button:focus-visible,
.yue button.copybtn:focus-visible,
.yue div.sphx-glr-download a:focus-visible,
.rl-menu-close:focus-visible {
  outline: 2px solid var(--rl-c-control-focus);
  outline-offset: 4px;
}

/* The website's control sizes are a fixed ladder — 32px, 36px, 40px, 44px,
   48px, 52px — and a control that lands between two steps reads as a control
   from somewhere else. The three the theme draws take the three steps they are:
   the in-article actions and an example's downloads are the ladder's smallest,
   the header's call to action is the navigation size, and the search page's
   submit is the page default, which is also the height of the field it sits
   next to. Each is a floor rather than a height, so a label that wraps still
   grows its control. */
.rl-actions .rl-action,
.yue div.sphx-glr-download a {
  min-height: 2rem;
}

.rl-cta {
  min-height: 2.25rem;
}

.searchform input[name="q"]+button {
  min-height: 2.5rem;
}

/* The website's size map rounds its two smallest controls a step tighter. */
.rl-actions .rl-action,
.yue button.copybtn,
.yue div.sphx-glr-download a,
.yue .sd-btn-sm,
.yue .sd-btn-xs {
  border-radius: var(--rl-r-md);
}

/* The two variants the theme's own markup publishes. */
[data-rl-variant="teal"] {
  --rl-c-control-ring: var(--rl-c-control-ring-accent);
}

[data-rl-variant="muted"] {
  --rl-c-control-ring: var(--sy-c-divider);
}

/* Call to action -----------------------------------------------------------
   One click from the documentation back to the product. Accent-filled, because
   it is the only control in the chrome that should ask to be pressed; its
   states are the contract's. */

.rl-cta {
  display: inline-flex;
  align-items: center;
  margin-right: 0.75rem;
  padding: 0.3125rem 0.75rem;
  background-color: var(--accent-9);
  color: var(--accent-contrast);
  font-size: var(--rl-t-caption);
  font-weight: 500;
  line-height: 1.25rem;
  text-decoration: none;
  white-space: nowrap;
}

/* Sphinx-design buttons are the documentation-native version of the same
   control. The extension steps their background colour on hover from an
   `!important` rule, which is a model the website does not have; rather than
   out-weighing the rule, the variable it reads is re-pointed at the resting
   colour for the duration of the hover, so the fill holds still and the
   contract's fade is what the reader sees. */
.yue .sd-btn:hover,
.yue .sd-btn:focus {
  --sd-color-primary-highlight: var(--sd-color-primary);
  --sd-color-secondary-highlight: var(--sd-color-secondary);
  --sd-color-success-highlight: var(--sd-color-success);
  --sd-color-info-highlight: var(--sd-color-info);
  --sd-color-warning-highlight: var(--sd-color-warning);
  --sd-color-danger-highlight: var(--sd-color-danger);
  --sd-color-light-highlight: var(--sd-color-light);
  --sd-color-muted-highlight: var(--sd-color-muted);
  --sd-color-dark-highlight: var(--sd-color-dark);
}

/* The website's accent variant rings one step darker than its fill. Its muted
   and default variants — base-200 over base-100, base-900 over base-800 — are
   what the role mapping already binds `sd-btn-light` and `sd-btn-secondary` to,
   so only the rings are said here; the fills are not re-opened. */
.yue :is(.sd-btn-primary, .sd-btn-outline-primary) {
  --rl-c-control-ring: var(--rl-c-control-ring-accent);
}

.yue :is(.sd-btn-light, .sd-btn-outline-light) {
  --rl-c-control-ring: var(--sy-c-divider);
}

/* `sd-btn-muted` is base-500, not the website's muted pairing, so it rings
   itself rather than borrowing base-200 from the variant next to it. */
.yue .sd-btn-muted {
  --rl-c-control-ring: var(--sd-color-muted);
}

.yue :is(.sd-btn-secondary, .sd-btn-dark) {
  --rl-c-control-ring: var(--sd-color-secondary);
}

/* Below the small breakpoint the frame is the window, so its own uprights are
   drawn against the screen's edge and are dropped. The column keeps its pair,
   at the 0.5rem the clamp above has come down to — which is the website's
   `mx-2`, and the same inset the navigation takeover gives its white panel — so
   both hairlines and the field beside them survive on a phone. The shell's own
   vertical padding stands down with the frame's border. */
@media (max-width: 48rem) {
  .rl-frame {
    border-inline: 0;
  }

  .rl-document-shell {
    padding-block: 0;
  }
}

/* At narrow widths the header has the mark, search and the menu to fit in, so
   the call to action stands down rather than squeezing them. */
@media (max-width: 40rem) {
  .rl-cta {
    display: none;
  }
}

/* Small-screen navigation takeover -----------------------------------------
   Below Shibuya's navigation breakpoint the header's menu opens the website's
   takeover: the stripe field, a white column between two hairlines, and section
   names large enough to hit with a thumb.

   Shibuya's own machinery is what opens and closes it — the menu control, the
   close control and the panel agree through `aria-controls`, `aria-expanded`
   and `aria-hidden`, and the panel is display:none while shut, so nothing
   inside it is reachable by keyboard or announced while it is closed. */

@media (max-width: 767px) {
  .sy-head-nav {
    top: 0;
    z-index: 30;
    border-top: none;
    padding: 4.5rem 0 2rem;
    background-color: var(--sy-c-background);
    background-image: var(--rl-image-stripe-field);
    opacity: 0;
    transition:
      opacity var(--rl-d-control) ease-in-out,
      display var(--rl-d-control) ease-in-out allow-discrete;
  }

  /* The white column — the website's `absolute inset-0 bg-white border-x
     border-base-200 mx-2` — inset so the field shows along both edges exactly
     as it does around the document column on a wide screen. */
  .sy-head-nav::before {
    content: "";
    position: fixed;
    z-index: -1;
    inset: 0 0.5rem;
    border-left: 1px solid var(--sy-c-divider);
    border-right: 1px solid var(--sy-c-divider);
    background-color: var(--sy-c-background);
  }

  /* Sections at the top, the supporting controls at the foot of the screen.
     The panel is still display-toggled, so nothing inside it is reachable by
     keyboard or announced while it is closed; `allow-discrete` is what lets the
     website's 300ms fade run either side of that switch. */
  .sy-head-nav[aria-hidden="false"] {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 2rem;
    opacity: 1;
  }

  @starting-style {
    .sy-head-nav[aria-hidden="false"] {
      opacity: 0;
    }
  }

  /* The website puts its mark small in the panel's top-left corner, level
     with the close control on the right. */
  .rl-menu-brand {
    position: absolute;
    top: 1rem;
    left: 1.5rem;
    display: flex;
    align-items: center;
    height: 2.75rem;
  }

  .rl-menu-brand img {
    height: 1rem;
    width: auto;
  }

  .sy-head-extra {
    position: static;
    padding: 0 1.5rem;
  }

  /* Upstream floats the search field into the panel's top-left corner, where
     the close control now is. Relative rather than static keeps the field's own
     mark positioned against it, so the offsets are cleared by hand. */
  .sy-head-extra form.searchbox {
    position: relative;
    top: auto;
    right: auto;
    left: auto;
    width: 100%;
  }

  /* The sections bar stands down: the takeover is where a phone reader crosses
     between sections, and two Sections navigations on one screen is one too
     many. Nothing is under the header here, so the offset it feeds — the
     sidebars' start and an anchor jump's landing — counts the header alone. */
  :root {
    --sy-s-offset-top: var(--rl-s-chrome-top);
  }

  .rl-subnav {
    display: none;
  }

  /* The close control exists only here. Above the breakpoint the panel is the
     header's own row of controls, and upstream's `md:hidden` is what keeps the
     control out of it — which is why the display is set here rather than in the
     rule below, where it would come after `md:hidden` and undo it. */
  .rl-menu-close {
    display: flex;
  }
}

/* The mark's three heights. The brand gives the horizontal lockup 32px in site
   chrome, 24px in the footer and 16px inside the navigation takeover, and those
   are the only three sizes it is drawn at. Upstream's header is 28px, which is
   neither, and the takeover's is stated with the footer's below. */
.sy-head-brand img {
  height: 2rem;
}

/* The website parks its close control at `top-4 right-4`. */
.rl-menu-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  background: var(--sy-c-background);
  color: var(--sy-c-text);
}

.rl-menu-close svg {
  width: 1.25rem;
  height: 1.25rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.rl-menu-brand:focus-visible,
.rl-mobile-nav a:focus-visible {
  outline: 2px solid var(--rl-c-focus);
  outline-offset: 2px;
}

/* Shibuya's own mark-swapping rules are scoped to its header brand, so the two
   marks this theme adds — the takeover's and the footer's — say which cut
   belongs to which colour mode themselves. */
:is(.rl-menu-brand, .rl-foot-brand) .dark-logo,
html.dark :is(.rl-menu-brand, .rl-foot-brand) .light-logo {
  display: none;
}

html.dark :is(.rl-menu-brand, .rl-foot-brand) .dark-logo {
  display: inline;
}

.rl-mobile-nav ul {
  margin: 0;
  padding: 0 1.5rem;
  list-style: none;
}

/* `text-6xl tracking-tighter font-semibold` — the website's display size. The
   upper bound is its literal 3.75rem; the lower one keeps a long section name
   inside a 320px viewport, which the marketing site's four short names never
   have to survive. */
.rl-mobile-nav a {
  display: block;
  padding: 0.5rem 0;
  color: var(--sy-c-heading);
  font-size: clamp(2.25rem, 11vw, 3.75rem);
  font-weight: 600;
  letter-spacing: var(--rl-tracking-heading);
  line-height: 1.1;
  text-decoration: none;
  transition: color var(--rl-d-link) ease-in-out;
}

.rl-mobile-nav a:hover {
  color: var(--sy-c-light);
}

/* The reader's own section, said in colour and in a rule under the word as well
   as in the markup's aria-current. */
.rl-mobile-nav a.current {
  color: var(--rl-c-nav-link-current);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.15em;
}

.rl-mobile-actions {
  padding: 1rem 1.5rem 0;
}

/* The header hides the call to action at this width; inside the takeover it is
   the website's full-width button again. */
.rl-mobile-actions .rl-cta {
  display: flex;
  justify-content: center;
  margin-right: 0;
  width: 100%;
  height: 2.75rem;
}

/* Page-to-page controls ----------------------------------------------------
   Previous and next become the website's bordered cards: a quiet surface, a
   teal hover, and a chevron that moves a little in the direction it points. */

.navigation {
  border-top: none;
  gap: 1rem;
}

.navigation a {
  padding: 0.75rem 1rem;
  color: var(--sy-c-text);
  text-decoration: none;
}

.navigation a:hover {
  color: var(--rl-c-nav-link-hover);
}

.navigation a:focus-visible {
  outline: 2px solid var(--rl-c-focus);
  outline-offset: 2px;
}

/* Documentation surfaces ---------------------------------------------------
   The website builds its help centre out of white cards, hairline borders and
   one accent at a time. These are that treatment applied to the surfaces Sphinx
   generates, so that a table, an admonition and a search result look like they
   were designed together. */

/* One card surface, from `HelpCenterEntries1.astro`: `bg-white rounded-xl
   outline outline-base-200 shadow-xl` with a `hover:bg-base-50` ground. An
   outline rather than a border, because the website's is one and because an
   outline does not move the content it wraps. Every raised surface in the theme
   spends this rule; none of them draws a box of its own. */
.navigation a,
.yue .sd-card,
.yue details.sd-dropdown,
.yue .sphx-glr-thumbcontainer,
#search-results ul.search>li,
.yue .toctree-wrapper>ul,
.yue .rl-landing-cards {
  border-color: transparent;
  border-radius: var(--rl-r-xl);
  outline: 1px solid var(--sy-c-divider);
  outline-offset: -1px;
  background-color: var(--sy-c-background);
  box-shadow: var(--rl-shadow-card);
  transition:
    background-color var(--rl-d-control) ease-in-out,
    box-shadow var(--rl-d-control) ease-in-out,
    outline-color var(--rl-d-control) ease-in-out;
}

.navigation a:hover,
.yue .sd-card:hover,
.yue .sphx-glr-thumbcontainer:hover,
#search-results ul.search>li:hover {
  background-color: var(--sy-c-surface);
}

/* The larger variant, from `HelpCenterFaq.astro`: `rounded-2xl shadow-2xl`. A
   disclosure list is the documentation's FAQ, so it is where the panel goes.

   The website also puts a small rounded tile behind an icon inside a card, whose
   ground and ink invert on hover. No surface Sphinx generates carries an icon of
   that kind — the page actions draw theirs inline at text size — so the tile has
   nowhere to be spent and is not declared. */
.yue details.sd-dropdown {
  border-radius: var(--rl-r-2xl);
  box-shadow: var(--rl-shadow-panel);
}

/* Navigation trees. Upstream already colours the current entry with the link
   role, which the brand layer binds to teal; what is added here is the website's
   quieter caption and the rule that marks where the reader is. */

.globaltoc .caption,
.sy-rside-inner>div>h3 {
  color: var(--sy-c-light);
  font-size: var(--rl-t-label);
  letter-spacing: var(--rl-tracking-label);
}

.globaltoc .caption::before {
  content: "";
  display: inline-block;
  width: 0.375rem;
  height: 0.375rem;
  margin-right: 0.5rem;
  border-radius: 1px;
  background-color: var(--color-yellow-600);
  vertical-align: middle;
}

.globaltoc>ul a,
.sy-rside .localtoc a {
  border-radius: var(--rl-r-md);
  color: var(--rl-c-nav-link);
  text-decoration: none;
}

/* An API page's contents are dotted identifiers with no space in them to break
   at, and a column narrow enough to hold a heading is narrower than
   `Waveguide.normalized_frequency`. Left alone the entry runs out through the
   column's own upright, which is the one hairline on the page a reader is meant
   to be able to trust. It wraps instead. */
.sy-rside .localtoc a {
  overflow-wrap: anywhere;
}

/* One reading of the pointer and of the reader's place, spent by every
   navigation surface the theme draws. Upstream paints a hovered entry with the
   accent's hover step and the current entry with the accent, which puts teal
   through both sidebars, the breadcrumbs and the page-to-page cards. The
   website's own navigation has no accent in it at all: it rests a link at
   base-800 and hovers it *quieter*, to base-600.

   So the pointer lightens the ink and the reader's own page darkens it to the
   strongest step the page has. Weight carries the current entry as well as
   colour, because two steps of one ramp are a small difference to ask a reader
   to see. Each of upstream's rules is answered by a selector of the same shape;
   this stylesheet is linked after Shibuya's, so they win on order. */
.globaltoc>ul a:hover,
.sy-rside .localtoc a:hover,
.sy-rside ul.this-page-menu a:hover,
.sy-breadcrumbs ol a:hover {
  color: var(--rl-c-nav-link-hover);
}

.globaltoc>ul a.current,
.sy-rside .localtoc a.current,
.sy-rside .localtoc li.current>a,
.sy-rside .localtoc li.active>a,
.sy-breadcrumbs ol strong {
  color: var(--rl-c-nav-link-current);
  font-weight: 500;
}

/* The rail beside the section the reader is in, which upstream draws in the
   accent for the same reason it colours the entry. It is the current entry's
   own mark, so it takes the current entry's ink. */
.globaltoc li.toctree-l2.current {
  border-color: var(--rl-c-nav-link-current);
}

.globaltoc>ul a:focus-visible,
.sy-rside .localtoc a:focus-visible,
.sy-breadcrumbs a:focus-visible {
  outline: 2px solid var(--rl-c-focus);
  outline-offset: 2px;
}

/* Breadcrumbs and page metadata. Compact, in the website's hierarchy: the trail
   is neutral, and where the reader has arrived is the navigation ink's darkest
   step, with the rest of the navigation surfaces. */

.sy-breadcrumbs ol {
  font-size: var(--rl-t-caption);
}

.sy-breadcrumbs ol a {
  color: var(--sy-c-text);
  font-weight: 500;
}

/* The help-centre search control -------------------------------------------
   `HelpCenterSearch.astro` states the field exactly: `h-10 py-2 px-4 text-sm
   border border-transparent rounded-lg bg-base-100 placeholder-base-400
   duration-300`, focusing to `focus:bg-white focus:ring-2 focus:ring-teal-500
   focus:ring-offset-2 focus:ring-offset-base-200`. The header's field and the
   search page's field are one control, so they are declared as one.

   The geometry — a 2px band then a 2px ring — and the colour are both the
   website's. teal-500 is 1.53:1 against the white page and 1.24:1 against the
   base-200 band it is offset from, so this ring does not meet the 3:1 that
   WCAG 2.1 SC 1.4.11 asks of a focus indicator. It is the same trade the
   control contract makes, taken for the same reason and kept consistent with
   it: a reader who focuses the search field and then a button should not see
   two different answers to one question. The role is its own so that either
   can be reversed without the other. In dark mode the value is 9.59:1 against
   the band and costs nothing.

   Recorded on the demo site's "Role mapping" page, under accessibility
   posture, and in `.scratch/website-design-parity/` ticket 11. */

.searchbox input,
.searchform input[name="q"] {
  height: 2.5rem;
  padding: 0.5rem 1rem;
  border: 1px solid transparent;
  border-radius: var(--rl-r-lg);
  background: var(--rl-c-field);
  color: var(--rl-c-field-text);
  transition:
    background-color var(--rl-d-control) ease-in-out,
    box-shadow var(--rl-d-control) ease-in-out;
}

.searchbox input::placeholder,
.searchform input[name="q"]::placeholder {
  color: var(--rl-c-field-placeholder);
}

.searchbox input:focus,
.searchform input[name="q"]:focus {
  background: var(--sy-c-background);
  box-shadow:
    0 0 0 2px var(--sy-c-divider),
    0 0 0 4px var(--rl-c-field-focus);
  /* Transparent rather than absent, so the ring survives a forced-colours
     rendering that throws box shadows away. */
  outline: 2px solid transparent;
  outline-offset: 2px;
}

/* The header's field carries a mark of its own, which the padding makes room
   for; the search page's field does not. */
.searchbox {
  position: relative;
}

.searchbox input {
  padding-left: 2rem;
}

.searchbox .rl-search-icon {
  position: absolute;
  left: 0.625rem;
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: var(--sy-c-light);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

/* The back-to-top control's glyph, which `components/back-to-top.html` redraws
   as Tabler's stroked arrow. Upstream's own arrow is a filled shape, so it sets
   `fill: currentColor` and no stroke; the website's icons are the other way
   round. The control's colour is still upstream's — it inverts on hover — and
   `currentColor` carries it either way. */
.back-to-top svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* The search page's submit control is the shared contract's, at the size the
   field beside it is. */
.searchform input[name="q"]+button {
  margin-left: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--accent-9);
  color: var(--accent-contrast);
  font-weight: 500;
  --rl-c-control-ring: var(--rl-c-control-ring-accent);
}

/* Search results are the help centre's list of answers, and a result is the
   same object as a help-centre card: the surface above, at the size a list row
   wants, with the whole row reacting to the pointer rather than the title. */

#search-results ul.search>li {
  margin-top: 0.75rem;
  padding: 0.875rem 1rem;
}

/* A term the reader searched for, found in the page or in a result's summary.
   The website marks things in yellow, and nothing else on a documentation page
   competes for that colour. */

.yue .highlighted,
#search-results .highlighted {
  padding: 0 0.125rem;
  border-radius: var(--rl-r-sm);
  background-color: var(--rl-c-highlight-background);
  color: var(--rl-c-highlight-text);
}

/* Toctrees in the page body. A list of links to other pages is a menu, and the
   website draws a menu as a card — the same card as everything else. */

.yue .toctree-wrapper>ul {
  margin: 1.25rem 0;
  padding: 0.5rem;
  list-style: none;
}

.yue .toctree-wrapper>ul>li {
  margin: 0;
}

/* A card of page links is a menu, not running prose, so these opt out of the
   prose link's rule and ground the way the theme's other controls do. The
   gallery's captions are named alongside them for the same reason: a thumbnail
   is a target, not a sentence, and it already says so by lifting on hover. */
.yue .toctree-wrapper a,
.yue .toctree-wrapper a:hover,
.yue .toctree-wrapper a:focus-visible,
.yue .sphx-glr-thumbcontainer a,
.yue .sphx-glr-thumbcontainer a:hover,
.yue .sphx-glr-thumbcontainer a:focus-visible {
  background-color: transparent;
  border-bottom: none;
  text-decoration: none;
}

.yue .toctree-wrapper>ul>li>a {
  display: block;
  padding: 0.5rem 0.75rem;
  border-radius: var(--rl-r-lg);
  color: var(--sy-c-text);
  font-weight: 500;
}

.yue .toctree-wrapper>ul>li>a:hover {
  background: var(--accent-a2);
  color: var(--sy-c-link);
}

.yue .toctree-wrapper>ul ul {
  padding-left: 1.5rem;
  list-style: none;
}

.yue .toctree-wrapper p.caption {
  border-bottom: none;
  color: var(--sy-c-light);
  font-size: var(--rl-t-label);
  letter-spacing: var(--rl-tracking-label);
}

/* Tables. A hairline frame around the whole thing, so a table reads as one
   object on the page rather than as a set of rules across it. */

/* Docutils wraps every table in a container of its own, which is where the
   frame and the sideways scrolling belong: a table that is its own scroller
   stops filling the width it was given. */
.yue .table-wrapper {
  margin: 2em 0;
  border: 1px solid var(--yue-c-table-border);
  border-radius: var(--rl-r-xl);
  overflow-x: auto;
}

.yue .table-wrapper>table {
  margin: 0;
}

.yue table>caption {
  padding: 0.75rem 1rem 0;
  font-size: var(--rl-t-caption);
  text-align: left;
}

.yue thead tr {
  background: var(--yue-c-th-background);
}

.yue :is(thead th, tbody td) {
  padding: 0.625rem 1rem;
}

.yue tbody tr:last-child {
  border-bottom-width: 0;
}

/* Admonitions. Upstream's four colour roles per kind are kept — they are what
   tells a warning from a note — and restated as a card: a full hairline border,
   a rounded corner, and the coloured edge the website uses to carry meaning.

   The rail is 4px, which is the width the band contract names and the width the
   rest of the system draws a coloured edge at: the brand's own accented figure
   is a 2px rule, and accent colour is spent in shapes under about 40px. A 12px
   slab of colour down the side of every note is the one place a documentation
   page was louder than the site it belongs to. */

.yue .admonition,
.yue :is(div.versionadded, div.versionchanged, div.versionremoved, div.deprecated) {
  border: 1px solid var(--sy-c-border);
  border-left: 0.25rem solid var(--color-3);
  border-radius: var(--rl-r-xl);
  background-color: var(--sy-c-background);
  overflow: hidden;
}

/* Upstream gives every admonition a `--color-3` — the rail — and gives a
   version directive only `--color-1` and `--color-2`. A custom property is
   inherited, so leaving the rail to a fallback would let a version directive
   written inside an admonition paint its edge and its glyph in the admonition's
   colour instead of its own. It names its rail here rather than not having
   one. */
.yue :is(div.versionadded, div.versionchanged, div.versionremoved, div.deprecated) {
  --color-3: var(--color-2);
}

/* Upstream hangs the kind's icon off the card's left edge — a coloured disc at
   `left: -12px` with the glyph masked over it — which a bordered card clips
   away, and which reads as a blot where it does survive. Both pseudo-elements
   are dropped, and the glyph is drawn inside the title bar instead. */
.yue .admonition::before,
.yue .admonition::after,
.yue :is(div.versionadded, div.versionchanged, div.versionremoved, div.deprecated)::before,
.yue :is(div.versionadded, div.versionchanged, div.versionremoved, div.deprecated)::after {
  display: none;
}

/* A custom admonition has no kind, so upstream's default glyph — a Lucide bell
   — is the one thing in the set the role mapping cannot reach by kind. It is
   named here instead, as the mark the website's own pages carry beside a
   section label.

   The kinds are excluded rather than left to win on their own: upstream states
   each kind at the same specificity as `.admonition` itself, so a plainer
   selector here would come later in the cascade and take the glyph off every
   kind at once. */
.yue .admonition:not(.note, .seealso,
  .tip, .hint,
  .important, .attention, .caution, .warning,
  .danger, .error,
  .admonition-todo) {
  --icon-url: var(--rl-icon-info-circle);
}

.yue .admonition>.admonition-title {
  margin: -0.825rem -1rem 0.825rem;
  padding: 0.5rem 1rem;
  border-bottom: 1px solid var(--sy-c-divider);
  background-color: var(--color-1);
  font-size: var(--rl-t-caption);
}

/* The glyph itself, in the shape the website gives an icon beside a label: no
   disc and no tile, the mark alone in the band's own colour at the label's own
   size. `--color-3` is the kind's rail, so the icon, the left edge and the
   title are one colour, and a reader learns the band once.

   The mask is what makes that possible: the glyph is a shape, and the colour is
   this rule's to choose, in both colour modes.

   It is an inline box rather than a flex item, and the label around it is left
   as ordinary inline text. Making either label a flex container would put every
   inline child in a box of its own, and the spaces between those boxes are
   dropped: a version directive would lose the space Sphinx writes inside its
   label, and a title with a role or a literal in it would lose the spaces
   around it. The offset centres the mark on the label's cap height. */
.yue .admonition>.admonition-title::before,
.yue :is(div.versionadded, div.versionchanged, div.versionremoved, div.deprecated) .versionmodified::before {
  content: "";
  display: inline-block;
  width: 1rem;
  height: 1rem;
  margin-right: 0.5rem;
  vertical-align: -0.25em;
  background-color: var(--color-3);
  -webkit-mask: var(--icon-url) no-repeat;
  mask: var(--icon-url) no-repeat;
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
}



/* Definition lists — the shape autodoc gives an API — take the same hairline
   as the rest, so a reference page looks like the pages around it.

   Upstream hangs a signature's continuation lines under its name with
   `text-indent: -2.4rem` against a left padding of 3rem, so the first line
   starts 0.6rem in and a wrapped one 3rem in. The card restates the padding to
   its own inset, and a shorthand cannot restate three sides and leave the
   fourth alone: the left padding has to carry the hang as well as the inset, or
   the negative indent pulls the name out through the border. The indent is said
   here too rather than inherited, so the two numbers that have to agree are
   next to each other. */

.yue dl.py>dt {
  padding: 0.375rem 0.75rem 0.375rem 3.15rem;
  text-indent: -2.4rem;
  border: 1px solid var(--sy-c-divider);
  border-radius: var(--rl-r-lg);
  background: var(--sy-c-surface);
}

/* Gallery ------------------------------------------------------------------
   Sphinx-gallery draws a gallery in colours and geometry that belong to no
   theme: a blue hover border, a frosted overlay that hides the thumbnail to
   show its description, and yellow gradient download buttons. The website has
   already answered every one of those questions somewhere else, so what
   follows spends its existing answers rather than inventing gallery ones.

   The card is `BlogEntries2.astro`, which is the website's card with a picture
   in it: an image at the top of a padded white card, a title under it, the
   description clamped to two lines beneath that, and the whole card a link.
   Its `[--card-padding:--spacing(2)]` is the padding here, and its image radius
   is the card's radius less that padding — the two numbers are stated next to
   each other below for that reason.

   Every rule in this section is a class deeper than it needs to be. Sphinx
   links `sg_gallery.css` after the theme's stylesheet, so a rule of equal
   weight loses to the extension's; `.yue` is the article the gallery is in.

   The thumbnails keep a white ground: a matplotlib figure is drawn on white,
   and a white figure floating on a dark card reads as a mistake, where a white
   card reads as a print. Sphinx-gallery pads every thumbnail to one size, so
   `contain` letterboxes the figure into the card's aspect rather than cropping
   an axis label out of it. */

.yue .sphx-glr-thumbnails {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.yue .sphx-glr-thumbcontainer {
  position: relative;
  /* A block rather than upstream's centred flex column. Two reasons: a card's
     text block starts where the card's padding ends, as the website's does,
     rather than being centred on its own width; and a flex item cannot be a
     `-webkit-box`, which is the only way to clamp the description below to two
     lines with an ellipsis. */
  display: block;
  box-sizing: border-box;
  width: 100%;
  margin: 0;
  padding: 0.5rem;
  border: 1px solid transparent;
  text-align: left;
}

/* The website lifts its card to the panel shadow on hover and moves nothing
   else. Upstream rings the card in its own blue at the same moment, which is
   the one state that has to be said again to be taken away. */
.yue .sphx-glr-thumbcontainer:hover {
  border-color: transparent;
  box-shadow: var(--rl-shadow-panel);
}

.yue .sphx-glr-thumbcontainer img {
  display: block;
  width: 100%;
  max-width: 100%;
  max-height: none;
  aspect-ratio: 12 / 9;
  object-fit: contain;
  /* The card's radius less its 0.5rem padding, so the image's corners run
     parallel to the card's. */
  border-radius: calc(var(--rl-r-xl) - 0.5rem);
  background-color: #ffffff;
}

/* The card is one target. Sphinx-gallery already emits a link with nothing
   visible in it for exactly this, and hangs it off a paragraph; both are laid
   over the whole card, as `BlogEntries2.astro` lays its `absolute inset-0`
   anchor over the card's contents. */
.yue .sphx-glr-thumbcontainer p {
  position: absolute;
  inset: 0;
  width: auto;
  height: auto;
  margin: 0;
}

.yue .sphx-glr-thumbcontainer a.internal {
  position: absolute;
  inset: 0;
  width: auto;
  height: auto;
  padding: 0;
  z-index: 1;
}

/* The link's own text is what a screen reader reads the card out as, and
   upstream hides it outright because the title is drawn again below. Hidden
   visually rather than removed, so the card is still a named link. */
.yue .sphx-glr-thumbcontainer p a span {
  position: absolute;
  display: block;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* `text-base font-medium text-base-900`, inset from the card's edge the way the
   website insets a card's text block from the image above it. */
.yue .sphx-glr-thumbnail-title {
  margin-top: 0.75rem;
  padding: 0 0.5rem;
  color: var(--sy-c-heading);
  font-size: var(--rl-t-body);
  font-weight: 500;
  line-height: 1.4;
}

/* The description. Sphinx-gallery puts it in the container's `tooltip`
   attribute and shows it only while the pointer is over the card, behind a
   frosted panel that hides the thumbnail the reader is looking at. The website
   shows a card's description under its title at `text-sm text-base-600` clamped
   to two lines, which is what this draws it as; the overlay is switched off.

   The hover selector is repeated because the extension's own is a class heavier
   than its resting one, and would otherwise take the description back to an
   absolutely positioned overlay while the pointer is on the card. */
.yue .sphx-glr-thumbcontainer[tooltip]::after,
.yue .sphx-glr-thumbcontainer[tooltip]:hover::after {
  content: attr(tooltip);
  position: static;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  width: auto;
  max-height: none;
  /* The space under the description is a margin rather than padding: the box
     is clipped at its padding edge, and padding there would show the top of the
     line the clamp had just cut off. */
  margin: 0.5rem 0 0.25rem;
  padding: 0 0.5rem;
  border-radius: 0;
  color: var(--sy-c-light);
  font-size: var(--rl-t-caption);
  line-height: 1.5;
}

.yue .sphx-glr-thumbcontainer[tooltip]::before,
.yue .sphx-glr-thumbcontainer[tooltip]:hover::before {
  content: none;
}

/* The tag strip over the grid, when a gallery is configured to have one. A tag
   is the website's quiet pill: the muted control ground, no border of its own,
   and the accent only once the reader has chosen it. */
.yue .sphx-glr-tag-list {
  gap: 0.5rem;
  padding-bottom: 1.5rem;
}

.yue .sphx-glr-tag,
.yue .sphx-glr-tag-label {
  padding: 0.25rem 0.625rem;
  border: 1px solid transparent;
  border-radius: var(--rl-r-md);
  background-color: var(--rl-c-control-muted);
  color: var(--sy-c-text);
  font-size: var(--rl-t-caption);
  font-weight: 500;
}

.yue .sphx-glr-tag-label {
  background-color: transparent;
  color: var(--sy-c-light);
}

.yue .sphx-glr-tag:hover,
.yue .sphx-glr-tag.active {
  border-color: var(--rl-c-control-ring-accent);
  color: var(--sy-c-link);
}

/* An example page ----------------------------------------------------------
   A figure is centred in the reading column, and a row of them is a row rather
   than an inline run of images with the gaps a text line would have given it. */

.yue .sphx-glr-single-img {
  display: block;
  max-width: 100%;
  margin: 1.5rem auto;
}

.yue ul.sphx-glr-horizontal {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin: 1.5rem 0;
  padding: 0;
  list-style: none;
}

.yue ul.sphx-glr-horizontal li {
  display: block;
  margin: 0;
}

.yue .sphx-glr-multi-img {
  max-width: 100%;
}

/* The script's own output. Upstream labels the block "Out:" in grey and grounds
   it in a pale yellow of its own; the label takes the caption role the theme
   gives every other block's, and the block itself is code, so it is grounded as
   code is. */
.yue .sphx-glr-script-out {
  gap: 0.75rem;
  color: var(--sy-c-light);
}

.yue .sphx-glr-script-out::before {
  color: var(--sy-c-light);
  font-size: var(--rl-t-caption);
  font-weight: 500;
}

.yue .sphx-glr-script-out .highlight pre {
  background-color: var(--code-block-background);
  border: 1px solid var(--sy-c-border);
  border-radius: var(--rl-r-xl);
  padding: 0.75rem 1rem;
}

/* How long the example took to run, and the signature sphinx-gallery signs a
   generated page with. Both are metadata about the page rather than part of it,
   at the size and colour the theme gives a caption. */
.yue p.sphx-glr-timing,
.yue p.sphx-glr-signature {
  margin-top: 2rem;
  margin-bottom: 0.25rem;
  color: var(--sy-c-light);
  font-size: var(--rl-t-caption);
}

.yue p.sphx-glr-timing strong,
.yue p.sphx-glr-timing+p strong {
  color: var(--sy-c-light);
  font-weight: 500;
}

/* The memory figure, which sphinx-gallery writes directly under the timing as a
   paragraph with no class of its own. It is the same kind of statement about
   the run, so it is drawn as one and pulled up against the line above it. */
.yue p.sphx-glr-timing+p {
  margin-top: 0.25rem;
  color: var(--sy-c-light);
  font-size: var(--rl-t-caption);
}

/* The downloads at the foot of an example. Upstream draws them as centred
   yellow gradient buttons, which is the one piece of chrome in the whole
   extension with a colour of its own. They are a row of controls, so they are
   drawn as the theme's controls: the shared contract's states, the page
   actions' muted fill and size, and the row laid out where the prose is rather
   than centred under it. */

.yue .sphx-glr-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 2rem;
  text-align: left;
}

.yue div.sphx-glr-download {
  margin: 0;
}

.yue div.sphx-glr-download p {
  margin: 0;
}

.yue div.sphx-glr-download a,
.yue div.sphx-glr-download a:hover,
.yue div.sphx-glr-download a:focus-visible {
  --rl-c-control-ring: var(--sy-c-divider);
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.625rem;
  /* A control, so it opts out of the prose link's dashed rule and its hover
     ground the way the theme's other in-article controls do. The border is kept
     and made invisible rather than dropped, so that the control's height does
     not move between its states. */
  border-bottom: 1px solid transparent;
  background-color: var(--rl-c-control-muted);
  background-image: none;
  color: var(--sy-c-text);
  font-size: var(--rl-t-caption);
  font-weight: 500;
  line-height: 1.5;
  text-decoration: none;
}

/* Each download says what it is with the website's own mark for it, drawn from
   the theme's Tabler set as a mask so the glyph takes the colour the rule names.
   The three colours are the website's three families, in the roles the landing
   page's figures already spend them through: the notebook takes the yellow the
   website gives its second family, the script the blue of its third, and the
   archive — which is the two of them together — the brand's own teal.

   The glyph is decorative: the button's text already names the download, which
   is what a screen reader reads out. */
.yue div.sphx-glr-download a::before {
  content: "";
  flex: none;
  width: 1rem;
  height: 1rem;
  margin-right: 0.375rem;
  background-color: var(--rl-c-glyph);
  mask-image: var(--rl-icon-file-dots);
  mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
}

.yue div.sphx-glr-download.sphx-glr-download-jupyter a::before {
  --rl-c-glyph: var(--rl-c-rule-secondary);
  mask-image: var(--rl-icon-notebook);
}

.yue div.sphx-glr-download.sphx-glr-download-python a::before {
  --rl-c-glyph: var(--rl-c-rule-tertiary);
  mask-image: var(--rl-icon-brand-python);
}

.yue div.sphx-glr-download.sphx-glr-download-zip a::before {
  --rl-c-glyph: var(--rl-c-rule-primary);
  mask-image: var(--rl-icon-file-zip);
}

/* The label inside the button is marked up as a literal, which everywhere else
   in the theme is a code span with a ground and a border of its own. Inside a
   control it is the control's label. */
.yue div.sphx-glr-download a code.download,
.yue div.sphx-glr-download a code.download span {
  padding: 0;
  border: none;
  background: none;
  color: inherit;
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
}

/* The note sphinx-gallery opens every example with says only that the example
   can be downloaded from the foot of the page, where the buttons that say so
   are already visible and labelled. It is chrome addressed to the reader before
   they have read the first line of the example, so it is not shown. */
.yue .sphx-glr-download-link-note {
  display: none;
}

/* Code inside components ---------------------------------------------------
   Upstream gives tab panels and notebook outputs a code ground of their own,
   which in light mode is pale — and the syntax palette, tuned against a dark
   ground in both colour modes, is barely readable on it. It also has a
   near-black ground for dark-code, from before this brand had a dark surface
   of its own. Both are restated here as the one ground the brand chose, at a
   specificity that reaches every container upstream names. Nothing is decided
   in this rule: every value is the role mapping's. */
html.light :is(.dark-code, .sd-tab-content, .sphinx-tabs-panel, .cell_output),
html.light .dark-code :is(.sd-tab-content, .jupyter_container .cell_output),
html.dark :is(.dark-code, .sd-tab-content, .sphinx-tabs-panel, .cell_output),
html.dark .dark-code :is(.sd-tab-content, .jupyter_container .cell_output) {
  --code-block-background: var(--color-base-800);
  --code-block-caption-background: var(--code-block-background);
  --code-block-highlight: color-mix(in srgb, var(--color-base-50) 10%, transparent);
  --code-block-linenos-divider: color-mix(in srgb, var(--color-base-50) 24%, transparent);
}

/* `Wrapper` variant `prose` gives a code panel `prose-pre:border
   prose-pre:border-base-300 prose-pre:rounded-xl prose-pre:scrollbar-hide`: the
   radius that separates a block of code from the prose around it, a hairline in
   the border role, and no scrollbar cutting across the ground. */
.yue .highlight>pre,
.yue pre.literal-block {
  border: 1px solid var(--sy-c-border);
  border-radius: var(--rl-r-xl);
  scrollbar-width: none;
}

.yue .highlight>pre::-webkit-scrollbar,
.yue pre.literal-block::-webkit-scrollbar {
  display: none;
}

/* A captioned block is one panel with a header, so the caption takes the code
   panel's geometry as well as its ground: the same hairline, the same radius on
   the two corners it owns, and no bottom edge of its own — the `pre` below it
   keeps its own top border, and that single line is what separates the header
   from the code. Upstream already squares off the `pre`'s top corners under a
   caption; the padding it gives the band is left alone. */
.yue .code-block-caption {
  border: 1px solid var(--sy-c-border);
  border-bottom: none;
  border-radius: var(--rl-r-xl) var(--rl-r-xl) 0 0;
}

/* The one place the accent's brightness has to be argued with. An outlined
   sphinx-design element draws its text in the solid, and this brand's solid is
   a mint that no white page will carry as words. Rather than fight the
   extension's `!important` rules, the variable they read is re-declared on the
   elements themselves: outlines get the accent's text step — the step a link
   takes — while filled elements keep the solid, where the theme controls the
   foreground. */
.yue :is(.sd-text-primary, .sd-outline-primary, .sd-btn-outline-primary) {
  --sd-color-primary: var(--accent-11);
  --sd-color-primary-highlight: var(--accent-12);
}

/* Sphinx-tabs ships its own greys for the strip and panel. The panel is a code
   surface more often than not, and the strip is the same control sphinx-design
   draws, so both are said again in the theme's terms. */
.yue .sphinx-tabs-tab {
  border: none;
  background: transparent;
  color: var(--sy-c-light);
  font-family: var(--rl-f-prose);
  font-size: var(--rl-t-caption);
  font-weight: 500;
}

.yue .sphinx-tabs-tab[aria-selected="true"] {
  border-bottom: 2px solid var(--sy-c-link);
  color: var(--sy-c-link);
}

.yue .sphinx-tabs-tab:hover {
  color: var(--sy-c-text);
}

.yue .sphinx-tabs-tab:focus-visible {
  outline: 2px solid var(--rl-c-focus);
  outline-offset: 2px;
}

.yue .sphinx-tabs-panel {
  border: none;
  border-top: 1px solid var(--sy-c-divider);
  background: transparent;
  padding: 1rem 0 0;
}

/* Copybutton and togglebutton both hang a control off the corner of something
   the theme has already styled. The copy button's states are the shared
   contract's — restating a border and a hover colour here would out-weigh the
   contract simply by coming later in the file — so only its fill, its ink and
   its ring are said.

   It says them in the code panel's terms rather than the page's. The panel is
   base-800 in both colour modes, so a fill taken from `--sy-c-background` put a
   white chip on a dark ground in light mode and a chip darker than the panel in
   dark mode — a control that belonged to neither surface. Fill and ring are
   instead the wash of base-50 that `--code-block-highlight` and the line-number
   divider already use on this ground, and the ink is a step of the syntax
   palette's own ramp. One pair of values then holds in both modes, because the
   surface it sits on does. */
.yue button.copybtn {
  background-color: color-mix(in srgb, var(--color-base-50) 8%, transparent);
  color: var(--color-base-300);
  --rl-c-control-ring: color-mix(in srgb, var(--color-base-50) 20%, transparent);
}

/* Both upstreams reach past the contract to repaint this one control on hover
   and on press — sphinx-copybutton to a pair of GitHub greys, Shibuya to no
   fill at all — and both selectors out-weigh the rule above. The contract's
   answer is that a control changes opacity and shadow in these states and
   nothing else, so the fill is said again at their weight and does not move.

   Note the fill is repeated rather than lifted into a variable: the value is
   the same wash in every state precisely because these rules exist to hold it
   still, and a variable would invite someone to vary it. */
.yue .highlight button.copybtn:hover,
.yue .highlight button.copybtn:active {
  background-color: color-mix(in srgb, var(--color-base-50) 8%, transparent);
}

/* The one state the contract has no opinion about: the copy succeeded, which
   the button says by ringing in the accent — at the accent's step 9, which is
   the same mint in both colour modes, because the ground under this control is
   the same in both too. Shibuya answers the same state in a Radix green that
   belongs to no part of this brand, so the ink is said here as well. */
.yue button.copybtn.success {
  color: var(--accent-9);
  --rl-c-control-ring: var(--accent-9);
}

.yue .toggle-button,
.yue button.toggle-button {
  color: var(--sy-c-light);
}

.yue .toggle-button:hover {
  color: var(--sy-c-link);
}

/* Mathematics --------------------------------------------------------------
   MathJax typesets into the page rather than into an image, so an equation is
   live markup that inherits from whatever is around it. That is the reason to
   use it here: it gives the theme something to actually get wrong. Colour it
   does inherit; the three things it does not are its measure, its overflow and
   the placement of an equation number. */

.yue mjx-container {
  color: var(--sy-c-text);
}

/* A long equation is the one piece of prose that cannot be re-wrapped, so it
   scrolls inside its own block rather than widening the page. */
.yue mjx-container[display="true"] {
  margin: 1.5rem 0;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 0.25rem;
}

/* A displayed equation is a block of its own, centred like the figures and
   tables around it, with its number set beside it rather than run into it. */
.yue div.math {
  margin: 1.5rem 0;
}

.yue div.math>.eqno {
  float: right;
  color: var(--sy-c-light);
}

.yue div.math>.eqno .headerlink {
  margin-left: 0.375rem;
}

/* Landing composition ------------------------------------------------------
   The website's frontpage, in pieces a Sphinx author can write: an eyebrow over
   a heading, a strip of figures, a row of cards, numbered steps, and a panel
   the page closes on.

   `BaseLayout.astro` frames the site in stripes and every section paints its
   own white `Wrapper` inside that frame, which is why the frontpage reads as
   one continuous white column with a rule between bands rather than as a stack
   of separate cards. The landing layout stands the reading column down, so the
   composition carries that white and those uprights itself, at the same width
   the header and the footer are already bound to; a landing page that uses none
   of these classes keeps the bare frame, as it did before.

   None of the colours are chosen here. The eyebrow's mark, the four rules, the
   three tiles, the step dots and the panel are roles the brand layer binds per
   colour mode. */

/* The landing layout's main is not a reading column: the bands inside it are
   what set a measure, so upstream's 64rem cap and the column's padding stand
   down and the composition is free to reach the frame. */
.rl-unboxed .sy-content {
  max-width: none;
  padding: 0;
}

/* A landing page is read rather than linked into, so the anchor Sphinx hangs
   off each heading is not drawn — which is upstream's decision for this layout
   too, made here rather than in an inline style block. */
.rl-unboxed .yue a.headerlink {
  display: none;
}

/* The composition's column. It is a flex column so that the eyebrow can be
   lifted above the title: docutils gives a section its title first and lets
   nothing precede it, so the label the website puts over its headline is
   written after the heading and ordered above it here. */
.yue .rl-landing {
  display: flex;
  flex-direction: column;
  max-width: var(--rl-w-column);
  margin-inline: auto;
  border-inline: 1px solid var(--sy-c-divider);
  background-color: var(--sy-c-background);
}

.yue .rl-landing>* {
  padding-inline: 2rem;
}

/* The hero. `Hero1.astro` sets its headline in the display size at
   `font-semibold tracking-tighter`, its lede at `text-lg` in medium weight over
   a `max-w-lg` measure, and puts its two buttons 3rem below. */
.yue .rl-landing>.rl-landing-eyebrow {
  order: -1;
  padding-top: 5rem;
}

/* Display, at the brand's own responsive ladder — 3rem, 3.75rem from the
   medium breakpoint, 4.5rem from the large one — rather than at one size in
   between. A page title is the one heading big enough for the difference
   between the steps to be the point. */
.yue .rl-landing>h1 {
  margin: 2rem 0 0;
  font-size: 3.75rem;
  font-weight: 600;
  letter-spacing: var(--rl-tracking-heading);
  line-height: 1.05;
  text-wrap: balance;
}

.yue .rl-landing-lede {
  max-width: 34rem;
  margin-top: 1.5rem;
  color: var(--sy-c-text);
  font-size: var(--rl-t-lead);
  font-weight: 500;
}

.yue .rl-landing-lede>p,
.yue .rl-landing-standfirst>p {
  margin: 0;
}

.yue .rl-landing-hero {
  padding-bottom: 4rem;
}

/* The hero's code sample. `Hero1.astro` sets its listing in one half of a
   two-column block, so it is never the width of the page; here it keeps a
   measure of its own instead. */
.yue .rl-landing-code {
  max-width: 48rem;
  margin-top: 3rem;
}

/* A hidden toctree still emits its wrapper, and the front page's structure is
   six of them: those trees are there to build the navigation, not to be read on
   the page. An empty one is taken out of the composition's flow rather than
   left as a zero-height child of it. A tree that does have entries is left
   alone, so a landing page can still show one. */
.yue .rl-landing>.toctree-wrapper:not(:has(ul)) {
  display: none;
}

/* Each band below the hero is one of the website's sections: a rule above it,
   and the same white column continuing through. */
.yue .rl-landing-band {
  padding-block: 4rem;
  border-top: 1px solid var(--sy-c-divider);
}

/* The label above a heading, at `text-xs font-medium uppercase` with its mark
   beside it. The mark is the family's colour and the words are not, so the
   glyph reads its own role rather than the text's. */
.yue .rl-landing-eyebrow {
  --rl-c-glyph: var(--rl-c-eyebrow-mark);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--rl-c-eyebrow);
  font-size: var(--rl-t-label);
  font-weight: 500;
  letter-spacing: var(--rl-tracking-label);
  text-transform: uppercase;
}

.yue .rl-landing-eyebrow>p {
  margin: 0;
}

/* A band's own heading is a rubric rather than a section title: the landing
   page is one document with one title, and a second level of headings would put
   marketing copy in the navigation tree. */
.yue p.rl-landing-heading {
  margin: 2rem 0 0;
  font-size: var(--rl-t-metric);
  font-weight: 600;
  letter-spacing: var(--rl-tracking-heading);
  line-height: 1.15;
  text-wrap: balance;
}

.yue .rl-landing-standfirst {
  max-width: 40rem;
  margin-top: 0.75rem;
  color: var(--sy-c-light);
}

/* The row of buttons under the hero and under the closing panel. Each button is
   a paragraph of its own, which is what `sphinx-design` emits; the row is what
   puts them side by side. */
.yue .rl-landing-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 3rem;
}

.yue .rl-landing-actions>p {
  margin: 0;
}

/* Figures ------------------------------------------------------------------
   `Benchmarks.astro`: a label with its mark, a number in the display size, and
   a caption, each cell hung off a 2px rule in its own family's colour. */
.yue .rl-landing-figures {
  display: grid;
  gap: 2rem;
  margin-top: 2.5rem;
}

.yue .rl-figure {
  padding-left: 1rem;
  border-left: 2px solid var(--rl-c-rule);
}

.yue .rl-figure-label {
  /* The label is quiet and its mark is not: `Benchmarks.astro` gives every
     figure its family's colour at the icon and nowhere else. */
  --rl-c-glyph: var(--rl-c-rule);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--sy-c-light);
  font-size: var(--rl-t-caption);
  font-weight: 500;
}

.yue .rl-figure-label>p {
  margin: 0;
}

.yue .rl-figure-value {
  margin-top: 0.75rem;
  color: var(--sy-c-heading);
  font-size: var(--rl-t-metric);
  font-weight: 600;
  letter-spacing: var(--rl-tracking-heading);
}

.yue .rl-figure-value>p,
.yue .rl-figure-caption>p {
  margin: 0;
}

.yue .rl-figure-caption {
  margin-top: 0.5rem;
  color: var(--sy-c-light);
  font-size: var(--rl-t-caption);
}

/* Cards --------------------------------------------------------------------
   `Capabilities.astro` draws its three cards as one raised, outlined block with
   a hairline gap between the cells rather than as three bordered boxes: the
   grid's own background shows through a 1px gap, which is the only rule the
   reader sees. */
.yue .rl-landing-cards {
  display: grid;
  gap: 1px;
  margin-top: 3rem;
  overflow: hidden;
  /* The one thing the shared surface cannot supply: the ground has to be the
     hairline colour, because the gap between the cells is what the reader sees
     as a rule. The cells carry the white the surface would have had. */
  background-color: var(--sy-c-divider);
}

.yue .rl-card {
  position: relative;
  padding: 2rem 1.5rem 2.5rem;
  background-color: var(--sy-c-background);
}

.yue p.rl-card-title {
  margin: 1rem 0 0;
  font-size: var(--rl-t-subtitle);
  font-weight: 600;
}

.yue .rl-card>p:not(.rl-card-title) {
  margin: 0.75rem 0 0;
  color: var(--sy-c-light);
}

/* The card's icon tile. It takes two pseudo-elements because one box cannot be
   both a filled tile and a masked glyph: the first is the tile, the second is
   the mark, laid over it. The mark's offsets are the card's own padding plus
   half the difference between the tile and the glyph, so the three numbers that
   have to agree are in the rules next to each other. */
.yue .rl-card::before {
  content: "";
  display: block;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--rl-r-lg);
  background-color: var(--rl-c-tile);
}

.yue .rl-card::after {
  content: "";
  position: absolute;
  top: 2.5rem;
  left: 2rem;
  width: 1.25rem;
  height: 1.25rem;
  background-color: var(--rl-c-tile-mark);
  -webkit-mask: var(--icon-url) no-repeat;
  mask: var(--icon-url) no-repeat;
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
}

/* Steps --------------------------------------------------------------------
   `Workflow.astro`: a ringed dot and a step label on one line, the step's title
   and body under both, over a rule. The grid is what keeps the dot and the
   label on that line without a wrapper element in the source. */
.yue .rl-landing-steps {
  display: grid;
  gap: 2rem;
  margin-top: 3rem;
}

.yue .rl-step {
  position: relative;
  display: grid;
  grid-template-columns: 2.25rem 1fr;
  column-gap: 0.75rem;
  align-items: center;
  padding-top: 1.5rem;
  border-top: 1px solid var(--sy-c-border);
}

.yue .rl-step::before {
  content: "";
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background-color: var(--rl-c-step);
  box-shadow: 0 0 0 2px var(--rl-c-step-ring);
}

/* The mark over the dot, on the same construction as the card's tile: the
   card's padding here is the step's own `padding-top`, plus half of 1rem. */
.yue .rl-step::after {
  content: "";
  position: absolute;
  top: 2rem;
  left: 0.5rem;
  width: 1.25rem;
  height: 1.25rem;
  background-color: var(--rl-c-step-mark);
  -webkit-mask: var(--icon-url) no-repeat;
  mask: var(--icon-url) no-repeat;
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
}

.yue .rl-step-label {
  color: var(--sy-c-light);
  font-size: var(--rl-t-label);
  font-weight: 500;
  letter-spacing: var(--rl-tracking-label);
  text-transform: uppercase;
}

.yue .rl-step-label>p {
  margin: 0;
}

.yue p.rl-step-title {
  grid-column: 1 / -1;
  margin: 1rem 0 0;
  font-size: var(--rl-t-subtitle);
  font-weight: 600;
}

.yue .rl-step>p:not(.rl-step-title) {
  grid-column: 1 / -1;
  margin: 0.5rem 0 0;
  color: var(--sy-c-text);
  font-size: var(--rl-t-caption);
}

/* Panel --------------------------------------------------------------------
   The treatment `Workflow.astro` and `ClosingCta.astro` share: a tinted, raised
   panel, so the band a reader is asked to act on is a destination rather than
   one more ruled section. */
.yue .rl-landing-panel {
  padding: 3rem 2.5rem;
  border-radius: var(--rl-r-2xl);
  background-image: var(--rl-image-panel);
  box-shadow: var(--rl-shadow-panel);
}

/* The families a piece of the composition can take. Each name binds the three
   values that piece spends, so a card, a rule and a dot in the same family are
   one word in the source. */
.rl-family-primary {
  --rl-c-rule: var(--rl-c-rule-primary);
  --rl-c-tile: var(--rl-c-tile-primary);
  --rl-c-tile-mark: var(--rl-c-tile-primary-mark);
  --rl-c-step: var(--rl-c-step-primary);
  --rl-c-step-ring: var(--rl-c-rule-primary);
}

.rl-family-secondary {
  --rl-c-rule: var(--rl-c-rule-secondary);
  --rl-c-tile: var(--rl-c-tile-secondary);
  --rl-c-tile-mark: var(--rl-c-tile-secondary-mark);
  --rl-c-step: var(--rl-c-step-secondary);
  --rl-c-step-ring: var(--rl-c-rule-secondary);
}

.rl-family-tertiary {
  --rl-c-rule: var(--rl-c-rule-tertiary);
  --rl-c-tile: var(--rl-c-tile-tertiary);
  --rl-c-tile-mark: var(--rl-c-tile-tertiary-mark);
  --rl-c-step: var(--rl-c-step-tertiary);
  --rl-c-step-ring: var(--rl-c-rule-tertiary);
}

.rl-family-neutral {
  --rl-c-rule: var(--rl-c-rule-neutral);
}

/* A mark beside a label, which is how the website draws an icon everywhere
   except inside a tile: the glyph alone, at the label's size, in a colour the
   rule using it chooses. The glyph itself is a mask, so one file of shapes
   serves both colour modes. */
.yue .rl-glyph::before {
  content: "";
  flex: none;
  display: inline-block;
  width: 1rem;
  height: 1rem;
  background-color: var(--rl-c-glyph, currentColor);
  -webkit-mask: var(--icon-url) no-repeat;
  mask: var(--icon-url) no-repeat;
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
}

/* Which shape a mark is. The names are the icon set's own, so a page names the
   glyph it wants rather than a role invented for one use of it. */
.rl-mark-bolt {
  --icon-url: var(--rl-icon-bolt);
}

.rl-mark-arrow-iteration {
  --icon-url: var(--rl-icon-arrow-iteration);
}

.rl-mark-brain {
  --icon-url: var(--rl-icon-brain);
}

.rl-mark-check {
  --icon-url: var(--rl-icon-check);
}

.rl-mark-clock {
  --icon-url: var(--rl-icon-clock);
}

.rl-mark-device-laptop {
  --icon-url: var(--rl-icon-device-laptop);
}

.rl-mark-file-dots {
  --icon-url: var(--rl-icon-file-dots);
}

.rl-mark-flame {
  --icon-url: var(--rl-icon-flame);
}

.rl-mark-git-fork {
  --icon-url: var(--rl-icon-git-fork);
}

.rl-mark-rocket {
  --icon-url: var(--rl-icon-rocket);
}

.rl-mark-shield {
  --icon-url: var(--rl-icon-shield);
}

.rl-mark-star {
  --icon-url: var(--rl-icon-star);
}

/* The composition's own breakpoints. The website puts its figures in two
   columns at `sm` and four at `lg`, and its cards and steps in three at `lg`. */
@media (min-width: 40rem) {
  .yue .rl-landing-figures {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 64rem) {
  .yue .rl-landing-figures {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .yue .rl-landing-cards,
  .yue .rl-landing-steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .yue .rl-landing-steps {
    gap: 3rem;
  }

  .yue .rl-landing-panel {
    padding: 5rem;
  }

  .yue .rl-landing>h1 {
    font-size: 4.5rem;
  }

  .yue p.rl-landing-heading {
    font-size: 3rem;
  }
}

/* Below the small breakpoint the composition loses its uprights with the rest
   of the frame, and the hero's type comes down to a size a phone can hold. */
@media (max-width: 48rem) {
  .yue .rl-landing>* {
    padding-inline: 1.5rem;
  }

  /* The ladder's own step, with the floor the takeover already needed for the
     same reason: a documentation title is a sentence where the marketing site's
     is three words, and "Documentation" alone is wider than a 390px phone at
     3rem. The ceiling is the brand's step and a wide phone reaches it. */
  .yue .rl-landing>h1 {
    font-size: clamp(2rem, 9vw, var(--rl-t-display));
  }

  .yue p.rl-landing-heading {
    font-size: var(--rl-t-headline);
  }

  .yue .rl-landing-panel {
    padding: 2rem 1.5rem;
  }
}

/* Extensions ---------------------------------------------------------------
   Everything below is markup this theme does not emit. An extension writes its
   own containers, ships its own stylesheet, or builds its controls in the
   reader's browser, and the theme's job is the same in each case: keep the
   result in the site's own vocabulary — one card, one hairline, one radius, the
   ink ramp for state — rather than let a second design system in beside it.

   Specificity is doing work here that it does not have to do elsewhere. Several
   of these stylesheets are added after the theme's own, so a rule that only
   matched as tightly as theirs would lose the cascade to it. Each selector below
   is one step tighter than the rule it is answering, and no more. */

/* Executed cells. jupyter-sphinx renders a cell as an input panel and an output
   panel, and its stylesheet draws them as two boxes with a drop shadow — the
   look of a notebook, from before a page had a design of its own. Here a cell is
   one card, the same card an API signature and a captioned listing get: a
   hairline, the site's radius, and a single rule between the source and what it
   produced. The ground under both panels is the code ground, which the block
   above already binds for `.cell_output`. */
.yue div.jupyter_container {
  margin: 1.5rem 0;
  padding: 0;
  border: 1px solid var(--sy-c-border);
  border-radius: var(--rl-r-xl);
  background-color: var(--sy-c-background);
  box-shadow: none;
  overflow: hidden;
}

/* Consecutive cells are consecutive objects. Upstream pulls the second up by
   half an em so that a run of them reads as one notebook; on this site a card
   keeps the spacing every other card has. */
.yue div.jupyter_container + div.jupyter_container {
  margin-top: 1.5rem;
}

/* The panels inside carry no frame of their own: the card is the frame. */
.yue .jupyter_container :is(div.code_cell, div.cell_input, div.cell_output),
.yue .jupyter_container div.output {
  margin: 0;
  border: 0;
  border-radius: 0;
  background-color: transparent;
}

.yue .jupyter_container div.highlight {
  background-color: var(--code-block-background);
}

/* A listing inside the card is not a card. It gives up the border and the
   radius it would have on its own, so that the card's edge is the only edge. */
.yue .jupyter_container .highlight > pre,
.yue .jupyter_container pre.literal-block {
  border: 0;
  border-radius: 0;
}

/* The one rule inside the card, between what was run and what it printed. It is
   the divider the code ground already declares for line numbers, so the line
   over the output is the same line the gutter is drawn with. */
.yue .jupyter_container div.cell_output {
  border-top: 1px solid var(--code-block-linenos-divider);
}

/* A stream on standard error is the one output that means something went
   differently, so it takes the danger admonition's band and ink rather than the
   code ground. nbsphinx marks the same thing on its own container, and is named
   here so that a site running it gets the treatment without this theme having to
   carry a second one. */
.yue .jupyter_container div.stderr,
.yue div.nboutput.container div.output_area.stderr {
  padding: 0.75rem 1rem;
  border: 0;
  background-color: var(--rl-c-danger-band);
  color: var(--rl-c-danger-text);
}

.yue .jupyter_container pre.stderr {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
}

/* Mermaid. The diagram itself is drawn from the brand's own seeds — that is
   configuration, and the demo site's extensions page shows it — so what is left
   here is the frame around it, which is the card figures get, and one thing to
   undo: Shibuya inverts a rendered diagram in dark mode, because Mermaid's light
   palette is all it expects to be given. A diagram that already re-renders in
   the brand's colours must not then be turned inside out. */
.yue pre.mermaid {
  margin: 1.5rem 0;
  padding: 1.5rem;
  border: 1px solid var(--sy-c-border);
  border-radius: var(--rl-r-xl);
  background-color: var(--sy-c-background);
  text-align: center;
  overflow-x: auto;
}

html.dark .yue pre.mermaid > svg {
  filter: none;
}

/* Iconify. An author's icon is a word in their sentence: it sits on the text's
   baseline rather than on the middle of the line, and it takes the ink around it
   unless it was given the accent by name. */
.yue iconify-icon {
  vertical-align: -0.125em;
}

.yue :is(.sd-tab-label, .sd-card-title, .sd-btn) > iconify-icon {
  margin-right: 0.375rem;
}

/* DataTables. The library builds its controls in the reader's browser and
   grounds them in a stylesheet of its own, which is a second design system
   arriving on the page after this one. The table keeps the frame every table on
   this site has; the controls it grows are restated as the site's own field and
   the site's own buttons. */
.yue div.dt-container {
  margin: 2em 0;
}

.yue div.dt-container .table-wrapper {
  margin: 0;
}

.yue div.dt-container :is(div.dt-layout-row, div.dt-layout-cell) {
  gap: 0.75rem;
  align-items: center;
}

/* The search box and the page-length menu are the site's search field: the same
   ground, the same radius, the same placeholder ink. */
.yue div.dt-container :is(.dt-search input, .dt-length select) {
  height: 2.25rem;
  padding: 0.375rem 0.75rem;
  border: 1px solid transparent;
  border-radius: var(--rl-r-lg);
  background: var(--rl-c-field);
  color: var(--rl-c-field-text);
  font-family: var(--sy-f-text);
  font-size: var(--rl-t-caption);
  transition: box-shadow var(--rl-d-control) ease-in-out;
}

.yue div.dt-container .dt-search input::placeholder {
  color: var(--rl-c-field-placeholder);
}

.yue div.dt-container :is(.dt-search input, .dt-length select):focus-visible {
  outline: 2px solid var(--rl-c-focus);
  outline-offset: 2px;
}

.yue div.dt-container :is(.dt-search label, .dt-length label, .dt-info) {
  color: var(--sy-c-light);
  font-size: var(--rl-t-caption);
}

/* The pager is navigation, so its states are the ink ramp: a quiet control at
   rest, the page you are on in the ink a current entry takes everywhere else,
   and nothing in the accent. */
.yue div.dt-container button.dt-paging-button {
  min-width: 2rem;
  margin: 0 0.125rem;
  padding: 0.25rem 0.625rem;
  border: 0;
  border-radius: var(--rl-r-md);
  background: transparent;
  color: var(--rl-c-nav-link);
  font-family: var(--sy-f-text);
  font-size: var(--rl-t-caption);
  line-height: 1.5;
  transition: background-color var(--rl-d-link) ease-in-out, color var(--rl-d-link) ease-in-out;
}

.yue div.dt-container button.dt-paging-button:hover:not(.disabled) {
  background: var(--rl-c-control-muted);
  color: var(--rl-c-nav-link-hover);
}

.yue div.dt-container button.dt-paging-button.current {
  background: var(--rl-c-control-muted);
  color: var(--rl-c-nav-link-current);
  font-weight: 600;
}

.yue div.dt-container button.dt-paging-button.disabled {
  color: var(--sy-c-light);
  opacity: 0.5;
}

.yue div.dt-container button.dt-paging-button:focus-visible {
  outline: 2px solid var(--rl-c-focus);
  outline-offset: 2px;
}

/* A sortable heading is a control, and it says so by the pointer it takes and by
   the ink it moves to; the arrows themselves are the library's. */
.yue table.dataTable thead th.dt-orderable-asc,
.yue table.dataTable thead th.dt-orderable-desc {
  cursor: pointer;
}

.yue table.dataTable thead th:is(.dt-ordering-asc, .dt-ordering-desc) {
  color: var(--sy-c-heading);
}

/* numpydoc. A Numpy docstring's sections come out as an ordinary field list,
   which the API treatment already covers, plus two things it does not: a rubric
   naming each group of members, and the borderless table of members underneath
   it. The table is a list of links rather than data, so it drops the frame every
   other table on this site carries and is set a step quieter, the way the
   sections of an API entry are. */
.yue dd > p.rubric {
  margin-top: 1.5rem;
  margin-bottom: 0.25rem;
  color: var(--sy-c-light);
  font-size: var(--rl-t-label);
  font-weight: 500;
  letter-spacing: var(--rl-tracking-label);
  text-transform: uppercase;
}

.yue .table-wrapper.autosummary {
  margin: 0.5rem 0 1rem;
  border: 0;
  border-radius: 0;
}

.yue table.autosummary :is(td, th) {
  padding: 0.375rem 0;
  background-color: transparent;
  vertical-align: top;
}

.yue table.autosummary td > p {
  margin: 0;
}

/* The type beside a parameter's name. Numpy's convention puts it on the same
   line as the name, so it needs to read as an aside rather than as a second
   name: upright, quieter, and separated by space rather than by punctuation. */
.yue dl .classifier {
  color: var(--sy-c-light);
  font-style: normal;
}

/* Reduced motion -----------------------------------------------------------
   The website's polish is transitions, and a reader who has asked their system
   for less movement should get the states without the movement. Every selector
   this stylesheet gives a `transition` is named here, and the smooth scrolling
   the website turns on goes with them: an anchor jump is movement too. */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .rl-subnav,
  .yue a:not(.rl-action, .sd-btn),
  .rl-subnav a,
  .sy-foot a,
  .rl-cta,
  .rl-actions .rl-action,
  .yue .sd-btn,
  .searchform input[name="q"]+button,
  .yue button.copybtn,
  .yue div.sphx-glr-download a,
  .rl-menu-close,
  .sy-head-nav,
  .rl-mobile-nav a,
  .navigation a,
  .yue .sd-card,
  .yue details.sd-dropdown,
  .yue .sphx-glr-thumbcontainer,
  #search-results ul.search>li,
  .yue .toctree-wrapper>ul,
  .yue .rl-landing-cards,
  .searchbox input,
  .searchform input[name="q"],
  .yue div.dt-container :is(.dt-search input, .dt-length select),
  .yue div.dt-container button.dt-paging-button {
    transition: none;
  }
}

.localtoc .pre {
  font-size: 90%;
}