/* NekoChat — Studio tier (loads after enterprise.css) */

:root {
  --mx: 50%;
  --my: 42%;
  --font-display: 'Syne', system-ui, sans-serif;
  --font-body: 'DM Sans', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --studio-ease: cubic-bezier(0.16, 1, 0.3, 1);
  --studio-ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --elev-1: 0 1px 2px rgba(0, 0, 0, 0.45);
  --elev-2: 0 8px 24px rgba(0, 0, 0, 0.35), 0 2px 8px rgba(0, 0, 0, 0.2);
  --elev-3: 0 24px 80px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.06);
  --specular: inset 0 1px 0 rgba(255, 255, 255, 0.14), inset 0 -1px 0 rgba(0, 0, 0, 0.12);
  --liquid-blur: 32px;
  --liquid-sat: 1.45;
}

html {
  font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
}

body {
  font-family: var(--font-body), var(--font);
  letter-spacing: -0.011em;
  background-color: #020204 !important;
  background-image:
    linear-gradient(180deg, rgba(8, 6, 22, 0.97) 0%, rgba(2, 2, 6, 1) 55%, #010103 100%) !important;
}

body::before {
  opacity: 0.35 !important;
}

/* Interactive spotlight (uses --mx/--my from JS) */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(ellipse 100% 85% at var(--mx) var(--my), rgba(139, 92, 246, 0.18), transparent 55%);
  mix-blend-mode: screen;
  transition: opacity 0.5s ease;
}

/* Ambient canvas — animated chromatic blobs */
.ambient-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  contain: strict;
}

.ambient-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.55;
  will-change: transform;
  mix-blend-mode: screen;
}

.ambient-blob-a {
  width: min(72vw, 720px);
  height: min(72vw, 720px);
  left: -15%;
  top: -18%;
  background: radial-gradient(circle at 40% 40%, rgba(167, 139, 250, 0.9), rgba(99, 102, 241, 0.35) 45%, transparent 70%);
  animation: blobDriftA 28s ease-in-out infinite;
}

.ambient-blob-b {
  width: min(65vw, 620px);
  height: min(65vw, 620px);
  right: -12%;
  bottom: -8%;
  background: radial-gradient(circle at 55% 45%, rgba(56, 189, 248, 0.45), rgba(99, 102, 241, 0.25) 50%, transparent 68%);
  animation: blobDriftB 32s ease-in-out infinite;
  animation-delay: -6s;
}

.ambient-blob-c {
  width: min(50vw, 480px);
  height: min(50vw, 480px);
  left: 35%;
  bottom: 15%;
  background: radial-gradient(circle at 50% 50%, rgba(244, 114, 182, 0.22), rgba(139, 92, 246, 0.12) 55%, transparent 70%);
  animation: blobDriftC 24s ease-in-out infinite;
  animation-delay: -12s;
}

@keyframes blobDriftA {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(8%, 6%) scale(1.08); }
  66% { transform: translate(-4%, 10%) scale(0.96); }
}

@keyframes blobDriftB {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-10%, -8%) scale(1.12); }
}

@keyframes blobDriftC {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  50% { transform: translate(12%, -14%) rotate(8deg); }
}

.ambient-grid {
  position: absolute;
  inset: 0;
  opacity: 0.04;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.35) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.35) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 75% 65% at 50% 35%, black 15%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 75% 65% at 50% 35%, black 15%, transparent 75%);
}

.app {
  z-index: 2;
}

/* Sidebar — iridescent edge */
.sidebar {
  background: linear-gradient(165deg, rgba(16, 14, 28, 0.72) 0%, rgba(8, 8, 14, 0.78) 100%) !important;
  border-right: 1px solid transparent !important;
  background-clip: padding-box !important;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.1),
    var(--specular),
    12px 0 64px rgba(0, 0, 0, 0.5),
    -1px 0 0 rgba(167, 139, 250, 0.12) !important;
}

.sidebar::before {
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.1) 0%, transparent 38%, rgba(99, 102, 241, 0.12) 100%) !important;
}

.logo-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.045em;
  background: linear-gradient(115deg, #fff 0%, #e9e8ff 40%, #c4b5fd 85%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.logo-sub {
  font-family: var(--font-body), sans-serif;
  letter-spacing: 0.18em;
  font-size: 9px !important;
  opacity: 0.75;
}

.btn-new {
  letter-spacing: -0.02em !important;
  font-weight: 600 !important;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.05)) !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
}

.btn-new:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

.hi {
  border-radius: 12px !important;
  transition: transform 0.2s var(--studio-ease), background 0.2s, border-color 0.2s !important;
}

.hi:hover {
  transform: translateX(4px);
  background: rgba(139, 92, 246, 0.12) !important;
  border-color: rgba(167, 139, 250, 0.25) !important;
}

.hi.on {
  background: rgba(139, 92, 246, 0.18) !important;
  border: 1px solid rgba(167, 139, 250, 0.35) !important;
}

.gem {
  width: 40px !important;
  height: 40px !important;
  border-radius: 12px !important;
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.45),
    inset 0 -2px 6px rgba(0, 0, 0, 0.25),
    0 12px 40px rgba(139, 92, 246, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.18) !important;
}

/* Main chrome */
.topbar {
  border-radius: 18px !important;
  padding: 12px 18px !important;
  background: rgba(14, 14, 20, 0.55) !important;
  box-shadow: var(--specular), var(--elev-2) !important;
}

.tb-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(0.95rem, 1.5vw, 1.05rem) !important;
  letter-spacing: -0.04em !important;
}

.tbb {
  border-radius: 12px !important;
  transition: transform 0.2s var(--studio-ease), box-shadow 0.2s, background 0.2s !important;
}

.tbb:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

