/* =========================================================
   ЭКРАН 1 И 2: ИНТРО И ПЕРЕХОД К БРЕНДУ
========================================================= */
#intro {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  contain: layout paint;
  overflow: hidden;
  transition: background-color 0.6s ease;
}

#bgRotateWrap {
  position: absolute;
  inset: -35%;
  z-index: 1;
  filter: blur(65px);
  opacity: 0.84;
  pointer-events: none;
  transition: opacity 1.4s cubic-bezier(0.22, 1, 0.36, 1);
}

#bgRotate {
  width: 100%;
  height: 100%;
  transform: translateZ(0);
  background: conic-gradient(
    from 0deg at 50% 50%,
    #050308 0deg,
    #0e081a 35deg,
    #180d2b 70deg,
    #23133f 110deg,
    #311b57 150deg,
    #3e236b 185deg,
    #261444 220deg,
    #160b28 255deg,
    #2d1950 290deg,
    #190d2c 325deg,
    #050308 360deg
  );
  animation: spinConic 34s linear infinite;
}

body.light-theme #bgRotate,
body.theme-morning #bgRotate {
  background: conic-gradient(
    from 0deg at 50% 50%,
    #e5ddf3 0deg,
    #d9ceec 35deg,
    #cbbce4 75deg,
    #bcabdc 115deg,
    #ae9ad3 155deg,
    #c3b3e0 195deg,
    #d5c9ea 235deg,
    #b8a6d9 280deg,
    #d0c3e7 320deg,
    #e5ddf3 360deg
  );
}

@keyframes spinConic {
  0% { transform: translateZ(0) rotate(0deg); }
  100% { transform: translateZ(0) rotate(360deg); }
}

#bgSoft {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 50%, rgba(102, 72, 158, 0.22) 0%, transparent 56%),
    radial-gradient(circle at 18% 22%, rgba(138, 108, 194, 0.14) 0%, transparent 46%),
    radial-gradient(circle at 82% 80%, rgba(79, 51, 128, 0.18) 0%, transparent 52%);
  transition: opacity 1.4s cubic-bezier(0.22, 1, 0.36, 1);
}

body.light-theme #bgSoft,
body.theme-morning #bgSoft {
  background:
    radial-gradient(circle at 50% 50%, rgba(138, 114, 184, 0.18) 0%, transparent 58%),
    radial-gradient(circle at 18% 22%, rgba(161, 140, 209, 0.2) 0%, transparent 46%),
    radial-gradient(circle at 82% 80%, rgba(107, 77, 156, 0.16) 0%, transparent 52%);
}

#bgVignette {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: radial-gradient(circle at 50% 50%, rgba(5, 3, 8, 0.16) 18%, rgba(0, 0, 0, 0.84) 100%);
  transition: opacity 1.4s cubic-bezier(0.22, 1, 0.36, 1);
}

body.light-theme #bgVignette,
body.theme-morning #bgVignette {
  background: radial-gradient(circle at 50% 50%, rgba(235, 229, 246, 0.14) 22%, rgba(206, 195, 227, 0.78) 100%);
}

#glow {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 24px;
  height: 24px;
  margin-left: -12px;
  margin-top: -12px;
  border-radius: 50%;
  z-index: 4;
  pointer-events: none;
  opacity: 0;
  transform: translate3d(0, 0, 0) scale3d(0.2, 0.2, 1);
  background: radial-gradient(circle, rgba(161, 140, 209, 0.58) 0%, rgba(86, 61, 133, 0.3) 45%, transparent 72%);
}

body.light-theme #glow,
body.theme-morning #glow {
  background: radial-gradient(circle, rgba(107, 77, 156, 0.42) 0%, rgba(149, 126, 196, 0.2) 48%, transparent 72%);
}

#introThemeSlot {
  position: fixed;
  top: 24px;
  right: 28px;
  z-index: 15;
}

