/* AnimeUp's UI palette, applied to the two built-in Material color schemes. */
[data-md-color-scheme="slate"],
[data-md-color-scheme="animeup-auto"] {
  --animeup-bg: #101113;
  --animeup-surface: #17191c;
  --animeup-border: #26292e;
  --animeup-text: #e8eaed;
  --animeup-muted: #c6cbd2;
  --animeup-accent: #2ac9de;
  --animeup-link: #55d8ea;
  --animeup-warning: #f2b84b;
  --animeup-success: #45d483;
  --animeup-danger: #f26d6d;
  --animeup-on-accent: #0d1015;   /* text on accent fills */
  --md-default-bg-color: var(--animeup-bg);
  --md-default-fg-color: var(--animeup-text);
  --md-default-fg-color--light: var(--animeup-muted);
  --md-default-fg-color--lighter: #9099a4;
  --md-primary-fg-color: var(--animeup-surface);
  --md-primary-fg-color--light: #20262c;
  --md-primary-fg-color--dark: #101113;
  --md-primary-bg-color: var(--animeup-text);
  --md-accent-fg-color: var(--animeup-accent);
  --md-typeset-color: var(--animeup-text);
  --md-typeset-a-color: var(--animeup-link);
  --md-code-bg-color: var(--animeup-surface);
  --md-code-fg-color: var(--animeup-text);
  --md-footer-bg-color: var(--animeup-surface);
  --md-footer-bg-color--dark: var(--animeup-bg);
}

[data-md-color-scheme="default"] {
  --animeup-bg: #f5f8f9;
  --animeup-surface: #ffffff;
  --animeup-border: #d9e1e5;
  --animeup-text: #17252b;
  --animeup-muted: #475963;
  --animeup-accent: #0078a8;
  --animeup-link: #0078a8;
  --animeup-warning: #a86d00;
  --animeup-success: #16834b;
  --animeup-danger: #bc3d43;
  --animeup-on-accent: #ffffff;
  --md-default-bg-color: var(--animeup-bg);
  --md-default-fg-color: var(--animeup-text);
  --md-default-fg-color--light: var(--animeup-muted);
  --md-default-fg-color--lighter: #697d86;
  --md-primary-fg-color: var(--animeup-surface);
  --md-primary-fg-color--light: #ffffff;
  --md-primary-fg-color--dark: #e7f0f2;
  --md-primary-bg-color: var(--animeup-text);
  --md-accent-fg-color: var(--animeup-accent);
  --md-typeset-color: var(--animeup-text);
  --md-typeset-a-color: var(--animeup-link);
  --md-code-bg-color: #edf3f5;
  --md-code-fg-color: var(--animeup-text);
  --md-footer-bg-color: #e7eef0;
  --md-footer-bg-color--dark: #dce7e9;
}

/* The System option follows macOS without extra JavaScript. */
@media (prefers-color-scheme: light) {
  [data-md-color-scheme="animeup-auto"] {
    --animeup-bg: #f5f8f9;
    --animeup-surface: #ffffff;
    --animeup-border: #d9e1e5;
    --animeup-text: #17252b;
    --animeup-muted: #475963;
    --animeup-accent: #0078a8;
    --animeup-link: #0078a8;
    --animeup-warning: #a86d00;
    --animeup-success: #16834b;
    --animeup-danger: #bc3d43;
    --animeup-on-accent: #ffffff;
    --md-default-fg-color--lighter: #697d86;
    --md-primary-fg-color--light: #ffffff;
    --md-primary-fg-color--dark: #e7f0f2;
    --md-code-bg-color: #edf3f5;
    --md-footer-bg-color: #e7eef0;
    --md-footer-bg-color--dark: #dce7e9;
  }
}

/* Material treats the custom System scheme as light unless its code palette is set explicitly. */
@media (prefers-color-scheme: dark) {
  [data-md-color-scheme="animeup-auto"] {
    --md-code-hl-variable-color: #c6cbd2;
    --md-code-hl-string-color: #2fb170;
    --md-code-hl-color: #2977ff;
    --md-code-hl-comment-color: #c6cbd2;
    --md-code-hl-punctuation-color: #c6cbd2;
    --md-code-hl-color--light: #2977ff1a;
    --md-code-hl-constant-color: #9383e2;
    --md-code-hl-generic-color: #c6cbd2;
    --md-code-hl-keyword-color: #6791e0;
    --md-code-hl-operator-color: #c6cbd2;
    --md-code-hl-name-color: #e8eaed;
    --md-code-hl-special-color: #f06090;
    --md-code-hl-number-color: #e6695b;
    --md-code-hl-function-color: #c973d9;
  }
}

[data-md-color-scheme="slate"] .md-header,
[data-md-color-scheme="animeup-auto"] .md-header,
[data-md-color-scheme="default"] .md-header {
  border-bottom: 1px solid var(--animeup-border);
  box-shadow: none;
  z-index: 6;
}

.animeup-header__brand,
.animeup-header__search,
.animeup-header__actions {
  align-items: center;
  display: flex;
  min-width: 0;
}

.animeup-header__brand {
  gap: 0.25rem;
  padding: 0 0.6rem;
}

.animeup-header__brand .md-header__button.md-logo {
  align-items: center;
  display: inline-flex;
  flex: 0 0 2rem;
  height: 2rem;
  justify-content: center;
  margin: 0;
  padding: 0;
  width: 2rem;
}

.md-header__button.md-logo img {
  height: 2rem;
  width: 2rem;
}

