/* resk.bio – public profile (also used for the sample card on the landing page) */

.profile-page {
  overflow-x: hidden;
}

/* -------------------------------------------------------------- backdrop */

.backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: var(--bg);
}

/*
 * Per-profile look. The page sets these custom properties inline (see
 * buildProfileView); the fallbacks are the defaults, also used by the sample
 * card on the landing page:
 *   --card-alpha  --card-blur  --card-radius  --bg-dim  --bg-blur  --avatar-radius
 */

/* Uploaded image or video. Blurring fades the edges, so the media is drawn
   larger than the screen by twice the blur on every side. */
.backdrop__media {
  position: absolute;
  inset: calc(var(--bg-blur, 0px) * -2);
  width: calc(100% + var(--bg-blur, 0px) * 4);
  max-width: none;
  height: calc(100% + var(--bg-blur, 0px) * 4);
  object-fit: cover;
  filter: blur(var(--bg-blur, 0px));
}

/* A YouTube track's video as the page background ("YouTube-Video als Hintergrund").
   The frame is sized to cover the screen at 16:9 and does not take clicks –
   playback is controlled from the music card. */
.backdrop__youtube {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.8s;
}

.has-video-bg .backdrop__youtube {
  opacity: 1;
}

.backdrop__youtube iframe {
  position: absolute;
  top: 50%;
  left: 50%;
  width: max(100vw, 177.78vh);
  height: max(100vh, 56.25vw);
  border: 0;
  transform: translate(-50%, -50%);
  filter: blur(var(--bg-blur, 0px));
  pointer-events: none;
}

/* Default background when nothing was uploaded: soft glows in the accent hues. */
.backdrop__aurora {
  position: absolute;
  inset: -25%;
  background:
    radial-gradient(closest-side at 30% 34%, color-mix(in srgb, var(--accent) 90%, transparent), transparent),
    radial-gradient(closest-side at 72% 30%, color-mix(in srgb, var(--glow-a) 70%, transparent), transparent),
    radial-gradient(closest-side at 56% 76%, color-mix(in srgb, var(--glow-b) 60%, transparent), transparent);
  filter: blur(80px);
  animation: drift 26s ease-in-out infinite alternate;
}

/* Darkens the background; --bg-dim (0–0.9) is the strength at the bottom edge. */
.backdrop__shade {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    120% 100% at 50% 0%,
    rgb(8 9 13 / calc(var(--bg-dim, 0.6) * 0.17)),
    rgb(8 9 13 / var(--bg-dim, 0.6))
  );
}

/* Images and videos can be bright – dim them more evenly so text on the cards stays readable. */
.backdrop__media ~ .backdrop__shade,
.has-video-bg .backdrop__shade {
  background: linear-gradient(rgb(8 9 13 / calc(var(--bg-dim, 0.6) * 0.7)), rgb(8 9 13 / var(--bg-dim, 0.6)));
}

@keyframes drift {
  from {
    transform: translate3d(-3%, -2%, 0) rotate(-4deg) scale(1);
  }
  to {
    transform: translate3d(3%, 3%, 0) rotate(5deg) scale(1.08);
  }
}

/* ----------------------------------------------------------------- stage */

.stage {
  display: grid;
  place-items: center;
  min-height: 100dvh;
  padding: 28px 16px 20px;
  perspective: 1400px;
}

.stack {
  display: grid;
  gap: 12px;
  width: min(100%, 460px);
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform 0.3s ease-out;
}

.stack > * {
  animation: rise 0.7s var(--ease) both;
}

.stack > :nth-child(2) { animation-delay: 70ms; }
.stack > :nth-child(3) { animation-delay: 140ms; }
.stack > :nth-child(4) { animation-delay: 210ms; }
.stack > :nth-child(5) { animation-delay: 280ms; }

/* Until the visitor has clicked the splash screen the cards stay parked. */
.is-waiting .stack > * {
  animation: none;
  opacity: 0;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.985);
  }
}

