:root {
  --bg: #05080d;
  --bg-2: #0a1320;
  --ice: #eaf4ff;
  --ice-2: #c7def2;
  --frost: #8fb3d1;
  --deep: #4a7396;
  --muted: #6f8aa3;
  --line: rgba(200, 225, 248, 0.12);
  --line-2: rgba(200, 225, 248, 0.22);
  --glass: rgba(14, 24, 38, 0.42);
  --glass-2: rgba(180, 215, 245, 0.05);
  --radius: 26px;
  --f-display: "Unbounded", system-ui, sans-serif;
  --f-body: "Manrope", system-ui, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--ice);
  font-family: var(--f-body);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  user-select: none;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul { list-style: none; }

#scene {
  position: fixed; inset: 0;
  width: 100vw; height: 100vh;
  display: block;
  z-index: 0;
}
.vignette {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(ellipse at 50% 45%, transparent 45%, rgba(2, 4, 8, .75) 100%);
}
.grain {
  position: fixed; inset: -50%; z-index: 2; pointer-events: none; opacity: .06;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><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%, -3%); } 60% { transform: translate(-2%, -1%); }
  80% { transform: translate(3%, 3%); } 100% { transform: translate(0, 0); }
}

/* ---------- layout ---------- */
.stage {
  position: relative; z-index: 3;
  min-height: 100vh;
  display: flex; align-items: center;
  padding: 48px clamp(16px, 7vw, 120px);
  perspective: 1400px;
  pointer-events: none;
}
.card { pointer-events: auto; }

/* ---------- card ---------- */
.card {
  position: relative;
  width: min(440px, 100%);
  padding: 30px 30px 22px;
  border-radius: var(--radius);
  background:
    linear-gradient(160deg, rgba(220, 238, 255, .09), rgba(220, 238, 255, .015) 40%, rgba(120, 170, 215, .05)),
    var(--glass);
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  border: 1px solid var(--line);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .14),
    inset 0 -1px 0 rgba(255, 255, 255, .03),
    0 40px 80px -30px rgba(0, 0, 0, .7),
    0 0 0 1px rgba(0, 0, 0, .25);
  transform-style: preserve-3d;
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform .5s var(--ease);
  opacity: 0;
  translate: 0 30px;
}
body.entered .card {
  opacity: 1; translate: 0 0;
  transition: transform .5s var(--ease), opacity 1.2s var(--ease) .35s, translate 1.4s var(--ease) .35s;
}
.card.tilting { transition: transform .12s linear, opacity 1.2s var(--ease), translate 1.4s var(--ease); }