/* Composer — flagship dock */
.input-bar {
  padding: 0 20px 14px !important;
  max-width: 760px !important;
}

.inp-shell {
  border-radius: 26px !important;
  padding: 14px 18px !important;
  background: rgba(12, 12, 18, 0.65) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  box-shadow:
    var(--specular),
    0 0 0 1px rgba(139, 92, 246, 0.1),
    0 20px 60px rgba(0, 0, 0, 0.45),
    0 0 80px rgba(99, 102, 241, 0.06) !important;
  position: relative;
  overflow: hidden;
}

.inp-shell::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(125deg, rgba(167, 139, 250, 0.55), rgba(99, 102, 241, 0.2), rgba(56, 189, 248, 0.35), rgba(167, 139, 250, 0.45));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0.45;
}

.inp-shell:focus-within {
  box-shadow:
    var(--specular),
    0 0 0 4px rgba(139, 92, 246, 0.18),
    0 24px 72px rgba(0, 0, 0, 0.5),
    0 0 100px rgba(139, 92, 246, 0.14) !important;
}

.inp-shell:focus-within::before {
  opacity: 0.95;
  background: linear-gradient(125deg, rgba(196, 181, 253, 0.85), rgba(99, 102, 241, 0.45), rgba(56, 189, 248, 0.55), rgba(167, 139, 250, 0.75));
}

.inp-shell > * {
  position: relative;
  z-index: 1;
}

.chat-inp {
  font-size: 15px !important;
  line-height: 1.55 !important;
}

.send-btn {
  width: 44px !important;
  height: 44px !important;
  border-radius: 14px !important;
  background: linear-gradient(165deg, #c4b5fd 0%, #8b5cf6 38%, #5b21b6 100%) !important;
  box-shadow:
    inset 0 2px 2px rgba(255, 255, 255, 0.35),
    0 8px 28px rgba(139, 92, 246, 0.55) !important;
}

.send-btn:hover {
  transform: scale(1.07) translateY(-2px) !important;
}

.msg:not(.u) .bub {
  border-radius: 20px 22px 22px 22px !important;
  background: rgba(18, 18, 26, 0.72) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  box-shadow: var(--specular), 0 16px 48px rgba(0, 0, 0, 0.28) !important;
  -webkit-backdrop-filter: blur(20px) saturate(1.25);
  backdrop-filter: blur(20px) saturate(1.25);
}

.msg.u .bub {
  border-radius: 22px 20px 22px 22px !important;
  background: linear-gradient(155deg, rgba(167, 139, 250, 0.55) 0%, rgba(91, 33, 182, 0.42) 100%) !important;
  border: 1px solid rgba(255, 255, 255, 0.22) !important;
  box-shadow: var(--specular), 0 20px 50px rgba(91, 33, 182, 0.35) !important;
}

.av {
  width: 36px !important;
  height: 36px !important;
  border-radius: 12px !important;
  font-size: 10px !important;
  font-weight: 800 !important;
  letter-spacing: 0.02em;
}

.w-title {
  font-family: var(--font-display) !important;
  font-weight: 800 !important;
  font-size: clamp(1.75rem, 4.5vw, 2.35rem) !important;
  letter-spacing: -0.055em !important;
  filter: drop-shadow(0 8px 32px rgba(139, 92, 246, 0.25));
}

/* Chat glow — more dramatic */
.chat-glow {
  width: min(100%, 900px) !important;
  height: min(60vh, 520px) !important;
  filter: blur(72px) !important;
  opacity: 0.85 !important;
}

.chat-glow.active {
  filter: blur(88px) !important;
  opacity: 1 !important;
}

/* Modals — cinematic entrance */
.ov.open .modal,
.ov.open .modal.modal-lg,
.ov.open .modal.modal-sm {
  animation: modalStudio 0.55s var(--studio-ease) both;
}

@keyframes modalStudio {
  from {
    opacity: 0;
    transform: translateY(28px) scale(0.94);
    filter: blur(12px);
  }
  to {
    opacity: 1;
    transform: none;
    filter: none;
  }
}

.modal {
  border-radius: 24px !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  box-shadow: var(--specular), var(--elev-3) !important;
}

.mhd-t {
  font-family: var(--font-display) !important;
  font-weight: 700 !important;
  letter-spacing: -0.03em !important;
  font-size: 1.1rem !important;
}

.mi {
  border-radius: 16px !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  background: rgba(16, 16, 22, 0.65) !important;
  transition: transform 0.25s var(--studio-ease), box-shadow 0.25s, border-color 0.2s !important;
}

.mi:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(139, 92, 246, 0.2) !important;
}

.mi.on {
  box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.45), 0 12px 40px rgba(139, 92, 246, 0.15) !important;
}

.cb {
  border-radius: 14px !important;
  border: 1px solid rgba(139, 92, 246, 0.2) !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

.cb-h {
  background: rgba(139, 92, 246, 0.12) !important;
}

/* Toasts */
.toast {
  border-radius: 14px !important;
  box-shadow: var(--elev-2) !important;
  animation: toastStudio 0.4s var(--studio-ease) both !important;
}

@keyframes toastStudio {
  from {
    opacity: 0;
    transform: translateX(28px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* Scrollbar — refined */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(139, 92, 246, 0.45), rgba(99, 102, 241, 0.35));
  border-radius: 100px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

/* Reduced motion */
#premium-page {
  background: transparent !important;
  position: relative;
  z-index: 3;
}

.pp-title {
  font-family: var(--font-display) !important;
  font-weight: 800 !important;
  letter-spacing: -0.045em !important;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .ambient-blob-a,
  .ambient-blob-b,
  .ambient-blob-c {
    animation: none !important;
  }

  body::after {
    transition: none;
  }
}
