/* =========================================
   CORE LAYOUT
========================================= */

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;

  background: #000;

  overflow: hidden;

  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

main {
  position: relative;

  display: flex;
  align-items: center;
  justify-content: center;

  width: 100%;
  height: 100%;
}

/* =========================================
   ICON NAVIGATOR
========================================= */

.icon-navigation {
  position: fixed;
  z-index: 20;
  top: 0;
  left: 0;

  width: 100%;

  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12pt;
  
  text-transform: uppercase;
  font-weight: bold;

  pointer-events: none;
}

.icon-navigation p {
  color: darkred;

  font-family: "Audiowide", sans-serif;
  font-size: 12pt;

  text-shadow:
    0 0 8px rgba(255, 255, 255, .08),
    0 0 16px rgba(0, 0, 0, .8);

  pointer-events: all;
  transition: color 0.25s ease;
}

.icon-navigation p.is-active {
  color: white;
}

/* =========================================
   ICON WRAPPER
========================================= */

.icon-shell {
  position: relative;

  width: 500px;
  height: 500px;

  display: flex;
  align-items: center;
  justify-content: center;

  touch-action: none;
  transform-origin: center center;

  transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: transform;
}

/* =========================================
   MAIN ICON
========================================= */

.icon {
  position: relative;

  width: 100%;
  height: 100%;

  border-radius: 50%;

  isolation: isolate;

  animation:
    introSpin 4.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;

  will-change: transform, opacity;

  transform-origin: center center;

  transform-style: flat;

  transition: transform 0.35s ease;
}

/* =========================================
   BACKGROUND IMAGE LAYER
========================================= */

.icon-body {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  overflow: hidden;
  z-index: 1;
}

.icon-body img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* =========================================
   SVG LAYER
========================================= */

.icon-svg {
  position: absolute;
  inset: 0;

  width: 100%;
  height: 100%;

  z-index: 10;

  overflow: visible;

  transform: translateZ(0);

  touch-action: manipulation;

  -webkit-transform: translateZ(0);
}

.icon-svg a {
  pointer-events: all;
  outline: none;
}

.icon-svg a:focus,
.icon-svg a:focus-visible {
  outline: none;
}

/* =========================================
   INTERACTIVE REGIONS
========================================= */

.icon-svg a {
  pointer-events: all;
}

.icon-hole {
  fill: rgba(0, 0, 0, 1);

  pointer-events: all;
  cursor: pointer;

  transition:
    fill 0.35s ease,
    filter 0.35s ease;

  filter:
    drop-shadow(0 0 3px rgba(255, 255, 255, .4));
}

/* Hover */
.icon-hole:hover,
.icon-hole.is-active {
  fill: rgba(255, 255, 255, .92);

  filter:
    drop-shadow(0 0 12px rgba(255, 255, 255, 1));
}

/* Active touch */
.icon-hole:active {
  fill: rgba(255, 255, 255, 1);
}

/* =========================================
   SCREW
========================================= */

.screw {
  position: absolute;
  z-index: 30;

  width: 40px;

  top: 50%;
  left: 50%;

  transform:
    translate(-50%, -50%);
}

.screw img {
  width: 100%;
  display: block;
}

/* =========================================
   TITLE
========================================= */

.title {
  position: fixed;

  top: 0;
  left: 50%;

  transform: translateX(-50%);

  z-index: 100;
}

.title p {
  margin: 0;

  color: silver;

  font-family: "Audiowide", sans-serif;
  font-size: 24pt;

  text-shadow:
    0 0 12px rgba(255, 255, 255, .08),
    0 0 24px rgba(0, 0, 0, .8);
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.25s ease;
}

a:hover {
  color: white;
  text-decoration: none;
}


/* =========================================
   INTRO ANIMATION
========================================= */

@keyframes introSpin {

  0% {
    opacity: 0;

    transform:
      rotate(720deg) scale(0);
  }

  20% {
    opacity: 1;

    transform:
      rotate(0deg) scale(1.2);
  }

  55% {
    transform:
      rotate(-15deg) scale(0.96);
  }

  100% {
    opacity: 1;

    transform:
      rotate(0deg) scale(1);
  }
}

/* =========================================
   MOBILE OPTIMIZATION
========================================= */

@media screen and (max-width: 768px) {

  body {
    overflow: hidden;

    touch-action: manipulation;

    -webkit-overflow-scrolling: touch;
  }

  .icon-navigation {
    justify-content: space-around;
    gap: 4pt;
  }

  .icon-navigation p {
    font-size: 9pt;
  }

  .icon-shell {
    width: 82vw;
    height: 82vw;

    max-width: 360px;
    max-height: 360px;
  }

  .title p {
    font-size: 16pt;
  }

  .screw {
    width: 22px;
  }

  .icon-hole {
    /*
      Enlarges tap reliability
      on mobile Safari
    */
    stroke: transparent;
    stroke-width: 24px;
  }
}

/* =========================================
   SMALL PHONE FIXES
========================================= */

@media screen and (max-width: 420px) {

  .icon-shell {
    width: 88vw;
    height: 88vw;
  }

  .title p {
    font-size: 14pt;
  }
}

/* =========================================
   REDUCED MOTION
========================================= */

@media (prefers-reduced-motion: reduce) {

  * {
    animation: none !important;
    transition: none !important;
  }
}

/* =========================================
   MOBILE — dynamic top-hole highlight
   Only the hole physically at 12 o'clock glows.
   All other is-active and hover states are suppressed.
========================================= */

@media screen and (max-width: 768px) {

  /* The hole currently at the top glows */
  .icon-hole.top-active {
    fill: rgba(255, 255, 255, .92);
    filter: drop-shadow(0 0 12px rgba(255, 255, 255, 1));
  }

  /* Nav label for top hole lights up */
  .icon-navigation p.top-active {
    color: white;
  }

  /* Suppress hover and is-active on mobile */
  .icon-hole:hover,
  .icon-hole.is-active {
    fill: rgba(0, 0, 0, 1);
    filter: drop-shadow(0 0 3px rgba(255, 255, 255, .4));
  }

  .icon-navigation p.is-active {
    color: darkred;
  }
}