.animeup-header__title {
  color: var(--animeup-text);
  font-size: 0.72rem;
  font-weight: 700;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.animeup-header__search {
  justify-content: flex-end;
}

.animeup-header__actions {
  gap: 8px;
  justify-content: flex-end;
  padding: 0 8px;
}

/* A named theme menu and a direct GitHub button, as in the Linfa guide. */
.md-header__option {
  display: none;
}

.animeup-theme-control {
  align-items: center;
  color: var(--animeup-text);
  display: flex;
  position: relative;
  white-space: nowrap;
}

.animeup-theme-control::after {
  border-bottom: 1.5px solid currentColor;
  border-right: 1.5px solid currentColor;
  content: "";
  height: 0.4rem;
  pointer-events: none;
  position: absolute;
  right: 0.65rem;
  top: 50%;
  transform: translateY(-70%) rotate(45deg);
  width: 0.4rem;
}

.animeup-theme-control:has(select:is(:hover, :focus-visible))::after {
  color: var(--animeup-accent);
}

.animeup-theme-control label {
  display: none;
}

.animeup-theme-control select,
.animeup-github {
  background: var(--animeup-surface);
  border: 1px solid var(--animeup-border);
  border-radius: 0.4rem;
  color: var(--animeup-text);
  font: inherit;
  font-size: 0.65rem;
  font-weight: 600;
  min-height: 2rem;
}

.animeup-theme-control select {
  appearance: none;
  cursor: pointer;
  padding: 0.25rem 1.65rem 0.25rem 0.5rem;
  word-spacing: 0.15rem;
}

.animeup-theme-control select:is(:hover, :focus-visible) {
  border-color: var(--animeup-accent);
  color: var(--animeup-accent);
}

.animeup-theme-control select:focus-visible {
  outline: 0;
}

.animeup-github:focus-visible {
  outline: 2px solid var(--animeup-accent);
  outline-offset: 2px;
}

.animeup-header__actions .md-header__source {
  display: block;
  margin: 0;
  max-width: none;
  width: auto;
}

.animeup-github {
  align-items: center;
  display: flex;
  gap: 0.35rem;
  padding: 0.25rem 0.35rem;
  text-decoration: none;
  white-space: nowrap;
}

.animeup-github:hover {
  border-color: var(--animeup-accent);
  color: var(--animeup-accent);
}

.animeup-github svg {
  fill: currentColor;
  height: 0.8rem;
  width: 0.8rem;
}

@media screen and (min-width: 60em) {
  .md-header__inner.md-grid.animeup-header {
    display: grid;
    grid-template-columns: clamp(11rem, 17vw, 13rem) minmax(0, 1fr) clamp(11rem, 17vw, 13rem);
    margin: 0;
    max-width: none;
    padding: 0;
  }

  .animeup-header__brand {
    grid-column: 1;
  }

  .animeup-header__search {
    grid-column: 2;
    padding-right: 0.5rem;
  }

  .animeup-header__actions {
    grid-column: 3;
  }
}

.md-header__button.md-logo img.animeup-logo__light,
.md-nav__button.md-logo img.animeup-logo__light,
.animeup-hero img.animeup-logo__light {
  display: none;
}

[data-md-color-scheme="default"] .md-header__button.md-logo img.animeup-logo__dark,
[data-md-color-scheme="default"] .md-nav__button.md-logo img.animeup-logo__dark,
[data-md-color-scheme="default"] .animeup-hero img.animeup-logo__dark {
  display: none;
}

[data-md-color-scheme="default"] .md-header__button.md-logo img.animeup-logo__light,
[data-md-color-scheme="default"] .md-nav__button.md-logo img.animeup-logo__light,
[data-md-color-scheme="default"] .animeup-hero img.animeup-logo__light {
  display: block;
}

@media (prefers-color-scheme: light) {
  [data-md-color-scheme="animeup-auto"] .md-header__button.md-logo img.animeup-logo__dark,
  [data-md-color-scheme="animeup-auto"] .md-nav__button.md-logo img.animeup-logo__dark,
  [data-md-color-scheme="animeup-auto"] .animeup-hero img.animeup-logo__dark {
    display: none;
  }

  [data-md-color-scheme="animeup-auto"] .md-header__button.md-logo img.animeup-logo__light,
  [data-md-color-scheme="animeup-auto"] .md-nav__button.md-logo img.animeup-logo__light,
  [data-md-color-scheme="animeup-auto"] .animeup-hero img.animeup-logo__light {
    display: block;
  }
}

@media screen and (max-width: 60em) {
  .animeup-github span {
    display: none;
  }

  .animeup-header__search {
    margin-left: auto;
  }
}

@media screen and (max-width: 44em) {
  .animeup-header__title {
    display: none;
  }
}

.md-tabs,
.md-sidebar,
.md-nav,
.md-main,
.md-footer {
  color: var(--animeup-text);
}

.md-sidebar__scrollwrap,
.md-search__form,
.md-search__output,
.md-typeset .highlight,
.md-typeset pre > code {
  background-color: var(--animeup-surface);
}

.md-typeset .md-code__nav {
  background-color: var(--animeup-surface);
}

.md-typeset .md-code__button {
  color: var(--animeup-muted);
}

.md-typeset .md-code__button:is(:hover, :focus-visible) {
  color: var(--animeup-accent);
}

.md-typeset h1,
.md-typeset h2,
.md-typeset h3,
.md-typeset strong {
  color: var(--animeup-text);
}

.md-typeset h1 {
  font-weight: 720;
  letter-spacing: -0.035em;
}

.md-typeset h2 {
  border-bottom: 1px solid var(--animeup-border);
  padding-bottom: 0.35em;
}

.md-typeset a:hover,
.md-nav__link:hover,
.md-nav__link--active,
.md-tabs__link--active {
  color: var(--animeup-accent);
}

.md-typeset img:not(.animeup-hero__icon) {
  border: 1px solid var(--animeup-border);
  border-radius: 0.7rem;
}

.md-typeset figure.animeup-flow {
  background: var(--animeup-surface);
  border: 1px solid var(--animeup-border);
  border-radius: 0.8rem;
  box-sizing: border-box;
  display: block;
  margin: 1.5rem 0 1.25rem;
  padding: 0.8rem;
  width: 100%;
}

.md-typeset .animeup-flow .animeup-flow__svg {
  --flow-bg: var(--animeup-bg);
  --flow-card: var(--animeup-surface);
  --flow-line: var(--animeup-border);
  --flow-ink: var(--animeup-text);
  --flow-muted: var(--animeup-muted);
  --flow-accent: var(--animeup-accent);
  --flow-accent-soft: color-mix(in srgb, var(--animeup-accent) 12%, var(--animeup-surface));
  display: block;
  height: auto;
  margin: 0 auto;
  max-width: 440px;
  width: 100%;
}

.md-typeset .animeup-guide-path .animeup-guide-path__wide {
  max-width: 820px;
}

.md-typeset .animeup-guide-path .animeup-guide-path__narrow {
  display: none;
}

@media screen and (max-width: 44em) {
  .md-typeset .animeup-guide-path .animeup-guide-path__wide {
    display: none;
  }

  .md-typeset .animeup-guide-path .animeup-guide-path__narrow {
    display: block;
  }
}

@media screen and (max-width: 30em) {
  .md-typeset figure.animeup-flow {
    padding: 0.35rem;
  }
}

.md-typeset table:not([class]) {
  background: var(--animeup-surface);
  border: 1px solid var(--animeup-border);
  border-radius: 0.45rem;
}

/* Material sizes table wrappers to their contents, which leaves short tables
   narrower than notes and the rest of the reading column. */
.md-typeset .md-typeset__scrollwrap {
  margin: 1em 0;
}

.md-typeset .md-typeset__table {
  box-sizing: border-box;
  display: block;
  overflow-x: auto;
  padding: 0;
  width: 100%;
}

.md-typeset .md-typeset__table > table:not([class]) {
  display: table;
  max-width: none;
  width: 100%;
}

.md-typeset table:not([class]) th,
.md-typeset table:not([class]) td,
.md-typeset hr,
.md-typeset blockquote,
.md-typeset .highlight pre {
  border-color: var(--animeup-border);
}

.md-typeset code,
.md-typeset kbd {
  border: 1px solid var(--animeup-border);
}

.md-typeset pre code {
  border: 0;
}

.eyebrow,
.animeup-hero__copy .eyebrow {
  color: var(--animeup-accent);
  display: block;
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 1.5;
  margin-bottom: 0.7rem;
  text-transform: uppercase;
}

.animeup-hero {
  align-items: center;
  background: linear-gradient(115deg, var(--animeup-surface), var(--animeup-bg));
  border: 1px solid var(--animeup-border);
  border-radius: 1rem;
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 5rem minmax(0, 1fr);
  margin: 0.4rem 0 1.4rem;
  padding: 1.6rem;
}

.animeup-hero__icon {
  height: 5rem;
  width: 5rem;
}

.md-typeset .animeup-hero h1 {
  margin: 0 0 0.45rem;
}

.animeup-hero__copy p {
  color: var(--animeup-muted);
  font-size: 1.02rem;
  line-height: 1.6;
  margin: 0;
}

.md-typeset .animeup-cover {
  display: block;
  width: 100%;
  max-width: 58rem;
  margin: 0 auto 1.6rem;
  box-shadow: 0 0.8rem 2.5rem #0002;
}

/* Material admonitions get the same semantic colors as the app. */
.md-typeset .admonition,
.md-typeset details {
  --md-admonition-fg-color: var(--animeup-text);
  background: var(--animeup-surface);
  border: 1px solid var(--animeup-border);
  border-left: 0.22rem solid var(--admonition-color, var(--animeup-accent));
  border-radius: 0.4rem;
  box-shadow: none;
  color: var(--animeup-text);
}

.md-typeset .admonition-title,
.md-typeset summary {
  background: color-mix(in srgb, var(--admonition-color, var(--animeup-accent)) 12%, var(--animeup-surface));
  color: var(--animeup-text);
}

.md-typeset .admonition.note,
.md-typeset .admonition.info,
.md-typeset .admonition.tip,
.md-typeset details.note,
.md-typeset details.info,
.md-typeset details.tip {
  --admonition-color: var(--animeup-accent);
}

.md-typeset .admonition.warning,
.md-typeset details.warning {
  --admonition-color: var(--animeup-warning);
}

.md-typeset .admonition.success,
.md-typeset details.success {
  --admonition-color: var(--animeup-success);
}

.md-typeset .admonition.danger,
.md-typeset details.danger {
  --admonition-color: var(--animeup-danger);
}

.md-typeset .admonition-title::before,
.md-typeset summary::before {
  background-color: var(--admonition-color, var(--animeup-accent));
}

.md-typeset :is(.admonition, details):is(.note, .info, .tip, .warning, .success, .danger) {
  border-color: var(--animeup-border);
  border-left-color: var(--admonition-color);
}

.md-typeset :is(.admonition, details):is(.note, .info, .tip, .warning, .success, .danger) > :is(.admonition-title, summary) {
  background-color: color-mix(in srgb, var(--admonition-color) 12%, var(--animeup-surface));
}

.md-typeset :is(.admonition, details):is(.note, .info, .tip, .warning, .success, .danger) > :is(.admonition-title, summary)::before {
  background-color: var(--admonition-color);
}

.md-typeset :is(.admonition, details).success > :is(.admonition-title, summary)::before {
  -webkit-mask: none;
  background: var(--animeup-success);
  border-radius: 50%;
  color: var(--animeup-bg);
  content: "✓";
  font: 700 16px/22px system-ui, sans-serif;
  mask: none;
  text-align: center;
}

.md-typeset .task-list-control .task-list-indicator::before {
  color: var(--animeup-success);
}

.md-footer-meta {
  display: none;
}

/* Keep chapter navigation inside the reading column, like the guide content. */
.md-footer {
  background: var(--animeup-bg);
}

.md-footer__inner.md-grid {
  box-sizing: border-box;
  display: grid;
  gap: 0.65rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0 auto;
  max-width: 54rem;
  padding: 1.5rem 1.2rem;
  width: 100%;
}

.md-footer__link {
  align-items: center;
  background: color-mix(in srgb, var(--animeup-accent) 7%, var(--animeup-surface));
  border: 1px solid color-mix(in srgb, var(--animeup-accent) 55%, var(--animeup-border));
  border-radius: 0.6rem;
  box-sizing: border-box;
  color: var(--animeup-text);
  gap: 0.55rem;
  min-height: 5rem;
  padding: 0.8rem 1rem;
  transition: background-color 0.2s, border-color 0.2s, box-shadow 0.2s;
  width: 100%;
}

.md-footer__link--prev {
  grid-column: 1;
}

.md-footer__link--next {
  grid-column: 2;
}

.md-footer__link:is(:hover, :focus-visible) {
  background: color-mix(in srgb, var(--animeup-accent) 15%, var(--animeup-surface));
  border-color: var(--animeup-accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--animeup-accent) 15%, transparent);
  color: var(--animeup-text);
}