#helloWord .char {
  display: inline-block;
  opacity: 0;
  transform: translate3d(0, 34px, 0);
}

#helloWord.brand-mode .char {
  background: var(--logo-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

#skipBtn {
  position: fixed;
  bottom: calc(44px + env(safe-area-inset-bottom, 0px));
  right: 44px;
  z-index: 15;
  opacity: 0;
  pointer-events: none;
  transform: translate3d(0, 12px, 0);
}

#skipBtn.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translate3d(0, 0, 0);
}

#enterSiteBtn {
  position: fixed;
  left: 50%;
  bottom: calc(50% - 9.2rem);
  z-index: 15;
  opacity: 0;
  pointer-events: none;
  transform: translate3d(-50%, 16px, 0);
}

#enterSiteBtn.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translate3d(-50%, 0, 0);
}
/* =========================================================
   ЭКРАН 3: ОСНОВНОЙ САЙТ (ЕДИНЫЙ ПЛАВНЫЙ СКРОЛЛ СТРАНИЦЫ)
========================================================= */
#site {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  opacity: 0;
  background: var(--bg);
  transition: background-color 0.8s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.45s ease, transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

#site.stage-black {
  background: var(--stage-bg);
}

#site.profile-hidden {
  opacity: 0 !important;
  pointer-events: none;
  transform: translate3d(0, -18px, 0) scale3d(0.98, 0.98, 1);
}

#siteAmbient {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  background:
    radial-gradient(circle at 20% 15%, rgba(86, 61, 133, 0.12) 0%, transparent 45%),
    radial-gradient(circle at 82% 85%, rgba(154, 132, 199, 0.08) 0%, transparent 50%);
  transition: opacity 1.2s ease;
}

#site.assembled #siteAmbient {
  opacity: 1;
}

/* =========================================================
   БАННЕР И ФОНОВАЯ АНИМАЦИЯ ПОД ТЕМЫ НОЧЬ / ДЕНЬ
========================================================= */
#banner {
  position: relative;
  z-index: 5;
  height: 14.5vh;
  min-height: 112px;
  max-height: 142px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  contain: layout paint;
  background: radial-gradient(ellipse at 50% 120%, rgba(96, 66, 150, 0.18) 0%, transparent 68%);
}

body.light-theme #banner,
body.theme-morning #banner {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.62) 0%, rgba(235, 227, 249, 0.45) 100%);
}

#bannerBgFx {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  opacity: 0;
  transition: opacity 1.1s ease;
}

#site.assembled #bannerBgFx {
  opacity: 1;
}

.banner-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(26px);
  will-change: transform;
}

.banner-orb.orb-1 {
  width: 280px;
  height: 130px;
  left: 14%;
  top: -20px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.28) 0%, transparent 72%);
  animation: bannerOrbDrift1 11s ease-in-out infinite alternate;
}

.banner-orb.orb-2 {
  width: 310px;
  height: 140px;
  right: 12%;
  bottom: -30px;
  background: radial-gradient(circle, rgba(217, 119, 230, 0.2) 0%, transparent 72%);
  animation: bannerOrbDrift2 13s ease-in-out infinite alternate;
}

body.light-theme .banner-orb.orb-1,
body.theme-morning .banner-orb.orb-1 {
  background: radial-gradient(circle, rgba(167, 139, 250, 0.32) 0%, transparent 72%);
}

body.light-theme .banner-orb.orb-2,
body.theme-morning .banner-orb.orb-2 {
  background: radial-gradient(circle, rgba(244, 184, 112, 0.28) 0%, rgba(196, 181, 253, 0.2) 50%, transparent 74%);
}

@keyframes bannerOrbDrift1 {
  0% { transform: translate3d(-18px, -6px, 0) scale(0.95); }
  100% { transform: translate3d(26px, 12px, 0) scale(1.08); }
}

