* {
  box-sizing: border-box;
}

:root {
  --color-bg-top-left: #FFF;
  --color-bg-bottom-right: #474447;
  --color-shadow: #080606;
  --color-numerals: #CFD8DF;
  --color-dial-base: #000;
  --color-dial-highlight: #38AFF5;
  --dim-max-width: 800px;
  --dim-min-width: calc(100vw - 40px);
  --font-size-numerals: min(5vw, 38px);
  --dim-clock-size: min(var(--dim-max-width), var(--dim-min-width));
  --dim-numerals-offset: calc(var(--dim-clock-size) * -0.415);
  --dim-dash-offset: calc(var(--dim-clock-size) * -0.462);
  --dim-dash-size: calc(var(--dim-clock-size) * 0.023);
  --dim-center-size:calc(var(--dim-clock-size) * 0.048);
  --dim-dash-width: calc(var(--dim-dash-size) * 0.2);
  --dim-hour-hand-height: calc(var(--dim-clock-size) * 0.28);
  --dim-hour-hand-width: calc(var(--dim-hour-hand-height) * 0.07);
  --dim-minute-hand-height: calc(var(--dim-clock-size) * 0.37);
  --dim-minute-hand-width: calc(var(--dim-minute-hand-height) * 0.04);
  --dim-second-hand-height: calc(var(--dim-clock-size) * 0.48);
  --dim-second-hand-width: calc(var(--dim-second-hand-height) * 0.02);
  --dim-inner-rim-size: 76%;
}

body, html {
  padding: 0;
  margin: 0;
  background-color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100vw;
  height: 100vh;
}

.clock {
  position: relative;
  aspect-ratio: 1;
  flex: 1;
  max-width: var(--dim-clock-size);
  border-radius: 50%;
  background-image: linear-gradient(to bottom right, var(--color-bg-top-left), var(--color-bg-bottom-right) 60%);
  border: 2px solid var(--color-bg-bottom-right);
  box-shadow: inset 1px 1px 1px 0px rgba(255, 255, 255, 0.25);
  overflow: hidden;
}

.outer-rim {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  position: absolute;
  margin: auto;
  width: 97%;
  aspect-ratio: 1;
  border-radius: 50%;
  background-color: transparent;
  box-shadow: inset 3px 3px 24px 16px var(--color-shadow);
}

.outer-rim {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  position: absolute;
  margin: auto;
  width: 97.5%;
  aspect-ratio: 1;
  border-radius: 50%;
  background-color: transparent;
  box-shadow: inset -1px -1px 1px 0px rgba(255, 255, 255, 0.2), inset 3px 3px 24px 16px var(--color-shadow);
}

.outer-rim--faint {
  z-index: 4;
  opacity: 0.66;
}

.inner-rim {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: var(--dim-inner-rim-size);
  aspect-ratio: 1;
  margin: auto;
  border-radius: 50%;
  box-shadow: inset 3px 3px 12px var(--color-shadow), inset -2px -2px 3px 0px rgba(255, 255, 255, 0.08), -1px -1px 2px 0 var(--color-shadow);
}

.numbers {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 0;
  height: 0;
  margin: auto;
  overflow: visible;
  font-family: Helvetica, Arial, sans-serif;
}

.numbers__number {
  color: var(--color-numerals);
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 0;
  height: 0;
  overflow: visible;
  font-size: var(--font-size-numerals);
  text-shadow: 0 0 1px var(--color-numerals);
}

.numbers__dash {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 0;
  height: 0;
  overflow: visible;
}
.numbers__dash span {
  display: block;
  width: var(--dim-dash-width);
  height: var(--dim-dash-size);
  background-color: var(--color-numerals);
  border-radius: 1px;
  flex: 1;
  color: transparent;
}

.dial {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  overflow: visible;
  width: 2px;
  height: 2px;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dial__hand {
  position: absolute;
  width: var(--dim-hour-hand-width);
  height: var(--dim-hour-hand-height);
  transform-origin: 50% 100%;
  bottom: 0;
  left: 0;
  border-radius: 3px;
  background-image: linear-gradient(to top, var(--color-dial-base), var(--color-dial-base) 40%, var(--color-dial-highlight) 40.5%);
  box-shadow: 2px 2px 12px rgba(0, 0, 0, 0.4);
}

.dial__container {
  position: absolute;
  inset: 0;
}

.dial__container--seconds {
  animation-duration: 60s;
  animation-name: rotation;
  animation-iteration-count: infinite;
  animation-timing-function: steps(480, end);
  z-index: 2;
}

.dial__container--minutes {
  animation-duration: 3600s;
  animation-name: rotation;
  animation-iteration-count: infinite;
  animation-timing-function: linear;
  z-index: 1;
}

.dial__container--hours {
  animation-duration: 43200s;
  animation-name: rotation;
  animation-iteration-count: infinite;
  animation-timing-function: linear;
  z-index: 1;
}

@keyframes rotation {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}
.dial__hand--minute {
  width: var(--dim-minute-hand-width);
  height: var(--dim-minute-hand-height);
  box-shadow: 2px 2px 8px black;
}

.dial__second {
  position: absolute;
  width: var(--dim-second-hand-width);
  height: var(--dim-second-hand-height);
  transform-origin: 50% 100%;
  bottom: 0;
  left: calc(var(--dim-second-hand-width) / -2);
  z-index: 2;
}
.dial__second::after {
  content: "";
  position: absolute;
  inset: 0;
  clip-path: polygon(0 100%, 100% 100%, 80% 0, 20% 0);
  border-radius: 12px 12px 4px 4px;
  background-image: linear-gradient(to top, #2D7287, #2D7287 10%, #F56F4F 10%, #F56F4F 40%, #EF852B 40%, #EF852B 60%, #E3BAAF 60%, #E3BAAF 76%, #FF0000 76%);
}
.dial__second::before {
  content: "";
  position: absolute;
  inset: 0;
  background-color: black;
  opacity: 0.4;
  filter: blur(3px);
}

.dial__second-back {
  position: absolute;
  width: calc(var(--dim-second-hand-width) * 3);
  height: calc(var(--dim-second-hand-height) * 0.23);
  border-radius: 10px;
  bottom: 0;
  left: calc(var(--dim-second-hand-width) * -1.5);
  z-index: 2;
  transform-origin: 50% 100%;
  background-image: linear-gradient(to top, #2D7287, #2D7287 40%, #148BA5 40%);
}

.dial__center {
  width: var(--dim-center-size);
  height: var(--dim-center-size);
  border-radius: 50%;
  position: absolute;
  background-color: #2D7287;
  z-index: 3;
}
.dial__center::before, .dial__center::after {
  position: absolute;
  inset: 20%;
  aspect-ratio: 1;
  background-color: #366269;
  content: "";
  border-radius: 50%;
  box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.66);
}
.dial__center::after {
  inset: calc(20% + 1px);
  box-shadow: inset 1px 1px 0px 0px rgba(255, 255, 255, 0.12);
}

.logo {
  position: absolute;
  width: 20%;
  aspect-ratio: 1.3;
  height: auto;
  top: 25%;
  left: 0;
  right: 0;
  margin: auto;
  z-index: 1;
}
.logo img {
  width: 100%;
  height: 100%;
}
