:root {
  --bg: #07080c;
  --text: #f0f0ee;
  --muted: rgba(240, 240, 238, 0.45);
  --faint: rgba(240, 240, 238, 0.1);
  --accent: rgba(240, 240, 238, 0.07);
  --accent-color: rgba(240, 240, 238, 0.7);
  --radius: 20px;
  --page-pad: clamp(48px, 8vw, 120px);
  --selection-bg: rgba(240, 240, 238, 0.7);
  --selection-text: #07080c;
  --lyrics-width: 320px;
  --lyrics-accent: rgba(240, 240, 238, 0.7);
}

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

html {
  scroll-behavior: smooth;
  background: #07080c;
  min-height: 100%;
}

body {
  background: var(--bg);
  background-color: #07080c;
  color: var(--text);
  font-family: 'Slade', ui-sans-serif, system-ui, sans-serif;
  min-height: 100svh;
  overflow-x: hidden;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

::selection {
  background: var(--selection-bg);
  color: var(--selection-text);
}
::-moz-selection {
  background: var(--selection-bg);
  color: var(--selection-text);
}

/* ── Animated background blobs ─────────────────────────────────────────────── */
#bg-a, #bg-b {
  position: fixed;
  top: -120px;
  bottom: -120px;
  left: -60px;
  right: -60px;
  z-index: 0;
  pointer-events: none;
  filter: blur(120px) saturate(1.3);
  transition: opacity 2.2s ease, background 2.2s ease;
  will-change: opacity;
  opacity: 0.6;
}
#bg-b { opacity: 0; }

/* Grain overlay */
body::after {
  content: '';
  position: fixed;
  inset: -200px;
  z-index: 1;
  pointer-events: none;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-size: 200px 200px;
}

/* ── Page wrapper ─────────────────────────────────────────────────────────── */
.page {
  position: relative;
  z-index: 2;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--page-pad);
}

/* ── Nav ──────────────────────────────────────────────────────────────────── */
nav {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(40px + env(safe-area-inset-top, 0px)) var(--page-pad) 40px;
  max-width: 1280px;
  margin: 0 auto;
}

.nav-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}
.nav-logo img {
  height: 28px;
  width: auto;
  display: block;
  transition: opacity 0.2s ease;
}
.nav-logo:hover img { opacity: 0.7; }

.nav-links {
  display: flex;
  gap: 10px;
  list-style: none;
  flex-wrap: wrap;
}
.nav-links a {
  display: inline-flex;
  align-items: center;
  padding: 9px 20px;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 400;
  border: 1px solid var(--faint);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
  letter-spacing: -0.01em;
}
.nav-links a:hover {
  color: var(--text);
  border-color: rgba(240, 240, 238, 0.3);
  background: var(--accent);
}

/* ── Hero Layout ─────────────────────────────────────────────────────────── */
.hero {
  padding: 80px 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: start;
}

.hero-right {
  position: relative;
}

/* ── Hero text ──────────────────────────────────────────────────────────────── */
h1 {
  font-size: clamp(64px, 9vw, 100px);
  font-weight: 400;
  line-height: 0.9;
  letter-spacing: -0.035em;
  margin-bottom: 32px;
}
h1 em {
  font-style: normal;
  color: var(--muted);
}

.hero-about {
  font-size: 18px;
  color: var(--muted);
  line-height: 1.7;
  max-width: 460px;
  font-weight: 400;
}

.hero-cta {
  margin-top: 40px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 26px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 15px;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.2s ease, border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
  font-weight: 400;
  letter-spacing: -0.01em;
  border: none;
}
.btn-primary {
  background: var(--text);
  color: var(--bg);
  border: 1px solid transparent;
}
.btn-primary:hover { opacity: 0.85; }
.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--faint);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.btn-ghost:hover {
  border-color: rgba(240, 240, 238, 0.3);
  background: var(--accent);
}

/* ── Now Playing card ──────────────────────────────────────────────────────── */
.hero-np {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 24px;
  min-width: 0;
  width: 100%;
  padding: 28px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--faint);
  border-radius: 24px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: border-color 0.4s ease;
}

.np-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 400;
  width: 100%;
}

