:root {
  --turp-motion-standard: cubic-bezier(0.2, 0, 0, 1);
  --turp-motion-emphasized: cubic-bezier(0.2, 0, 0, 1);
  --turp-motion-fast: 160ms;
  --turp-motion-medium: 260ms;
}

html.turp-motion-ready body,
html.turp-motion-ready .site-rail,
html.turp-motion-ready .document-app-bar,
html.turp-motion-ready .document-app-bar::before,
html.turp-motion-ready .appearance-dialog,
html.turp-motion-ready .appearance-dialog::backdrop,
html.turp-motion-ready .release-card,
html.turp-motion-ready .privacy-note,
html.turp-motion-ready .resource-card,
html.turp-motion-ready .appearance-switch-row,
html.turp-motion-ready .theme-selector,
html.turp-motion-ready .palette-choice {
  transition-duration: var(--turp-motion-medium);
  transition-property: background-color, border-color, box-shadow, color;
  transition-timing-function: var(--turp-motion-standard);
}

.rail-nav {
  position: relative;
  isolation: isolate;
}

.rail-nav__indicator {
  position: absolute;
  inset: 0 0 auto;
  z-index: 0;
  height: var(--turp-nav-indicator-height, 58px);
  border-radius: 6px;
  background: color-mix(in srgb, var(--primary-container) 44%, transparent);
  opacity: 0;
  pointer-events: none;
  transform: translate3d(0, var(--turp-nav-indicator-y, 0px), 0);
}

.rail-nav.is-ready .rail-nav__indicator {
  opacity: 1;
  transition:
    transform 240ms var(--turp-motion-emphasized),
    height 240ms var(--turp-motion-emphasized),
    background-color var(--turp-motion-medium) var(--turp-motion-standard),
    opacity var(--turp-motion-fast) linear;
}

.nav-item {
  position: relative;
  z-index: 1;
  border-radius: 6px;
  background: transparent !important;
  transition:
    color var(--turp-motion-fast) var(--turp-motion-standard),
    transform var(--turp-motion-fast) var(--turp-motion-standard),
    background-color var(--turp-motion-fast) var(--turp-motion-standard);
}

.nav-item.is-active {
  background: transparent !important;
  color: var(--primary);
  font-weight: 500;
}

.nav-item:hover {
  background: color-mix(in srgb, var(--surface-container) 68%, transparent) !important;
}

.nav-item.is-active:hover {
  background: color-mix(in srgb, var(--primary-container) 14%, transparent) !important;
}

.theme-selector {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

.theme-selector__indicator {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 0;
  z-index: 0;
  width: var(--turp-theme-indicator-width, 0px);
  border-radius: 10px;
  background: var(--primary-container);
  opacity: 0;
  pointer-events: none;
  transform: translate3d(var(--turp-theme-indicator-x, 0px), 0, 0);
}

.theme-selector.is-ready .theme-selector__indicator {
  opacity: 1;
  transition:
    transform 240ms var(--turp-motion-emphasized),
    width 240ms var(--turp-motion-emphasized),
    background-color var(--turp-motion-medium) var(--turp-motion-standard),
    opacity var(--turp-motion-fast) linear;
}

.theme-selector__choice {
  position: relative;
  z-index: 1;
  background: transparent !important;
  transition:
    color var(--turp-motion-fast) var(--turp-motion-standard),
    transform var(--turp-motion-fast) var(--turp-motion-standard),
    background-color var(--turp-motion-fast) var(--turp-motion-standard);
}

.theme-selector__choice.is-selected {
  background: transparent !important;
}

.theme-selector__choice:hover {
  background: color-mix(in srgb, var(--surface-container) 68%, transparent) !important;
}

.theme-selector__choice.is-selected:hover {
  background: color-mix(in srgb, var(--on-primary-container) 7%, transparent) !important;
}

.button,
.icon-button,
.resource-row,
.appearance-launcher,
.palette-choice,
.release-card__toggle,
.material-switch {
  transition:
    transform var(--turp-motion-fast) var(--turp-motion-standard),
    background-color var(--turp-motion-fast) var(--turp-motion-standard),
    border-color var(--turp-motion-fast) var(--turp-motion-standard),
    box-shadow var(--turp-motion-fast) var(--turp-motion-standard),
    color var(--turp-motion-fast) var(--turp-motion-standard),
    filter var(--turp-motion-fast) var(--turp-motion-standard);
}

.button-primary {
  box-shadow: 0 1px 2px rgb(0 0 0 / 16%);
}

@media (hover: hover) {
  /*.button:hover,
  .resource-row:hover,
  .palette-choice:hover {
    transform: translateY(-1px);
  }*/

  .button-primary:hover {
    box-shadow: 0 4px 12px rgb(0 0 0 / 20%);
  }

  /*.icon-button:hover,
  .appearance-launcher:hover,
  .release-card__toggle:hover {
    transform: scale(1.025);
  }*/
}

/*.button:active,
.icon-button:active,
.resource-row:active,
.appearance-launcher:active,
.palette-choice:active,
.theme-selector__choice:active,
.nav-item:active,
.release-card__toggle:active,
.material-switch:active {
  transform: scale(0.97);
  transition-duration: 70ms;
}*/

@media (prefers-reduced-motion: reduce) {
  html.turp-motion-ready body,
  html.turp-motion-ready .site-rail,
  html.turp-motion-ready .document-app-bar,
  html.turp-motion-ready .document-app-bar::before,
  html.turp-motion-ready .appearance-dialog,
  html.turp-motion-ready .appearance-dialog::backdrop,
  html.turp-motion-ready .release-card,
  html.turp-motion-ready .privacy-note,
  html.turp-motion-ready .resource-card,
  html.turp-motion-ready .appearance-switch-row,
  html.turp-motion-ready .theme-selector,
  html.turp-motion-ready .palette-choice,
  .rail-nav__indicator,
  .theme-selector__indicator,
  .nav-item,
  .theme-selector__choice,
  .button,
  .icon-button,
  .resource-row,
  .appearance-launcher,
  .palette-choice,
  .release-card__toggle,
  .material-switch,
  .material-switch__handle {
    transition: none !important;
  }
}
