@import url('https://fonts.googleapis.com/css2?family=Pacifico&family=Playfair+Display:wght@700&family=Space+Mono:wght@700&family=Permanent+Marker&family=Lobster&family=Abril+Fatface&family=Bebas+Neue&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --body-bg:       #0a0a0a;
  --header-bg:     rgba(10, 10, 10, 0.8);
  --logo-color:    #f2f2f2;
  --divider-color: #3d3d3d;
  --footer-bg:     #0f0f0f;
  --footer-text:   #3d3d3d;
  --text-color:    #e0e0e0;
  --text-muted:    rgba(224, 224, 224, 0.65);
  --card-bg:       rgba(255, 255, 255, 0.03);
  --card-border:   rgba(255, 255, 255, 0.08);
}

html.light {
  --body-bg:       #f0f0f0;
  --header-bg:     rgba(240, 240, 240, 0.85);
  --logo-color:    #111111;
  --divider-color: #c0c0c0;
  --footer-bg:     #e2e2e2;
  --footer-text:   #999999;
  --text-color:    #1a1a1a;
  --text-muted:    rgba(26, 26, 26, 0.65);
  --card-bg:       rgba(0, 0, 0, 0.03);
  --card-border:   rgba(0, 0, 0, 0.08);
}

body {
  background-color: var(--body-bg);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--header-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 13px 28px;
  z-index: 1000;
  overflow: hidden;
  border-radius: 0;
  box-shadow:
    inset 0 -1px 0 rgba(255, 255, 255, 0.07),
    0 6px 28px rgba(0, 0, 0, 0),
    0 0 0 1px rgba(255, 255, 255, 0);
  transition:
    top              0.38s cubic-bezier(0.34, 1.15, 0.64, 1),
    left             0.38s cubic-bezier(0.34, 1.15, 0.64, 1),
    right            0.38s cubic-bezier(0.34, 1.15, 0.64, 1),
    padding          0.30s cubic-bezier(0.34, 1.15, 0.64, 1),
    border-radius    0.30s ease,
    background-color 0.25s ease,
    box-shadow       0.25s ease;
}

header.shrunk {
  top: 14px;
  left: calc(50% - 70px);
  right: calc(50% - 70px);
  border-radius: 40px;
  padding: 11px 14px;
  box-shadow:
    inset 0 -1px 0 rgba(255, 255, 255, 0),
    0 6px 28px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.1);
  transition:
    top              0.50s cubic-bezier(0.34, 1.6, 0.64, 1),
    left             0.25s cubic-bezier(0.34, 1, 0.64, 1),
    right            0.25s cubic-bezier(0.34, 1, 0.64, 1),
    padding          0.32s cubic-bezier(0.34, 1.08, 0.64, 1),
    border-radius    0.32s cubic-bezier(0.34, 1.08, 0.64, 1),
    background-color 0.32s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow       0.32s cubic-bezier(0.4, 0, 0.2, 1);
}

.logo {
  color: var(--logo-color);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.4px;
  white-space: nowrap;
  line-height: 1;
  height: 28px;
  overflow: hidden;
  display: flex;
  align-items: center;
  transition:
    font-size   0.38s cubic-bezier(0.34, 1.15, 0.64, 1),
    height      0.38s cubic-bezier(0.34, 1.15, 0.64, 1),
    color       0.25s ease;
}

header.shrunk .logo {
  font-size: 15px;
  height: 19px;
  transition:
    font-size  0.32s cubic-bezier(0.34, 1.08, 0.64, 1),
    height     0.32s cubic-bezier(0.34, 1.08, 0.64, 1);
}

.theme-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  color: var(--logo-color);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  opacity: 0.7;
  transition: opacity 0.2s ease, color 0.25s ease;
  line-height: 0;
  outline: none;
}

.theme-btn:hover { opacity: 1; }

.theme-btn:focus-visible {
  opacity: 1;
  outline: 2px solid rgba(91, 33, 182, 0.6);
  outline-offset: 2px;
}

.theme-btn:active {
  opacity: 0.5;
  transform: scale(0.9);
}

html.light .theme-btn:focus-visible {
  outline-color: rgba(91, 33, 182, 0.45);
}

html.light header {
  box-shadow:
    inset 0 -1px 0 rgba(0, 0, 0, 0.1),
    0 6px 28px rgba(0, 0, 0, 0),
    0 0 0 1px rgba(0, 0, 0, 0);
}

html.light header.shrunk {
  box-shadow:
    inset 0 -1px 0 rgba(0, 0, 0, 0),
    0 6px 28px rgba(0, 0, 0, 0.12),
    0 0 0 1px rgba(0, 0, 0, 0.15);
}

.divider {
  height: 1px;
  background: var(--divider-color);
  transition: background 0.25s ease;
}