/* Expand button in np-label */
.np-expand-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 4px;
  font-size: 11px;
  transition: color 0.2s ease;
  margin-left: auto;
}
.np-expand-btn:hover { color: var(--text); }

/* Animated dot */
.np-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(240, 240, 238, 0.2);
  flex-shrink: 0;
  transition: background 0.5s ease, box-shadow 0.5s ease;
}
.np-dot.live {
  background: #30d158;
  box-shadow: 0 0 12px rgba(48, 209, 88, 0.7);
  animation: pulse 2s ease-in-out infinite;
}
.np-dot.paused {
  background: #f5a623;
  box-shadow: 0 0 8px rgba(245, 166, 35, 0.35);
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 12px rgba(48, 209, 88, 0.7); }
  50%       { box-shadow: 0 0 4px rgba(48, 209, 88, 0.2); }
}

/* Album art */
.np-main {
  display: flex;
  align-items: center;
  gap: 20px;
  width: 100%;
  min-width: 0;
}

.np-art {
  width: 88px;
  height: 88px;
  flex-shrink: 0;
  border-radius: 50%;
  overflow: hidden;
  background: var(--faint);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: rgba(255, 255, 255, 0.15);
  user-select: none;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}
.np-art img {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  will-change: transform;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

/* Metadata */
.np-meta {
  min-width: 0;
  flex: 1;
  width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow: hidden;
}

.np-title-wrap,
.np-artist-wrap,
.np-album-wrap {
  overflow: hidden;
  width: 100%;
  white-space: nowrap;
}

.np-title {
  font-size: 24px;
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-weight: 400;
  display: inline-block;
  white-space: nowrap;
}
.np-artist {
  font-size: 15px;
  color: rgba(240, 240, 238, 0.65);
  line-height: 1.3;
  font-weight: 400;
  display: inline-block;
  white-space: nowrap;
}
.np-album {
  font-size: 13px;
  color: rgba(240, 240, 238, 0.35);
  line-height: 1.3;
  font-weight: 400;
  display: inline-block;
  white-space: nowrap;
}

/* Progress bar */
.np-progress-wrap {
  width: 100%;
  height: 3px;
  border-radius: 999px;
  background: var(--faint);
  overflow: hidden;
  margin-top: 20px;
  position: relative;
}
.np-progress-bar {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: var(--accent-color);
  transition: width 0.8s linear, background 1.5s ease;
  position: relative;
}
/* Shimmer on progress bar */
.np-progress-bar::after {
  content: '';
  position: absolute;
  top: 0;
  right: -20px;
  width: 20px;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  animation: shimmer 2s ease-in-out infinite;
}
@keyframes shimmer {
  0%, 100% { opacity: 0; }
  50% { opacity: 1; }
}

.np-times {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  margin-top: 9px;
  font-weight: 400;
  letter-spacing: 0.02em;
}

.np-source {
  font-size: 11px;
  color: rgba(240, 240, 238, 0.18);
  margin-top: 3px;
  letter-spacing: 0.02em;
}

.np-state {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--muted);
}
.np-state i { opacity: 0.4; width: 20px; text-align: center; }

.np-last-seen {
  font-size: 12px;
  color: var(--muted);
  font-weight: 400;
}

/* ── Previous Track ──────────────────────────────────────────────────────────── */
.previous-track {
  width: 100%;
  padding-top: 20px;
  border-top: 1px solid var(--faint);
}

.previous-track-label {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 400;
  margin-bottom: 16px;
}

.previous-track-main {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  min-width: 0;
}

.previous-track-art {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  border-radius: 8px;
  overflow: hidden;
  background: var(--faint);
}
.previous-track-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.previous-track-meta {
  min-width: 0;
  flex: 1;
  width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}

.previous-track-title-wrap,
.previous-track-artist-wrap,
.previous-track-album-wrap {
  overflow: hidden;
  width: 100%;
  white-space: nowrap;
}

.previous-track-title {
  font-size: 15px;
  letter-spacing: -0.015em;
  line-height: 1.2;
  font-weight: 400;
  display: inline-block;
  white-space: nowrap;
  color: rgba(240, 240, 238, 0.75);
}