@keyframes bannerOrbDrift2 {
  0% { transform: translate3d(20px, 8px, 0) scale(1.05); }
  100% { transform: translate3d(-24px, -10px, 0) scale(0.94); }
}

.banner-ring {
  position: absolute;
  left: 50%;
  top: 50%;
  border-radius: 50%;
  border: 1px dashed rgba(191, 164, 247, 0.18);
  pointer-events: none;
}

body.light-theme .banner-ring,
body.theme-morning .banner-ring {
  border-color: rgba(84, 54, 133, 0.16);
}

.banner-ring.ring-1 {
  width: 340px;
  height: 340px;
  margin-left: -170px;
  margin-top: -170px;
  animation: bannerRingSpin 36s linear infinite;
}

.banner-ring.ring-2 {
  width: 520px;
  height: 520px;
  margin-left: -260px;
  margin-top: -260px;
  border-style: solid;
  border-color: rgba(191, 164, 247, 0.09);
  animation: bannerRingSpinRev 52s linear infinite;
}

body.light-theme .banner-ring.ring-2,
body.theme-morning .banner-ring.ring-2 {
  border-color: rgba(84, 54, 133, 0.09);
}

@keyframes bannerRingSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes bannerRingSpinRev {
  from { transform: rotate(360deg); }
  to { transform: rotate(0deg); }
}

.banner-spark {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--violet-bright);
  box-shadow: 0 0 10px var(--violet-bright);
  opacity: 0.45;
  animation: sparkFloat 6.5s ease-in-out infinite alternate;
}

body.light-theme .banner-spark,
body.theme-morning .banner-spark {
  background: #7c3aed;
  box-shadow: 0 0 8px rgba(124, 58, 237, 0.45);
  opacity: 0.38;
}

.banner-spark.s1 { left: 22%; top: 28%; animation-delay: 0s; }
.banner-spark.s2 { left: 36%; top: 72%; animation-delay: 1.2s; width: 3px; height: 3px; }
.banner-spark.s3 { left: 64%; top: 24%; animation-delay: 2.1s; }
.banner-spark.s4 { left: 78%; top: 68%; animation-delay: 0.8s; width: 3px; height: 3px; }
.banner-spark.s5 { left: 50%; top: 18%; animation-delay: 1.7s; width: 2.5px; height: 2.5px; }

@keyframes sparkFloat {
  0% { transform: translate3d(0, 6px, 0) scale(0.85); opacity: 0.25; }
  100% { transform: translate3d(0, -9px, 0) scale(1.2); opacity: 0.72; }
}
#bannerGlow {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  background: var(--sun-grad);
}

#bannerLine {
  position: absolute;
  bottom: 0;
  left: 6%;
  right: 6%;
  height: 1px;
  z-index: 3;
  opacity: 0;
  background: linear-gradient(to right, transparent, var(--violet-bright), transparent);
  box-shadow: 0 0 18px var(--glow-color);
}

#logo {
  position: relative;
  z-index: 4;
  font-size: clamp(1.9rem, 4.3vw, 3.05rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.05;
  background: var(--logo-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  opacity: 0;
  transform: translate3d(0, 0, 0) scale3d(0.2, 0.2, 1);
  will-change: transform, opacity;
  user-select: none;
}

#logoSub {
  position: relative;
  z-index: 4;
  margin-top: 5px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  opacity: 0;
  transition: opacity 0.4s ease;
}

#fantasyWord {
  display: inline-flex;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--violet);
  transition: text-shadow 1.5s ease;
}

#fantasyWord.lit {
  text-shadow: 0 0 16px rgba(191, 164, 247, 0.35);
}

body.light-theme #fantasyWord.lit,
body.theme-morning #fantasyWord.lit {
  text-shadow: 0 0 14px rgba(84, 54, 133, 0.22);
}

#fantasyWord .f-char {
  display: inline-block;
  opacity: 0;
  transform: translate3d(0, 8px, 0);
}

