window {
  // lamefun trick to get rounded borders regardless of CSD use
  border-width: 0px;

  // this needs to be transparent
  // see bug #722563
  $_wm_border: if($variant=='light', transparentize(black, 0.77), transparentize(black, 0.25));
  $_wm_border_backdrop: if($variant=='light', transparentize(black, 0.82), transparentize(black, 0.25));

  &.csd {
    box-shadow: 0 1px 3px 3px transparent,
                0 2px 8px 2px transparentize(black, 0.87),
                0 3px 20px 10px transparentize(black, 0.91),
                0 6px 32px 16px transparentize(black, 0.96),
                0 0 0 1px $_wm_border; //doing borders with box-shadow
    margin: 0px;
    border-radius: $window_radius;

    @if $variant == 'dark' {
      $_window_outline: if($contrast=='high', transparentize(white, .7), transparentize(white, .9));
      outline: 1px solid $_window_outline;
      outline-offset: -1px;
    }

    &:backdrop {
      // the transparent shadow here is to enforce that the shadow extents don't
      // change when we go to backdrop, to prevent jumping windows.
      // The biggest shadow should be in the same order then in the active state
      // or the jumping will happen during the transition.
      box-shadow: 0 1px 3px 3px transparentize(black, 0.91),
                  0 2px 14px 5px transparentize(black, 0.95),
                  0 4px 28px 12px transparentize(black, 0.97),
                  0 6px 32px 16px transparent,
                  0 0 0 1px $_wm_border_backdrop;
      transition: $backdrop_transition;
    }

    &.dialog.message {
      box-shadow: 0 1px 2px transparentize(black, 0.8),
                  0 0 0 1px transparentize($_wm_border, 0.1);
    }

    &.tiled,
    &.tiled-top,
    &.tiled-left,
    &.tiled-right,
    &.tiled-bottom {
      border-radius: 0;
      outline: none;

      box-shadow: 0 0 0 1px $_wm_border,
                  0 0 0 20px transparent; //transparent control workaround -- #3670

      &:backdrop {
        box-shadow: 0 0 0 1px $_wm_border_backdrop,
                    0 0 0 20px transparent;
      }
    }

    &.maximized,
    &.fullscreen {
      border-radius: 0;
      outline: none;
      box-shadow: none;
      transition: none;
    }
  }

  &.solid-csd {
    margin: 0;
    padding: 5px;
    border-radius: 0;
    box-shadow: inset 0 0 0 5px $borders_color,
                inset 0 0 0 4px $headerbar_bg_color,
                inset 0 0 0 1px $_wm_border;

    &:backdrop {
      box-shadow: inset 0 0 0 5px $borders_color,
                  inset 0 0 0 4px $bg_color,
                  inset 0 0 0 1px $_wm_border_backdrop;
    }
  }

  // server-side decorations as used by mutter
  &.ssd { box-shadow: 0 0 0 1px $_wm_border; } //just doing borders, wm draws actual shadows
}