.md-footer__title {
  flex: 1;
  margin: 0;
  min-width: 0;
  padding: 0;
}

.md-footer__link--prev .md-footer__title {
  text-align: left;
}

.md-footer__direction {
  color: var(--animeup-accent);
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.md-footer__title .md-ellipsis {
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.35;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
}

.md-footer__button {
  color: var(--animeup-accent);
  flex: 0 0 auto;
  height: 1.35rem;
  margin: 0;
  padding: 0;
  width: 1.35rem;
}

@media screen and (max-width: 44em) {
  .md-footer__link {
    gap: 0.3rem;
    padding: 0.6rem;
  }

  .md-footer__link--prev .md-footer__title {
    display: block;
  }
}

@media screen and (max-width: 44rem) {
  .animeup-hero {
    gap: 0.8rem;
    grid-template-columns: 3.5rem minmax(0, 1fr);
    padding: 1rem;
  }

  .animeup-hero__icon {
    height: 3.5rem;
    width: 3.5rem;
  }

  .animeup-hero__copy p {
    grid-column: 1 / -1;
    font-size: 0.9rem;
  }
}

/* Keep both navigation bands continuous beside the reading column. */
@media screen and (min-width: 60em) {
  .md-header__button[for="__drawer"] {
    display: none;
  }

  /* A drawer opened on a narrow screen must not cover the desktop layout
     when the viewport grows again. */
  .md-overlay {
    display: none !important;
  }

  .md-header__button.md-logo {
    display: inline-flex;
  }

  .md-main__inner.md-grid {
    display: grid;
    grid-template-columns: clamp(11rem, 17vw, 13rem) minmax(0, 1fr) clamp(11rem, 17vw, 13rem);
    margin: 0;
    max-width: none;
  }

  .md-sidebar--primary,
  .md-sidebar--secondary {
    align-self: start;
    background: var(--animeup-surface);
    box-sizing: border-box;
    height: calc(100vh - 2.4rem);
    left: auto;
    margin: 0;
    overflow: hidden;
    padding: 0;
    position: sticky;
    right: auto;
    top: 2.4rem;
    transform: none;
    width: 100%;
  }

  .md-sidebar--primary {
    border-right: 1px solid var(--animeup-border);
    grid-column: 1;
    grid-row: 1;
  }

  .md-sidebar--secondary {
    background: transparent;
    border-left: 0;
    grid-column: 3;
    grid-row: 1;
  }

  .md-sidebar--primary .md-sidebar__scrollwrap,
  .md-sidebar--secondary .md-sidebar__scrollwrap {
    background: transparent;
    height: 100%;
    margin: 0;
    overflow-y: auto;
    padding: 0.6rem 0.65rem 1.2rem;
    position: static;
    width: 100%;
  }

  .md-sidebar--primary .md-nav,
  .md-sidebar--secondary .md-nav {
    background: transparent;
    display: block;
    height: auto;
    position: static;
    width: 100%;
  }

  .md-sidebar--primary .md-nav__button.md-logo,
  .md-sidebar--primary .md-nav__item--nested > .md-nav > .md-nav__title,
  .md-sidebar--primary .md-nav__item--nested > .md-nav__link .md-nav__icon {
    display: none;
  }

  .md-sidebar--primary .md-nav__item--nested > .md-nav {
    opacity: 1;
    transform: none;
  }

  .md-sidebar--primary .md-nav__item--nested > .md-nav__link {
    font-weight: 700;
    pointer-events: none;
  }

  .md-sidebar--primary .md-nav__item--nested > .md-nav > .md-nav__list {
    padding-left: 0.45rem;
  }

  .md-sidebar--primary .md-nav__list {
    background: var(--animeup-surface) !important;
    box-shadow: none !important;
  }

  .md-sidebar--primary .md-nav__link {
    font-size: 0.68rem;
    line-height: 1.35;
    padding: 0.2rem 0.45rem;
  }

  .md-sidebar--primary .md-nav__item--section > .md-nav > .md-nav__list {
    padding-bottom: 0.2rem;
  }

  .md-sidebar--primary .md-nav--secondary {
    display: none;
  }

  .md-sidebar--primary .md-nav__title,
  .md-sidebar--secondary .md-nav__title {
    background: var(--animeup-surface);
    box-shadow: none;
    box-sizing: border-box;
    height: auto;
    padding: 0.5rem 0.6rem 0.7rem;
    position: sticky;
    top: 0;
    width: 100%;
  }

  .md-sidebar--secondary .md-nav__title {
    background: transparent;
  }

  .md-sidebar--secondary .md-nav__link {
    border-left: 2px solid transparent;
    padding-left: 0.5rem;
  }

  .md-sidebar--secondary .md-nav__link--active {
    border-left-color: transparent;
    color: var(--animeup-muted);
    font-weight: 400;
  }

  .md-sidebar--secondary .md-nav__link.animeup-toc-current {
    border-left-color: var(--animeup-accent);
    color: var(--animeup-accent);
    font-weight: 700;
  }

  .md-sidebar--primary .md-nav--primary > .md-nav__title,
  .md-sidebar--primary .md-nav__item--section > .md-nav__link {
    color: var(--animeup-text);
    font-size: 15px;
    font-weight: 700;
  }

  .md-sidebar--primary .md-nav__item--section > .md-nav__link {
    padding-left: 0;
  }

  .md-content {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
    width: 100%;
  }

  .md-content__inner {
    margin: 0 auto;
    max-width: 54rem;
    padding: 1.5rem 1.2rem 2rem;
  }

  .md-footer__inner.md-grid {
    width: calc(100% - 2 * clamp(11rem, 17vw, 13rem));
  }
}

/* Match Linfa's reading scale and let the article breathe at intermediate widths. */
.md-typeset {
  font-size: 15px;
  line-height: 1.7;
}

.md-typeset h1 {
  font-size: clamp(30px, 3vw, 38px);
  line-height: 1.15;
}

.md-typeset h1 .headerlink {
  display: none;
}

.md-typeset h2 {
  font-size: clamp(23px, 2.2vw, 29px);
  line-height: 1.25;
  margin-top: 2.4em;   /* more air above sections (Material's default is 1.6em) */
}

.md-typeset h3 {
  font-size: 20px;
  margin-top: 2.2em;   /* and above subsections (default 1.6em) */
}

.animeup-hero {
  gap: 20px;
  grid-template-columns: 72px minmax(0, 1fr);
  padding: 24px;
}

.animeup-hero__icon {
  height: 72px;
  width: 72px;
}

.animeup-hero__copy p {
  font-size: 17px;
  line-height: 1.55;
}

.md-footer__title .md-ellipsis {
  font-size: 16px;
}

.md-footer__direction {
  font-size: 12px;
}

/* The first item is Home, followed directly by the seven chapters. */
.md-nav--primary > .md-nav__list > .md-nav__item:first-child > a.md-nav__link {
  align-items: center;
  display: flex;
  gap: 9px;
}

.md-nav--primary > .md-nav__list > .md-nav__item:first-child > a.md-nav__link::before {
  background: currentColor;
  content: "";
  flex: 0 0 16px;
  height: 16px;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z'/%3E%3C/svg%3E") center / contain no-repeat;
  width: 16px;
}

.md-sidebar--primary .md-nav__item:not(.md-nav__item--section) {
  border-top: 0;
}

.md-nav--primary > .md-nav__list > .md-nav__item--section {
  border-top: 1px solid var(--animeup-border);
  margin-bottom: 0;
  margin-top: 9px;
  padding-top: 8px;
}

@media screen and (min-width: 60em) {
  .md-header__inner.md-grid.animeup-header,
  .md-main__inner.md-grid {
    grid-template-columns: clamp(250px, 21vw, 274px) minmax(0, 1fr) clamp(250px, 21vw, 274px);
  }

  .md-header__inner.md-grid.animeup-header {
    height: 58px;
    grid-template-columns: clamp(250px, 21vw, 274px) minmax(0, 1fr) max-content;
  }

  .animeup-header__brand {
    padding-left: 16px;
  }

  .animeup-header__title {
    font-size: 14px;
  }

  .animeup-header__search {
    gap: 8px;
    padding-right: 0;
  }

  .animeup-search-toggle {
    align-items: center;
    background: var(--animeup-surface);
    border: 1px solid var(--animeup-border);
    border-radius: 8px;
    color: var(--animeup-text);
    cursor: pointer;
    display: inline-flex;
    flex: 0 0 2rem;
    height: 2rem;
    justify-content: center;
    padding: 7px;
    width: 2rem;
  }

  .animeup-search-toggle:hover,
  .animeup-search-toggle:focus-visible {
    border-color: var(--animeup-accent);
    color: var(--animeup-accent);
  }

  .animeup-search-toggle svg {
    fill: currentColor;
    height: 18px;
    width: 18px;
  }

  .animeup-search-panel {
    flex: 0 1 auto;
    min-width: 0;
    opacity: 0;
    pointer-events: none;
    transition: width 220ms ease, opacity 180ms ease, visibility 220ms;
    visibility: hidden;
    width: 0;
  }

  .animeup-header__search.is-open .animeup-search-panel {
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
    width: min(290px, calc(100vw - 560px));
  }

  .animeup-header__search.is-open {
    gap: 0;
  }

  .animeup-header__search.is-open .animeup-search-input {
    border-radius: 8px 0 0 8px;
    border-right: 0;
  }

  .animeup-header__search.is-open .animeup-search-toggle {
    border-left: 0;
    border-radius: 0 8px 8px 0;
  }

  .animeup-header__search.is-open:focus-within .animeup-search-input,
  .animeup-header__search.is-open:focus-within .animeup-search-toggle {
    border-color: var(--animeup-accent);
  }

  .md-main__inner.md-grid {
    min-height: calc(100vh - 58px);
  }

  .md-sidebar--primary,
  .md-sidebar--secondary {
    height: calc(100vh - 58px);
    top: 58px;
  }

  .md-sidebar--primary {
    /* Material moves this sidebar off-canvas below its own 76.25em breakpoint.
       Keep it visible until our 60em layout switches to the drawer. */
    left: 0 !important;
    position: fixed;
    top: 58px !important;
    transform: none !important;
    width: clamp(250px, 21vw, 274px);
    z-index: 2;
  }

  .md-sidebar--primary .md-sidebar__scrollwrap {
    height: 100% !important;
  }

  .md-sidebar--secondary {
    left: auto;
    position: fixed;
    right: 0;
    top: 58px !important;
    width: clamp(250px, 21vw, 274px);
    z-index: 2;
  }

  .md-sidebar--secondary .md-sidebar__scrollwrap {
    height: 100% !important;
  }

  .md-sidebar--primary .md-nav__link,
  .md-sidebar--secondary .md-nav__link {
    font-size: 12px;
    line-height: 1.4;
  }

  .md-content__inner {
    box-sizing: border-box;
    margin: 0 auto !important;
    /* 800 px up to a 1500 px window, then it grows with the screen, up to 1140 px (30 Oct). The boards
       are exported at 3x, so they stay sharp at that width */
    max-width: min(1140px, max(800px, calc(100vw - 700px)));
    padding: 36px 20px 28px;
  }

  .md-footer {
    display: grid;
    grid-template-columns: clamp(250px, 21vw, 274px) minmax(0, 1fr) clamp(250px, 21vw, 274px);
  }

  .md-footer::before,
  .md-footer::after {
    background: var(--animeup-surface);
    content: "";
    grid-row: 1;
  }

  .md-footer::before {
    border-right: 1px solid var(--animeup-border);
    grid-column: 1;
  }

  .md-footer::after {
    background: transparent;
    grid-column: 3;
  }

  .md-footer__inner.md-grid {
    grid-column: 2;
    grid-row: 1;
    max-width: min(1140px, max(800px, calc(100vw - 700px)));   /* as wide as the content above */
    padding: 16px 20px 36px;
    width: 100%;
  }
}

@media screen and (min-width: 60em) and (max-width: 77.5em) {
  .md-main__inner.md-grid,
  .md-footer {
    grid-template-columns: clamp(250px, 21vw, 274px) minmax(0, 1fr);
  }

  .md-sidebar--secondary,
  .md-footer::after {
    display: none !important;
  }

  .md-footer__inner.md-grid {
    width: 100%;
  }
}

@media screen and (max-width: 60em) {
  .md-sidebar--primary,
  .md-sidebar--primary .md-sidebar__scrollwrap {
    background: var(--animeup-surface);
  }

  .md-sidebar--primary .md-nav--primary {
    background: transparent;
    left: 8px;
    right: 8px;
    width: auto;
  }

  .md-sidebar--primary .md-nav--primary .md-nav,
  .md-sidebar--primary .md-nav--primary .md-nav__title,
  .md-sidebar--primary .md-nav--primary .md-nav__list {
    background: transparent !important;
    box-shadow: none !important;
  }

  .md-nav--primary > .md-nav__title > .md-nav__button.md-logo {
    display: none !important;
  }

  .md-sidebar--primary .md-nav__source,
  .md-nav--primary .md-nav__item--active > label.md-nav__link[for="__toc"],
  .md-nav--primary .md-nav--secondary,
  .md-nav--primary > .md-nav__list > .md-nav__item--nested > .md-nav > .md-nav__title,
  .md-nav--primary > .md-nav__list > .md-nav__item--nested > label.md-nav__link .md-nav__icon {
    display: none !important;
  }

  /* Flatten Material's drill-down navigation inside the mobile drawer. */
  .md-nav--primary > .md-nav__list > .md-nav__item--nested > .md-nav {
    display: block !important;
    height: auto !important;
    opacity: 1 !important;
    position: static !important;
    transform: none !important;
    visibility: visible !important;
    width: 100%;
  }

  .md-nav--primary > .md-nav__list > .md-nav__item--nested > .md-nav > .md-nav__list {
    height: auto !important;
    overflow: visible !important;
  }

  .md-nav--primary > .md-nav__list > .md-nav__item--nested > label.md-nav__link {
    color: var(--animeup-text);
    cursor: default;
    font-size: 15px;
    font-weight: 700;
    pointer-events: none;
  }

  .md-nav--primary .md-nav__item--active > a.md-nav__link {
    display: flex !important;
  }

  .md-sidebar--primary .md-nav__link {
    font-size: 12px;
    line-height: 1.4;
    padding: 4px 9px;
  }

  .md-nav--primary > .md-nav__list > .md-nav__item--section > .md-nav__link {
    padding-left: 0;
  }

  .animeup-search-toggle {
    align-items: center;
    background: var(--animeup-surface);
    border: 1px solid var(--animeup-border);
    border-radius: 8px;
    color: var(--animeup-text);
    cursor: pointer;
    display: inline-flex;
    flex: 0 0 2rem;
    height: 2rem;
    justify-content: center;
    padding: 7px;
    width: 2rem;
  }

  .animeup-search-toggle svg {
    fill: currentColor;
    height: 18px;
    width: 18px;
  }

  .animeup-search-panel {
    left: 12px;
    opacity: 0;
    pointer-events: none;
    position: fixed;
    right: 12px;
    top: 54px;
    transform: scaleX(0.85);
    transform-origin: right;
    transition: opacity 180ms ease, transform 180ms ease, visibility 180ms;
    visibility: hidden;
    width: auto;
  }

  .animeup-header__search.is-open .animeup-search-panel {
    opacity: 1;
    pointer-events: auto;
    transform: none;
    visibility: visible;
  }

  .md-typeset {
    font-size: 15px;
  }

  .md-content__inner {
    box-sizing: border-box;
    margin: 0 auto !important;
    max-width: 800px;
    padding: 26px 20px 40px;
    width: 100%;
  }

  .md-footer__inner.md-grid {
    max-width: 800px;
    padding: 16px 20px 36px;
  }
}

@media screen and (max-width: 44em) {
  .animeup-hero {
    gap: 14px;
    grid-template-columns: minmax(0, 1fr);
    padding: 18px;
  }

  .animeup-hero__icon {
    height: 56px;
    width: 56px;
  }

  .animeup-hero__copy p {
    font-size: 16px;
  }

  .md-footer__inner.md-grid {
    padding: 20px;
  }
}

@media screen and (max-width: 22em) {
  .animeup-header__brand {
    gap: 0;
    padding-right: 0;
  }
}

.animeup-search-panel {
  position: relative;
  z-index: 10;
}

.animeup-search-form {
  margin: 0;
}

.animeup-search-input {
  background: var(--animeup-surface);
  border: 1px solid var(--animeup-border);
  border-radius: 8px;
  box-sizing: border-box;
  color: var(--animeup-text);
  font: inherit;
  font-size: 13px;
  height: 2rem;
  outline: 0;
  padding: 0 11px;
  width: 100%;
}

.animeup-search-input:focus-visible {
  border-color: var(--animeup-accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--animeup-accent) 25%, transparent);
}

