/* ═══════════════════════════════════════════════════════════════════
   МОБИЛЬНАЯ ВЕРСИЯ — все правки только для экранов до 768px.
   Десктоп НЕ затронут.
   ═══════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  /* 0) Сокращаем вертикальные отступы между секциями (3-4x от десктопа) */
  section.py-32 { padding-top: 2.5rem !important; padding-bottom: 2.5rem !important; }
  section.py-40 { padding-top: 3rem   !important; padding-bottom: 3rem   !important; }
  section.py-20 { padding-top: 2rem   !important; padding-bottom: 2rem   !important; }
  section.py-16 { padding-top: 1.5rem !important; padding-bottom: 1.5rem !important; }
  /* Отступ перед заголовком секции (mb-16) — тоже уменьшаем */
  section .mb-16 { margin-bottom: 2rem !important; }
  /* Hero — меньше отступа снизу (там min-h-screen + padding-bottom: 66px) */
  #hero { padding-bottom: 2rem !important; padding-top: 1rem !important; min-height: auto !important; }

  /* Убираем фикс-высоту И padding у grid'а планет — пусть будет ровно по содержимому */
  .planet-system {
    height: auto !important;
    min-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  /* 1) Декоративные сферы-фоны меньше, чтобы не торчали за экран */
  .planet-orb {
    width: 320px !important;
    height: 320px !important;
  }

  /* 2) Все секции с декор. блобами получают overflow:hidden чтобы не было гориз. скролла */
  #hero, #cta, #ai, #capsules, #tree, #timeline, #case {
    overflow-x: hidden;
  }

  /* 3) AI-секция — больше внутренних отступов для воздуха */
  #ai > .max-w-7xl {
    padding-left: 4px;
    padding-right: 4px;
  }
  #ai .reveal,
  #ai .chat-card {
    max-width: 100%;
    box-sizing: border-box;
  }

  /* 4) Древо — на мобилке узлы сгруппированы по семьям с цветными карточками */
  .tree-wrap {
    height: auto !important;
    min-height: 0 !important;
    padding: 12px !important;
    display: flex !important;
    flex-direction: column;
    gap: 16px;
    border-radius: 18px;
    background: rgba(20, 8, 36, 0.4);
  }
  /* SVG-линии скрываем — на узком экране они нечитаемы и создают визуальный шум */
  .tree-svg { display: none !important; }

  /* Группы становятся видимыми карточками с подписями */
  .tree-group {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px 4px;
    place-items: center;
    padding: 32px 8px 14px;
    border-radius: 16px;
    position: relative;
  }
  .tree-group::before {
    content: attr(data-label);
    position: absolute;
    top: 10px;
    left: 14px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-family: 'Geist Mono', ui-monospace, monospace;
    font-weight: 600;
  }
  .group-couple {
    background: linear-gradient(135deg, rgba(255, 107, 157, 0.10), rgba(93, 211, 255, 0.08));
    border: 1px solid rgba(255, 107, 157, 0.28);
  }
  .group-couple::before { color: #FF6B9D; }
  .group-bride {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.06), rgba(167, 139, 250, 0.10));
    border: 1px solid rgba(255, 215, 0, 0.22);
  }
  .group-bride::before { color: #FFD700; }
  .group-groom {
    background: linear-gradient(135deg, rgba(93, 211, 255, 0.10), rgba(167, 139, 250, 0.08));
    border: 1px solid rgba(93, 211, 255, 0.28);
  }
  .group-groom::before { color: #5DD3FF; }

  /* Узлы — нормальная flow-позиция (без absolute) */
  .net-node {
    position: static !important;
    left: auto !important;
    top: auto !important;
    transform: none !important;
    width: 100% !important;
    max-width: 110px;
    gap: 6px !important;
    animation: none !important;
  }
  .net-node .nn-circle {
    width: 52px !important;
    height: 52px !important;
    border-width: 2px;
  }
  .net-node .nn-icon { font-size: 24px !important; }
  .net-node .nn-label b {
    font-size: 11px !important;
    line-height: 1.1 !important;
    max-width: 100px;
    text-align: center;
    word-break: break-word;
  }
  .net-node .nn-label i {
    font-size: 9px !important;
    line-height: 1.15 !important;
    max-width: 100px;
    letter-spacing: 0;
    text-align: center;
  }

  /* 5) Бургер-меню — показываем кнопку на мобилке */
  .mobile-menu-btn { display: inline-flex !important; }

  /* Кейс-карточка свадьбы скрыта на мобилке (дублирует ссылку из текста) */
  .case-3d-wrap { display: none !important; }

  /* Шрифт hero чуть мельче в очень узком экране */
  #hero h1 .hero-line { font-size: clamp(2rem, 9vw, 3rem); }
  /* Но рукописный подзаголовок-курсив сохраняет свой стиль и размер */
  #hero h1 .hero-line.hero-sub {
    font-family: 'Caveat', 'Marck Script', cursive !important;
    font-size: clamp(2.4rem, 11vw, 3.8rem) !important;
    font-weight: 500 !important;
    line-height: 1.05;
  }

  /* Заголовки секций — поменьше */
  section h2.font-display { font-size: clamp(1.75rem, 7vw, 2.5rem); }

  /* Подзаголовки секций (text-lg описание) — мельче на мобилке */
  section p.text-lg { font-size: 0.95rem !important; line-height: 1.5 !important; }

  /* Заголовок «Family OS» в навигации — без лишней ширины */
  nav .font-display { font-size: 1rem; }

  /* Таймлайн — подтягиваем карточки повыше + сжимаем высоту блока */
  .timeline-track {
    height: 440px !important;
    padding: 0 !important;
  }
  .timeline-track > div { padding: 0 1rem !important; }

  /* Свайп-индикатор наверху — виден только на мобилке */
  .timeline-hint-top { display: inline-flex !important; }
}

/* Группы древа на ДЕСКТОПЕ — прозрачные обёртки (узлы остаются абсолютно-позиционированными внутри .tree-wrap) */
.tree-group { display: contents; }

/* «это вселенная» — должно быть всегда одной строкой, не разбиваться */
.hero-letters { white-space: nowrap; }