.previous-track-artist {
  font-size: 13px;
  color: rgba(240, 240, 238, 0.45);
  font-weight: 400;
  display: inline-block;
  white-space: nowrap;
}

.previous-track-album {
  font-size: 12px;
  color: rgba(240, 240, 238, 0.28);
  font-weight: 400;
  display: inline-block;
  white-space: nowrap;
}

/* ── Lyrics sidebar ──────────────────────────────────────────────────────────── */
.hero-lyrics {
  position: absolute;
  left: calc(100% + 40px);
  top: 0;
  width: var(--lyrics-width);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
  min-width: 0;
}

.lyrics-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 400;
}

.lyrics-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  background: none;
  border: none;
  font-family: inherit;
  padding: 0;
  transition: color 0.2s ease;
  user-select: none;
  letter-spacing: -0.01em;
}
.lyrics-toggle:hover { color: var(--text); }
.lyrics-toggle i {
  font-size: 10px;
  transition: transform 0.3s ease;
}
.lyrics-toggle.open i { transform: rotate(180deg); }

.lyrics-content-wrap {
  overflow: hidden;
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.4s ease;
  width: 100%;
}
.lyrics-content-wrap.open {
  grid-template-rows: 1fr;
}
.lyrics-content {
  overflow: hidden;
  min-height: 0;
  width: 100%;
}

.lyrics-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 14px;
  font-size: 13px;
  color: var(--muted);
}
.lyrics-loading.hidden { display: none; }

.lyrics-text-wrap {
  position: relative;
  width: 100%;
}

.lyrics-text {
  padding-top: 14px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.9;
  font-family: inherit;
  white-space: pre-wrap;
  word-wrap: break-word;
  max-height: 400px;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.lyrics-text::-webkit-scrollbar { display: none; }
.lyrics-text.hidden { display: none; }
.lyrics-text.synced {
  white-space: normal;
  padding-top: 14px;
}

/* ── Synced lyric lines ──────────────────────────────────────────────────────── */
.lyrics-line {
  display: block;
  padding: 5px 0 5px 12px;
  border-left: 2px solid transparent;
  opacity: 0.2;
  color: var(--text);
  transform: translateX(0) scale(0.97);
  transform-origin: left center;
  transition:
    opacity 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    color 0.4s ease,
    transform 0.4s cubic-bezier(0.34, 1.2, 0.64, 1),
    border-color 0.4s ease,
    text-shadow 0.6s ease;
  will-change: transform, opacity;
  line-height: 1.55;
  font-size: 13.5px;
  cursor: default;
  border-radius: 0 4px 4px 0;
}
.lyrics-line.near-1 {
  opacity: 0.45;
  transform: translateX(0) scale(0.985);
}
.lyrics-line.near-2 {
  opacity: 0.28;
  transform: translateX(0) scale(0.975);
}
.lyrics-line.active {
  opacity: 1;
  color: var(--text);
  transform: translateX(6px) scale(1);
  border-left-color: var(--lyrics-accent);
  text-shadow: 0 0 20px var(--lyrics-accent), 0 0 40px color-mix(in srgb, var(--lyrics-accent) 35%, transparent);
}

/* ── Divider ──────────────────────────────────────────────────────────────── */
.divider {
  width: 100%;
  height: 1px;
  background: var(--faint);
  margin: 20px 0;
}

/* ── Section headers ──────────────────────────────────────────────────────── */
.section {
  padding: 80px 0;
}

.section-header {
  display: flex;
  align-items: baseline;
  gap: 18px;
  margin-bottom: 48px;
}
.section-header h2 {
  font-size: clamp(36px, 5vw, 48px);
  font-weight: 400;
  letter-spacing: -0.03em;
  line-height: 1;
}
.section-header span {
  font-size: 15px;
  color: var(--muted);
  font-weight: 400;
}

/* ── Music section ──────────────────────────────────────────────────────────── */
.music-intro {
  font-size: 16px;
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 40px;
  font-weight: 400;
}

/* ── Projects grid ──────────────────────────────────────────────────────────── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 20px;
}

.project-card {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--faint);
  border-radius: 24px;
  padding: 32px;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 16px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: background 0.25s ease, border-color 0.25s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.project-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(240, 240, 238, 0.06) 0%, transparent 70%);
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.project-card:hover::before { opacity: 1; }
.project-card:hover {
  background: rgba(255, 255, 255, 0.055);
  border-color: rgba(255, 255, 255, 0.2);
}

.project-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid var(--faint);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: var(--text);
  font-family: 'Slade', serif;
  font-weight: 400;
}
.project-icon img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.project-name {
  font-size: 20px;
  letter-spacing: -0.02em;
  line-height: 1.2;
  font-weight: 400;
}
.project-desc {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.75;
  flex: 1;
  font-weight: 400;
}
.project-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: rgba(240, 240, 238, 0.28);
  letter-spacing: 0.01em;
}
.project-footer i { font-size: 12px; }

/* ── Photography Grid ──────────────────────────────────────────────────────── */
.photography-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.photo-item {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--faint);
  aspect-ratio: 3 / 2;
  transition: border-color 0.3s ease;
}
.photo-item:hover {
  border-color: rgba(240, 240, 238, 0.2);
}
.photo-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}
.photo-item:hover img {
  transform: scale(1.04);
}