@media screen and (min-width: 60em) {
  .animeup-header__search.is-open .animeup-search-input:focus-visible {
    box-shadow: none;
  }
}

.animeup-search-input::placeholder {
  color: var(--animeup-muted);
}

.animeup-search-results {
  background: var(--animeup-surface);
  border: 1px solid var(--animeup-border);
  border-radius: 9px;
  box-shadow: 0 14px 35px #0004;
  box-sizing: border-box;
  color: var(--animeup-muted);
  display: none;
  font-size: 12px;
  left: 0;
  max-height: min(60vh, 480px);
  overflow-y: auto;
  padding: 10px;
  position: absolute;
  top: calc(100% + 6px);
  width: 100%;
  z-index: 10;
}

.animeup-search-results:not(:empty) {
  display: block;
}

.animeup-search-results ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.animeup-search-results a {
  border-radius: 6px;
  color: var(--animeup-text);
  display: block;
  padding: 9px;
  text-decoration: none;
}

.animeup-search-results a:hover,
.animeup-search-results a:focus-visible {
  background: color-mix(in srgb, var(--animeup-accent) 10%, var(--animeup-surface));
  outline: 0;
}

.animeup-search-results strong,
.animeup-search-results span {
  display: block;
}

.animeup-search-results span {
  color: var(--animeup-muted);
  line-height: 1.4;
  margin-top: 3px;
}

