/* City of cranes, adapted for PitchMeIn.
   Motion and structure from Ferran Buireu, https://codepen.io/fbuireu/pen/XBGZdd */

:root {
  --paper: #f5f8fc;
  --ink: #10233f;
  --muted: #3d5270;
  --frame: #0c2344;
  --accent: #2a62d6;
  --accent-deep: #1a4494;
  --accent-mid: #1e4fba;
  --crane: #7eb0ff;
  --crane-deep: #2a62d6;
  --leaf: #5b8def;
  --leaf-deep: #1e4fba;
  --trunk: #0c2344;
  --window: #f4f8ff;
  --crane-width: 260px;
  --crane-height: 173.333px;
  --trunk-height: 8px;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  overflow: hidden;
  font-family: Nunito, "Avenir Next", system-ui, sans-serif;
  font-size: 16px;
  color: var(--ink);
  background: var(--frame);
}

.standby {
  position: relative;
  height: 100vh;
  background: linear-gradient(to top, var(--frame) 0%, #163e86 30%, #9ec0ff 64%, var(--paper) 100%);
}

.advice {
  display: flex;
  flex-flow: column nowrap;
  justify-content: center;
  align-items: center;
  height: 50vh;
  width: 100vw;
  padding: 1.5rem;
  text-align: center;
}

.mark {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0 0.85rem;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.door-gif,
.door-still {
  width: 42px;
  height: 38px;
  flex: none;
  display: block;
}

.door-still { display: none; }

.advice h1 {
  margin: 0;
  font-size: clamp(2rem, 4.6vw, 3.25rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
}

.advice p {
  margin: 0.85rem 0 0;
  max-width: 36rem;
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  font-weight: 600;
  line-height: 1.35;
  color: var(--muted);
}

.city-stuff {
  display: flex;
  position: absolute;
  justify-content: center;
  width: 100%;
  height: 100%;
  bottom: 0;
  overflow: hidden;
  box-shadow: inset 0 -60px 0 -30px var(--accent);
  pointer-events: none;
}

.crane__list,
.skyscrappers__list,
.tree__container {
  position: absolute;
  width: 100%;
  bottom: 0;
}

.skyscrappers__list {
  height: calc(var(--crane-height) / 2);
  left: 0;
}

.skyscrapper__item {
  position: absolute;
  bottom: 0;
  z-index: 10;
  transform: rotate(180deg);
  background: linear-gradient(115deg, var(--accent) 73%, var(--accent-deep) 73%, var(--accent-deep) 100%);
}

.skyscrapper__item::after {
  content: "";
  position: absolute;
  width: 80%;
  height: 80%;
  left: 10%;
  bottom: 10%;
  background-image: radial-gradient(circle, var(--window) 0.7px, transparent 0.85px);
  background-size: 6px 8px;
}

.skyscrapper-1 {
  width: 121.33px;
  height: 138.67px;
  right: 25%;
}

.skyscrapper-2 {
  width: 60.67px;
  height: 69.33px;
  right: 35%;
  bottom: 10%;
}

.skyscrapper-3 {
  width: 40.44px;
  height: 115.56px;
  right: 45%;
}

.skyscrapper-4 {
  width: 30.33px;
  height: 86.67px;
  right: 55%;
}

.skyscrapper-4::after {
  width: 20%;
  height: 60%;
  left: 25%;
}

.skyscrapper-5 {
  width: 7%;
  height: 50%;
  right: 67%;
  z-index: 11;
  background: var(--accent);
}

.skyscrapper-5::after { height: 0; }

.crane-cabin,
.crane-arm {
  transform-origin: 80% center;
  animation: crane__movement 12s infinite alternate;
}

.crane__list {
  width: var(--crane-width);
  height: var(--crane-height);
  z-index: 0;
  perspective: 600px;
}

.crane__item {
  position: absolute;
  border: 1px solid var(--crane-deep);
  border-radius: 2px;
}

.crane-cable {
  height: 1px;
  border: none;
  outline: 1px solid transparent;
  background: var(--crane-deep);
  z-index: 0;
}

.crane-cable-1 {
  width: 60%;
  top: 0;
  left: 11%;
  transform-origin: right 0;
  animation: cable-1__movement 12s infinite alternate;
}

.crane-cable-2 {
  width: 19%;
  top: 0;
  right: 8%;
  transform-origin: top left;
  animation: cable-2__movement 12s infinite alternate;
}

.crane-cable-3 {
  width: 1px;
  height: 30%;
  top: 22%;
  left: 9%;
  transform-origin: right center;
  animation: cable-3__movement 12s ease-in-out infinite alternate;
}

.crane-cable-3::after {
  content: "";
  display: block;
  position: absolute;
  height: 0.2em;
  width: 9000%;
  bottom: 0;
  left: -4500%;
  background: var(--window);
  border: 1px solid var(--crane-deep);
}

.crane-stand {
  width: 5%;
  height: 100%;
  right: 25%;
  z-index: 1;
  background: linear-gradient(to top, var(--crane-deep), var(--crane));
}

.crane-weight {
  width: 8%;
  height: 20%;
  right: 4%;
  top: 12%;
  z-index: 2;
  background: var(--crane);
  transform-origin: 0 center;
  animation: crane-weight__movement 12s infinite alternate;
}

.crane-cabin {
  width: 12%;
  height: 9%;
  right: 24%;
  top: 20%;
  z-index: 2;
  background: var(--crane);
}

.crane-cabin::after {
  content: "";
  display: block;
  position: absolute;
  width: 100%;
  height: 10%;
  top: 60%;
  left: 0;
  background: var(--window);
}

.crane-arm {
  width: 100%;
  height: 7%;
  top: 15%;
  border-top-left-radius: 10px;
  z-index: 3;
  background: var(--crane);
}

.crane-1 { left: 20%; z-index: 10; }
.crane-2 {
  left: 30%;
  bottom: -1rem;
  z-index: -1;
  transform: scale(0.75) scaleX(-1);
}
.crane-3 {
  left: 40%;
  bottom: -0.5rem;
  z-index: 10;
  transform: scale(0.8);
}
.crane-2 .crane-cable-3 { animation-delay: 3s; }
.crane-3 .crane-cable-3 { animation-delay: 4.5s; }

.tree__container {
  height: calc(var(--crane-height) / 2 - var(--trunk-height) * 3);
  left: 0;
  margin-bottom: calc(var(--trunk-height) / 2);
}

.tree__item {
  display: flex;
  flex-flow: column nowrap;
  position: absolute;
  justify-content: flex-end;
  align-items: center;
  left: 60%;
}

.tree__trunk {
  order: 2;
  display: block;
  position: absolute;
  width: calc(var(--trunk-height) / 2);
  height: var(--trunk-height);
  margin-top: var(--trunk-height);
  border-radius: 2px;
  background: var(--trunk);
}

.tree__leaves {
  order: 1;
  position: relative;
  border-top: 0 solid transparent;
  border-right: 4px solid transparent;
  border-bottom: calc(var(--trunk-height) * 4) solid var(--leaf);
  border-left: 4px solid transparent;
}

.tree__leaves::after {
  content: "";
  position: absolute;
  height: 100%;
  left: -4px;
  border-top: 0;
  border-right: 0;
  border-bottom: calc(var(--trunk-height) * 4) solid var(--leaf-deep);
  border-left: 4px solid transparent;
}

.tree-1 { left: 66%; }
.tree-2 { left: 67%; }
.tree-4 { left: 57%; }
.tree-5 { left: 58%; }
.tree-7 { left: 51%; }
.tree-8 { left: 52%; }

@keyframes cable-1__movement {
  0%, 20% { transform: rotateY(0) rotateZ(-10deg); }
  70%, 100% { transform: rotateY(45deg) rotateZ(-10deg); }
}

@keyframes cable-2__movement {
  0%, 20% { transform: rotateY(0) rotateZ(29deg); }
  70%, 100% { transform: rotateY(15deg) rotateZ(29deg); }
}

@keyframes cable-3__movement {
  0% { transform: translate(0, 0); }
  20% { transform: translate(2500%, -18%); }
  60% { transform: translate(11000%, -25%); }
  70% { height: 30%; transform: translate(9100%, -25%); }
  90%, 100% { height: 80%; transform: translate(9100%, -15%); }
}

@keyframes crane__movement {
  0%, 20% { transform: rotateY(0); }
  70%, 100% { transform: rotateY(45deg); }
}

@keyframes crane-weight__movement {
  0%, 20% { transform: rotateY(0) translateX(0); }
  70%, 100% { transform: rotateY(45deg) translateX(-50%); }
}

@media screen and (max-width: 900px) {
  .skyscrapper-2,
  .skyscrapper-3,
  .crane-2,
  .crane-3 { display: none; }
}

@media screen and (max-width: 768px) {
  .tree-1,
  .tree-2 { display: none; }
}

@media screen and (max-width: 450px) {
  .skyscrapper-1,
  .tree-7,
  .tree-8 { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .door-gif { display: none; }
  .door-still { display: block; }
  .crane-cabin,
  .crane-arm,
  .crane-cable,
  .crane-weight { animation: none; }
}