.pill-word {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  color: var(--violet-bright);
  font-size: 0.67rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  opacity: 0;
  transform: translate3d(0, 0, 0) scale3d(0.7, 0.7, 1);
}

.pill-word.burst {
  animation: pillBurst 0.85s cubic-bezier(0.22, 1, 0.36, 1) forwards, pillBreath 5s ease-in-out 0.9s infinite;
}

@keyframes pillBurst {
  0% { opacity: 0; transform: translate3d(0, 0, 0) scale3d(0.7, 0.7, 1); }
  55% { opacity: 1; transform: translate3d(0, 0, 0) scale3d(1.08, 1.08, 1); box-shadow: 0 0 32px var(--glow-color); }
  100% { opacity: 1; transform: translate3d(0, 0, 0) scale3d(1, 1, 1); box-shadow: 0 0 14px var(--glow-color); }
}

@keyframes pillBreath {
  0%, 100% { box-shadow: 0 0 14px var(--glow-color); }
  50% { box-shadow: 0 0 24px var(--glow-color); }
}

/* =========================================================
   3D-КАРУСЕЛЬ ГЛАВНЫХ / ПОСЛЕДНИХ 5 НОВОСТЕЙ (СРЕДНИЕ КАРТОЧКИ)
========================================================= */
#featuredCarouselWrap {
  position: relative;
  z-index: 4;
  flex-shrink: 0;
  padding: 12px 16px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  opacity: 0;
  transform: translate3d(0, 20px, 0);
  user-select: none;
  touch-action: pan-y;
}

.carousel-stage {
  position: relative;
  width: 100%;
  max-width: 1080px;
  height: 158px;
  perspective: 1200px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
}

.carousel-stage:active {
  cursor: grabbing;
}

.feat-card {
  position: absolute;
  width: min(440px, 84vw);
  height: 144px;
  padding: 16px 20px;
  border-radius: 20px;
  border: 1px solid var(--glass-border);
  background: var(--card-surface);
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.36);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  will-change: transform, opacity;
  transition: transform 0.48s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.4s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.carousel-stage.dragging .feat-card {
  transition: none !important;
}

body.light-theme .feat-card,
body.theme-morning .feat-card {
  background: #ffffff;
  border-color: rgba(79, 48, 133, 0.24);
  box-shadow: 0 12px 30px rgba(79, 48, 133, 0.13);
}

.feat-card.is-center {
  border-color: var(--violet-bright);
  box-shadow: 0 20px 44px rgba(124, 82, 212, 0.28);
}

body.light-theme .feat-card.is-center,
body.theme-morning .feat-card.is-center {
  border-color: #6d28d9;
  box-shadow: 0 16px 36px rgba(109, 40, 217, 0.18);
}

.feat-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.feat-badge {
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 999px;
  color: var(--violet-bright);
  background: rgba(154, 132, 199, 0.16);
  border: 1px solid var(--glass-border);
}

.feat-date {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-dim);
}

.feat-title {
  font-size: 1.06rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.feat-excerpt {
  font-size: 0.82rem;
  line-height: 1.42;
  color: var(--text-dim);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.carousel-dots {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 8px;
}

.c-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  border: none;
  background: var(--text-dim);
  opacity: 0.35;
  cursor: pointer;
  padding: 0;
  transition: width 0.3s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s ease, background-color 0.3s ease;
}

.c-dot.active {
  width: 22px;
  opacity: 1;
  background: var(--violet-bright);
}
/* =========================================================
   ФИРМЕННОЕ ПРИЛИПАЮЩЕЕ ГОРИЗОНТАЛЬНОЕ СВАЙП-МЕНЮ (MAIN DOCK — 4 РАЗДЕЛА)
========================================================= */
#mainDockWrap {
  position: sticky;
  top: 0;
  z-index: 25;
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  padding: 10px 16px;
  opacity: 0;
  transform: translate3d(0, 18px, 0);
  transition: background-color 0.3s ease;
}