.card__sheen {
  position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0%), rgba(225, 240, 255, .12), transparent 45%);
  mix-blend-mode: screen;
}
.card__frost {
  position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: .55;
  background:
    radial-gradient(120px 60px at 0% 0%, rgba(235, 245, 255, .14), transparent 70%),
    radial-gradient(160px 80px at 100% 100%, rgba(235, 245, 255, .08), transparent 70%);
  -webkit-mask: linear-gradient(#000, #000) content-box, linear-gradient(#000, #000);
}

.card__head { display: flex; align-items: center; gap: 20px; transform: translateZ(40px); }
.avatar { position: relative; width: 92px; height: 92px; flex: none; }
.avatar img {
  width: 100%; height: 100%; object-fit: cover; border-radius: 24px; display: block;
  filter: saturate(.85) contrast(1.02);
}
.avatar__ring {
  position: absolute; inset: -5px; border-radius: 28px;
  border: 1px solid var(--line-2);
  background: conic-gradient(from var(--a, 0deg), transparent 0 70%, rgba(230, 244, 255, .55) 80%, transparent 90%) border-box;
  -webkit-mask: linear-gradient(#000 0 0) padding-box exclude, linear-gradient(#000 0 0);
          mask: linear-gradient(#000 0 0) padding-box exclude, linear-gradient(#000 0 0);
  animation: spin 6s linear infinite;
}
@property --a { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
@keyframes spin { to { --a: 360deg; } }

.name {
  font-family: var(--f-display); font-weight: 500;
  font-size: 44px; letter-spacing: -.02em; line-height: 1;
  background: linear-gradient(180deg, #ffffff 10%, #b9d4ec 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.roles {
  margin-top: 10px;
  font-family: var(--f-mono); font-size: 12px; color: var(--frost);
  display: flex; flex-wrap: wrap; gap: 4px 8px;
}
.roles i { color: var(--deep); font-style: normal; }

.block { margin-top: 26px; transform: translateZ(20px); }
.label {
  font-family: var(--f-mono); font-weight: 400; font-size: 11px;
  letter-spacing: .08em; color: var(--muted); margin-bottom: 10px; text-transform: lowercase;
}

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chips li {
  font-family: var(--f-mono); font-size: 13px;
  padding: 7px 13px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--glass-2);
  color: var(--ice-2);
  transition: border-color .3s, background .3s, color .3s;
}
.chips li:hover { border-color: var(--line-2); background: rgba(200, 228, 255, .1); color: #fff; }

.projects { display: grid; gap: 8px; }
.project {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 16px; border-radius: 16px;
  border: 1px solid var(--line); background: var(--glass-2);
  transition: background .3s, border-color .3s, transform .3s var(--ease);
}
a.project:hover { background: rgba(200, 228, 255, .09); border-color: var(--line-2); transform: translateX(4px); }
.project__name { font-weight: 600; font-size: 15px; }
.status {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--f-mono); font-size: 11px; color: var(--ice-2);
  padding: 3px 9px 3px 8px; border-radius: 999px; border: 1px solid var(--line);
}
.status b {
  width: 6px; height: 6px; border-radius: 50%; background: #d8ecff;
  box-shadow: 0 0 0 0 rgba(216, 236, 255, .5);
  animation: pulse 2.4s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(216, 236, 255, .45); }
  70% { box-shadow: 0 0 0 7px rgba(216, 236, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(216, 236, 255, 0); }
}
.arrow { margin-left: auto; width: 16px; height: 16px; fill: none; stroke: var(--frost); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform .3s var(--ease), stroke .3s; }
a.project:hover .arrow { transform: translate(2px, -2px); stroke: #fff; }
.private { margin-left: auto; font-family: var(--f-mono); font-size: 11px; color: var(--muted); }

.links { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.link {
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 12px; text-align: left;
  padding: 12px 14px; border-radius: 16px;
  border: 1px solid var(--line); background: var(--glass-2);
  transition: background .3s, border-color .3s, transform .3s var(--ease);
}
.link::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 35%, rgba(235, 246, 255, .16) 50%, transparent 65%);
  transform: translateX(-120%);
}
.link:hover { background: rgba(200, 228, 255, .09); border-color: var(--line-2); transform: translateY(-2px); }
.link:hover::after { transform: translateX(120%); transition: transform .9s var(--ease); }
.link--wide { grid-column: span 2; }
.link svg { width: 20px; height: 20px; flex: none; fill: var(--ice-2); }
.link svg.stroke { fill: none; stroke: var(--ice-2); stroke-width: 1.6; stroke-linejoin: round; }
.link span { display: flex; flex-direction: column; min-width: 0; font-size: 14px; font-weight: 500; }
.link span, .link em { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link em { font-style: normal; font-family: var(--f-mono); font-size: 10.5px; color: var(--muted); letter-spacing: .04em; margin-bottom: 2px; }

.card__foot {
  margin-top: 24px; padding-top: 14px; border-top: 1px solid var(--line);
  display: flex; justify-content: space-between;
  font-family: var(--f-mono); font-size: 11px; color: var(--muted);
}

/* ---------- player ---------- */
.player {
  position: fixed; z-index: 5; right: 28px; bottom: 28px;
  width: 392px; padding: 16px 16px 10px;
  border-radius: 24px; overflow: hidden; isolation: isolate;
  background: rgba(8, 14, 24, .58);
  backdrop-filter: blur(26px) saturate(150%);
  -webkit-backdrop-filter: blur(26px) saturate(150%);
  border: 1px solid rgba(210, 230, 250, .1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .09), 0 34px 70px -30px rgba(0, 0, 0, .85);
  opacity: 0; translate: 0 24px;
}
body.entered .player { opacity: 1; translate: 0 0; transition: opacity 1s var(--ease) .8s, translate 1.2s var(--ease) .8s; }

.player__ambient { position: absolute; inset: -30%; z-index: -1; pointer-events: none; }
.player__ambient img {
  width: 100%; height: 100%; object-fit: cover; opacity: 0;
  filter: blur(46px) saturate(.75) brightness(.6);
  transition: opacity 1.2s;
}
.player__ambient img.ok { opacity: .5; }
.player__ambient::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(7, 12, 21, .15), rgba(7, 12, 21, .75) 70%);
}

.player__body { display: grid; grid-template-columns: 104px 1fr; gap: 16px; }

.art {
  position: relative; width: 104px; height: 104px; border-radius: 14px; overflow: hidden;
  box-shadow: 0 14px 30px -12px rgba(0, 0, 0, .75), 0 0 0 1px rgba(255, 255, 255, .08);
  transform: scale(calc(1 + var(--beat, 0) * .06));
  transition: transform .08s linear;
}
.art img, .art__ph, .art__glare { position: absolute; inset: 0; width: 100%; height: 100%; }
.art img { object-fit: cover; opacity: 0; transition: opacity .6s, filter .3s; }
.art img.ok { opacity: 1; }
.art:hover img { filter: brightness(.8); }
.art__ph { background: linear-gradient(140deg, #dcecfb, #6f93b5 55%, #1b2c40); }
.art__glare { background: linear-gradient(135deg, rgba(255, 255, 255, .22), transparent 38%); pointer-events: none; }

.info { display: flex; flex-direction: column; min-width: 0; }
.info__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.eyebrow, .count {
  font-family: var(--f-mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
  white-space: nowrap;
}
.eyebrow { display: inline-flex; align-items: center; gap: 7px; min-width: 0; overflow: hidden; }
.eq { display: inline-flex; align-items: flex-end; gap: 2px; height: 9px; flex: none; }
.eq b { width: 2px; height: 3px; border-radius: 1px; background: var(--ice-2); }
.player.playing .eq b { animation: eq .9s ease-in-out infinite; }
.player.playing .eq b:nth-child(2) { animation-delay: -.3s; }
.player.playing .eq b:nth-child(3) { animation-delay: -.6s; }
@keyframes eq { 0%, 100% { height: 3px; } 50% { height: 9px; } }

.title { margin-top: 9px; overflow: hidden; white-space: nowrap; }
.title span { display: inline-block; font-family: var(--f-display); font-weight: 500; font-size: 18px; letter-spacing: -.01em; line-height: 1.25; }
.title.scroll { -webkit-mask: linear-gradient(90deg, #000 85%, transparent); mask: linear-gradient(90deg, #000 85%, transparent); }
.title.scroll span { animation: marquee 9s ease-in-out infinite alternate; }
@keyframes marquee { 0%, 15% { transform: translateX(0); } 85%, 100% { transform: translateX(var(--over)); } }
.artist { margin-top: 2px; font-size: 13px; color: var(--frost); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.ctrl { margin-top: auto; display: flex; align-items: center; gap: 2px; margin-left: -7px; }
.ctrl button {
  width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%;
  color: var(--ice-2); transition: background .25s, color .25s, transform .2s var(--ease);
}
.ctrl button:hover { background: rgba(210, 232, 255, .1); color: #fff; }
.ctrl button:active { transform: scale(.92); }
.ctrl svg { width: 18px; height: 18px; fill: currentColor; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.ctrl .ctrl__play { width: 40px; height: 40px; margin: 0 4px; background: #eef6ff; color: #0a1422; }
.ctrl .ctrl__play:hover { background: #fff; color: #0a1422; transform: scale(1.06); }
.ctrl .ctrl__play svg { stroke: none; }
.ctrl__play { position: relative; }
.ctrl__play::after {
  content: ""; position: absolute; inset: -4px; border-radius: 50%;
  border: 1.5px solid transparent; border-top-color: rgba(238, 246, 255, .9);
  opacity: 0; transition: opacity .3s;
}
.player.buffering .ctrl__play::after { opacity: 1; animation: spin-r .8s linear infinite; }
@keyframes spin-r { to { transform: rotate(360deg); } }
.i-pause { display: none; }
.player.playing .i-pause { display: block; }
.player.playing .i-play { display: none; }

.vol { margin-left: auto; display: flex; align-items: center; }
.vol svg { fill: none; }
.vol svg path:first-child { fill: currentColor; }
.vol .x { display: none; }
.player.muted .vol .w1, .player.muted .vol .w2 { display: none; }
.player.muted .vol .x { display: block; }
.vol input { -webkit-appearance: none; appearance: none; width: 62px; height: 16px; background: transparent; cursor: pointer; }
.vol input::-webkit-slider-runnable-track { height: 3px; border-radius: 3px; background: linear-gradient(90deg, var(--ice-2) var(--v, 50%), rgba(200, 225, 248, .16) var(--v, 50%)); }
.vol input::-moz-range-track { height: 3px; border-radius: 3px; background: linear-gradient(90deg, var(--ice-2) var(--v, 50%), rgba(200, 225, 248, .16) var(--v, 50%)); }
.vol input::-webkit-slider-thumb { -webkit-appearance: none; width: 11px; height: 11px; border-radius: 50%; background: #fff; margin-top: -4px; box-shadow: 0 1px 4px rgba(0, 0, 0, .4); }
.vol input::-moz-range-thumb { width: 11px; height: 11px; border: 0; border-radius: 50%; background: #fff; }

.wave { position: relative; margin-top: 16px; height: 34px; cursor: pointer; outline: none; touch-action: none; }
.wave canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.times { display: flex; justify-content: space-between; margin-top: 5px; font-family: var(--f-mono); font-size: 10.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

.next-up {
  display: flex; align-items: center; gap: 10px; width: calc(100% + 32px);
  margin: 10px -16px 0; padding: 10px 16px 2px; text-align: left;
  border-top: 1px solid rgba(210, 230, 250, .08);
}
.next-up__label { font-family: var(--f-mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); width: 46px; flex: none; }
.next-up__art { position: relative; width: 26px; height: 26px; flex: none; border-radius: 6px; overflow: hidden; background: linear-gradient(140deg, #dcecfb, #1b2c40); }
.next-up__art img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .5s; }
.next-up__art img.ok { opacity: 1; }
.next-up__text { flex: 1; min-width: 0; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.next-up__text b { font-weight: 600; }
.next-up__text i { font-style: normal; color: var(--frost); }
.next-up__text i::before { content: " · "; color: var(--muted); }
.next-up__arrow { width: 15px; height: 15px; flex: none; fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform .3s var(--ease), stroke .3s; }
.next-up:hover .next-up__arrow { transform: translateX(3px); stroke: #fff; }

.player.switching .art img, .player.switching .title, .player.switching .artist { animation: swap .38s var(--ease); }
@keyframes swap { 0% { opacity: 0; transform: translateY(6px); } 100% { opacity: 1; transform: none; } }

/* ---------- intro ---------- */
.intro {
  position: fixed; inset: 0; z-index: 20; cursor: pointer;
  display: grid; place-items: center;
  outline: none;
}
.intro canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.intro__text {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 18px;
  transition: opacity .25s;
}
.intro__name {
  font-family: var(--f-display); font-weight: 300; font-size: clamp(56px, 12vw, 140px); letter-spacing: -.03em;
  color: rgba(255, 255, 255, .92);
  text-shadow: 0 2px 40px rgba(20, 40, 70, .35);
}
.intro__hint {
  font-family: var(--f-mono); font-size: 12px; letter-spacing: .2em; color: rgba(235, 245, 255, .75);
  animation: breathe 2.6s ease-in-out infinite;
}
@keyframes breathe { 50% { opacity: .35; } }
.intro.breaking .intro__text { opacity: 0; }
.intro.gone { display: none; }

/* ---------- toast ---------- */
.toast {
  position: fixed; z-index: 30; left: 50%; top: 24px;
  translate: -50% -20px; opacity: 0;
  padding: 10px 16px; border-radius: 999px;
  font-family: var(--f-mono); font-size: 12px;
  background: rgba(14, 24, 38, .7); border: 1px solid var(--line-2);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  transition: opacity .3s, translate .4s var(--ease);
  pointer-events: none;
}
.toast.show { opacity: 1; translate: -50% 0; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .stage { align-items: flex-start; justify-content: center; padding: 38vh 16px 200px; }
  .card { padding: 24px 20px 18px; }
  .name { font-size: 38px; }
  .avatar { width: 78px; height: 78px; }
  .player { left: 12px; right: 12px; bottom: 12px; width: auto; padding: 14px 14px 8px; }
  .player__body { grid-template-columns: 84px 1fr; gap: 14px; }
  .art { width: 84px; height: 84px; }
  .title span { font-size: 16px; }
  .vol input { display: none; }
  .wave { margin-top: 12px; height: 28px; }
  .next-up { width: calc(100% + 28px); margin: 8px -14px 0; padding: 8px 14px 2px; }
  .stage { padding-bottom: 300px; }
}
@media (max-width: 380px) {
  .links { grid-template-columns: 1fr; }
  .link--wide { grid-column: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .grain, .avatar__ring, .status b, .intro__hint { animation: none; }
}