@media screen and (max-width: 60em) {
  .animeup-search-panel {
    position: fixed;
  }
}

/* Model study: context frame, 3-column crop grid, wipe comparison */
.md-typeset .ms-case {
  margin: 1em 0 0.4em;
}

.md-typeset .ms-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
  margin: 1em 0 1.4em;
}

.md-typeset .ms-case figure,
.md-typeset .ms-grid figure {
  margin: 0;
  max-width: none;
}

.md-typeset .ms-case img,
.md-typeset .ms-grid img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--animeup-border);
  border-radius: 4px;
  image-rendering: auto;
}

.md-typeset .ms-grid figure:first-child img {
  image-rendering: pixelated;
}

.md-typeset .ms-case figcaption,
.md-typeset .ms-grid figcaption {
  margin: 0.3em 0 0;
  max-width: none;
  font-size: 0.68rem;
  line-height: 1.35;
  text-align: left;
  color: var(--animeup-muted);
}

.md-typeset .ms-grid figcaption strong {
  display: block;
  color: var(--animeup-text);
  font-weight: 600;
}

.md-typeset .ms-tag {
  display: inline-block;
  margin-right: 0.35em;
  padding: 0 0.4em;
  border-radius: 999px;
  border: 1px solid currentColor;
  font-size: 0.58rem;
  line-height: 1.5;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.md-typeset .ms-tag--ref { color: var(--animeup-muted); }
.md-typeset .ms-tag--app { color: var(--animeup-accent); }
.md-typeset .ms-tag--new { color: var(--animeup-success); }
.md-typeset .ms-tag--out { color: var(--animeup-danger); }
/* In light the outline alone hardly tells blue from green: a faint fill of the same colour. */
[data-md-color-scheme="default"] .md-typeset .ms-tag { background: color-mix(in srgb, currentColor 8%, transparent); }
@media (prefers-color-scheme: light) {
  [data-md-color-scheme="animeup-auto"] .md-typeset .ms-tag { background: color-mix(in srgb, currentColor 8%, transparent); }
}

.md-typeset .ms-wipe {
  margin: 1em 0 1.6em;
}

.md-typeset .ms-wipe__pick {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.4rem 1rem;
  margin-bottom: 0.4rem;
  font-size: 0.72rem;
  color: var(--animeup-muted);
}

.md-typeset .ms-wipe__pick select {
  margin-left: 0.3em;
  padding: 0.15em 0.3em;
  border: 1px solid var(--animeup-border);
  border-radius: 4px;
  background: var(--animeup-surface);
  color: var(--animeup-text);
  font: inherit;
}

.md-typeset .ms-wipe__view {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid var(--animeup-border);
  border-radius: 4px;
  cursor: ew-resize;
  touch-action: pan-y;
}

.md-typeset .ms-wipe__view img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  margin: 0;
  border: 0;
}

