.audio-page {
  position: relative;
  width: 100%;
  height: 100vh;
  background: radial-gradient(ellipse at bottom, #1b2735 0%, #090a0f 100%);
  color: #fff;
  text-align: center;

  a {
    color: #fff;
  }

  > .page-content {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    margin: auto;
    z-index: 999;

    padding-top: 330px;

    @include media-down(lg) {
      padding-top: 50px;
      width: 95%;
    }

    .audio-intro {
      width: 100%;
      margin: auto;
      text-align: left;
      margin-bottom: 30px;

      display: grid;
      grid-template-columns: 1fr auto 1fr;
      gap: 2rem;

      > div > .neon-sign {
        position: relative;
        top: auto;
        left: auto;
        right: auto;
        bottom: auto;
        transform: none;
        margin-bottom: 40px;

        > .neon-text {
          font-size: 3rem;
          animation-delay: 2.5s;
          line-height: 1rem;

          > span {
            display: block;
            position: absolute;
            top: 50px;
            left: 50%;
            transform: rotate(110deg);
            letter-spacing: -20%;
            animation-delay: 2.3s;
          }
        }
      }

      > *:nth-child(3n + 2) {
        align-self: center;
        font-size: 3rem;
      }

      @include media-down(xl) {
        width: 100%;
        grid-template-columns: 1fr;

        > *:nth-child(3n + 2) {
          display: none;
        }
      }

      ul {
        margin-bottom: 2rem;

        li {
          margin-left: 2rem;
        }
      }

      .intro-ipod {
        float: left;
        @include media-down(lg) {
          display: none;
        }
      }

      p {
        margin-bottom: 1rem;
      }
    }

    > .neon-sign {
      position: absolute;
      top: 0;
      left: 50%;
      top: 100px;
      width: 100%;
      pointer-events: none;

      @include media-down(lg) {
        left: auto;
        top: auto;
        position: relative;
        margin-bottom: 50px;
      }

      .neon-text {
        @include media-down(lg) {
          font-size: 5rem;
        }
      }
    }
  }

  .recent-tracks-container {
    width: 100%;
    margin: 0 auto 100px;

    padding-bottom: 15px;
    border-bottom: 2px solid transparent;
    border-image: linear-gradient(90deg, #ff00ff, #00ffff) 1;

    .audio-sub-header {
      width: 100%;
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 20px;
      padding-bottom: 15px;
      border-bottom: 2px solid transparent;
      border-image: linear-gradient(90deg, #00ffff, #ff00ff) 1;

      h3 {
        margin: 0;
        font-size: 1.5rem;
        color: #fff;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 2px;
      }

      .lastfm-link {
        color: #999;
        text-decoration: none;
        font-size: 0.9rem;
        transition: color 0.3s ease;

        &:hover {
          color: #ff00ff;
        }
      }
    }

    @include media-down(lg) {
      width: 100%;
    }

    .recent-tracks-list {
      display: grid;
      grid-template-columns: repeat(5, 1fr);
      gap: 20px;

      @include media-down(lg) {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
      }

      @include media-down(md) {
        grid-template-columns: 1fr;
      }
    }

    .track-loading {
      grid-column: 1 / -1;
      text-align: center;
      color: #999;
      padding: 40px 20px;
      font-size: 0.9rem;
      font-style: italic;
    }

    .recent-track {
      display: flex;
      flex-direction: column;
      gap: 12px;
      padding: 15px;
      background: rgba(0, 0, 0, 0.6);
      border: 2px solid #333;
      border-radius: 8px;
      transition: all 0.3s ease;
      text-decoration: none;
      color: inherit;
      position: relative;

      @include media-down(lg) {
        display: grid;
        grid-template-columns: auto 1fr;
      }

      .track-cover {
        @include media-down(lg) {
          max-width: 100px;
        }
        @include media-down(md) {
          max-width: 60px;
        }
      }

      .track-details {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
      }

      &:hover {
        border-color: #00ffff;
        box-shadow: 0 0 20px rgba(0, 255, 255, 0.3);
        transform: translateY(-5px);

        .track-title {
          color: #00ffff;
        }
      }

      &.now-playing {
        border-color: #ff00ff;
        background: rgba(255, 0, 255, 0.1);
        box-shadow: 0 0 25px rgba(255, 0, 255, 0.4);

        &::before {
          content: "♫ NOW PLAYING";
          position: absolute;
          top: -10px;
          left: 50%;
          transform: translateX(-50%);
          font-size: 0.65rem;
          color: #ff00ff;
          background: #0d0d0d;
          padding: 4px 10px;
          border-radius: 10px;
          text-transform: uppercase;
          letter-spacing: 1px;
          font-weight: 700;
          white-space: nowrap;
          border: 1px solid #ff00ff;
        }

        .track-cover {
          box-shadow: 0 0 20px rgba(255, 0, 255, 0.5);
        }
      }

      .track-cover {
        width: 100%;
        aspect-ratio: 1/1;
        border-radius: 6px;
        overflow: hidden;
        background: #0a0a0a;
        transition: box-shadow 0.3s ease;

        img {
          width: 100%;
          height: 100%;
          object-fit: cover;
        }

        &.no-art {
          display: flex;
          align-items: center;
          justify-content: center;
          border: 2px dashed #333;

          .cover-placeholder {
            font-size: 2rem;
            color: #555;
          }
        }
      }

      .track-details {
        display: flex;
        flex-direction: column;
        gap: 6px;

        .track-title {
          font-size: 0.9rem;
          font-weight: 600;
          color: #fff;
          transition: color 0.3s ease;
          overflow: hidden;
          text-overflow: ellipsis;
          display: -webkit-box;
          -webkit-line-clamp: 2;
          -webkit-box-orient: vertical;
          line-height: 1.3;
        }

        .track-artist {
          font-size: 0.8rem;
          color: #999;
          overflow: hidden;
          text-overflow: ellipsis;
          white-space: nowrap;
        }
      }
    }
  }

  .record-shelf-container {
    .shelf {
      display: flex;
      gap: 5%;
      position: relative;
      overflow: visible;
      padding-left: 5%;
      padding-right: 5%;

      .neon-sign {
        position: absolute;
        width: 200px;
        left: -90px;
        top: 50px;

        > .neon-text {
          font-size: 3em;
          line-height: 2.5rem;
        }
      }
    }

    .shelf::before {
      content: "";
      position: absolute;
      bottom: -10px;
      left: 0;
      right: 0;
      height: 10px;
      background: linear-gradient(
        to bottom,
        #6b4423 0%,
        #4a2f1a 50%,
        #2d1b0e 100%
      );
      border-radius: 0 0 6px 6px;
      box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    }

    .record-slot {
      position: relative;
      width: 20%;
      min-width: 100px;
      aspect-ratio: 1/1;
    }

    .record-sleeve {
      width: 100%;
      height: 100%;
      position: relative;
      transition: transform 0.3s ease;

      &.active {
        .sleeve-front {
          border: 3px solid white;
        }
      }
    }

    .sleeve-front {
      width: 100%;
      height: 100%;
      aspect-ratio: 1/1;
      position: absolute;
      border-radius: 2px;
      box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.3),
        inset 0 0 20px rgba(0, 0, 0, 0.2);
      display: flex;
      align-items: center;
      justify-content: center;
      font-weight: bold;
      color: white;
      text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
      padding: 10px;
      text-align: center;
      background-image: var(--album-cover);
      background-size: cover;
      background-position: center;
      transition: transform 0.3s ease;
      z-index: 99;

      .album-title {
        font-size: 16px;
        opacity: 0;
      }

      &:hover {
        .album-title {
          opacity: 1;
        }
      }
    }

    .vinyl-record {
      position: absolute;
      width: 95%;
      height: 95%;
      border-radius: 50%;
      top: 2%;
      right: 2%;
      background:
        radial-gradient(circle at center, #1a1a1a 30%, transparent 30%),
        conic-gradient(
          from 0deg,
          #0f0f0f 0deg,
          #1a1a1a 45deg,
          #0f0f0f 90deg,
          #1a1a1a 135deg,
          #0f0f0f 180deg,
          #1a1a1a 225deg,
          #0f0f0f 270deg,
          #1a1a1a 315deg,
          #0f0f0f 360deg
        );
      box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
      z-index: 1;
      transition: transform 0.3s ease;
    }

    .vinyl-record::before {
      content: "";
      position: absolute;
      width: 35%;
      height: 35%;
      border-radius: 50%;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      background: radial-gradient(
        circle,
        #000 0%,
        #ff4444 10%,
        #cc0000 50%,
        #1a1a1a 50%,
        #0f0f0f 100%
      );
    }

    .vinyl-record::after {
      content: "";
      position: absolute;
      transform: translateX(-50%);
      width: 100%;
      height: 100%;
      border-radius: 50%;
      background: repeating-radial-gradient(
        circle at center,
        transparent 0px,
        transparent 2px,
        rgba(255, 255, 255, 0.03) 2px,
        rgba(255, 255, 255, 0.03) 3px
      );
    }

    .record-slot:hover .vinyl-record {
      transform: translateX(20%);
    }

    .record-slot:hover .sleeve-front {
      transform: translateX(-10%);
    }
  }

  .audio-shelf-text {
    width: 60%;
    margin: auto;
    margin-top: 50px;
    margin-bottom: 50px;
    text-align: left;
    border: 1px solid white;

    padding: 30px;
    border-radius: 10px;
    backdrop-filter: blur(10px);
    background-color: rgba(255, 255, 255, 0.1);

    @include media-down(lg) {
      width: 100%;
      padding: 10px;
    }

    p {
      margin-bottom: 1rem;
    }
  }

  .audio-gear {
    margin: 2rem 0;

    > .neon-sign {
      position: relative;
      top: auto;
      left: auto;
      right: auto;
      bottom: auto;
      transform: none;
      margin-bottom: 90px;

      > .neon-text {
        font-size: 5rem;
        animation-delay: 2.5s;
        line-height: 1rem;

        > span {
          display: block;
          position: absolute;
          top: 50px;
          left: 50%;
          transform: rotate(80deg);
          letter-spacing: -20%;
          animation-delay: 2.3s;
        }
      }
    }

    .gear-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
      gap: 1.5rem;
      margin-top: 1.5rem;

      @media (max-width: 768px) {
        grid-template-columns: 1fr;
      }

      .gear-item {
        backdrop-filter: blur(10px);
        background-color: rgba(255, 255, 255, 0.1);
        border: 1px solid white;
        border-radius: 4px;
        padding: 1.5rem;
        transition: all 0.3s ease;
        display: flex;
        flex-direction: column;
        gap: 1rem;

        &:hover {
          transform: translateY(-2px);
        }

        .gear-icon {
          font-size: 2rem;
          text-align: center;
        }

        .gear-content {
          display: flex;
          flex-direction: column;
          gap: 0.5rem;
          flex: 1;
        }
      }
    }

    .gear-title {
      font-size: 1.2rem;
      margin: 0;
      color: var(--neon-cyan);
      font-family: var(--mono-font, monospace);
    }

    .gear-category {
      font-size: 0.85rem;
      color: var(--neon-magenta);
      text-transform: uppercase;
      letter-spacing: 0.05em;
      opacity: 0.8;
    }

    .gear-summary {
      font-size: 0.9rem;
      line-height: 1.5;
      opacity: 0.85;
      margin: 0.5rem 0;
      flex: 1;
    }

    .gear-link {
      color: var(--neon-cyan);
      text-decoration: none;
      font-size: 0.9rem;
      margin-top: auto;
      transition: color 0.3s ease;

      &:hover {
        color: var(--neon-magenta);
        text-decoration: underline;
      }
    }
  }
}

.starfield-full {
  position: fixed;
  inset: 0;
  height: 100%;
  background: linear-gradient(180deg, #0a0f1a 0%, #1a2a3a 50%, #2a3a52);

  > .buildings-bg {
    position: fixed;
    bottom: 0;
    left: 15%;
    height: 40%;
    width: 50%;
    z-index: 2;

    @include media-down(lg) {
      width: 100%;
      left: 0;
    }
  }
}

.star {
  position: absolute;
  width: 2px;
  height: 2px;
  background: white;
  border-radius: 50%;
  animation: twinkle linear infinite;
}

.star.small {
  width: 1px;
  height: 1px;
}

.star.medium {
  width: 2px;
  height: 2px;
}

.star.large {
  width: 3px;
  height: 3px;
  box-shadow: 0 0 4px rgba(255, 255, 255, 0.5);
}

@keyframes twinkle {
  0%,
  100% {
    opacity: 0.3;
  }
  50% {
    opacity: 1;
  }
}