/* Подзаголовок hero — рукописный золотистый курсив с лёгким glow */
.hero-sub {
  display: block;
  font-family: 'Caveat', 'Marck Script', 'Dancing Script', cursive;
  font-weight: 500;
  font-style: normal;
  font-size: clamp(2.2rem, 6.5vw, 4.5rem);
  letter-spacing: 0.01em;
  line-height: 1.05;
  background: linear-gradient(120deg, #FFD700 0%, #FFC158 35%, #FF9F4A 65%, #FFD700 100%);
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
          color: transparent;
  filter:
    drop-shadow(0 2px 4px rgba(0, 0, 0, 0.55))
    drop-shadow(0 0 14px rgba(255, 215, 0, 0.45))
    drop-shadow(0 0 28px rgba(255, 200, 60, 0.22));
}

/* === Case-3D-card — кейс-плашка свадьбы с 3D-сердцем и параллаксом === */
.case-3d-wrap {
  perspective: 1200px;
  --mx: 0px;
  --my: 0px;
}
.case-3d-card {
  transform-style: preserve-3d;
  transform: translate3d(calc(var(--mx, 0) * 0.5), calc(var(--my, 0) * 0.5), 0)
             rotateX(calc(var(--my, 0) * -0.04deg))
             rotateY(calc(var(--mx, 0) *  0.04deg));
  transition: transform 0.5s cubic-bezier(.2,.8,.2,1);
  will-change: transform;
}
.case-3d-card:hover {
  transition: transform 0.2s cubic-bezier(.2,.8,.2,1);
}
/* Зеркальный блик-оверлей */
.case-3d-shine {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 30% 0%, rgba(255, 255, 255, 0.18) 0%, transparent 50%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.10) 0%, transparent 30%, transparent 70%, rgba(255, 255, 255, 0.04) 100%);
  mix-blend-mode: screen;
}
/* 3D-сердце — большое, стеклянное, парящее, с параллаксом */
.case-heart {
  display: inline-block;
  position: relative;
  font-size: 6rem;
  line-height: 1;
  margin-bottom: 1rem;
  transform: translate3d(calc(var(--mx, 0) * 1.5), calc(var(--my, 0) * 1.5), 60px) rotate(-6deg);
  filter:
    drop-shadow(0 0 14px rgba(255, 61, 138, 0.75))
    drop-shadow(0 0 32px rgba(255, 107, 157, 0.5))
    drop-shadow(0 10px 24px rgba(20, 5, 40, 0.65));
  animation: heartFloat3D 4.5s ease-in-out infinite;
  transition: transform 0.6s cubic-bezier(.2,.8,.2,1), filter 0.5s;
  transform-style: preserve-3d;
}
.case-heart-emoji {
  display: inline-block;
  position: relative;
}
.case-heart-emoji::after {
  /* Зеркальный лёгкий блик внутри сердца */
  content: '';
  position: absolute;
  top: 18%;
  left: 22%;
  width: 28%;
  height: 22%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.75) 0%, transparent 70%);
  pointer-events: none;
  filter: blur(2px);
}
@keyframes heartFloat3D {
  0%, 100% {
    transform: translate3d(calc(var(--mx, 0) * 1.5), calc(var(--my, 0) * 1.5), 60px) rotate(-6deg) scale(1);
  }
  50% {
    transform: translate3d(calc(var(--mx, 0) * 1.5), calc(var(--my, 0) * 1.5 - 14px), 80px) rotate(6deg) scale(1.06);
  }
}
.case-3d-card:hover .case-heart {
  filter:
    drop-shadow(0 0 22px rgba(255, 61, 138, 0.95))
    drop-shadow(0 0 50px rgba(255, 107, 157, 0.7))
    drop-shadow(0 14px 32px rgba(20, 5, 40, 0.8));
}

/* Свайп-индикатор для таймлайна — мелкий, наверху-слева */
.timeline-hint-top {
  display: none;
  position: absolute;
  top: 14px;
  left: 16px;
  z-index: 5;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 11px;
  letter-spacing: 0.10em;
  font-family: 'Geist Mono', ui-monospace, monospace;
  pointer-events: none;
  text-transform: uppercase;
}
.timeline-hint-top .th-arrows {
  display: inline-flex;
  gap: 1px;
}
.timeline-hint-top .th-arrows span {
  display: inline-block;
  width: 10px;
  height: 10px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23A78BFA' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 6l6 6-6 6'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  opacity: 0.3;
  animation: thArrow 1.4s ease-in-out infinite;
}
.timeline-hint-top .th-arrows span:nth-child(1) { animation-delay: 0s; }
.timeline-hint-top .th-arrows span:nth-child(2) { animation-delay: 0.2s; }
.timeline-hint-top .th-arrows span:nth-child(3) { animation-delay: 0.4s; }
@keyframes thArrow {
  0%, 100% { opacity: 0.25; }
  50%      { opacity: 1; }
}

/* Бургер-меню — стили (показ управляется @media выше) */
.mobile-menu-btn {
  display: none;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  color: white;
  cursor: pointer;
  padding: 0;
  font-size: 22px;
  line-height: 1;
  transition: background 0.2s, transform 0.15s;
}
.mobile-menu-btn:hover { background: rgba(167, 139, 250, 0.22); }
.mobile-menu-btn:active { transform: scale(0.94); }

.mobile-menu {
  position: fixed;
  inset: 0;
  background: rgba(8, 4, 16, 0.92);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  z-index: 80;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
}
.mobile-menu.is-open {
  opacity: 1;
  pointer-events: auto;
}
.mobile-menu a {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  color: white;
  text-decoration: none;
  padding: 8px 24px;
  border-radius: 999px;
  transition: background 0.2s, transform 0.2s;
}
.mobile-menu a:active { transform: scale(0.96); }
.mobile-menu a:hover  { background: rgba(167, 139, 250, 0.18); }
.mobile-menu-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 42px;
  height: 42px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  color: white;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}
.mobile-menu-close:hover { background: rgba(255, 107, 157, 0.25); transform: rotate(90deg); }

/* === Accessibility: уважаем prefers-reduced-motion === */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  #stars, #hearts, .aurora, .planet-orb { display: none !important; }
}

:root {
  --bg: #0A0118;
  --bg2: #1A0B2E;
  --pink: #FF6B9D;
  --violet: #A78BFA;
  --gold: #FFD700;
  --text: #E8E4F3;
  --muted: #7C7395;
}

