/* Self-hosted fonts (SIL Open Font License) */
@font-face { font-family: "Bebas Neue"; src: url("../assets/fonts/bebas-neue-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Inter"; src: url("../assets/fonts/inter-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Inter"; src: url("../assets/fonts/inter-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Inter"; src: url("../assets/fonts/inter-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("../assets/fonts/jetbrains-mono-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("../assets/fonts/jetbrains-mono-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }

:root {
  --bg: #050d09;
  --bg-2: #0b1811;
  --ink: #e4f5dc;
  --ink-dim: rgba(228, 245, 220, 0.6);
  --line: rgba(228, 245, 220, 0.12);
  --accent: #2bb564;
  --accent-2: #0f4a2a;
  --display: "Bebas Neue", Impact, "Arial Narrow", sans-serif;
  --body: "Inter", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --gutter: clamp(16px, 4vw, 48px);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  line-height: 1.6;
  overflow-x: hidden;
}
body.has-player { padding-bottom: 96px; }
img { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }

/* Film grain overlay */
.grain {
  position: fixed; inset: -50%;
  pointer-events: none; z-index: 100; opacity: 0.07;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  animation: grain 1.2s steps(6) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); } 20% { transform: translate(-3%, 2%); }
  40% { transform: translate(2%, -4%); } 60% { transform: translate(-4%, -1%); }
  80% { transform: translate(3%, 3%); } 100% { transform: translate(0, 0); }
}

/* Nav */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px var(--gutter);
  background: linear-gradient(to bottom, rgba(5, 13, 9, 0.9), transparent);
}
.nav__brand {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; font-family: var(--display); font-size: 24px; letter-spacing: 0.08em;
}
.nav__logo { height: 32px; width: auto; filter: invert(1) sepia(0.3) hue-rotate(60deg); }
.nav__links { display: flex; gap: clamp(14px, 3vw, 32px); }
.nav__links a {
  font-family: var(--mono); font-size: 13px; text-transform: uppercase; letter-spacing: 0.12em;
  text-decoration: none; color: var(--ink-dim); transition: color 0.2s;
}
.nav__links a:hover { color: var(--accent); }

/* Hero */
.hero {
  position: relative; min-height: 100vh; min-height: 100svh;
  display: grid; place-items: center; text-align: center;
  padding: 120px var(--gutter) 80px; overflow: hidden;
}
.hero__bg {
  position: absolute; inset: -40px;
  background:
    radial-gradient(ellipse at 50% 120%, rgba(43, 181, 100, 0.3), transparent 60%),
    radial-gradient(ellipse at 20% 0%, rgba(15, 74, 42, 0.6), transparent 55%),
    var(--bg);
  background-size: cover; background-position: center;
  filter: saturate(0.9);
}
.hero__bg[style*="url"] { filter: blur(28px) brightness(0.3) saturate(1.1); }
.hero__inner { position: relative; max-width: 1000px; }
.hero__logo { width: min(380px, 70vw, 42vh); aspect-ratio: 1; object-fit: cover; margin: 0 auto 28px; border-radius: 4px; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7), 0 0 0 1px var(--line); }
.hero__title {
  font-family: var(--display); font-weight: 400;
  font-size: clamp(64px, 16vw, 220px); line-height: 0.85; letter-spacing: 0.02em;
  margin: 0;
}
.hero:not(.no-logo) .hero__title { font-size: clamp(40px, 8vw, 96px); }
.hero__tag {
  font-family: var(--mono); color: var(--ink-dim); text-transform: uppercase;
  letter-spacing: 0.2em; font-size: clamp(12px, 1.4vw, 15px); margin: 20px 0 36px;
}
.hero__cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero__scroll {
  position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%);
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.3em; text-transform: uppercase;
  color: var(--ink-dim);
}
.hero__scroll::after {
  content: ""; display: block; width: 1px; height: 36px; margin: 8px auto 0;
  background: linear-gradient(var(--ink-dim), transparent);
  animation: drip 2s ease-in-out infinite;
}
@keyframes drip { 0%, 100% { transform: scaleY(0.3); transform-origin: top; } 50% { transform: scaleY(1); } }

/* Glitch title */
.glitch { position: relative; }
.glitch::before, .glitch::after {
  content: attr(data-text); position: absolute; inset: 0; pointer-events: none;
}
.glitch::before { color: var(--accent); transform: translate(3px, 0); mix-blend-mode: screen; opacity: 0.7; animation: glitch 4s infinite steps(1); }
.glitch::after { color: #d6f7a0; transform: translate(-3px, 0); mix-blend-mode: screen; opacity: 0.35; animation: glitch 5.5s infinite reverse steps(1); }
@keyframes glitch {
  0%, 92%, 100% { clip-path: inset(0 0 100% 0); }
  93% { clip-path: inset(20% 0 60% 0); }
  95% { clip-path: inset(60% 0 10% 0); }
  97% { clip-path: inset(40% 0 40% 0); }
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 22px; border: 1px solid var(--line); border-radius: 999px;
  background: transparent; text-decoration: none;
  font-family: var(--mono); font-size: 13px; text-transform: uppercase; letter-spacing: 0.12em;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}
.btn:hover { border-color: var(--ink); transform: translateY(-1px); }
.btn--primary { background: var(--accent); border-color: var(--accent); color: #03110a; font-weight: 600; }
.btn--primary:hover { background: #3fd07b; border-color: #3fd07b; }

/* Sections */
.section { padding: clamp(72px, 10vw, 140px) var(--gutter); max-width: 1280px; margin: 0 auto; }
.section__head {
  display: flex; align-items: baseline; gap: 16px;
  border-bottom: 1px solid var(--line); padding-bottom: 16px; margin-bottom: 48px;
}
.section__head h2 {
  font-family: var(--display); font-weight: 400; font-size: clamp(44px, 7vw, 88px);
  line-height: 1; margin: 0; letter-spacing: 0.02em;
}
.section__num { font-family: var(--mono); color: var(--accent); font-size: 14px; }

/* Feature (selected song) */
.feature {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(24px, 5vw, 64px); align-items: center; margin-bottom: 64px;
}
.feature__art { position: relative; }
.feature__art > img {
  width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 4px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6), 0 0 0 1px var(--line);
}
.feature__alts { display: flex; gap: 10px; margin-top: 14px; }
.alt {
  width: 64px; height: 64px; padding: 0; border: 1px solid var(--line); border-radius: 3px;
  background: none; overflow: hidden; opacity: 0.55; transition: opacity 0.2s, border-color 0.2s;
}
.alt img { width: 100%; height: 100%; object-fit: cover; }
.alt:hover { opacity: 0.9; }
.alt.is-active { opacity: 1; border-color: var(--accent); }
.feature__label {
  font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: 0.2em; color: var(--accent);
}
.feature__title {
  font-family: var(--display); font-weight: 400; font-size: clamp(48px, 7vw, 96px);
  line-height: 0.95; margin: 8px 0 8px;
}
.feature__meta { font-family: var(--mono); color: var(--ink-dim); font-size: 13px; margin: 0 0 24px; }
.feature__viz { width: 100%; height: 72px; margin-top: 32px; display: block; }

.feature__actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.tag {
  padding: 12px 18px; border: 1px dashed var(--accent-2); border-radius: 999px;
  font-family: var(--mono); font-size: 13px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--ink-dim);
}
.tag[hidden], .btn[hidden] { display: none; }

/* Lyrics panel */
.lyrics { position: fixed; inset: 0; z-index: 80; }
.lyrics[hidden] { display: none; }
.lyrics__backdrop {
  position: absolute; inset: 0; background: rgba(2, 6, 4, 0.6); backdrop-filter: blur(3px);
  opacity: 0; transition: opacity 0.3s;
}
.lyrics__panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(460px, 100%);
  display: flex; flex-direction: column;
  background: var(--bg-2); border-left: 1px solid var(--accent-2);
  box-shadow: -30px 0 80px rgba(0, 0, 0, 0.6);
  transform: translateX(100%); transition: transform 0.3s ease;
}
.lyrics.is-open .lyrics__backdrop { opacity: 1; }
.lyrics.is-open .lyrics__panel { transform: none; }
.lyrics__head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 16px;
  padding: 28px 28px 20px; border-bottom: 1px solid var(--line);
}
.lyrics__title { font-family: var(--display); font-weight: 400; font-size: 40px; line-height: 1; margin: 6px 0 0; }
.lyrics__close {
  width: 40px; height: 40px; flex: none; border-radius: 50%;
  border: 1px solid var(--line); background: transparent; transition: border-color 0.2s, color 0.2s;
}
.lyrics__close:hover { border-color: var(--accent); color: var(--accent); }
.lyrics__body {
  flex: 1; overflow-y: auto; padding: 24px 28px 120px;
  scrollbar-width: thin; scrollbar-color: var(--accent-2) transparent;
  mask-image: linear-gradient(to bottom, transparent, #000 24px, #000 calc(100% - 80px), transparent);
}
.lyrics__text { margin: 0; white-space: pre-wrap; color: var(--ink-dim); font-size: 16px; line-height: 1.9; }

/* Track grid */
.tracks {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 20px;
}
.track__btn {
  width: 100%; padding: 0; border: 0; background: none; text-align: left;
  display: grid; grid-template-columns: auto 1fr auto; column-gap: 10px; row-gap: 10px;
}
.track__art { grid-column: 1 / -1; position: relative; overflow: hidden; border-radius: 3px; }
.track__art img { width: 100%; aspect-ratio: 1; object-fit: cover; transition: transform 0.4s, filter 0.4s; }
.track__play {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 32px; background: rgba(5, 13, 9, 0.45); opacity: 0; transition: opacity 0.2s;
}
.track__btn:hover .track__art img { transform: scale(1.04); filter: brightness(0.8); }
.track__btn:hover .track__play, .track.is-playing .track__play { opacity: 1; }
.track.is-playing .track__play { color: var(--accent); }
.track__num, .track__code { font-family: var(--mono); font-size: 12px; color: var(--ink-dim); padding-top: 3px; }
.track__title { font-weight: 500; }
.track.is-selected .track__art { outline: 2px solid var(--accent); outline-offset: 3px; }
.track.is-selected .track__num { color: var(--accent); }

/* About */
.section--about { position: relative; }
.about { max-width: 760px; }
.about .about__lead {
  font-family: var(--display); font-size: clamp(32px, 4.5vw, 56px); line-height: 1.05;
  margin: 0 0 24px; letter-spacing: 0.01em; color: var(--ink);
}
.about p { color: var(--ink-dim); font-size: 18px; }

/* Links */
.links { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.links a {
  display: flex; justify-content: space-between; align-items: center;
  padding: 22px 4px; border-bottom: 1px solid var(--line); text-decoration: none;
  font-family: var(--display); font-size: clamp(32px, 5vw, 56px); letter-spacing: 0.02em;
  transition: color 0.2s, padding 0.25s;
}
.links a:hover { color: var(--accent); padding-left: 16px; }
.links__arrow { font-size: 0.45em; transition: transform 0.25s; }
.links a:hover .links__arrow { transform: translateX(8px); }

/* Footer */
.footer {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  padding: 32px var(--gutter); border-top: 1px solid var(--line);
  font-family: var(--mono); font-size: 12px; color: var(--ink-dim); text-transform: uppercase; letter-spacing: 0.12em;
}
.footer a { text-decoration: none; }

/* Player bar */
.player {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; align-items: center; gap: 14px;
  padding: 12px var(--gutter) 16px;
  background: rgba(11, 24, 17, 0.92); backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}
.player[hidden] { display: none; }
.player__cover { width: 56px; height: 56px; object-fit: cover; border-radius: 3px; }
.player__info { display: flex; flex-direction: column; min-width: 0; }
.player__title { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player__time { font-family: var(--mono); font-size: 12px; color: var(--ink-dim); }
.player__controls { display: flex; gap: 6px; align-items: center; }
.player__controls button {
  width: 40px; height: 40px; border-radius: 50%; border: 0; background: transparent; font-size: 15px;
}
.player__controls button:hover { background: var(--line); }
.player__controls .player__play { width: 48px; height: 48px; background: var(--accent); color: #03110a; }
.player__controls .player__play:hover { background: #3fd07b; }
.player__seek {
  grid-column: 1 / -1; width: 100%; height: 3px; margin: 0;
  accent-color: var(--accent); cursor: pointer;
}
.player__msg {
  position: absolute; right: var(--gutter); top: -28px;
  font-family: var(--mono); font-size: 12px; color: var(--accent);
}

/* Responsive */
@media (max-width: 760px) {
  .feature { grid-template-columns: 1fr; }
  .tracks { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .nav__brand { font-size: 20px; }
  .nav__links a { font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .grain, .glitch::before, .glitch::after, .hero__scroll::after { animation: none; }
  html { scroll-behavior: auto; }
}