.content {
  flex: 1;
  min-height: 100vh;
  padding: 48px 28px 64px;
  color: var(--text-color);
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.profile {
  display: flex;
  align-items: center;
  gap: 64px;
}
.profile-text {
  flex: 1;
}
.profile-avatar {
  width: 180px;
  height: 180px;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
  display: block;
}
.profile-heading {
  font-size: 2.4rem;
  font-weight: 800;
  margin: 0 0 14px;
  letter-spacing: -0.5px;
  line-height: 1.2;
}
.profile-name {
  background: linear-gradient(90deg, #5b21b6 0%, #ffffff 40%, #5b21b6 80%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: name-shimmer 2.4s linear infinite;
}
@keyframes name-shimmer {
  0%   { background-position: 200% center; }
  100% { background-position: 0% center; }
}
.profile-info {
  list-style: none;
  padding: 0;
  margin: 0 0 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.profile-info li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.97rem;
  color: var(--text-muted);
}
.profile-info li svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  stroke: var(--text-muted);
}
.profile-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.profile-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
  color: var(--text-muted);
  text-decoration: none;
  transition: border-color 0.2s, color 0.2s, background 0.2s, transform 0.2s;
}
.profile-link:hover {
  transform: scale(1.1);
}
.profile-link[aria-label="GitHub"]:hover {
  color: #e6edf3;
  border-color: #e6edf3;
  background: rgba(230,237,243,0.08);
}
.profile-link[aria-label="X (Twitter)"]:hover {
  color: #e7e7e7;
  border-color: #e7e7e7;
  background: rgba(231,231,231,0.08);
}
.profile-link[aria-label="Discord"]:hover {
  color: #5865f2;
  border-color: #5865f2;
  background: rgba(88,101,242,0.08);
}
.profile-link svg {
  width: 18px;
  height: 18px;
}
html.light .profile-link {
  border-color: rgba(0,0,0,0.25);
  background: rgba(255,255,255,0.7);
}
html.light .profile-link[aria-label="GitHub"]:hover {
  color: #24292f;
  border-color: rgba(91,33,182,0.35);
  background: rgba(91,33,182,0.08);
}
html.light .profile-link[aria-label="X (Twitter)"]:hover {
  color: #0f0f0f;
  border-color: rgba(91,33,182,0.35);
  background: rgba(91,33,182,0.08);
}
html.light .profile-link[aria-label="Discord"]:hover {
  color: #5865f2;
  border-color: rgba(88,101,242,0.45);
  background: rgba(88,101,242,0.08);
}

.page-wrapper {
  display: flex;
  flex-direction: column;
  gap: 28px;
  max-width: 860px;
  width: 100%;
}

.music-card.is-loading .music-card-header,
.music-card.is-loading .music-card-body,
.music-card.is-loading .music-recent-section { visibility: hidden; }

.music-card.is-error .music-card-header,
.music-card.is-error .music-card-body,
.music-card.is-error .music-recent-section { display: none; }

.music-card-error {
  display: none;
  padding: 20px 16px;
  font-size: 0.8rem;
  color: var(--text-muted, #888);
  text-align: center;
  line-height: 1.6;
}
.music-card.is-error .music-card-error {
  display: block;
}
.music-card-error a {
  color: inherit;
  text-decoration: underline;
  cursor: pointer;
}

.music-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  overflow: hidden;
  width: 100%;
  transition: background 0.25s ease, border-color 0.25s ease;
}
.music-card:not(.is-loading):hover {
  border-color: #5b21b6;
}

.music-card.is-playing {
  border-color: rgba(29, 185, 84, 0.4);
  box-shadow: 0 0 0 1px rgba(29, 185, 84, 0.15), 0 4px 24px rgba(29, 185, 84, 0.08);
}

.music-card.is-playing:hover {
  border-color: rgba(29, 185, 84, 0.65);
}
.music-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid transparent;
  border-image: linear-gradient(to right, transparent 16px, var(--card-border) 16px, var(--card-border) calc(100% - 16px), transparent calc(100% - 16px)) 1;
}
.music-card-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.music-now-dot {
  display: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #1db954;
  flex-shrink: 0;
}

.music-now-dot.is-active {
  display: block;
  animation: now-pulse 1.5s ease-in-out infinite;
}

@keyframes now-pulse {
  0%, 100% { opacity: 1;   transform: scale(1); }
  50%       { opacity: 0.4; transform: scale(0.7); }
}