.card {
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--card-radius, 22px);
  background: rgb(13 15 22 / var(--card-alpha, 0.64));
  -webkit-backdrop-filter: blur(var(--card-blur, 22px)) saturate(150%);
  backdrop-filter: blur(var(--card-blur, 22px)) saturate(150%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 18px 50px -14px rgba(0, 0, 0, 0.6);
}

/* ------------------------------------------------------------------ hero */

.hero {
  padding: 38px 24px 26px;
  text-align: center;
}

.views {
  position: absolute;
  top: 14px;
  left: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-soft);
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
}

.avatar {
  display: grid;
  place-items: center;
  width: 104px;
  height: 104px;
  margin: 0 auto;
  overflow: hidden;
  border-radius: var(--avatar-radius, 50%);
  background: linear-gradient(140deg, var(--accent), var(--glow-a));
  color: var(--accent-ink);
  font-size: 2.6rem;
  font-weight: 600;
  line-height: 1;
  box-shadow:
    0 0 0 3px rgba(13, 15, 22, 0.9),
    0 0 0 5px color-mix(in srgb, var(--accent) 55%, transparent),
    0 16px 40px -10px color-mix(in srgb, var(--accent) 65%, transparent);
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero__name {
  margin-top: 18px;
  font-size: 1.7rem;
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: -0.015em;
  overflow-wrap: anywhere;
}

/* Optional glow in the accent colour ("Leuchteffekt") */
.hero__name--glow {
  text-shadow:
    0 0 14px color-mix(in srgb, var(--accent) 85%, transparent),
    0 0 38px color-mix(in srgb, var(--accent) 55%, transparent);
}

.hero__handle {
  color: var(--text-soft);
  font-size: 0.92rem;
}

.hero__tagline {
  margin-top: 12px;
  color: color-mix(in srgb, var(--accent) 62%, white);
  font-weight: 500;
  overflow-wrap: anywhere;
}

.hero__bio {
  max-width: 36ch;
  margin: 8px auto 0;
  color: #c6cadc;
  font-size: 0.95rem;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.socials {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 22px;
}

.social {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: calc(var(--card-radius, 22px) * 0.64);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  transition: transform 0.2s var(--ease), background-color 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.social .icon {
  width: 20px;
  height: 20px;
}

.social:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--accent) 60%, transparent);
  background: color-mix(in srgb, var(--accent) 22%, transparent);
  box-shadow: 0 10px 24px -10px color-mix(in srgb, var(--accent) 80%, transparent);
}

/* -------------------------------------------------------------- projects */

.projects {
  display: grid;
  gap: 12px;
}

.project {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  color: inherit;
  text-decoration: none;
  transition: transform 0.2s var(--ease), border-color 0.2s;
}

a.project:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
}

.project__logo {
  display: grid;
  place-items: center;
  flex: none;
  width: 48px;
  height: 48px;
  overflow: hidden;
  border-radius: calc(var(--card-radius, 22px) * 0.64);
  background: color-mix(in srgb, var(--accent) 16%, rgba(255, 255, 255, 0.04));
  color: color-mix(in srgb, var(--accent) 70%, white);
}

.project__logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project__logo .icon {
  width: 22px;
  height: 22px;
}

.project__body {
  display: grid;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.project__top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
}

.project__name {
  font-weight: 600;
  overflow-wrap: anywhere;
}

.badge {
  padding: 2px 8px;
  border-radius: 99px;
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: color-mix(in srgb, var(--accent) 62%, white);
  font-size: 0.72rem;
  font-weight: 550;
  white-space: nowrap;
}

.project__desc {
  display: -webkit-box;
  overflow: hidden;
  color: var(--text-soft);
  font-size: 0.88rem;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow-wrap: anywhere;
}

.project__arrow {
  flex: none;
  color: var(--text-faint);
  transition: transform 0.2s var(--ease), color 0.2s;
}

a.project:hover .project__arrow {
  color: var(--text);
  transform: translate(2px, -2px);
}

/* ---------------------------------------------------------------- player */

.player {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas:
    'play meta controls'
    'play seek seek';
  align-items: center;
  gap: 4px 14px;
  padding: 14px 16px;
}