.photo-overlay {
  position: absolute;
  bottom: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}
.photo-item:hover .photo-overlay { opacity: 1; }
.photo-overlay i { font-size: 13px; color: #fff; }

.photo-item.lazy-hidden img {
  filter: blur(20px);
  transform: scale(1.06);
  transition: filter 0.6s ease, transform 0.6s ease;
}
.photo-item.lazy-loaded img {
  filter: blur(0);
  transform: scale(1);
}
.photo-item:hover.lazy-loaded img {
  transform: scale(1.04);
}

.photography-load-more {
  margin-top: 28px;
  text-align: center;
}

/* ── Lightbox ──────────────────────────────────────────────────────────────── */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.lightbox.open {
  opacity: 1;
  pointer-events: auto;
}
.lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 8px;
  user-select: none;
  -webkit-user-drag: none;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.7);
}
.lightbox-close {
  position: absolute;
  top: max(24px, env(safe-area-inset-top, 24px));
  right: max(24px, env(safe-area-inset-right, 24px));
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--text);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  transition: background 0.2s ease, border-color 0.2s ease;
  z-index: 1;
}
.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
}

/* ── Music Modal ──────────────────────────────────────────────────────────── */
.music-modal {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: var(--bg);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}
.music-modal.open {
  opacity: 1;
  pointer-events: auto;
}

/* Modal header bar */
.music-modal-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(env(safe-area-inset-top, 0px) + 24px) 40px 20px;
  background: linear-gradient(to bottom, var(--bg) 70%, transparent);
}

.music-modal-title {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 400;
  display: flex;
  align-items: center;
  gap: 10px;
}

.music-modal-close {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--faint);
  color: var(--text);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  transition: background 0.2s ease, border-color 0.2s ease;
  flex-shrink: 0;
}
.music-modal-close:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(240, 240, 238, 0.25);
}

/* Main modal body — two column on desktop */
.music-modal-inner {
  flex: 1;
  display: grid;
  grid-template-rows: auto 1fr;
  grid-template-columns: 1fr 1fr;
  grid-template-areas:
    "header header"
    "player lyrics";
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
  padding: 0 60px calc(60px + env(safe-area-inset-bottom, 0px));
  gap: 0 80px;
  align-items: start;
}

.music-modal-header {
  grid-area: header;
  padding-left: 0;
  padding-right: 0;
  position: relative;
  background: none;
}

/* Left: Now Playing */
.music-modal-np {
  grid-area: player;
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
  padding-top: 20px;
}

/* Large album art */
.music-modal-np .np-art {
  width: 100%;
  aspect-ratio: 1;
  height: auto;
  max-width: 400px;
  border-radius: 20px;
  overflow: hidden;
  background: var(--faint);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  color: rgba(255, 255, 255, 0.12);
  user-select: none;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
  margin-bottom: 32px;
}
.music-modal-np .np-art img {
  width: 100%;
  height: 100%;
  border-radius: 20px;
  object-fit: cover;
  display: block;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
  will-change: transform;
}

/* Track metadata below art */
.music-modal-np .np-meta {
  width: 100%;
  flex: unset;
}