/* ===== Local fonts (WOFF2 — кириллица+латиница, ~85% сжатия) ===== */
@font-face { font-family: 'Cheshirskiy Cat'; src: url('fonts/Cheshirskiy_Cat.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'Luna Obscura';    src: url('fonts/HS_LunaObscura.woff2')  format('woff2'); font-display: swap; }
@font-face { font-family: 'Ray Typewriter';  src: url('fonts/Ray_Typewriter.woff2')  format('woff2'); font-display: swap; }
@font-face { font-family: 'Berezka';         src: url('fonts/Berezka.woff2')         format('woff2'); font-display: swap; }
@font-face { font-family: 'Carmen';          src: url('fonts/Carmen.woff2')          format('woff2'); font-display: swap; }
@font-face { font-family: 'Sangyo';          src: url('fonts/Sangyo-Regular.woff2')  format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Sangyo';          src: url('fonts/Sangyo-Italic.woff2')   format('woff2'); font-weight: 400; font-style: italic;  font-display: swap; }

/* Рукописный курсивный шрифт для акцент-подзаголовков */
@font-face {
  font-family: 'Caveat';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('vendor/gfonts/files/caveat_v23_WnznHAc5bAfYB2QRah7pcpNvOx-pjfJ9SII.ttf') format('truetype');
}
@font-face {
  font-family: 'Caveat';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('vendor/gfonts/files/caveat_v23_WnznHAc5bAfYB2QRah7pcpNvOx-pjRV6SII.ttf') format('truetype');
}

/* Font variables — default = Science Gothic (выбран как финальный) */
:root {
  --font-display: 'Science Gothic', system-ui, sans-serif;
  --font-body: 'Manrope', system-ui, sans-serif;
  --display-tracking: -0.02em;
  --display-weight: 900;
}

/* High specificity + !important to beat Tailwind CDN injected styles */
html body,
html body input,
html body button,
html body a {
  font-family: var(--font-body) !important;
}
.font-display {
  font-family: var(--font-display) !important;
  letter-spacing: var(--display-tracking) !important;
  font-weight: var(--display-weight) !important;
}

/* FONT DRAWER */
#font-drawer.open { display: block; animation: drawerFade 0.3s ease-out; }
@keyframes drawerFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.font-card {
  position: relative;
  display: block;
  width: 100%;
  text-align: left;
  padding: 1.5rem 1.5rem 1.25rem;
  border-radius: 1.25rem;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.08);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(.2,.8,.2,1);
  overflow: hidden;
}
.font-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 30%, rgba(255,107,157,0.1), transparent 60%);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}
.font-card:hover {
  border-color: rgba(255,107,157,0.4);
  transform: translateY(-2px);
  box-shadow: 0 20px 40px -20px rgba(255,107,157,0.3);
}
.font-card:hover::before { opacity: 1; }
.font-card.selected {
  border-color: var(--pink);
  background: rgba(255,107,157,0.08);
  box-shadow: 0 0 30px -5px rgba(255,107,157,0.5);
}
.font-card.selected::after {
  content: '✓';
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(90deg, var(--pink), var(--violet));
  color: white;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.font-card .fc-name {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.font-card .fc-vibe {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(167,139,250,0.15);
  color: var(--violet);
  font-size: 0.65rem;
  letter-spacing: 0.05em;
}
.font-card .fc-display {
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(90deg, var(--pink), var(--violet));
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  margin-bottom: 0.5rem;
}
.font-card .fc-body {
  font-size: 0.85rem;
  color: rgba(232,228,243,0.7);
  line-height: 1.5;
}

/* Toast for font switch */
#font-toast {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  padding: 0.6rem 1.2rem;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--pink), var(--violet));
  color: white;
  font-size: 0.8rem;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
  z-index: 100;
  box-shadow: 0 10px 30px rgba(255,107,157,0.4);
}
#font-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

html { scroll-behavior: smooth; }
body {
  -webkit-font-smoothing: antialiased;
  background: #0A0118;
}

/* Selection */
::selection { background: var(--pink); color: white; }

/* Aurora background — slow breathing radial gradient */
.aurora {
  background:
    radial-gradient(circle at 20% 20%, rgba(255,107,157,0.18), transparent 45%),
    radial-gradient(circle at 80% 30%, rgba(167,139,250,0.18), transparent 45%),
    radial-gradient(circle at 50% 80%, rgba(255,215,0,0.10), transparent 50%);
  filter: blur(40px);
  animation: aurora 18s ease-in-out infinite alternate;
}
@keyframes aurora {
  0%   { transform: translate3d(0,0,0) scale(1); opacity: 0.9; }
  50%  { transform: translate3d(20px,-30px,0) scale(1.1); opacity: 1; }
  100% { transform: translate3d(-20px,20px,0) scale(0.95); opacity: 0.85; }
}

/* HERO planet orb */
.planet-orb {
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 30%, rgba(255,107,157,0.6), transparent 50%),
    radial-gradient(circle at 70% 70%, rgba(167,139,250,0.7), transparent 55%),
    radial-gradient(circle at 50% 50%, rgba(255,215,0,0.15), transparent 70%);
  filter: blur(60px);
  opacity: 0.7;
  animation: orb 12s ease-in-out infinite alternate;
}
@keyframes orb {
  0%   { transform: translate(-50%,-50%) rotate(0deg) scale(1); }
  100% { transform: translate(-50%,-50%) rotate(40deg) scale(1.15); }
}

/* Bounce slow */
.animate-bounce-slow { animation: bounceSlow 2.4s ease-in-out infinite; }
@keyframes bounceSlow {
  0%,100% { transform: translate(-50%, 0); opacity: 0.7; }
  50%     { transform: translate(-50%, 8px); opacity: 1; }
}

