:root {
  --phone-screen-width: 375px;
  --phone-screen-height: 667px;
  --phone-border: 20px;
  --running-shake: 20px;
}

html, body, .container, .grid {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
}

body, button {
  font-family: sans-serif;
}

.landing * {
  display: block;
  margin: 100px auto;
  text-align: center;
}

.landing img {
  width: 50%;
}

.container {
  display: none;
}

body[data-fullscreen="true"] .container {
  display: block;
}

body[data-fullscreen="true"] .landing {
  display: none;
}

.background {
  --blur: 8px;
  background-size: cover;
  background-position: center center;
  width: calc(100% + (var(--blur) * 4));
  height: calc(100% + (var(--blur) * 4));
  top: calc(-1 * (var(--blur) * 2));
  left: calc(-1 * (var(--blur) * 2));
  z-index: -2;
  position: fixed;
  filter: blur(var(--blur));
}

.grid {
  display: grid;
  grid-template-columns: 1fr calc(var(--phone-screen-width) + var(--phone-border) * 2) 1fr;
  grid-template-rows: 1fr calc(var(--phone-screen-height) + var(--phone-border) * 2) 1fr;
}

.left-hand {
  grid-column-start: 1;
  grid-row-start: 2;
  grid-row-end: 4;
  background-image: url("img/left_hand.png");
  background-position: bottom left;
  background-size: contain;
  background-repeat: no-repeat;
  display: none;
}

.google-home {
  z-index: -1;
  grid-column-start: 1;
  grid-row-start: 2;
  display: flex;
  flex-flow: column;
  align-items: flex-start;
  justify-content: center;
  padding-right: 20%;
}

.google-home span {
  color: #000;
  font-size: 20px;
  padding: 20px;
  margin: 20px 40px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 10px;
  position: relative;
  display: none;
  animation: google-home-appear 2s 6s both;
}

.google-home span:nth-child(2) {
  animation-delay: 10s;
}

.google-home span:nth-child(3) {
  animation-delay: 2s;
}

.google-home span:nth-child(4) {
  animation-delay: 6s;
}

@keyframes google-home-appear {
  from {
    top: 100px;
    opacity: 0;
  }

  to {
    top: 0px;
    opacity: 1;
  }
}

.google-home span::before {
  content: "Google Home";
  position: absolute;
  top: -20px;
  left: 0px;
  line-height: 20px;
  margin-top: -10px;
  margin-left: 10px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.9);
}

.google-home span:nth-child(2n)::after {
  content: "";
  border-right: 20px solid transparent;
  border-top: 20px solid rgba(255, 255, 255, 0.9);
  position: absolute;
  left: 20px;
  bottom: 0px;
  margin-bottom: -20px;
}

.right-hand {
  background-repeat: no-repeat;
}

.right-hand.left-of-phone {
  grid-column-start: 1;
  grid-row-start: 2;
  grid-row-end: 3;
  background-image: url("img/right_hand_left.png");
  background-position: center right;
}

.right-hand.right-of-phone {
  grid-column-start: 3;
  grid-row-start: 1;
  grid-row-end: 3;
  background-image: url("img/right_hand_right_top.png");
  background-position: bottom left;
}

.right-hand.below-phone {
  grid-column-start: 2;
  grid-row-start: 3;
  grid-row-end: 4;
  background-image: url("img/right_hand_middle_bottom.png");
  background-position: top right;
}

.right-hand.below-right-of-phone {
  grid-column-start: 3;
  grid-row-start: 3;
  grid-row-end: 4;
  background-image: url("img/right_hand_right_bottom.png");
  background-position: top left;
}

.right-hand.behind-phone {
  grid-column-start: 2;
  grid-row-start: 2;
  background-image: url("img/right_hand_middle_top.png");
  background-position: bottom right;
  z-index: -1;
}

.phone {
  grid-column-start: 2;
  grid-row-start: 2;
}

.phone .screen {
  width: 100%;
  height: 100%;
  background: #fff;
  border: var(--phone-border) #000 solid;
  box-sizing: border-box;
  border-radius: 30px;
}

.commands {
  grid-column-start: 2;
  grid-row-start: 3;
  display: flex;
  justify-content: center;
  align-items: center;
}

.commands span, .commands button {
  color: #fff;
  font-size: 20px;
  margin: 0px 10px;
}

.commands button {
  padding: 10px;
  background: transparent;
  border: #fff solid 1px;
  border-radius: 10px;
}

.commands button::selection {
  background: transparent;
  color: #fff;
}

body[data-location="bedroom"] button[data-location="bedroom"] {
  display: none;
}

body[data-location="bedroom"] .background {
  background-image: url("img/bedroom_bg.jpg");
}

body[data-location="bedroom"] .google-home span[data-location="bedroom"] {
  display: inline-flex;
}

body[data-location="living-room"] button[data-location="living-room"] {
  display: none;
}

body[data-location="living-room"] .background {
  background-image: url("img/living_room_bg.jpg");
}

body[data-location="living-room"] .google-home span[data-location="living-room"] {
  display: inline-flex;
}

body[data-location="park"] button[data-location="park"] {
  display: none;
}

body[data-location="park"] .background {
  background-image: url("img/park_bg.jpg");
  animation: bg-running-horizontal 0.6s infinite alternate, bg-running-vertical 0.3s infinite alternate;
  width: calc(100% + (var(--blur) * 4) + (var(--running-shake) * 2));
  height: calc(100% + (var(--blur) * 4) + (var(--running-shake) * 2));
}

@keyframes bg-running-horizontal {
  from {
    margin-left: 0px;
  }

  to {
    margin-left: calc(-1 * var(--running-shake));
  }
}

@keyframes bg-running-vertical {
  from {
    margin-top: 0px;
  }

  to {
    margin-top: calc(-1 * var(--running-shake));
  }
}

body[data-location="park"] .left-hand {
  display: block;
  animation: hand-slide-in 2s;
}

@keyframes hand-slide-in {
  from {
    margin-left: -1000px;
    margin-right: 1000px;
  }

  to {
    margin-left: 0px;
    margin-right: 0px;
  }
}