/* YouTube's player. Hidden until a YouTube track is current; YouTube requires
   its player to stay visible and at least 200px tall while it plays. */
.player__video {
  display: none;
  grid-area: video;
  min-width: 0;
  aspect-ratio: 16 / 9;
  margin-bottom: 8px;
  overflow: hidden;
  border-radius: calc(var(--card-radius, 22px) * 0.64);
  background: #000;
}

.player.has-video {
  grid-template-areas:
    'video video video'
    'play meta controls'
    'play seek seek';
}

.player.has-video .player__video {
  display: block;
}

.player__video iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.player__video-hint {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 8px;
  height: 100%;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-soft);
  font-size: 0.86rem;
}

.player__video-hint .icon {
  width: 30px;
  height: 30px;
  color: var(--text);
}

.player__play {
  grid-area: play;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 10px 24px -8px color-mix(in srgb, var(--accent) 75%, transparent);
  transition: transform 0.15s var(--ease);
}

.player__play:hover {
  transform: scale(1.06);
}

.player__play .icon {
  width: 22px;
  height: 22px;
}

.player .icon--pause,
.player.is-playing .icon--play,
.player .icon--muted,
.player.is-muted .icon--sound {
  display: none;
}

.player.is-playing .icon--pause,
.player.is-muted .icon--muted {
  display: block;
}

.player__meta {
  grid-area: meta;
  display: grid;
  min-width: 0;
  line-height: 1.3;
}

.player__title,
.player__artist {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player__title {
  font-weight: 600;
}

.player__artist {
  color: var(--text-soft);
  font-size: 0.84rem;
}

.player__controls {
  grid-area: controls;
  display: flex;
  align-items: center;
  gap: 2px;
}

.player__btn {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  color: var(--text-soft);
  transition: color 0.15s, background-color 0.15s;
}

.player__btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.player__btn .icon {
  width: 18px;
  height: 18px;
}

.player__volume {
  display: flex;
  align-items: center;
}

/* The volume slider slides out next to the mute button on hover / keyboard focus. */
.player__volume .range {
  flex: none;
  width: 0;
  opacity: 0;
  transition: width 0.2s var(--ease), opacity 0.2s, margin 0.2s;
}

@media (hover: hover) {
  .player__volume:hover .range,
  .player__volume:focus-within .range {
    width: 68px;
    margin: 0 4px 0 8px;
    opacity: 1;
  }
}

.player__seek {
  grid-area: seek;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-soft);
  font-size: 0.76rem;
  font-variant-numeric: tabular-nums;
}

.player__seek span {
  min-width: 2.2em;
}

.player__seek span:last-child {
  text-align: right;
}

/* ---------------------------------------------------------------- splash */

.enter {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  width: 100%;
  background: rgba(8, 9, 13, 0.5);
  -webkit-backdrop-filter: blur(28px);
  backdrop-filter: blur(28px);
  color: var(--text);
  transition: opacity 0.6s, visibility 0.6s;
}

.enter__label {
  padding: 0 24px;
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  animation: breathe 2.6s ease-in-out infinite;
}

.enter.is-hidden {
  opacity: 0;
  visibility: hidden;
}

@keyframes breathe {
  50% {
    opacity: 0.45;
  }
}

/* ---------------------------------------------------------------- credit */

.credit {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 6px 0 2px;
  color: var(--text-faint);
  font-size: 0.82rem;
}

.credit a {
  color: var(--text-soft);
  text-decoration: none;
  transition: color 0.15s;
}

.credit a:hover {
  color: var(--text);
}

/* Below this width 16:9 would be shorter than the 200px YouTube asks for, so the
   height is fixed instead. (min-height + aspect-ratio would widen the card.) */
@media (max-width: 430px) {
  .player__video {
    aspect-ratio: auto;
    height: 200px;
  }
}

@media (max-width: 400px) {
  .hero {
    padding: 36px 18px 22px;
  }

  .player {
    gap: 4px 12px;
    padding: 12px 14px;
  }
}