/* PLANETS — главы жизни в свободном расположении */
.planet-system {
  position: relative;
  width: 100%;
  height: clamp(900px, 95vh, 1180px);
  margin: 0 auto;
  padding: 60px 0;
}
.planet-wrap {
  position: absolute;
  left: var(--x, 50%);
  top: var(--y, 50%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: transparent;
  border: 0;
  cursor: pointer;
  isolation: isolate;
}
@media (max-width: 768px) {
  .planet-system {
    display: grid;
    grid-template-columns: 1fr 1fr;
    height: auto;
    gap: 2.5rem 1rem;
    place-items: center;
  }
  .planet-wrap {
    position: relative !important;
    left: auto !important;
    top: auto !important;
  }
}
.planet-wrap {
  /* mouse parallax + float — управляются JS-ом и CSS-keyframe вместе */
  --mx: 0px;
  --my: 0px;
  transform: translate3d(var(--mx), calc(var(--my) + var(--sy, 0px)), 0);
  transition: transform 0.6s cubic-bezier(.2,.8,.2,1);
}
.planet {
  --size: calc(clamp(140px, 16vw, 200px) * var(--scale, 1));
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  position: relative;
  /* По умолчанию — облачная сфера-градиент (запасной вариант, если нет PNG) */
  background:
    radial-gradient(circle at 30% 25%, rgba(255,255,255,0.7) 0%, rgba(255,255,255,0) 30%),
    radial-gradient(ellipse 70% 60% at 65% 35%, var(--p3) 0%, transparent 60%),
    radial-gradient(ellipse 65% 55% at 30% 60%, var(--p2) 0%, transparent 55%),
    radial-gradient(ellipse 40% 40% at 50% 80%, var(--p3) 0%, transparent 50%),
    var(--p1);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  box-shadow:
    inset 4px 6px 14px rgba(255, 255, 255, 0.12),
    inset -5px -7px 18px rgba(0, 0, 0, 0.22);
  filter:
    drop-shadow(0 6px 10px rgba(8, 2, 24, 0.55))
    drop-shadow(0 18px 28px rgba(10, 1, 24, 0.55))
    drop-shadow(0 0 10px color-mix(in srgb, var(--p1) 50%, transparent));
  animation: planetFloat var(--float-dur, 7s) ease-in-out infinite;
  animation-delay: var(--float-delay, 0s);
  transition: filter 0.5s, transform 0.5s cubic-bezier(.2,.8,.2,1);
}

/* PNG-планеты — реальные иллюстрации; зум 118% обрезает встроенный внешний glow по краям */
.planet-wrap[data-planet="01"] .planet { background: url('planets/01-znakomstvo.webp?v=10')      center / 100% no-repeat; box-shadow: none; }
.planet-wrap[data-planet="02"] .planet { background: url('planets/02-svadba.webp?v=10')           center / 100% no-repeat; box-shadow: none; }
.planet-wrap[data-planet="03"] .planet { background: url('planets/03-medovy.webp?v=10')           center / 100% no-repeat; box-shadow: none; }
.planet-wrap[data-planet="04"] .planet { background: url('planets/04-svoy-dom.webp?v=10')         center / 100% no-repeat; box-shadow: none; }
.planet-wrap[data-planet="05"] .planet { background: url('planets/05-deti.webp?v=10')             center / 100% no-repeat; box-shadow: none; }
.planet-wrap[data-planet="06"] .planet { background: url('planets/06-puteshestviya.webp?v=10')    center / 100% no-repeat; box-shadow: none; }
.planet-wrap[data-planet="07"] .planet { background: url('planets/07-godovschiny.webp?v=10')      center / 100% no-repeat; box-shadow: none; }
.planet-wrap[data-planet="08"] .planet { background: url('planets/08-drevo.webp?v=10')            center / 100% no-repeat; box-shadow: none; }
/* Убираем CSS-атмосферу для PNG-планет — у них уже есть свой натуральный glow */
.planet-wrap[data-planet] .planet::before { display: none; }
/* Снимаем круглую обрезку — PNG показывается полностью в свой натуральной форме (сфера + транспарентные углы) */
.planet-wrap[data-planet] .planet { border-radius: 0; }
.planet::before {
  /* Тонкая атмосфера */
  content: '';
  position: absolute;
  inset: -6%;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, transparent 58%, color-mix(in srgb, var(--p1) 28%, transparent) 78%, transparent 92%);
  pointer-events: none;
  z-index: -1;
  filter: blur(8px);
}
.planet::after {
  /* Тонкое кольцо-орбита, появляется на ховер */
  content: '';
  position: absolute;
  inset: -14%;
  border-radius: 50%;
  border: 1px dashed color-mix(in srgb, var(--p1) 35%, transparent);
  opacity: 0;
  transform: scale(0.92) rotate(-10deg);
  transition: opacity 0.4s, transform 0.6s;
  pointer-events: none;
}
@keyframes planetFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(-14px) rotate(2deg); }
}
.planet-wrap:hover .planet {
  transform: scale(1.06) translateY(-4px);
  filter:
    drop-shadow(0 8px 14px rgba(8, 2, 24, 0.55))
    drop-shadow(0 22px 32px rgba(10, 1, 24, 0.6))
    drop-shadow(0 0 14px color-mix(in srgb, var(--p1) 70%, transparent));
}
.planet-wrap:hover .planet::after {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

/* Подпись ВНУТРИ планеты */
.planet-label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  pointer-events: none;
  z-index: 2;
  padding: 8px;
  transition: transform 0.4s cubic-bezier(.2,.8,.2,1);
}
.planet-wrap:hover .planet-label { transform: scale(1.05); }
.pl-num {
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: clamp(9px, 0.9vw, 11px);
  letter-spacing: 0.22em;
  /* Цифра в самом светлом оттенке планеты */
  color: var(--p3);
  text-transform: uppercase;
  font-weight: 600;
  text-shadow:
    0 0 1px rgba(0,0,0,1),
    0 1px 4px rgba(0,0,0,0.95),
    0 0 8px rgba(0,0,0,0.7),
    0 0 14px color-mix(in srgb, var(--p1) 50%, transparent);
  margin-bottom: 4px;
  filter: brightness(1.15);
}
.pl-name {
  font-family: var(--font-display);
  font-size: calc(clamp(0.9rem, 1.4vw, 1.2rem) * var(--scale, 1) * 0.95);
  font-weight: 800;
  letter-spacing: -0.01em;
  color: #fff;
  text-shadow:
    0 0 6px color-mix(in srgb, var(--p1) 90%, transparent),
    0 0 14px color-mix(in srgb, var(--p1) 80%, transparent),
    0 0 28px color-mix(in srgb, var(--p1) 65%, transparent),
    0 0 48px color-mix(in srgb, var(--p1) 45%, transparent),
    0 2px 4px rgba(0,0,0,0.9);
  line-height: 1;
  filter: brightness(1.1) saturate(1.15);
}
/* Для длинных имён — фиксированный размер шрифта без умножения на --scale, чтобы текст помещался в круг */
.planet-wrap[data-planet="01"] .pl-name,  /* Знакомство */
.planet-wrap[data-planet="06"] .pl-name,  /* Путешествия */
.planet-wrap[data-planet="07"] .pl-name {  /* Годовщины */
  font-size: clamp(0.85rem, 1.05vw, 1.05rem);
  letter-spacing: -0.015em;
}

/* Специально для «Свадьбы» — у белой планеты белый glow вместо --p1 */
.planet-wrap[data-planet="02"] .planet {
  filter:
    drop-shadow(0 6px 10px rgba(8, 2, 24, 0.55))
    drop-shadow(0 18px 28px rgba(10, 1, 24, 0.55))
    drop-shadow(0 0 12px rgba(255, 255, 255, 0.55))
    drop-shadow(0 0 24px rgba(255, 255, 255, 0.25));
}
.planet-wrap[data-planet="02"]:hover .planet {
  filter:
    drop-shadow(0 8px 14px rgba(8, 2, 24, 0.55))
    drop-shadow(0 22px 32px rgba(10, 1, 24, 0.6))
    drop-shadow(0 0 18px rgba(255, 255, 255, 0.75))
    drop-shadow(0 0 36px rgba(255, 255, 255, 0.35));
}

/* Специально для «Свадьбы» — на белой планете цветной glow текста не работает, ставим серый */
.planet-wrap[data-planet="02"] .pl-name {
  text-shadow:
    0 0 6px rgba(120, 115, 130, 0.45),
    0 0 14px rgba(100, 95, 110, 0.3),
    0 0 28px rgba(90, 85, 100, 0.2),
    0 2px 4px rgba(30, 25, 40, 0.55);
}
.pl-quote { display: none; }

/* Heart-comets canvas */
#hearts {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

/* Индивидуальные параметры floating для каждой планеты — рандом-эффект */
.planet-system .planet-wrap:nth-child(1) .planet { --float-dur: 6.5s; --float-delay: 0s; }
.planet-system .planet-wrap:nth-child(2) .planet { --float-dur: 8s;   --float-delay: -1.2s; }
.planet-system .planet-wrap:nth-child(3) .planet { --float-dur: 7.2s; --float-delay: -2.4s; }
.planet-system .planet-wrap:nth-child(4) .planet { --float-dur: 6.8s; --float-delay: -3.5s; }
.planet-system .planet-wrap:nth-child(5) .planet { --float-dur: 7.8s; --float-delay: -0.8s; }
.planet-system .planet-wrap:nth-child(6) .planet { --float-dur: 6.2s; --float-delay: -2s; }
.planet-system .planet-wrap:nth-child(7) .planet { --float-dur: 8.4s; --float-delay: -4.1s; }
.planet-system .planet-wrap:nth-child(8) .planet { --float-dur: 7.5s; --float-delay: -3.2s; }

/* TIMELINE — clean horizontal layout, нить + карточки чётко видны */
.timeline-track {
  scrollbar-width: none;
  -ms-overflow-style: none;
  scroll-behavior: smooth;
  overscroll-behavior-x: contain;
  height: 560px;
  padding: 0 !important;
}
.timeline-track::-webkit-scrollbar { display: none; height: 0; width: 0; }
.timeline-track > div {
  height: 100%;
  padding: 0 4rem !important;
  align-items: stretch !important;
  gap: 2.5rem !important;
}
/* Толстая видимая нить — яркая по всему viewport, fade только у самых краёв */
.timeline-line {
  background: linear-gradient(90deg,
    rgba(167,139,250,0.35) 0%,
    rgba(167,139,250,0.95) 4%,
    rgba(167,139,250,0.95) 96%,
    rgba(167,139,250,0.35) 100%) !important;
  height: 2px !important;
  top: 50% !important;
  transform: translateY(-50%);
  box-shadow: 0 0 16px rgba(167,139,250,0.5), 0 0 32px rgba(167,139,250,0.25);
  z-index: 0;
}