.music-card-title {
  font-size: 0.97rem;
  font-weight: 700;
  color: var(--text-color);
}
.music-card-icon {
  color: var(--text-muted);
  display: flex;
}
.music-card-body {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px 16px;
}
.music-album-art {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}
.music-track-info {
  flex: 1;
  min-width: 0;
}
.music-track-name {
  font-size: 0.97rem;
  font-weight: 600;
  color: var(--text-color);
  text-decoration: none;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.2s;
}
.music-track-name:hover { color: #1db954; }
.music-artist {
  font-size: 0.87rem;
  color: var(--text-color);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.music-album-name {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.music-time {
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: 0 20px 10px;
  display: block;
}
.music-recent-section {
  border-top: 1px solid transparent;
  border-image: linear-gradient(to right, transparent 16px, var(--card-border) 16px, var(--card-border) calc(100% - 16px), transparent calc(100% - 16px)) 1;
  padding: 12px 20px 16px;
}
.music-recent-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.music-recent-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 72px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
}
.music-recent-list::-webkit-scrollbar {
  display: none;
}
.music-recent-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
}
.music-recent-num {
  color: var(--text-muted);
  width: 14px;
  flex-shrink: 0;
  text-align: right;
}
.music-recent-name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-decoration: none;
  color: var(--text-color);
  transition: color 0.2s;
}
.music-recent-name:hover { color: #1db954; }
.music-recent-artist {
  color: var(--text-muted);
  font-size: 0.82rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 130px;
}

.footer {
  background-color: var(--footer-bg);
  padding: 48px 28px;
  color: var(--footer-text);
  text-align: center;
  transition: background-color 0.25s ease, color 0.25s ease;
}

.visitor-count {
  margin: 10px 0 0;
  font-size: 0.75rem;
  color: var(--text-muted);
  opacity: 0.6;
}

.footer a {
  color: var(--text-color);
  text-decoration: none;
  font-size: 0.85rem;
  opacity: 0.75;
  transition: opacity 0.2s;
}

.footer a:hover {
  opacity: 1;
}

@media (max-width: 640px) {
  .content {
    padding: 24px 16px 48px;
  }

  .profile {
    gap: 20px;
    align-items: flex-start;
  }

  .profile-avatar {
    width: 90px;
    height: 90px;
    border-radius: 10px;
  }

  .profile-heading {
    font-size: 1.6rem;
    margin-bottom: 10px;
  }

  .music-card-header {
    padding: 12px 14px;
  }

  .music-card-body {
    padding: 12px 14px 6px;
    gap: 12px;
  }

  .music-recent-section {
    padding: 10px 14px 14px;
  }

  .music-recent-artist {
    max-width: 90px;
  }

  header.shrunk {
    left: calc(50% - 90px);
    right: calc(50% - 90px);
  }
}

/* ── Anime Card ──────────────────────────────────────────────────────────── */

.anime-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  overflow: hidden;
  width: 100%;
  transition: border-color 0.25s ease;
}
.anime-card:not(.is-loading):hover {
  border-color: #5b21b6;
}
.anime-card.is-loading .anime-scroll-wrapper {
  visibility: hidden;
  min-height: 220px;
}
.anime-card.is-error .anime-scroll-wrapper { display: none; }
.anime-card-error {
  display: none;
  padding: 20px 16px;
  font-size: 0.8rem;
  color: var(--text-muted, #888);
  text-align: center;
  line-height: 1.6;
}
.anime-card.is-error .anime-card-error { display: block; }
.anime-card-error a {
  color: inherit;
  text-decoration: underline;
  cursor: pointer;
}
.anime-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid transparent;
  border-image: linear-gradient(to right, transparent 16px, var(--card-border) 16px, var(--card-border) calc(100% - 16px), transparent calc(100% - 16px)) 1;
}
.anime-card-title {
  font-size: 0.97rem;
  font-weight: 700;
  color: var(--text-color);
}
.anime-card-icon {
  color: var(--text-muted);
  display: flex;
}
.anime-scroll-wrapper {
  padding: 16px 20px;
  overflow: hidden;
}
.anime-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  overflow-y: visible;
  scrollbar-width: none;
  cursor: grab;
  padding-top: 4px;
  padding-bottom: 4px;
  margin-top: -4px;
  user-select: none;
}
.anime-scroll::-webkit-scrollbar { display: none; }
.anime-scroll.is-dragging { cursor: grabbing; }
.anime-scroll a, .anime-scroll img { -webkit-user-drag: none; user-drag: none; }
.anime-item {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  width: 112px;
  text-decoration: none;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  overflow: hidden;
  transition: border-color 0.25s, box-shadow 0.25s, transform 0.2s;
  position: relative;
  z-index: 0;
}
.anime-item:hover {
  border-color: rgba(91, 33, 182, 0.5);
  box-shadow: 0 8px 24px rgba(91, 33, 182, 0.12);
  transform: translateY(-2px);
  z-index: 1;
}
.anime-cover-wrap {
  position: relative;
  width: 112px;
  height: 160px;
  background: var(--card-border);
  overflow: hidden;
  flex-shrink: 0;
}
.anime-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}
.anime-item:hover .anime-cover {
  transform: scale(1.06);
}
.anime-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.65) 0%, transparent 55%);
  opacity: 0;
  transition: opacity 0.25s;
  display: flex;
  align-items: flex-end;
  padding: 8px;
}
.anime-item:hover .anime-overlay { opacity: 1; }
.anime-overlay-text {
  font-size: 0.62rem;
  color: #fff;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.anime-info {
  padding: 8px 8px 10px;
  flex: 1;
}
.anime-status {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #5b21b6;
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
html.light .anime-status { color: #7c3aed; }
.anime-title {
  font-size: 0.77rem;
  font-weight: 600;
  color: var(--text-color);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.35;
}

/* ── Reveal animation ────────────────────────────────────────────────────── */
[data-reveal] {
  opacity: 0;
  transform: translateY(22px);
  transition:
    opacity  0.55s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.55s cubic-bezier(0.4, 0, 0.2, 1);
  transition-delay: var(--reveal-delay, 0ms);
}

[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  [data-reveal] {
    transition: none;
    opacity: 1;
    transform: none;
  }
}