@font-face {
  font-family: 'Euclidic Circular A';
  src: url('assets/EuclidCircularA-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body {
  font-family:
    system-ui,
    -apple-system,
    sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Remove touch/mouse highlighting and selection for visuals, but preserve
   keyboard focus with `:focus-visible` for accessibility. */
* {
  -webkit-tap-highlight-color: transparent;
}

img,
video,
button,
a,
.control-button,
.logo-pill {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

img {
  -webkit-user-drag: none;
  user-drag: none;
}

/* Remove text selection highlight color */
::selection {
  background: transparent;
}

#video-forward,
#video-reverse,
#controls {
  display: none;
}

#video-forward.loaded,
#video-reverse.loaded,
#controls.loaded {
  display: block;
}

#video-forward.loaded,
#video-reverse.loaded {
  width: 100%;
  height: auto;
  max-height: 100%;
  display: block;
}

#video-forward.hidden,
#video-reverse.hidden {
  display: none !important;
}

.video-container {
  position: relative;
  opacity: 0;
  transition: opacity 800ms ease-out;
  aspect-ratio: 320/343;
  max-width: 100%;
  max-height: 100%;
  padding-block: 2vh;
  min-height: 600px;
}
.video-container.loaded {
  opacity: 1;
}

.petals-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}
.petal-wrapper {
  position: absolute;
  width: 120px;
  height: auto;
  scale: 0.6;
  @media (min-height: 600px) and (min-width: 600px) {
    scale: 0.7;
  }
  @media (min-height: 700px) and (min-width: 700px) {
    scale: 0.8;
  }
  @media (min-height: 800px) and (min-width: 800px) {
    scale: 0.9;
  }
  &.petal-1-wrapper {
    top: 16%;
    left: 1%;
  }
  &.petal-2-wrapper {
    top: 43%;
    left: -1%;
  }
  &.petal-3-wrapper {
    top: 62%;
    left: -3%;
  }
  &.petal-4-wrapper {
    top: 76%;
    left: 16%;
  }
  &.petal-5-wrapper {
    top: 68%;
    right: 10%;
  }
  &.petal-6-wrapper {
    top: 32%;
    right: -1%;
  }
  &.petal-7-wrapper {
    top: 18%;
    right: 7%;
  }
}
.petal {
  width: 100%;
  height: auto;
  &.petal-1 {
    filter: blur(12px);
    scale: 0.6;
  }
  &.petal-2 {
    opacity: 0.77;
    scale: 0.9;
    filter: blur(7px);
  }
  &.petal-3 {
    filter: blur(1px);
  }
  &.petal-4 {
    scale: 0.8;
    filter: blur(8px);
    opacity: 0.5;
  }
  &.petal-5 {
    scale: 0.8;
    filter: blur(11px);
    opacity: 0.4;
  }
  &.petal-6 {
    scale: 0.9;
    filter: blur(1px);
  }
  &.petal-7 {
    scale: 0.7;
    opacity: 0.4;
    filter: blur(10px);
  }
}

#controls {
  position: absolute;
  bottom: 0; /* bottom set in JS */
  background: #7e58ae;
  border-radius: 50%;
  box-shadow: 0 7.273px 16.364px 7.273px rgba(0, 0, 0, 0.13);
  aspect-ratio: 1/1;
  scale: 0.75;
  height: 165px;
  left: 50%;
  translate: -50% 0;
  transition: all 180ms ease;
  &:focus-visible,
  &:hover {
    scale: 0.73;
  }
  @media (min-height: 600px) and (min-width: 600px) {
    scale: 0.8;
    &:focus-visible,
    &:hover {
      scale: 0.78;
    }
  }
  @media (min-height: 700px) and (min-width: 700px) {
    scale: 0.85;
    &:focus-visible,
    &:hover {
      scale: 0.83;
    }
  }
  @media (min-height: 800px) and (min-width: 800px) {
    scale: 1;
    &:focus-visible,
    &:hover {
      scale: 0.98;
    }
  }
}

.svg-container {
  position: absolute;
  z-index: 3;
  pointer-events: none;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  transform-origin: center center;
  @media (prefers-reduced-motion: no-preference) {
    transition: transform 300ms ease;
  }
}

.svg-container svg {
  width: 137px;
  height: 146px;
  transform: scale(0.95);
  display: block;
}

/* button says "rotate more" */
.svg-container:has(+ .control-button.playing-backward),
.svg-container:has(+ .control-button.backward-video-complete),
.svg-container:has(+ .control-button.not-yet-played:hover),
.svg-container:has(+ .control-button.not-yet-played:focus-visible) {
  transform: rotate(-15deg);
}

/* button says "rotate more" hover */
.svg-container:has(+ .control-button.playing-backward:hover),
.svg-container:has(+ .control-button.playing-backward:focus-visible),
.svg-container:has(+ .control-button.backward-video-complete:hover),
.svg-container:has(+ .control-button.backward-video-complete:focus-visible) {
  transform: rotate(0deg);
}

/* button says "rotate less" */
.svg-container:has(+ .control-button.playing-forward),
.svg-container:has(+ .control-button.forward-video-complete) {
  transform: rotate(-85deg);
}

/* button says "rotate less" hover */
.svg-container:has(+ .control-button.playing-forward:hover),
.svg-container:has(+ .control-button.playing-forward:focus-visible),
.svg-container:has(+ .control-button.forward-video-complete:hover),
.svg-container:has(+ .control-button.forward-video-complete:focus-visible) {
  transform: rotate(-90deg);
}

.control-button {
  position: absolute;
  background-color: transparent;
  top: 0;
  left: 0;
  opacity: 1;
  font-size: 1.4rem;
  color: white;
  cursor: pointer;
  border: none;
  height: 100%;
  width: 100%;
  border-radius: 50%;
  outline-offset: 5px;
}

.control-button span {
  max-width: 80%;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
  line-height: 1.1;
  font-family:
    'Euclidic Circular A',
    system-ui,
    -apple-system,
    sans-serif;
  /* macOS / WebKit */
  -webkit-font-smoothing: antialiased;
  /* Firefox on macOS */
  -moz-osx-font-smoothing: grayscale;
  /* Hint the renderer for better glyph shapes */
  text-rendering: optimizeLegibility;
}

.control-button:disabled {
  opacity: 0.4;
}

.logo-pill-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.logo-pill {
  position: relative;
  border-radius: 53px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  background: rgba(212, 212, 212, 0.1);
  box-shadow: 0 4px 9px 4px rgba(0, 0, 0, 0.13);
  backdrop-filter: blur(17.5px);
  z-index: 9;
  padding-inline: 10px;
  padding-top: 6px;
  padding-bottom: 4px;
  position: absolute;
  scale: 0.65;
  @media (min-height: 600px) and (min-width: 600px) {
    scale: 0.7;
  }
  @media (min-height: 700px) and (min-width: 700px) {
    scale: 0.8;
  }
  @media (min-height: 800px) and (min-width: 800px) {
    scale: 0.9;
  }
  &.logo-altus {
    top: 30%;
    left: 9%;
  }
  &.logo-aria {
    top: 21%;
    right: 17%;
  }
  &.logo-kontos {
    right: 19%;
    bottom: 40%;
  }
}