.timeline-point {
  position: relative;
  width: 13rem;
  flex-shrink: 0;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  height: 100%;
  z-index: 2;
}
.timeline-point .dot {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--violet);
  box-shadow: 0 0 0 4px rgba(8,6,15,0.95), 0 0 20px var(--violet), 0 0 40px rgba(167,139,250,0.4);
  transition: all 0.3s;
  z-index: 3;
}
.timeline-point .dot.big {
  width: 20px;
  height: 20px;
  background: var(--pink);
  box-shadow: 0 0 25px var(--pink);
}
.timeline-point .dot.pulse {
  background: var(--gold);
  box-shadow: 0 0 30px var(--gold);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%,100% { box-shadow: 0 0 20px var(--gold); transform: translate(-50%,-50%) scale(1); }
  50%     { box-shadow: 0 0 40px var(--gold); transform: translate(-50%,-50%) scale(1.3); }
}

/* Карточки: верхние — в верхней половине трека, нижние — в нижней */
.timeline-point .card {
  position: absolute;
  left: 50%;
  width: 13rem;
  height: 165px;
  padding: 1rem 1.1rem;
  border-radius: 1rem;
  background: rgba(26,11,46,0.95);
  border: 1px solid rgba(167,139,250,0.18);
  backdrop-filter: blur(10px);
  opacity: 0;
  transform: translateX(-50%) translateY(20px);
  transition: opacity 0.7s cubic-bezier(.2,.8,.2,1), transform 0.7s cubic-bezier(.2,.8,.2,1), border-color 0.3s, box-shadow 0.3s;
  box-shadow: 0 16px 36px -12px rgba(0,0,0,0.7), 0 4px 16px -4px rgba(167,139,250,0.2);
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow: hidden;
}
/* Нечётные — карточка СНИЗУ, верх карточки на 32px ниже центра */
.timeline-point:nth-child(odd) .card {
  top: calc(50% + 32px);
}
/* Чётные — карточка СВЕРХУ, низ карточки на 32px выше центра */
.timeline-point:nth-child(even) .card {
  bottom: calc(50% + 32px);
  transform: translateX(-50%) translateY(-20px);
}
/* Появление при попадании в зону видимости */
.timeline-point.tl-visible .card {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.timeline-point.tl-visible:hover .card {
  border-color: rgba(255,107,157,0.5);
  box-shadow: 0 20px 48px -10px rgba(255,107,157,0.45), 0 0 24px rgba(255,107,157,0.2);
}
/* Тонкая connector-линия от точки к карточке */
.timeline-point::before {
  content: '';
  position: absolute;
  left: 50%;
  width: 1px;
  height: 28px;
  background: linear-gradient(to bottom, rgba(167,139,250,0.6), rgba(167,139,250,0));
  transform: translateX(-50%);
  z-index: 1;
}
.timeline-point:nth-child(odd)::before  { top: calc(50% + 8px); }
.timeline-point:nth-child(even)::before { bottom: calc(50% + 8px); background: linear-gradient(to top, rgba(167,139,250,0.6), rgba(167,139,250,0)); }
.timeline-point:hover .dot {
  transform: translate(-50%, -50%) scale(1.4);
}

/* AI chat */
.chat-card { box-shadow: 0 30px 80px -30px rgba(93,211,255,0.25); }
.persona-btn {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 999px;
  background: transparent;
  border: 0;
  color: rgba(255,255,255,0.55);
  cursor: pointer;
  transition: all 0.25s;
  font-weight: 500;
  white-space: nowrap;
}
.persona-btn:hover { color: white; }
.persona-btn.active {
  background: linear-gradient(90deg, #5DD3FF, #FF6B9D);
  color: white;
  font-weight: 600;
}
#chat-stream::-webkit-scrollbar { width: 4px; }
#chat-stream::-webkit-scrollbar-track { background: transparent; }
#chat-stream::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 4px; }
.msg { display: flex; }
.msg.user { justify-content: flex-end; }
.msg.ai { justify-content: flex-start; }
.bubble {
  max-width: 85%;
  padding: 0.75rem 1rem;
  border-radius: 1rem;
  line-height: 1.5;
}
.msg.user .bubble {
  background: linear-gradient(135deg, var(--pink), var(--violet));
  color: white;
  border-bottom-right-radius: 0.25rem;
}
.msg.ai .bubble {
  position: relative;
  isolation: isolate;
  border: 1px solid rgba(255, 107, 157, 0.55);
  border-bottom-left-radius: 0.25rem;
  box-shadow:
    0 0 12px rgba(255, 107, 157, 0.30),
    0 0 32px rgba(255, 107, 157, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  /* Основной текст — белый для читабельности */
  color: rgba(255, 255, 255, 0.94);
  background-color: transparent;
  background-image: none;
}
/* Фон-пузырь — отдельный слой под текстом (зеркальное свечение + стекло) */
.msg.ai .bubble::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0.02) 50%, rgba(255, 107, 157, 0.10)),
    rgba(20, 8, 36, 0.68);
  backdrop-filter: blur(10px) saturate(140%);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
}
/* Акценты в тексте — разные цвета для важных фраз */
.msg.ai .bubble strong,
.msg.ai .bubble .acc-pink {
  background-image: linear-gradient(135deg, #FF6B9D 0%, #FFD700 100%);
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
          color: transparent;
  font-weight: 700;
}
.msg.ai .bubble .acc-cyan {
  background-image: linear-gradient(135deg, #5DD3FF 0%, #A78BFA 100%);
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
          color: transparent;
  font-weight: 600;
}
.msg.ai .bubble .acc-purple {
  background-image: linear-gradient(135deg, #C84BFF 0%, #FF6B9D 100%);
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
          color: transparent;
  font-weight: 600;
}
.msg.ai .bubble .acc-gold {
  background-image: linear-gradient(135deg, #FFD700 0%, #FF8C8C 100%);
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
          color: transparent;
  font-weight: 600;
}
.msg.ai .bubble .acc-mint {
  background-image: linear-gradient(135deg, #5DE3D2 0%, #5DD3FF 100%);
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
          color: transparent;
  font-weight: 600;
}
.dot-typing {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted);
  margin: 0 2px;
  animation: typing 1.2s ease-in-out infinite;
}
.dot-typing:nth-child(2) { animation-delay: 0.15s; }
.dot-typing:nth-child(3) { animation-delay: 0.3s; }
@keyframes typing {
  0%,80%,100% { opacity: 0.3; transform: translateY(0); }
  40%         { opacity: 1; transform: translateY(-4px); }
}

/* TREE → NET-GRAPH (паутина связей с движущимися нитями) */
.tree-svg { z-index: 1; pointer-events: none; }
.tree-line {
  fill: none;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-dasharray: 5 7;
  animation: lineFlow 3s linear infinite;
  opacity: 0.85;
  vector-effect: non-scaling-stroke;
}
.tree-line--main {
  stroke-width: 2.2;
  stroke-dasharray: 8 4;
  animation: lineFlow 1.8s linear infinite;
  opacity: 1;
  filter: drop-shadow(0 0 4px rgba(255,107,157,0.6));
}
.tree-line--soft {
  stroke-width: 1.1;
  stroke-dasharray: 3 9;
  animation-duration: 4.5s;
  opacity: 0.55;
}
.tree-line--web {
  stroke-width: 0.85;
  stroke-dasharray: 1.5 5;
  animation-duration: 6s;
  opacity: 0.38;
}
/* Брачные узы: тонкий красный пунктир между парами, строго между кружками */
.tree-line--couple {
  stroke-width: 1.0;
  stroke-dasharray: 2 2.5;
  animation: none;
  opacity: 0.95;
  filter: drop-shadow(0 0 2px rgba(255, 61, 110, 0.45));
}

/* Tooltip для узлов древа: компактный, цветной, полупрозрачный */
.tree-tooltip {
  max-width: 260px;
  padding: 14px 16px;
  border-radius: 18px;
  font-size: 13px;
  line-height: 1.45;
  color: #FBEFFF;
  background: linear-gradient(135deg,
    rgba(199, 100, 220, 0.22),
    rgba(93, 211, 255, 0.18));
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  box-shadow:
    0 8px 28px rgba(20, 5, 40, 0.55),
    0 0 0 1px rgba(255, 107, 157, 0.10) inset;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}
.tree-tooltip b {
  display: block;
  font-family: var(--font-display);
  font-size: 14px;
  color: #FFD9F0;
  margin-bottom: 4px;
  letter-spacing: 0.02em;
}
.tree-tooltip i {
  font-style: italic;
  color: rgba(255, 255, 255, 0.92);
}

/* Модальная подложка для карточки био — центр вьюпорта */
.tree-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 60;
  background: rgba(8, 4, 16, 0.5);
  backdrop-filter: blur(6px) saturate(120%);
  -webkit-backdrop-filter: blur(6px) saturate(120%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.tree-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

/* Карточка био внутри модалки: двухколоночный список фактов */
.tree-info-card {
  position: relative;
  text-align: left;
  width: 100%;
  max-width: 720px;
  padding: 24px 28px;
  border-radius: 22px;
  background: linear-gradient(135deg,
    rgba(199, 100, 220, 0.22),
    rgba(93, 211, 255, 0.16)),
    rgba(20, 8, 36, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 20px 60px rgba(8, 2, 24, 0.7),
              0 0 0 1px rgba(255, 107, 157, 0.08) inset;
  animation: bioFadeIn 0.4s cubic-bezier(.2,.8,.2,1);
}
.tree-info-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.7);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, transform 0.2s;
}
.tree-info-close:hover {
  background: rgba(255, 107, 157, 0.22);
  color: white;
  transform: rotate(90deg);
}
@keyframes bioFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.tree-info-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
}
.tree-info-name {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.tree-info-role {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
  font-style: italic;
}
.tree-info-facts {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 28px;
}
.tree-info-facts li {
  position: relative;
  padding-left: 18px;
  font-size: 13.5px;
  line-height: 1.45;
  color: rgba(255, 235, 250, 0.92);
}
.tree-info-facts li::before {
  content: '✦';
  position: absolute;
  left: 0;
  top: 1px;
  font-size: 11px;
  color: #FF6B9D;
}
@media (max-width: 720px) {
  .tree-info-facts { grid-template-columns: 1fr; }
  .tree-info-card  { padding: 16px 18px; }
}
.tree-line:nth-child(2n)  { animation-duration: 3.4s; }
.tree-line:nth-child(3n)  { animation-duration: 3.8s; animation-direction: reverse; }
.tree-line:nth-child(5n)  { animation-duration: 2.6s; }
@keyframes lineFlow {
  to { stroke-dashoffset: -24; }
}

/* NET-NODE: иконка в круглой рамке + подпись снизу */
.net-node {
  position: absolute;
  left: var(--nx);
  top: var(--ny);
  transform: translate(-50%, -50%);
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 3;
  animation: nodeFloat 6s ease-in-out infinite;
}
.net-node:nth-child(2n) { animation-duration: 7s; animation-delay: -1.5s; }
.net-node:nth-child(3n) { animation-duration: 5.5s; animation-delay: -3s; }
.nn-circle {
  width: clamp(58px, 6vw, 76px);
  height: clamp(58px, 6vw, 76px);
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 30%, rgba(255,255,255,0.10), transparent 55%),
    radial-gradient(circle, #1A0F2E 0%, #08060F 100%);
  border: 2.5px solid var(--c, #5DD3FF);
  box-shadow:
    0 0 16px color-mix(in srgb, var(--c) 60%, transparent),
    0 0 32px color-mix(in srgb, var(--c) 30%, transparent),
    inset 0 0 14px color-mix(in srgb, var(--c) 18%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: transform 0.35s cubic-bezier(.2,.8,.2,1), box-shadow 0.3s, border-color 0.3s;
}
.nn-circle.special {
  border-color: var(--gold);
  box-shadow:
    0 0 22px rgba(255,215,0,0.6),
    0 0 44px rgba(255,215,0,0.3),
    inset 0 0 18px rgba(255,215,0,0.25);
  animation: nnGoldPulse 2.6s ease-in-out infinite;
}
.nn-circle.pending {
  border-style: dashed;
  border-color: rgba(93, 227, 210, 0.55);
}
@keyframes nnGoldPulse {
  0%, 100% { box-shadow: 0 0 22px rgba(255,215,0,0.6), 0 0 44px rgba(255,215,0,0.3), inset 0 0 18px rgba(255,215,0,0.25); }
  50%      { box-shadow: 0 0 32px rgba(255,215,0,0.85), 0 0 64px rgba(255,215,0,0.5), inset 0 0 24px rgba(255,215,0,0.35); }
}
.nn-icon {
  font-size: clamp(26px, 3vw, 34px);
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.6));
}
.nn-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  pointer-events: none;
}
.nn-label b {
  font-family: var(--font-display);
  font-size: clamp(13px, 1.2vw, 15px);
  font-weight: 700;
  color: white;
  text-shadow: 0 2px 6px rgba(0,0,0,0.9), 0 0 10px rgba(0,0,0,0.6);
}
.nn-label i {
  font-style: normal;
  font-size: clamp(10px, 0.9vw, 11.5px);
  color: var(--c, rgba(255,255,255,0.7));
  font-family: 'Geist Mono', ui-monospace, monospace;
  letter-spacing: 0.04em;
  text-shadow: 0 1px 4px rgba(0,0,0,0.85);
  filter: brightness(1.15);
  text-align: center;
  max-width: 130px;
  line-height: 1.25;
}
.net-node:hover .nn-circle {
  transform: scale(1.12);
  box-shadow:
    0 0 28px color-mix(in srgb, var(--c) 80%, transparent),
    0 0 56px color-mix(in srgb, var(--c) 50%, transparent),
    inset 0 0 18px color-mix(in srgb, var(--c) 28%, transparent);
}
.net-node:hover { animation-play-state: paused; }
@keyframes nodeFloat {
  0%, 100% { transform: translate(-50%, -50%) translateY(0); }
  50%      { transform: translate(-50%, -50%) translateY(-7px); }
}

/* старые tree-node стили (legacy) — оставляю на случай вдруг где-то остались */
.tree-node {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 28% 25%, rgba(255,255,255,0.6), transparent 35%),
    linear-gradient(135deg, var(--pink), var(--violet));
  border: none;
  color: white;
  font-weight: 800;
  font-family: var(--font-display);
  font-size: 1.05rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    inset -6px -8px 18px rgba(0,0,0,0.3),
    inset 4px 4px 12px rgba(255,255,255,0.2),
    0 0 30px rgba(255,107,157,0.4);
  transition: transform 0.3s cubic-bezier(.2,.8,.2,1), box-shadow 0.3s;
  z-index: 3;
  animation: nodeFloat 5s ease-in-out infinite;
  text-shadow: 0 1px 4px rgba(0,0,0,0.6);
}
@keyframes nodeFloat {
  0%, 100% { transform: translate(-50%, -50%) translateY(0); }
  50%      { transform: translate(-50%, -50%) translateY(-6px); }
}
.tree-node.small {
  width: 60px;
  height: 60px;
  font-size: 0.95rem;
  background:
    radial-gradient(circle at 28% 25%, rgba(255,255,255,0.4), transparent 40%),
    linear-gradient(135deg, var(--bg2), color-mix(in srgb, var(--violet) 50%, transparent));
  border: 1px solid rgba(167,139,250,0.4);
  box-shadow:
    inset -4px -6px 14px rgba(0,0,0,0.3),
    inset 3px 3px 10px rgba(255,255,255,0.15),
    0 0 20px rgba(167,139,250,0.35);
  animation-duration: 6s;
}
.tree-node.small.special {
  background:
    radial-gradient(circle at 28% 25%, rgba(255,255,255,0.5), transparent 40%),
    linear-gradient(135deg, var(--gold), var(--pink));
  border-color: var(--gold);
  box-shadow:
    inset -4px -6px 14px rgba(0,0,0,0.25),
    inset 3px 3px 10px rgba(255,255,255,0.25),
    0 0 24px rgba(255,215,0,0.5);
}
.tree-node:hover {
  transform: translate(-50%, -50%) translateY(-6px) scale(1.18);
  box-shadow:
    inset -6px -8px 18px rgba(0,0,0,0.35),
    inset 4px 4px 14px rgba(255,255,255,0.3),
    0 0 50px var(--pink);
  animation-play-state: paused;
}
.tree-node .ring {
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  border: 1.5px dashed rgba(255,107,157,0.5);
  animation: ringPulse 3s ease-in-out infinite, ringRotate 12s linear infinite;
}
@keyframes ringPulse {
  0%,100% { opacity: 0.5; }
  50%     { opacity: 1; }
}
@keyframes ringRotate {
  to { transform: rotate(360deg); }
}

/* Reveal animations */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* Hero lines initial state for GSAP */
.hero-line { opacity: 0; transform: translateY(40px); }

/* Hero floating letters — лёгкий параллакс, без эффектов */
.hero-letters .hl {
  display: inline-block;
  animation: letterFloat 3s ease-in-out infinite;
  animation-delay: var(--d, 0s);
}
.hero-letters .hl-space { display: inline-block; width: 0.35em; }
.hero-letters .hl-word { display: inline-block; white-space: nowrap; }
@keyframes letterFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-5px); }
}