.md-typeset .ms-wipe__a {
  clip-path: inset(0 calc(100% - var(--x)) 0 0);
}

.md-typeset .ms-wipe__handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--x);
  width: 2px;
  margin-left: -1px;
  background: var(--animeup-accent);
  pointer-events: none;
}

.md-typeset .ms-wipe input[type="range"] {
  width: 100%;
  margin: 0.5rem 0 0;
  accent-color: var(--animeup-accent);
}

@media screen and (max-width: 44em) {
  .md-typeset .ms-grid {
    gap: 0.4rem;
  }

  .md-typeset .ms-grid figcaption {
    font-size: 0.6rem;
  }
}

/* 2.0 guide pictures: drawn at the column's width (760 pt, exported at 2×), and short loops
   for the ones that move. They are dark for now; light twins will swap in with the theme. */
.md-typeset img.au,
.md-typeset video.au {
  display: block;
  width: 100%;
  height: auto;
  margin: 1.2rem 0;
  border: 1px solid var(--animeup-border);
  border-radius: 0.7rem;
  background: #131417;
}

/* Small drawings beside their paragraph, so a list of steps doesn't read as a wall of text. */
.md-typeset .au-steps {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 1.2rem 0;
}

.md-typeset .au-step {
  display: grid;
  grid-template-columns: 12rem minmax(0, 1fr);
  gap: 1.2rem;
  align-items: center;
}

.md-typeset .au-step > p:first-child,
.md-typeset .au-step > div > p {
  margin: 0;
}

.md-typeset .au-step img {
  display: block;
  width: 100%;
  height: auto;
}

@media screen and (max-width: 30em) {
  .md-typeset .au-step {
    grid-template-columns: 1fr;
    gap: 0.6rem;
  }

  .md-typeset .au-step img {
    max-width: 14rem;
  }
}

/* The cover: a before/after comparison like the app's Compare player. --pos is the divider. */
.md-typeset .au-hero {
  --pos: 50%;
  position: relative;
  aspect-ratio: 16 / 9;
  margin: 1.2rem 0 1.6rem;
  border-radius: 0.8rem;
  overflow: hidden;
  cursor: ew-resize;
  touch-action: pan-y;
  user-select: none;
  background: #0d0f13;
  box-shadow: 0 0 0 1px var(--animeup-border), 0 18px 50px rgba(0, 0, 0, 0.35);
}

