/* ─────────────────────────────────────────────────────────────────────────────
   style.css — moe personal page
   ───────────────────────────────────────────────────────────────────────────── */

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

/* ── Base layout ─────────────────────────────────────────────────────────────── */
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,
               Ubuntu, Cantarell, sans-serif;
  background: radial-gradient(ellipse at bottom, #1B2735 0%, #090A0F 100%);
  color: #fff;
  overflow: hidden;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  -webkit-tap-highlight-color: transparent;
}

/* ── Starfield canvas (fixed, behind everything) ─────────────────────────────── */
#starfield-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* ── No-JS fallback ──────────────────────────────────────────────────────────── */
.noscript-notice {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #090A0F;
  color: #fff;
  padding: 1.5rem;
  text-align: center;
  z-index: 9999;
  font-family: sans-serif;
}

/* ── Main content container ──────────────────────────────────────────────────── */
.container {
  position: relative;
  z-index: 10;
  text-align: center;
  padding: 2rem;
  max-width: 500px;
  width: 90%;
}

/* ── Animated title ──────────────────────────────────────────────────────────── */
h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
  font-weight: 700;
  letter-spacing: 4px;
  text-transform: uppercase;
  text-shadow:
    0 0 20px rgba(255, 255, 255, 0.5),
    0 0 40px rgba(100, 150, 255, 0.3);
  transition: font-family 0.15s;
  min-height: 5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Individual letter — wave animation */
.letter {
  display: inline-block;
  animation: wave 3s ease-in-out infinite;
}

.letter:nth-child(1) { animation-delay: 0.15s; }
.letter:nth-child(2) { animation-delay: 0.08s; }

@keyframes wave {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-20px); }
}

/* Blinking cursor after the title */
.cursor {
  display: inline-block;
  width: 2px;
  height: 2.5rem;
  background: #fff;
  margin-left: 5px;
  vertical-align: middle;
  opacity: 0;
}

.cursor.visible {
  animation: blink 0.7s infinite;
}

@keyframes blink {
  0%,  49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

/* ── Link list ───────────────────────────────────────────────────────────────── */
.link-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 2rem;
}

/* Shared base for links and audio button */
.link-item,
.audio-player {
  backdrop-filter: blur(10px);
  padding: 1rem 2rem;
  border-radius: 12px;
  font-size: 1.1rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  min-height: 56px;
  touch-action: manipulation;
  user-select: none;
}

/* ── Link items ──────────────────────────────────────────────────────────────── */
.link-item {
  background: rgba(255, 255, 255, 0.08);
  border: 2px solid rgba(255, 255, 255, 0.2);
  text-decoration: none;
  color: #fff;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow:
    0 4px 15px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.link-item:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-3px);
  box-shadow:
    0 8px 25px rgba(0, 0, 0, 0.4),
    0 0 30px rgba(100, 150, 255, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.link-item:active {
  transform: translateY(-1px);
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Focus ring (keyboard nav) */
.link-item:focus-visible,
.audio-player:focus-visible {
  outline: 2px solid rgba(155, 176, 255, 0.8);
  outline-offset: 3px;
}

/* ── Icons ───────────────────────────────────────────────────────────────────── */
.link-icon {
  width: 24px;
  height: 24px;
  filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.5));
  color: transparent;      /* hide alt text colour */
  font-size: 0;            /* hide alt text size  */
  pointer-events: none;
  transition: filter 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.link-icon.broken {
  opacity: 0.4;
  filter: none;
}

/* ── Audio player button ─────────────────────────────────────────────────────── */
.audio-player {
  background: rgba(128, 128, 128, 0.15);
  border: 2px solid rgba(128, 128, 128, 0.3);
  color: rgba(255, 255, 255, 0.5);
  box-shadow:
    0 4px 15px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(128, 128, 128, 0.1);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  --volume-width: 30%;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  width: 100%;
}

.audio-player .link-icon {
  filter: drop-shadow(0 0 5px rgba(128, 128, 128, 0.3));
  position: relative;
  z-index: 2;
}

/* Loading state */
.audio-player.loading {
  opacity: 0.6;
  cursor: wait;
}

/* Playing state */
.audio-player.playing {
  background: rgba(255, 255, 255, 0.08);
  border: 2px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  box-shadow:
    0 4px 15px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.audio-player.playing .link-icon,
.audio-player.volume-mode .link-icon {
  filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.5));
}