/* Hero — без теней, без glow */
#hero h1 { text-shadow: none; }
#hero h1 .text-transparent { filter: none; }

/* Голубо-розовые кнопки — усиленный неон при hover */
.magnetic.bg-gradient-to-r {
  position: relative;
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(0,0,0,0.4);
}
.magnetic.bg-gradient-to-r::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  background: linear-gradient(90deg, #5DD3FF, #C84BFF, #FF6B9D);
  opacity: 0;
  filter: blur(14px);
  transition: opacity 0.4s;
  z-index: -1;
}
.magnetic.bg-gradient-to-r:hover::before { opacity: 0.85; }

/* Запуск событий — кнопка в Hero */
.event-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  font-size: 12px;
  font-family: 'Geist Mono', ui-monospace, monospace;
  letter-spacing: 0.05em;
  border-radius: 999px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(93, 211, 255, 0.3);
  color: rgba(255,255,255,0.85);
  cursor: pointer;
  transition: all 0.3s;
}
.event-trigger:hover {
  background: rgba(93, 211, 255, 0.1);
  border-color: rgba(93, 211, 255, 0.6);
  box-shadow: 0 0 20px rgba(93, 211, 255, 0.3);
}

/* Modal — общая база для event-modal и onboarding */
.modal-bg {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
  background: rgba(8, 6, 15, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-bg.open {
  display: flex;
  animation: modalIn 0.35s ease-out;
}
@keyframes modalIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.modal-card {
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  background: linear-gradient(180deg, rgba(26, 11, 46, 0.95), rgba(14, 11, 26, 0.95));
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 24px;
  padding: 32px;
  position: relative;
  box-shadow: 0 30px 80px -20px rgba(0,0,0,0.6), 0 0 60px rgba(93, 211, 255, 0.15);
  animation: modalCardIn 0.4s cubic-bezier(.2,.8,.2,1);
  scrollbar-width: thin;
  scrollbar-color: rgba(167, 139, 250, 0.35) transparent;
}
.modal-card::-webkit-scrollbar { width: 8px; }
.modal-card::-webkit-scrollbar-track { background: transparent; }
.modal-card::-webkit-scrollbar-thumb {
  background: rgba(167, 139, 250, 0.35);
  border-radius: 999px;
}
.modal-card::-webkit-scrollbar-thumb:hover { background: rgba(167, 139, 250, 0.55); }
@keyframes modalCardIn {
  from { opacity: 0; transform: scale(0.92) translateY(12px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-card .close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.15);
  background: transparent;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: all 0.2s;
}
.modal-card .close:hover { border-color: var(--pink); background: rgba(255,107,157,0.1); }
.modal-card label {
  display: block;
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.6);
  margin-bottom: 8px;
  font-family: 'Geist Mono', ui-monospace, monospace;
}
.modal-card input[type="text"], .modal-card textarea, .modal-card select {
  width: 100%;
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  color: white;
  font-family: inherit;
  font-size: 15px;
  outline: none;
  transition: all 0.2s;
}
.modal-card input[type="text"]:focus, .modal-card textarea:focus, .modal-card select:focus {
  border-color: rgba(93, 211, 255, 0.6);
  box-shadow: 0 0 0 3px rgba(93, 211, 255, 0.1);
}
.modal-card .pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Onboarding — пояснение под лейблом */
.modal-card .ob-sub {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
  margin-top: -10px;
  margin-bottom: 4px;
  letter-spacing: 0.01em;
}

/* Цветной pill со свотчем */
.modal-card .pill-color {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.modal-card .pill-swatch {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--swatch, #888);
  box-shadow: 0 0 6px var(--swatch, #888);
  flex: 0 0 auto;
}

/* Добавление своих pill-ов (Свой герой/артефакт + Enter) */
.modal-card .pill-plus-wrap {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}
.modal-card .pill-plus-input {
  flex: 1 1 auto;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.10);
  color: white;
  font-size: 13px;
}
.modal-card .pill-plus-input:focus {
  border-color: rgba(167, 139, 250, 0.5);
  box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.12);
}
.modal-card .pill-plus-btn {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(167, 139, 250, 0.25);
  border: 1px solid rgba(167, 139, 250, 0.4);
  color: white;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}
.modal-card .pill-plus-btn:hover  { background: rgba(167, 139, 250, 0.45); }
.modal-card .pill-plus-btn:active { transform: scale(0.92); }

/* Universe Card — превью вселенной (glass + мягкие цветные пятна по углам) */
.universe-card {
  position: relative;
  border-radius: 22px;
  padding: 20px 22px;
  background:
    radial-gradient(circle at 0% 0%,   var(--uc-c1, transparent) 0%, transparent 55%),
    radial-gradient(circle at 100% 0%, var(--uc-c2, transparent) 0%, transparent 55%),
    radial-gradient(circle at 0% 100%, var(--uc-c3, transparent) 0%, transparent 55%),
    radial-gradient(circle at 100% 100%, var(--uc-c4, transparent) 0%, transparent 55%),
    rgba(20, 10, 36, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 20px 60px rgba(8, 2, 24, 0.5);
  backdrop-filter: blur(8px) saturate(130%);
  -webkit-backdrop-filter: blur(8px) saturate(130%);
  overflow: hidden;
  animation: bioFadeIn 0.5s cubic-bezier(.2,.8,.2,1);
}
.universe-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 20%, rgba(255,255,255,0.06), transparent 55%);
  pointer-events: none;
}
.universe-head { position: relative; z-index: 1; margin-bottom: 12px; }
.universe-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  margin: 0;
  background: linear-gradient(90deg, #fff, #FFD9F0);
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
}
.universe-subtitle {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.72);
  margin-top: 4px;
}
.universe-section {
  position: relative;
  z-index: 1;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.10);
}
.universe-section-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 8px;
  font-family: 'Geist Mono', ui-monospace, monospace;
}
.universe-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.universe-chip {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: white;
  font-size: 13px;
  backdrop-filter: blur(6px);
}
.universe-text {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  font-style: italic;
  color: rgba(255, 255, 255, 0.9);
}
.universe-palette {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.universe-palette-swatch {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--swatch, #888);
  box-shadow: 0 0 12px var(--swatch, #888), inset 0 0 6px rgba(0,0,0,0.3);
  border: 1px solid rgba(255, 255, 255, 0.18);
}
.universe-cta {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 22px;
}
.universe-deeper {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.20);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.88);
  padding: 10px 16px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.universe-deeper:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.4);
  color: white;
}

