/* base.css */

/* ─── GOOGLE FONTS ────────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;700&display=swap');

/* ─── LOCAL FONTS ─────────────────────────────────────────────────────────── */

/* Cy Grotesk Grand Dark — для заголовков, названий папок, album header */
@font-face {
  font-family: "Cy Grotesk Grand";
  src: url("/assets/fonts/cy-grotesk-grand-dark/cy-grotesk-grand-dark.otf") format("opentype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* Alan Sans — для текста статьи (локальный файл при наличии, иначе fallback) */
/* Если файл alan-sans появится, добавить @font-face аналогично */


/* ─── DESIGN TOKENS ───────────────────────────────────────────────────────── */
:root {
  /* Layout */
  --container-width: 1200px;

  /* Legacy dark theme vars (kept for player controls) */
  --bg-color: transparent;
  --panel-bg: rgba(255, 255, 255, 0.10);
  --text-color: #1a2a3a;
  --text-muted: #5a7a96;
  --accent-color: #3d7fc1;
  --accent-light: #6aabdf;
  --border-color: rgba(100, 160, 220, 0.22);
  --selected-bg: rgba(61, 127, 193, 0.14);
  --selected-border: #3d7fc1;
  --music-blue: #2a5a8c;

  /* Typography */
  --font-heading: "Cy Grotesk Grand", "Outfit", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body:    "Alan Sans", "Outfit", Arial, sans-serif;
  --font-family:  "Outfit", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ─── BACKGROUND ──────────────────────────────────────────────────────────── */
html, body {
  min-height: 100%;
}

#bg-video {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  pointer-events: none;
}

body {
  background-color: #b8d8f0; /* fallback color */
  background-image: none;
  color: var(--text-color);
  font-family: var(--font-family);
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow-x: hidden;
}

/* ─── ROOT CONTAINER ──────────────────────────────────────────────────────── */
#root {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--container-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 20px;
  justify-content: center;
}

/* ─── INTRO SCREEN ──────────────────────────────────────────────────────────── */
.intro-screen {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #0a0a0a; /* fallback while video loads / on error */
  transition: opacity 0.6s ease-out;
}

.intro-screen.fade-out {
  opacity: 0;
  pointer-events: none;
}

.intro-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

.intro-video-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.35);
  z-index: 0;
}

.intro-logo {
  position: absolute;
  top: calc(46% - 3px);
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
  width: clamp(252px, 36vw, 558px);
  height: auto;
  pointer-events: none;
}

.intro-loading-container {
  position: absolute;
  top: 57%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

/* ── Windows XP-style loading bar ────────────────────────────────────────── */

.loading-bar-track {
  width: clamp(280px, 34vw, 540px);
  max-width: 85vw;
  height: 26px;
  border: 1px solid rgba(100, 160, 255, 0.6);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  overflow: hidden;
  position: relative;
}

.loading-bar-fill {
  position: absolute;
  top: 2px;
  bottom: 2px;
  left: -105px;
  display: flex;
  gap: 3px;
  animation: xp-indeterminate 2s infinite linear;
}

.loading-segment {
  width: 24px;
  height: 100%;
  background: linear-gradient(180deg, #8bc2f0 0%, #3d7fc1 100%);
  border-radius: 2px;
}

@keyframes xp-indeterminate {
  0% { left: -105px; }
  100% { left: 100%; }
}

/* ─── APP MAIN SCREEN ─────────────────────────────────────────────────────── */
.app-screen {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  min-height: 800px;
  gap: 0;
  transition: gap 1.2s cubic-bezier(0.16, 1, 0.3, 1), align-items 1.2s ease;
}

.app-screen.workspace-mode {
  justify-content: center;
  align-items: flex-start;
  gap: 32px;
}

/* ── PERSISTENT SPLIT LAYOUT ────────────────────────────────────────────────
   Once the user presses OK and enters JPM Music (hasEnteredApp = true),
   the app adds .has-entered and stays in split mode permanently
   until a page refresh. Home no longer collapses the right panel.
*/
.app-screen.has-entered {
  justify-content: center;
  align-items: flex-start;
  gap: 32px;
}

@media (max-width: 1180px) {
  .app-screen {
    flex-direction: column;
    align-items: center;
    gap: 20px;
  }
  .app-screen.workspace-mode {
    gap: 20px;
  }
}