.music-modal-np .np-title {
  font-size: 32px;
  letter-spacing: -0.025em;
  line-height: 1.05;
  margin-bottom: 4px;
}
.music-modal-np .np-artist {
  font-size: 18px;
  color: rgba(240, 240, 238, 0.65);
}
.music-modal-np .np-album {
  font-size: 14px;
  color: rgba(240, 240, 238, 0.35);
}

.music-modal-np .np-main {
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
}

.music-modal-np .np-title-wrap,
.music-modal-np .np-artist-wrap,
.music-modal-np .np-album-wrap {
  white-space: normal;
  overflow: visible;
}

.music-modal-np .np-title,
.music-modal-np .np-artist,
.music-modal-np .np-album {
  white-space: normal;
  display: block;
}

.music-modal-np .np-progress-wrap {
  margin-top: 28px;
}

.music-modal-np .np-source {
  margin-top: 6px;
}

/* Right: Lyrics */
.music-modal-lyrics {
  grid-area: lyrics;
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  padding-top: 20px;
  position: sticky;
  top: 100px;
  max-height: calc(100vh - 140px);
  overflow: hidden;
}

.music-modal-lyrics .lyrics-text {
  max-height: calc(100vh - 260px);
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.music-modal-lyrics .lyrics-text::-webkit-scrollbar { display: none; }

/* Fade mask on lyrics column */
.music-modal-lyrics .lyrics-content {
  position: relative;
}
.music-modal-lyrics .lyrics-content::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 80px;
  background: linear-gradient(to bottom, transparent, var(--bg));
  pointer-events: none;
}

/* Override lyrics toggle & content-wrap for modal to always show */
.music-modal-lyrics .lyrics-toggle { display: none; }
.music-modal-lyrics .lyrics-content-wrap {
  grid-template-rows: 1fr !important;
  overflow: visible;
  display: block;
}

/* ── Footer ──────────────────────────────────────────────────────────────── */
footer {
  position: relative;
  z-index: 2;
  padding: 48px var(--page-pad) calc(56px + env(safe-area-inset-bottom, 0px));
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}
footer .foot-left {
  font-size: 14px;
  color: var(--muted);
  font-weight: 400;
}
footer .foot-right { display: flex; gap: 20px; }
footer a {
  color: var(--muted);
  text-decoration: none;
  font-size: 20px;
  transition: color 0.2s ease;
}
footer a:hover { color: var(--text); }

/* ── Page-load entrance ──────────────────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  animation: reveal-up 0.7s ease forwards;
}
@keyframes reveal-up {
  to { opacity: 1; transform: translateY(0); }
}
.reveal-1 { animation-delay: 0.05s; }
.reveal-2 { animation-delay: 0.16s; }
.reveal-3 { animation-delay: 0.28s; }
.reveal-4 { animation-delay: 0.40s; }
.reveal-5 { animation-delay: 0.52s; }

#np-body {
  transition: opacity 0.25s ease;
  width: 100%;
  min-width: 0;
}
#np-body.fading { opacity: 0; }

/* ── Favourite song ──────────────────────────────────────────────────────── */
.fav-song {
  width: 100%;
  padding: 24px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--faint);
  border-radius: 20px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.fav-label {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 400;
  margin-bottom: 16px;
}

.fav-main {
  display: flex;
  align-items: center;
  gap: 18px;
  width: 100%;
  min-width: 0;
}

.fav-art {
  width: 72px;
  height: 72px;
  flex-shrink: 0;
  border-radius: 10px;
  overflow: hidden;
  background: var(--faint);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}