/* Кнопка «Наверх» — плавающая в правом нижнем углу */
.back-to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 30%, rgba(255,255,255,0.10), transparent 55%),
    linear-gradient(135deg, rgba(93, 211, 255, 0.85), rgba(200, 75, 255, 0.75), rgba(255, 107, 157, 0.85));
  border: 1px solid rgba(255, 255, 255, 0.20);
  color: white;
  cursor: pointer;
  z-index: 70;
  box-shadow:
    0 12px 28px rgba(8, 2, 24, 0.55),
    0 0 22px rgba(255, 107, 157, 0.35);
  opacity: 0;
  pointer-events: none;
  transform: translateY(14px) scale(0.92);
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(.2,.8,.2,1), box-shadow 0.25s;
}
.back-to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}
.back-to-top:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow:
    0 16px 36px rgba(8, 2, 24, 0.7),
    0 0 32px rgba(255, 107, 157, 0.55);
}
.back-to-top:active { transform: translateY(0) scale(0.96); }

/* Стрелки прокрутки таймлайна — десктоп */
.timeline-scroller { position: relative; }
.timeline-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.85);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: background 0.2s, color 0.2s, transform 0.18s, border-color 0.2s;
  user-select: none;
}
.timeline-arrow:hover {
  background: rgba(167, 139, 250, 0.28);
  border-color: rgba(167, 139, 250, 0.55);
  color: white;
  transform: translateY(-50%) scale(1.08);
}
.timeline-arrow:active { transform: translateY(-50%) scale(0.94); }
.timeline-arrow--left  { left: -18px; }
.timeline-arrow--right { right: -18px; }

