/* The normal, resting state is always the readable state. */
@media screen {
  .nav-inner a[data-route] { position: relative; }
  .nav-inner a.sm-current[aria-current="page"] { border-bottom-color: transparent; }
  .sm-nav-rule {
    position: absolute;
    inset: auto 0 -3px;
    height: 3px;
    background: currentColor;
    transform-origin: left center;
    pointer-events: none;
  }

  .sm-rail-anchor { position: relative; }
  .sm-art-frame { position: relative; }
  [data-motion-stop] { position: relative; z-index: 4; }
  .sm-travel, .sm-track, .sm-head, .sm-arrival { pointer-events: none; }
  .sm-travel {
    position: absolute;
    z-index: 3;
    height: 0;
    transform-origin: 0 0;
  }
  .sm-track, .sm-head, .sm-arrival { position: absolute; display: block; }
  .sm-track {
    inset: -2px 0 auto;
    height: 4px;
    border-radius: 2px;
    background: linear-gradient(90deg, #896129, #ca963e 70%, #f4d897);
    transform-origin: left;
  }
  .sm-head {
    top: -6px;
    left: 0;
    width: 12px;
    height: 12px;
    margin-left: -6px;
    border: 2px solid #6a491d;
    border-radius: 2px;
    rotate: 45deg;
    background: #ffdfa1;
    box-shadow: 0 0 0 2px #f5d38a66;
  }
  .sm-arrival {
    top: calc(var(--sm-stop-size, 36px) / -2);
    left: 100%;
    width: var(--sm-stop-size, 36px);
    height: var(--sm-stop-size, 36px);
    margin-left: calc(var(--sm-stop-size, 36px) / -2);
    border: 2px solid #9b6d29;
    border-radius: 50%;
    opacity: 0;
  }

  [data-motion-art] { animation: none; }
  .sm-previous-art {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
  }
  .sm-reading-cursor {
    position: absolute;
    z-index: 3;
    height: 3px;
    border-radius: 100% 25%;
    background: linear-gradient(90deg,#af803e,#f2cb7b 36%,#d5a959);
    box-shadow: 0 1px 1px #45301155;
    pointer-events: none;
    transform-origin: left center;
  }
  .tl-hero-actions .tl-sequence[aria-pressed="true"] { position: relative; }
  .tl-hero-actions .tl-sequence[aria-pressed="true"]::after {
    content: "";
    position: absolute;
    left: .65rem;
    right: .65rem;
    bottom: 2px;
    height: 2px;
    background: currentColor;
    opacity: .72;
    pointer-events: none;
    transform-origin: left center;
  }
}

@media screen and (prefers-reduced-motion: no-preference) {
  html:not([data-reading-motion="reduce"]) :where(.act, .round, .bcourse-btn, .bsm-control,
  .bsm-entry, .bst-button, [data-era], [data-event], .nav-inner a) {
    transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
  }
  html:not([data-reading-motion="reduce"]) :where(.act, .round, .bsm-control,
  .bcourse-btn):not(:disabled):active { translate: 0 1px; }
  html:not([data-reading-motion="reduce"]) .bsm-detail-top,
  html:not([data-reading-motion="reduce"]) dialog[open] > .searchbox {
    animation: sm-detail-arrive 420ms cubic-bezier(.18,.72,.22,1) both;
  }
  html:not([data-reading-motion="reduce"]) dialog[open]::backdrop {
    animation: sm-scrim-arrive 180ms ease-out;
  }
  html:not([data-reading-motion="reduce"]) .sm-procession > li:not(:last-child)::before {
    animation: sm-engrave-line 580ms var(--sm-arrive,0ms) cubic-bezier(.25,.65,.3,1) backwards;
    transform-origin: left center;
  }
  html:not([data-reading-motion="reduce"]) .bcourse-inline-chapter[aria-current="true"]::before {
    animation: sm-chapter-bar 480ms cubic-bezier(.2,.7,.2,1);
    transform-origin: center top;
  }
  html:not([data-reading-motion="reduce"]) .tl-hero-actions .tl-sequence[aria-pressed="true"]::after {
    animation: sm-play-interval var(--tl-step-duration,11s) linear both;
  }
  html:not([data-reading-motion="reduce"]) g.bsm-mark-active[data-position="place"] > circle:first-of-type {
    transform-box: fill-box;
    transform-origin: center;
    animation: sm-locator-arrive 850ms cubic-bezier(.2,.72,.23,1);
  }
  @keyframes sm-detail-arrive {
    from { opacity: .78; translate: 0 10px; }
    to { opacity: 1; translate: 0 0; }
  }
  @keyframes sm-scrim-arrive { from { opacity: .35; } to { opacity: 1; } }
  @keyframes sm-engrave-line {
    from { scale: .12 1; }
    to { scale: 1 1; }
  }
  @keyframes sm-chapter-bar {
    from { scale: 1 .1; }
    to { scale: 1 1; }
  }
  @keyframes sm-play-interval {
    from { scale: 0 1; }
    to { scale: 1 1; }
  }
  @keyframes sm-locator-arrive {
    from { scale: 1.48; }
    to { scale: 1; }
  }
}

@media (forced-colors: active) {
  .sm-nav-rule { background: LinkText; }
  .sm-travel, .sm-reading-cursor { display: none; }
}
@media print {
  .sm-nav-rule, .sm-travel, .sm-reading-cursor, .sm-previous-art { display: none; }
}
