/* ==================================================
   TYPOGRAPHY
================================================== */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
}

h1 { color: #f7f7fb; }
h2 { color: var(--color-white); font-size: 30px; }
h3 { color: var(--color-white); font-size: 22px; text-align: center; }
h4 { color: #00e6d7; font-size: 18px; }
h5 { color: #875; }

/* =========================================================
   CS HERO — Dashboard v1 (new layout)
   ========================================================= */

.cs-hero {
  --hero-radius: 24px;
  --hero-glass: rgba(18, 18, 24, 0.55);
  --hero-glass-border: rgba(255, 255, 255, 0.12);
  --hero-text: #f5f5f7;
  --hero-text-dim: rgba(245, 245, 247, 0.65);
  --hero-accent: #6c5ce7;
  --hero-accent-2: #00d2ff;
  --hero-pad: clamp(20px, 3vw, 40px);

  position: relative;
  isolation: isolate;
  min-height: clamp(340px, 42vh, 480px);
  border-radius: var(--hero-radius);
  overflow: hidden;
  color: var(--hero-text);
  background: #0d0d12;
  box-shadow:
    0 24px 60px -20px rgba(0, 0, 0, 0.65),
    inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

/* ---------- Background layer ---------- */
.cs-hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.cs-hero-cover {
  width: 100%;
  height: 100%;
  display: block;
  will-change: transform, object-position;
  transition: transform 0.6s ease, object-position 0.6s ease;
  user-select: none;
}

/* Overlay: gradient wash + vignette so text always reads */
.csx-hero__overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(
      180deg,
      rgba(10, 10, 16, 0.15) 0%,
      rgba(10, 10, 16, 0.55) 55%,
      rgba(10, 10, 16, 0.92) 100%
    ),
    radial-gradient(
      120% 90% at 15% 100%,
      rgba(108, 92, 231, 0.35) 0%,
      transparent 60%
    );
  backdrop-filter: blur(0.5px);
}

/* ---------- Inner layout: split grid ---------- */
.cs-hero__inner {
  position: relative;
  z-index: 2;
  height: 100%;
  min-height: inherit;
  padding: var(--hero-pad);

  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto 1fr auto;
  grid-template-areas:
    "identity  nowplaying"
    "headline  headline"
    "actions   actions";
  gap: clamp(16px, 2vw, 28px);
  align-items: start;
}

/* =========================================================
   IDENTITY STAGE — moves as one unit
   ========================================================= */

.cs-hero__identity {
    /* One positioning context for the whole cluster */
    position: relative;
    z-index: 3;

    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;

    /* So the engine's transform applies to the whole cluster */
    will-change: transform, left, top;
    transform-origin: center;

    /* Ensure the ring + avatar never clip each other.
       overflow MUST be visible here. */
    overflow: visible;

    /* Cursor for grab (engine may override) */
    cursor: grab;
}

.cs-hero__identity:active { cursor: grabbing; }

/* ---- Avatar ring + image: stay locked together ---- */

.cs-hero__avatar-group {
    position: relative;
    flex: 0 0 auto;

    width: 84px;
    height: 84px;
    border-radius: 50%;
    padding: 3px;

    /* The gold ring is painted HERE. The img sits inside.
       When the parent (.cs-hero__identity) moves, both
       move together as one block. */
    background:
        linear-gradient(135deg, var(--cs-gold), var(--cs-orange)) padding-box,
        linear-gradient(135deg, var(--cs-purple), var(--cs-gold)) border-box;

    box-shadow:
        0 0 0 1px rgba(245, 179, 1, 0.35),
        0 10px 30px -8px var(--cs-glow-purple),
        0 0 40px -10px var(--cs-glow-orange);

    /* Do NOT clip — but the img itself is round so nothing
       actually escapes. Keeping this visible avoids the
       "avatar slides out of a box" look if the engine ever
       transforms only the img. */
    overflow: visible;
}

.cs-hero__avatar {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    background: var(--cs-bg-2);
    opacity: 0;
    transition: opacity 0.4s ease;

    /* Explicitly NO transform of its own — engine must not
       move this node; position is inherited from stage. */
    transform: none !important;
    position: static;
}


.cs-hero__user {
  min-width: 0;
}

.cs-hero__user h2 {
  margin: 0;
  font-size: clamp(1.15rem, 2.2vw, 1.6rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cs-hero__user span {
  display: block;
  margin-top: 2px;
  font-size: 0.85rem;
  color: var(--hero-text-dim);
  font-weight: 500;
}

/* ---------- Now playing + presence (top-right cluster) ---------- */
.cs-hero__now-playing,
.cs-hero__presence,
.cs-hero__online {
  grid-area: nowplaying;
  justify-self: end;
  align-self: start;
}

.cs-hero__now-playing {
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--hero-glass);
  border: 1px solid var(--hero-glass-border);
  backdrop-filter: blur(14px) saturate(1.2);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--hero-text-dim);
  min-height: 36px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cs-hero__now-playing:empty { display: none; }

.cs-hero__presence,
.cs-hero__online {
  display: none; /* toggled by JS engine */
}

.cs-hero__online.is-online {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(0, 210, 100, 0.18);
  border: 1px solid rgba(0, 210, 100, 0.4);
  color: #4ade80;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* remove these — they were the bug */
/* .cs-hero h1 { margin-bottom: 2.2em; } */
/* .cs-hero h1 + p { transform: translateY(calc(100% + 8px)); } */

.cs-hero__headline {
  grid-area: headline;
  align-self: end;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cs-hero__headline h1 { margin: 0; }
.cs-hero__headline p  { margin: 0; max-width: 52ch; }

/* ---------- Action buttons ---------- */
.cs-artist-actions,
.cs-client-actions,
.cs-studio-actions {
  grid-area: actions;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  align-self: end;
  margin-top: 8px;
}

.cs-hero .btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 10px 20px;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease,
    border-color 0.2s ease;
  white-space: nowrap;
}

.cs-hero .btn:hover { transform: translateY(-1px); }
.cs-hero .btn:active { transform: translateY(0); }

.cs-hero .btn-primary {
  background: linear-gradient(135deg, var(--hero-accent), var(--hero-accent-2));
  color: #fff;
  box-shadow: 0 8px 22px -8px rgba(108, 92, 231, 0.7);
}

.cs-hero .btn-primary:hover {
  box-shadow: 0 12px 28px -8px rgba(108, 92, 231, 0.9);
}

.cs-hero .btn-outline {
  background: var(--hero-glass);
  border-color: var(--hero-glass-border);
  color: var(--hero-text);
  backdrop-filter: blur(10px);
}

.cs-hero .btn-outline:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.25);
}

/* ---------- Social root (badge row) ---------- */
.cs-social-anchor {
  grid-area: actions;
  justify-self: end;
  align-self: end;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ---------- Hidden inputs ---------- */
.cs-hero input[type="file"] { display: none; }

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 720px) {
  .cs-hero__inner {
    grid-template-columns: 1fr;
    grid-template-areas:
      "identity"
      "headline"
      "actions"
      "nowplaying";
    grid-template-rows: auto auto auto auto;
    gap: 14px;
  }

  .cs-hero__now-playing,
  .cs-hero__presence,
  .cs-hero__online {
    justify-self: start;
  }

  .cs-hero h1 {
    font-size: clamp(1.6rem, 7vw, 2.2rem);
    margin-bottom: 1.6em;
  }

  .cs-social-anchor { justify-self: start; }
}