/* На мобилке прячем стрелки — работает нативный тач-свайп */
@media (max-width: 768px) {
  .timeline-arrow { display: none; }
}

/* Прокручиваемая палитра цветов: пилюли в одну строку + стрелки */
.modal-card .color-scroller {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}
.modal-card .pill-row--scroll {
  flex: 1 1 auto;
  flex-wrap: nowrap;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 4px 2px;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 14px), transparent 100%);
          mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 14px), transparent 100%);
}
.modal-card .pill-row--scroll::-webkit-scrollbar { display: none; }
.modal-card .pill-row--scroll .pill {
  flex: 0 0 auto;
  white-space: nowrap;
}
.modal-card .color-scroll-arrow {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.78);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  user-select: none;
  transition: background 0.2s, color 0.2s, transform 0.15s;
}
.modal-card .color-scroll-arrow:hover {
  background: rgba(167, 139, 250, 0.22);
  color: white;
  transform: scale(1.08);
}
.modal-card .color-scroll-arrow:active {
  transform: scale(0.94);
}
.modal-card .pill {
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  font-size: 13px;
  color: rgba(255,255,255,0.85);
  cursor: pointer;
  transition: all 0.2s;
}
.modal-card .pill:hover { border-color: rgba(255,107,157,0.4); }
.modal-card .pill.active {
  background: linear-gradient(90deg, rgba(93,211,255,0.3), rgba(255,107,157,0.3));
  border-color: rgba(255,107,157,0.7);
  color: white;
}
.modal-card .submit-btn {
  width: 100%;
  margin-top: 24px;
  padding: 14px 24px;
  border-radius: 14px;
  background: linear-gradient(90deg, #5DD3FF, #C84BFF, #FF6B9D);
  border: 0;
  color: white;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 0 24px rgba(93, 211, 255, 0.3);
}
.modal-card .submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(255, 107, 157, 0.5), 0 0 40px rgba(93, 211, 255, 0.4);
}

/* Chapter modal — превью главы */
.chapter-header {
  margin-bottom: 20px;
}
.chapter-header .chapter-num {
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.chapter-header h3 {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
  color: white;
  margin-bottom: 8px;
}
.chapter-header .chapter-quote {
  font-style: italic;
  color: rgba(255,255,255,0.65);
  font-size: 14px;
}
.chapter-body {
  display: grid;
  gap: 14px;
  margin-bottom: 24px;
}
.chapter-body h4 {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: white;
  margin-bottom: 4px;
}
.chapter-body .chapter-section {
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
}
.chapter-body ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 6px;
}
.chapter-body li {
  font-size: 13px;
  color: rgba(255,255,255,0.78);
  display: flex;
  gap: 8px;
}
.chapter-body li::before {
  content: '→';
  color: var(--ch-color, #5DD3FF);
  font-weight: 700;
}

/* Plumbob над С&В в дереве (Sims!) */
.tree-node[data-name="Соня & Влад"]::before {
  content: '';
  position: absolute;
  top: -28px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 16px;
  height: 16px;
  background: linear-gradient(135deg, #4FE372, #2BC04C);
  box-shadow: 0 0 18px #4FE372, 0 0 30px rgba(79,227,114,0.5);
  animation: plumbobFloat 2.5s ease-in-out infinite;
  z-index: 4;
}
@keyframes plumbobFloat {
  0%, 100% { top: -28px; }
  50%      { top: -36px; }
}

/* Magnetic buttons cursor effect */
.magnetic { will-change: transform; }