/* Hover states */
.audio-player:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
  box-shadow:
    0 6px 20px rgba(0, 0, 0, 0.35),
    0 0 20px rgba(100, 150, 255, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.audio-player.playing:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-3px);
  box-shadow:
    0 8px 25px rgba(0, 0, 0, 0.4),
    0 0 30px rgba(100, 150, 255, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.audio-player:active,
.audio-player.playing:active {
  transform: translateY(-1px);
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Volume drag mode ────────────────────────────────────────────────────────── */
.audio-player.volume-mode {
  cursor: ew-resize !important;
  color: #fff !important;
}

.audio-player.volume-mode > * {
  position: relative;
  z-index: 2;
}

/* Fill bar showing current volume level */
.audio-player.volume-mode::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: var(--volume-width);
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.2),
    rgba(255, 255, 255, 0.35)
  );
  transition: var(--volume-transition, width 0.05s linear);
  pointer-events: none;
  z-index: 1;
}

/* Star-colour themes for volume mode (match starfield star colours) */
.audio-player.volume-mode.star-blue {
  background: rgba(155, 176, 255, 0.15);
  border-color: rgba(155, 176, 255, 0.4);
  box-shadow: 0 0 30px rgba(155, 176, 255, 0.4), inset 0 0 20px rgba(155, 176, 255, 0.1);
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.audio-player.volume-mode.star-white {
  background: rgba(235, 238, 255, 0.15);
  border-color: rgba(235, 238, 255, 0.4);
  box-shadow: 0 0 30px rgba(235, 238, 255, 0.4), inset 0 0 20px rgba(235, 238, 255, 0.1);
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.audio-player.volume-mode.star-yellow {
  background: rgba(255, 215, 100, 0.15);
  border-color: rgba(255, 215, 100, 0.4);
  box-shadow: 0 0 30px rgba(255, 215, 100, 0.4), inset 0 0 20px rgba(255, 215, 100, 0.1);
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.audio-player.volume-mode.star-orange {
  background: rgba(255, 165, 80, 0.15);
  border-color: rgba(255, 165, 80, 0.4);
  box-shadow: 0 0 30px rgba(255, 165, 80, 0.4), inset 0 0 20px rgba(255, 165, 80, 0.1);
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.audio-player.volume-mode.star-red {
  background: rgba(255, 90, 50, 0.15);
  border-color: rgba(255, 90, 50, 0.4);
  box-shadow: 0 0 30px rgba(255, 90, 50, 0.4), inset 0 0 20px rgba(255, 90, 50, 0.1);
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Progress bar ────────────────────────────────────────────────────────────── */
.progress-wrap {
  height: 3px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 2px;
  margin-top: 0.55rem;
  overflow: hidden;
  position: relative;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.3s;
}

.audio-player.playing .progress-wrap,
.audio-player.volume-mode .progress-wrap {
  opacity: 1;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 2px;
  transition: width 0.1s linear;
}

/* ── Responsive ──────────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  h1 {
    font-size: 2.5rem;
  }

  .link-item,
  .audio-player {
    font-size: 1rem;
    padding: 0.9rem 1.5rem;
    min-height: 52px;
  }
}

/* ── Reduced motion ──────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .letter {
    animation: none;
  }

  .cursor.visible {
    animation: none;
    opacity: 1;
  }

  .link-item,
  .audio-player {
    transition: none;
  }
}