.md-typeset .au-hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  border: 0;
  border-radius: 0;
  pointer-events: none;
}

.md-typeset .au-hero .au-hero__before {
  clip-path: inset(0 calc(100% - var(--pos)) 0 0);
}

/* The cover frames the face and the town at 2×: the whole scene at the column's width hides the
   difference. 1:1 still opens the whole picture. */
.md-typeset .au-hero img.au-hero__pic {
  inset: auto;
  left: var(--zx, 0);
  top: var(--zy, 0);
  width: var(--zw, 100%);
  max-width: none;
  height: auto;
}

.md-typeset .au-hero .au-hero__clip {
  position: absolute;
  inset: 0;
  clip-path: inset(0 calc(100% - var(--pos)) 0 0);
}

.md-typeset .au-hero .au-hero__line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(var(--pos) - 1px);
  width: 2px;
  background: #fff;
  box-shadow: 0 0 12px rgba(42, 201, 222, 0.9);
  pointer-events: none;
}

.md-typeset .au-hero .au-hero__knob {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 2.2rem;
  height: 2.2rem;
  margin: -1.1rem 0 0 -1.1rem;
  border-radius: 50%;
  background: #fff;
  color: #0d1015;
  display: flex;
  align-items: center;
  justify-content: center;
  font: 700 0.9rem/1 -apple-system, BlinkMacSystemFont, sans-serif;
  box-shadow: 0 0 0 4px rgba(42, 201, 222, 0.45), 0 8px 24px rgba(0, 0, 0, 0.5);
}

.md-typeset .au-hero:focus-visible {
  outline: 2px solid var(--animeup-accent);
  outline-offset: 3px;
}

.md-typeset .au-hero__caption {
  margin-top: -0.9rem;
  font-size: 0.7rem;
  color: var(--animeup-muted);
}

.md-typeset .au-hero .au-hero__zoom {
  position: absolute;
  left: 0.7rem;
  bottom: 0.7rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  border: 0;
  background: rgba(10, 12, 16, 0.72);
  color: #fff;
  font: 600 0.62rem/1 ui-monospace, "SF Mono", Menlo, monospace;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.22);
  cursor: zoom-in;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.md-typeset .au-hero .au-hero__zoom:hover {
  background: var(--animeup-accent);
  color: var(--animeup-on-accent);
}

/* 1:1 overlay */
.au-full {
  position: fixed;
  inset: 0;
  z-index: 10;
  background: rgba(6, 8, 11, 0.94);
}

.au-full__scroll {
  position: absolute;
  inset: 0;
  overflow: auto;
  display: flex;
  padding: 3rem;
  box-sizing: border-box;
}

.au-full .au-full__pic {
  --pos: 50%;
  position: relative;
  flex: none;
  margin: auto;
  cursor: ew-resize;
  overflow: hidden;
  border-radius: 0;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.16);
}

.au-full .au-full__pic img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  image-rendering: auto;
}

.au-full .au-hero__before {
  clip-path: inset(0 calc(100% - var(--pos)) 0 0);
}

.au-full .au-hero__line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(var(--pos) - 1px);
  width: 2px;
  background: #fff;
  box-shadow: 0 0 12px rgba(42, 201, 222, 0.9);
  pointer-events: none;
}

.au-full .au-hero__knob {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 42px;
  height: 42px;
  margin: -21px 0 0 -21px;
  border-radius: 50%;
  background: #fff;
  color: #0d1015;
  display: flex;
  align-items: center;
  justify-content: center;
  font: 700 15px/1 -apple-system, BlinkMacSystemFont, sans-serif;
  box-shadow: 0 0 0 4px rgba(42, 201, 222, 0.45);
}

.au-full__tag {
  position: fixed;
  top: 1rem;
  padding: 5px 11px;
  border-radius: 999px;
  font: 600 12px -apple-system, BlinkMacSystemFont, sans-serif;
  pointer-events: none;
}

.au-full__tag--l { left: 1rem; background: rgba(10, 12, 16, 0.8); color: #fff; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2); }
.au-full__tag--r { right: 4rem; background: #2ac9de; color: #0d1015; }

.au-full__close {
  position: fixed;
  top: 0.8rem;
  right: 1rem;
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font: 400 1.3rem/1 -apple-system, sans-serif;
  cursor: pointer;
}

/* Two covers: one shown at a time, chosen with the tabs under them. */
.md-typeset .au-gallery .au-hero { display: none; margin-bottom: 0.6rem; }
.md-typeset .au-gallery .au-hero.is-on { display: block; }

.md-typeset .au-gallery__tabs {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 1.4rem;
}

.md-typeset .au-gallery__tabs button {
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--animeup-border);
  background: transparent;
  color: var(--animeup-muted);
  font-size: 0.68rem;
  cursor: pointer;
}

.md-typeset .au-gallery__tabs button b { color: var(--animeup-text); margin-right: 0.3rem; }
.md-typeset .au-gallery__tabs button.is-on { background: var(--animeup-accent); border-color: var(--animeup-accent); color: var(--animeup-on-accent); }
.md-typeset .au-gallery__tabs button.is-on b { color: var(--animeup-on-accent); }

.md-typeset .au-hero .au-hero__zoomicon {
  flex: none;
  width: 0.5rem;
  height: 0.5rem;
}

/* "See more examples" under the cover: a button, so it isn't lost at the end of the caption */
.md-typeset .au-more { margin: 0.5rem 0 1.6rem; }   /* a little air between the caption and the button */
.md-typeset .au-more .au-more__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  background: var(--animeup-accent);
  color: var(--animeup-on-accent);
  font-size: 0.72rem;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 6px 18px rgba(42, 201, 222, 0.25);
  transition: filter 0.15s ease;
}
.md-typeset .au-more .au-more__btn:hover { filter: brightness(1.08); color: var(--animeup-on-accent); }

/* Pictures with a light and a dark twin: the guide's own schemes (dark is the default, "default" is
   light, "animeup-auto" follows macOS), so Material's #only-light / #only-dark need these rules.
   !important: grids that set their own img display (.au-rule img) must not show both twins. */
.md-typeset img[src$="#only-light"] { display: none !important; }
[data-md-color-scheme="default"] .md-typeset img[src$="#only-light"] { display: block !important; }
[data-md-color-scheme="default"] .md-typeset img[src$="#only-dark"] { display: none !important; }
@media (prefers-color-scheme: light) {
  [data-md-color-scheme="animeup-auto"] .md-typeset img[src$="#only-light"] { display: block !important; }
  [data-md-color-scheme="animeup-auto"] .md-typeset img[src$="#only-dark"] { display: none !important; }
}
/* The same for what Markdown can't tag with #only-…: videos and pictures inside HTML blocks. */
.md-typeset .au-only-light { display: none !important; }
[data-md-color-scheme="default"] .md-typeset .au-only-light { display: block !important; }
[data-md-color-scheme="default"] .md-typeset .au-only-dark { display: none !important; }
@media (prefers-color-scheme: light) {
  [data-md-color-scheme="animeup-auto"] .md-typeset .au-only-light { display: block !important; }
  [data-md-color-scheme="animeup-auto"] .md-typeset .au-only-dark { display: none !important; }
}