.fav-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.fav-meta {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow: hidden;
}
.fav-title {
  font-size: 20px;
  letter-spacing: -0.02em;
  line-height: 1.1;
  font-weight: 400;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fav-artist {
  font-size: 14px;
  color: rgba(240, 240, 238, 0.65);
  font-weight: 400;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fav-album {
  font-size: 12px;
  color: rgba(240, 240, 238, 0.35);
  font-weight: 400;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fav-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 14px;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  background: none;
  border: none;
  font-family: inherit;
  padding: 0;
  transition: color 0.2s ease;
  user-select: none;
  letter-spacing: -0.01em;
}
.fav-toggle:hover { color: var(--text); }
.fav-toggle i {
  font-size: 10px;
  transition: transform 0.3s ease;
}
.fav-toggle.open i { transform: rotate(180deg); }

.fav-reason-wrap {
  overflow: hidden;
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.4s ease;
}
.fav-reason-wrap.open { grid-template-rows: 1fr; }
.fav-reason { overflow: hidden; min-height: 0; }
.fav-reason p {
  padding-top: 14px;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.75;
}

/* ── Top Artist Card ──────────────────────────────────────────────────────── */
.top-artist-outer {
  width: 100%;
  margin-bottom: 32px;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--faint);
  background: rgba(255, 255, 255, 0.025);
}

/* Skeleton */
.ta-skeleton-wrap {
  width: 100%;
}

.ta-sk-hero {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.04) 75%);
  background-size: 200% 100%;
  animation: ta-shimmer 1.6s infinite;
}

@keyframes ta-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Hero — square 1:1 aspect ratio, full width */
.ta-hero {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: flex-end;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.5s ease, transform 0.5s ease;
  overflow: hidden;
}
.ta-hero.visible {
  opacity: 1;
  transform: translateY(0);
}

.ta-hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 15%;
  display: block;
}

.ta-hero-overlay {
  position: absolute;
  inset: 0;
  /* Stronger gradient at bottom for text legibility, subtle darkening at top */
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0.1) 0%,
    rgba(0,0,0,0.05) 30%,
    rgba(0,0,0,0.55) 65%,
    rgba(0,0,0,0.92) 100%
  );
}

/* Ghost album covers inside hero image */
.ta-hero-albums {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  pointer-events: none;
  z-index: 1;
}

.ta-hero-album-ghost {
  position: absolute;
  border-radius: 10px;
  overflow: hidden;
  opacity: 0.15;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  border: 1px solid rgba(255,255,255,0.08);
  transition: opacity 0.5s ease 0.2s;
}
.ta-hero.visible .ta-hero-album-ghost {
  /* opacity stays at 0.15 — defined per element below */
}

/* Three ghost albums: top-right, mid-right offset, top-left corner */
.ta-hero-album-ghost:nth-child(1) {
  width: 22%;
  aspect-ratio: 1;
  top: 6%;
  right: 5%;
  transform: rotate(6deg);
}
.ta-hero-album-ghost:nth-child(2) {
  width: 18%;
  aspect-ratio: 1;
  top: 18%;
  right: 20%;
  transform: rotate(-4deg);
}
.ta-hero-album-ghost:nth-child(3) {
  width: 15%;
  aspect-ratio: 1;
  top: 5%;
  left: 6%;
  transform: rotate(-8deg);
}

.ta-hero-album-ghost img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: inherit;
}

.ta-hero-content {
  position: relative;
  z-index: 2;
  padding: 28px 32px;
  width: 100%;
}

.ta-eyebrow {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
  font-family: 'Slade', ui-sans-serif, system-ui, sans-serif;
  font-weight: 400;
  margin-bottom: 8px;
  display: block;
}

.ta-name {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: clamp(32px, 5vw, 64px);
  line-height: 1;
  letter-spacing: -0.02em;
  color: #fff;
  margin-bottom: 8px;
}

.ta-plays {
  font-size: 12px;
  color: rgba(255,255,255,0.4);
  letter-spacing: 0.04em;
  font-family: 'Slade', ui-sans-serif, system-ui, sans-serif;
}

.ta-plays strong {
  color: rgba(255,255,255,0.75);
  font-weight: 400;
}

/* Error state */
.ta-error {
  padding: 40px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  font-family: 'Slade', ui-sans-serif, system-ui, sans-serif;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 1400px) {
  .hero-lyrics {
    left: calc(100% + 20px);
    width: 260px;
  }
}