.main-dock {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  width: min(600px, 94vw);
  height: 44px;
  padding: 4px;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: rgba(14, 10, 26, 0.84);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.14), 0 10px 28px rgba(0, 0, 0, 0.32);
  user-select: none;
  touch-action: none;
  cursor: grab;
}

.main-dock:active {
  cursor: grabbing;
}

body.light-theme .main-dock,
body.theme-morning .main-dock {
  background: rgba(255, 255, 255, 0.92);
  box-shadow: inset 0 1px 1px #ffffff, 0 8px 24px rgba(79, 48, 133, 0.16);
}

.main-dock-thumb {
  position: absolute;
  top: 4px;
  left: 4px;
  width: calc((100% - 8px) / 4);
  height: calc(100% - 8px);
  border-radius: 999px;
  background: linear-gradient(135deg, #7c52d4 0%, #5848c2 100%);
  box-shadow: 0 4px 14px rgba(124, 82, 212, 0.38);
  will-change: transform;
  pointer-events: none;
  transition: transform 0.38s cubic-bezier(0.16, 1, 0.3, 1);
}

.dock-btn {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-family: inherit;
  font-size: 0.83rem;
  font-weight: 500;
  pointer-events: none;
  white-space: nowrap;
  transition: color 0.25s ease;
}

.dock-btn svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.dock-btn.active {
  color: #ffffff;
}

.dock-beta-tag {
  font-size: 0.56rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 1.5px 5px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.22);
  border: 1px solid rgba(245, 158, 11, 0.48);
  color: #fbbf24;
  line-height: 1.1;
}

body.light-theme .dock-beta-tag,
body.theme-morning .dock-beta-tag {
  background: rgba(217, 119, 6, 0.14);
  border-color: rgba(217, 119, 6, 0.42);
  color: #b45309;
}

/* =========================================================
   НИЖНЯЯ РАБОЧАЯ РАМКА КОНТЕНТА (ПРОКРУЧИВАЕТСЯ ВМЕСТЕ СО СТРАНИЦЕЙ)
========================================================= */
#workspace {
  position: relative;
  z-index: 2;
  flex-shrink: 0;
  display: flex;
  padding: 4px 1.4rem calc(2rem + env(safe-area-inset-bottom, 0px));
}

.window-box {
  border-radius: 22px;
  border: 1px solid var(--glass-border);
  background: var(--card-bg);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.26);
  transition: background-color 0.6s ease, border-color 0.6s ease, box-shadow 0.6s ease;
}

body.light-theme .window-box,
body.theme-morning .window-box {
  background: rgba(248, 245, 254, 0.9);
  box-shadow: 0 14px 36px rgba(79, 48, 133, 0.1);
}

#contentWindow {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translate3d(0, 28px, 0);
}

#contentArea {
  width: 100%;
  overflow: hidden;
  position: relative;
  transition: height 0.38s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Единая горизонтальная лента 4 страниц */
.dock-pages-track {
  display: flex;
  align-items: flex-start;
  width: 400%;
  will-change: transform;
  transition: transform 0.38s cubic-bezier(0.16, 1, 0.3, 1);
}

.dock-page {
  width: 25%;
  min-height: 440px;
  flex-shrink: 0;
  padding: 1.4rem 1.6rem;
}

.sec-title {
  font-size: clamp(1.3rem, 2.3vw, 1.75rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
  background: var(--logo-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

@media (max-width: 640px) {
  .carousel-stage {
    height: 142px;
  }
  .feat-card {
    height: 130px;
    padding: 13px 16px;
  }
  .dock-btn span {
    font-size: 0.76rem;
  }
  .dock-btn svg {
    display: none;
  }
  #workspace {
    padding: 4px 0.8rem calc(1.4rem + env(safe-area-inset-bottom, 0px));
  }
  .dock-page {
    padding: 1.1rem;
    min-height: 380px;
  }
}