/* Two pictures, the dark one wiped away by the light one as the page scrolls (the design system):
   --wipe goes from 0 to 1 while the picture crosses the window; a thin accent line marks the edge */
.md-typeset .au-fade {
  --wipe: 0;
  position: relative;
  margin: 1.2rem 0;
  border-radius: 0.7rem;
  overflow: hidden;
  border: 1px solid var(--animeup-border);
}
.md-typeset .au-fade img {
  display: block;
  width: 100%;
  height: auto;
  margin: 0;
  border: 0;
  border-radius: 0;
}
.md-typeset .au-fade img + img {
  position: absolute;
  inset: 0;
  /* the revealed part is x/w + y/h <= 2 * wipe: a straight edge parallel to the other diagonal, sweeping
     from the top-left corner to the bottom-right one (--a = min(2·wipe, 1), --b = max(2·wipe − 1, 0)) */
  clip-path: polygon(0 0, calc(var(--a, 0) * 100%) 0, calc(var(--a, 0) * 100%) calc(var(--b, 0) * 100%),
                     calc(var(--b, 0) * 100%) calc(var(--a, 0) * 100%), 0 calc(var(--a, 0) * 100%));
}
.md-typeset .au-fade .au-fade__edge {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  filter: drop-shadow(0 0 6px rgba(42, 201, 222, 0.8));
  opacity: calc(min(var(--wipe), 1 - var(--wipe)) * 12);
  pointer-events: none;
}
.md-typeset .au-fade .au-fade__edge line {
  stroke: var(--animeup-accent);
  stroke-width: 2px;
}

/* "Where it started": 2.0 wiping in over 1.6 from the top down, with a soft edge (swap.js). Without the
   script, 1.6 stays. --swap runs 0 → 1; the mask's soft band, 30% of the height, slides from above the
   picture to below it. */
@property --swap {
  syntax: "<number>";
  inherits: true;
  initial-value: 0;
}
.md-typeset .au-swap {
  --swap: 0;
  position: relative;
  margin: 1.2rem 0;
  border-radius: 0.7rem;
  overflow: hidden;
  border: 1px solid var(--animeup-border);
  transition: --swap 1.4s cubic-bezier(0.45, 0, 0.25, 1);
}
.md-typeset .au-swap.is-gone {
  --swap: 1;
}
.md-typeset .au-swap img {
  display: block;
  width: 100%;
  height: auto;
  margin: 0;
  border: 0;
  border-radius: 0;
}
.md-typeset .au-swap .au-swap__from {
  position: absolute;
  inset: 0;
  height: 100%;
  -webkit-mask-image: linear-gradient(to bottom, transparent calc(var(--swap) * 130% - 30%), #000 calc(var(--swap) * 130%));
  mask-image: linear-gradient(to bottom, transparent calc(var(--swap) * 130% - 30%), #000 calc(var(--swap) * 130%));
}
/* the sun: 2.0 comes in a little overexposed and settles; a soft, blurred band of white light rides the
   edge and fades once the wipe is through. Only forwards: going back, the classes go at once and the light
   with them. */
.md-typeset .au-swap .au-swap__sun {
  position: absolute;
  left: -10%;
  right: -10%;
  height: 70%;
  top: calc(var(--swap) * 130% - 15% - 35%);
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.05) 30%,
                              rgba(255, 255, 255, 0.11) 50%, rgba(255, 255, 255, 0.05) 70%, rgba(255, 255, 255, 0));
  filter: blur(24px);
  mix-blend-mode: screen;
  opacity: 0;
  pointer-events: none;
}
.md-typeset .au-swap.is-sunlit .au-swap__sun {
  animation: au-sun-band 2.2s ease-out both;
}
.md-typeset .au-swap.is-sunlit img:not(.au-swap__from) {
  animation: au-sun-pic 2.6s ease-out both;
}
@keyframes au-sun-band {
  0% { opacity: 0; }
  12% { opacity: 1; }
  60% { opacity: 0.9; }
  100% { opacity: 0; }
}
@keyframes au-sun-pic {
  0% { filter: brightness(1.12); }
  45% { filter: brightness(1.04); }
  100% { filter: none; }
}
@media (prefers-reduced-motion: reduce) {
  .md-typeset .au-swap {
    transition: none;
  }
  .md-typeset .au-swap .au-swap__from {
    -webkit-mask-image: none;
    mask-image: none;
    transition: opacity 0.6s;
  }
  .md-typeset .au-swap.is-gone .au-swap__from {
    opacity: 0;
  }
  .md-typeset .au-swap.is-sunlit .au-swap__sun,
  .md-typeset .au-swap.is-sunlit img:not(.au-swap__from) {
    animation: none;
  }
}

/* The table of contents' entries sit 7 px in from its title, as the navigation's do on the left
   (Material's list indent put them 14 px in) (30 Oct) */
@media screen and (min-width: 60em) {
  .md-sidebar--secondary .md-nav--secondary > .md-nav__list {
    padding-left: 7.4px;
  }
}

/* Text with a small decorative picture beside it (the Design page's contrast check); stacked when narrow */
.md-typeset .au-side {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 28px;
  align-items: start;
  margin: 1em 0;
}
.md-typeset .au-side > p:last-child,
.md-typeset .au-side img {
  margin: 0;
}
.md-typeset .au-side img {
  width: 100%;
  border-radius: 0.7rem;
  border: 1px solid var(--animeup-border);
}
.md-typeset .au-side > div > p:first-child { margin-top: 0; }
.md-typeset .au-side--left {
  grid-template-columns: 240px minmax(0, 1fr);
}
/* On a phone the picture goes above the text, whichever side it sits on: the --left rule used to come
   after this and kept two columns, one word per line (found 31 Oct) */
@media screen and (max-width: 44.9375em) {
  .md-typeset .au-side,
  .md-typeset .au-side--left { grid-template-columns: 1fr; }
  .md-typeset .au-side img { max-width: 280px; }
}

/* "Rules fixed along the way": a grid of small cards, a picture, a title and a few words each; three
   across, two on narrower screens, one on a phone (30 Oct) */
.md-typeset .au-rules {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px 24px;
  margin: 1.2rem 0 1.6rem;
}
.md-typeset .au-rule img {
  display: block;
  width: 100%;
  margin: 0 0 12px;
  border-radius: 0.6rem;
  border: 1px solid var(--animeup-border);
}
.md-typeset .au-rule p {
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.5;
}
.md-typeset .au-rule strong {
  display: block;
  margin-bottom: 4px;
  font-size: 0.78rem;
}
@media screen and (max-width: 76.1875em) {
  .md-typeset .au-rules { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media screen and (max-width: 44.9375em) {
  .md-typeset .au-rules { grid-template-columns: 1fr; }
}