@media (max-width: 1200px) {
  .hero { gap: 40px; }
  .hero-lyrics {
    position: static;
    width: 100%;
    margin-top: 0;
  }
  .hero-right {
    display: flex;
    flex-direction: column;
    gap: 32px;
  }

  /* Modal: single column at 1200px */
  .music-modal-inner {
    grid-template-columns: 1fr;
    grid-template-areas:
      "header"
      "player"
      "lyrics";
    padding: 0 40px calc(48px + env(safe-area-inset-bottom, 0px));
    gap: 0;
    max-width: 600px;
  }

  .music-modal-lyrics {
    position: static;
    max-height: none;
    overflow: visible;
    padding-top: 40px;
  }
  .music-modal-lyrics .lyrics-text {
    max-height: 480px;
  }
  .music-modal-lyrics .lyrics-content::after { display: none; }

  .music-modal-np .np-art {
    max-width: 280px;
  }
}

@media (max-width: 768px) {
  :root { --page-pad: 20px; }

  nav {
    padding: calc(20px + env(safe-area-inset-top, 0px)) var(--page-pad) 20px;
  }
  .nav-logo img { height: 22px; }

  .hero {
    grid-template-columns: 1fr;
    gap: 40px;
    padding: 32px 0 48px;
  }

  h1 {
    font-size: clamp(52px, 14vw, 72px);
    margin-bottom: 20px;
  }

  .hero-about { font-size: 16px; max-width: 100%; }
  .hero-cta { margin-top: 24px; gap: 10px; }

  .hero-np {
    padding: 22px;
    border-radius: 20px;
    width: 100%;
  }

  .hero-lyrics {
    position: static;
    width: 100%;
  }
  .hero-right {
    display: flex;
    flex-direction: column;
    gap: 24px;
  }

  .np-art { width: 72px; height: 72px; }
  .np-art img { width: 72px; height: 72px; }
  .np-title  { font-size: 20px; }
  .np-artist { font-size: 14px; }

  .previous-track-title { font-size: 14px; }
  .previous-track-art { width: 44px; height: 44px; }

  .fav-song { padding: 20px; }
  .fav-main { gap: 14px; }
  .fav-art { width: 60px; height: 60px; }
  .fav-title { font-size: 17px; }

  .section { padding: 48px 0; }
  .section-header { margin-bottom: 28px; flex-wrap: wrap; gap: 6px; }

  .projects-grid { grid-template-columns: 1fr; gap: 14px; }
  .project-card { padding: 22px; border-radius: 20px; }

  .photography-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  footer {
    padding: 28px var(--page-pad) calc(36px + env(safe-area-inset-bottom, 0px));
    flex-direction: column-reverse;
    align-items: center;
    gap: 14px;
    text-align: center;
  }

  /* Mobile modal */
  .music-modal-inner {
    padding: 0 20px calc(40px + env(safe-area-inset-bottom, 0px));
    max-width: 100%;
  }
  .music-modal-header {
    padding: calc(env(safe-area-inset-top, 0px) + 20px) 20px 16px;
  }
  .music-modal-np .np-art {
    max-width: 220px;
    border-radius: 16px;
    margin-bottom: 24px;
  }
  .music-modal-np .np-art img {
    border-radius: 16px;
  }
  .music-modal-np .np-title { font-size: 24px; }
  .music-modal-np .np-artist { font-size: 16px; }
  .music-modal-lyrics { padding-top: 32px; }

  /* Top artist mobile */
  .ta-hero {
    aspect-ratio: 1 / 1;
  }
  .ta-sk-hero {
    aspect-ratio: 1 / 1;
  }
  .ta-hero-content {
    padding: 20px 22px;
  }
  .ta-name {
    font-size: clamp(28px, 8vw, 48px);
  }
  /* Slightly larger ghost albums on mobile since image is smaller */
  .ta-hero-album-ghost:nth-child(1) { width: 26%; }
  .ta-hero-album-ghost:nth-child(2) { width: 22%; }
  .ta-hero-album-ghost:nth-child(3) { width: 18%; }
}

@media (max-width: 480px) {
  h1 { font-size: clamp(42px, 16vw, 58px); }

  .btn { padding: 11px 20px; font-size: 14px; }
  .nav-links a { padding: 8px 15px; font-size: 13px; }

  .np-main { gap: 14px; }
  .np-art { width: 60px; height: 60px; }
  .np-art img { width: 60px; height: 60px; }
  .np-title { font-size: 17px; }

  .photography-grid { grid-template-columns: 1fr; gap: 8px; }

  .hero-np { padding: 18px; border-radius: 18px; }
}
