/* Картина → нажатие на эмблему между пальцами → солнечная система. */
* { box-sizing: border-box; }
html { overflow-x: clip; }
body.creation-entry { width: 100%; min-height: 100%; margin: 0; overflow-x: clip; --ease-in-out: cubic-bezier(.77, 0, .175, 1); }
body.creation-entry { background: #000; color: var(--moon); font-family: var(--body); }
::selection { background: #45ec00; color: #000; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

#gl { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; pointer-events: none; opacity: 0;
  transform: translate(calc(var(--core-x, 50vw) - 50vw), calc(var(--core-y, 50svh) - 50svh));
  transition: opacity 1200ms var(--ease-in-out); }
body:has(.expanded) #gl { opacity: .4; }
.nebula {
  position: fixed; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 45% 55% at 72% 55%, rgb(156 128 247 / .08), transparent 70%),
    radial-gradient(ellipse 30% 40% at 92% 90%, rgb(69 236 0 / .035), transparent 70%);
}
.scene { position: relative; width: 100%; height: 100%; height: 100svh; isolation: isolate; }

/* Сохраняем картину целиком, включая оба лица, при любой ориентации экрана. */
.painting { position: absolute; inset: 0; z-index: 2; pointer-events: none; opacity: 1;
  transition: opacity 900ms var(--ease-in-out); }
.painting img { display: block; width: 100%; height: 100%; object-fit: contain; user-select: none; }
.expanded .painting { opacity: 0; transition-duration: 1200ms; }
.entry-hint { position: absolute; left: 50%; top: min(calc(var(--art-bottom, 90vh) + 18px), calc(100% - 58px)); z-index: 6;
  margin: 0; padding: 10px 18px; border-radius: 24px; width: max-content; max-width: calc(100% - 32px);
  transform: translateX(-50%); color: #fff; background: rgb(0 0 0 / .68); text-align: center;
  font-size: 12px; line-height: 1.5; letter-spacing: .02em; pointer-events: none; opacity: .85;
  transition: opacity 180ms var(--ease-out); }
.expanded .entry-hint { opacity: 0; }

/* Ветки дерева разделов: прорисовываются от эмблемы при открытии. */
.orbits { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; overflow: visible; }
.orbits path { fill: none; stroke: rgb(196 179 255 / .38); stroke-width: 1.5; stroke-linecap: round; vector-effect: non-scaling-stroke;
  stroke-dasharray: 1; stroke-dashoffset: 1; opacity: 0;
  transition: stroke-dashoffset 500ms var(--ease-out), opacity 400ms var(--ease-out), stroke 200ms ease; }
.orbits path.hot { stroke: rgb(69 236 0 / .7); }
.expanded .orbits path { opacity: 1; stroke-dashoffset: 0;
  transition: stroke-dashoffset 900ms var(--ease-out) calc(700ms + var(--i) * 250ms), opacity 300ms var(--ease-out) calc(700ms + var(--i) * 250ms), stroke 200ms ease; }

#planets { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 4; pointer-events: none; }
/* Пока система свёрнута, холст планет не перекрывает солнце. */
.scene:not(.open) #planets { visibility: hidden; }

/* Одна кнопка связывает нарисованный знак и центр космической навигации. */
.core { display: block; gap: 0; border-radius: 0; font-family: inherit; position: absolute; left: 0; top: 0; z-index: 6; padding: 0; border: 0; background: none; cursor: pointer;
  transform: translate(var(--core-x, 50vw), var(--core-y, 50svh)) translate(-50%, -50%) scale(var(--core-scale, .4));
  -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.creation-entry .core::before { border: 0; box-shadow: none; animation: none; transform: none; opacity: 1; content: ''; position: absolute; inset: calc(0px - var(--core-hit-pad, 0px)); border-radius: 32px; }
.expanded .core { z-index: 3; }
.core:focus-visible { outline: 6px solid var(--star); outline-offset: 18px; border-radius: 24px; }
.core:focus-visible::before { background: rgb(69 236 0 / .08); }

/* Логотип в полный размер; солнце стоит ровно за кинокатушкой и совпадает с ней по размеру. */
.emblem-stage { position: relative; display: block; width: clamp(240px, 27vw, 380px); aspect-ratio: 480 / 337;
  opacity: 0; transition: opacity 700ms var(--ease-in-out); }
.expanded .emblem-stage { opacity: 1; }
.scene:not(.open) .sun-corona, .scene:not(.open) .sun-surface { animation-play-state: paused; }
.tab-hidden .sun-corona, .tab-hidden .sun-surface { animation-play-state: paused; }
.motion-paused .sun-corona, .motion-paused .sun-surface { animation-play-state: paused; }
.sun { position: absolute; z-index: 1; left: 50%; top: 69.5%; width: 41%; aspect-ratio: 1; transform: translate(-50%, -50%); }
.sun > span { display: block; position: absolute; border-radius: 50%; pointer-events: none; }
.sun-atmosphere { inset: -95%;
  background: radial-gradient(circle, rgb(255 196 110 / .2) 0%, rgb(255 160 60 / .1) 30%, rgb(255 120 30 / .04) 48%, transparent 70%); }
.sun-corona { inset: -62%;
  background: radial-gradient(circle, rgb(255 226 160 / .9) 38%, rgb(255 190 95 / .42) 45%, rgb(255 150 55 / .16) 55%, rgb(255 120 35 / .05) 66%, transparent 76%);
  animation: breathe 5.5s ease-in-out infinite; }
.sun-disc { inset: 0; overflow: hidden;
  background: radial-gradient(circle at 46% 44%, #ffd56e 0%, #ffbb45 38%, #f7951f 70%, #e06c18 88%, #c4500f 100%);
  box-shadow: 0 0 18px 4px rgb(255 214 140 / .85), 0 0 60px 14px rgb(255 160 60 / .35), inset 0 0 36px 4px rgb(140 45 0 / .4); }
/* Медленно плывущая «грануляция» поверхности (процедурный шум, без загружаемых картинок). */
.sun-surface { inset: -25%; opacity: .55; mix-blend-mode: overlay;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.045' numOctaves='3' seed='7'/%3E%3CfeColorMatrix values='0 0 0 0 1  0 0 0 0 .85  0 0 0 0 .5  0 0 0 1.6 -.55'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)'/%3E%3C/svg%3E") center / 60% repeat;
  animation: spin 120s linear infinite; }
.sun-corona, .sun-atmosphere { transition: opacity 1.1s var(--ease-out); }
.expanded .sun-corona { opacity: .55; }
.expanded .sun-atmosphere { opacity: .6; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes breathe { 50% { transform: scale(1.04); opacity: .8; } }
.emblem { position: relative; z-index: 2; display: block; width: 100%; height: auto;
  user-select: none; pointer-events: none; filter: drop-shadow(0 0 10px rgb(255 170 70 / .35)); }
@media (hover: hover) and (pointer: fine) {
  .core:hover .sun-disc { filter: brightness(1.08); }
  .core:hover .sun-corona { animation-duration: 2.4s; }
}

/* Планеты: 3D-шары рисует planets.js поверх .orb-ball. Пока WebGL не готов — градиентные шары. */
.orbs { position: absolute; inset: 0; z-index: 5; pointer-events: none; }
.orb { position: absolute; left: 0; top: 0; width: 0; height: 0; color: #fff; text-decoration: none; pointer-events: auto; will-change: transform, opacity; }
.orb-ball { --d: calc(var(--planet, 58px) * var(--size, 1)); position: absolute; left: 0; top: 0; width: var(--d); height: var(--d); border-radius: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle at 32% 26%, rgb(255 255 255 / .8) 0, transparent 24%), radial-gradient(circle at 40% 36%, var(--c1), var(--c2) 72%);
  box-shadow: 0 0 30px var(--glow), inset -10px -12px 24px rgb(0 0 0 / .42); }
.orb.ready .orb-ball { background: none; box-shadow: none; }
.orb-label { position: absolute; left: 0; top: calc(var(--d, 58px) / 2 + 8px); transform: translateX(calc(-50% + var(--shift, 0px))); display: block; width: max-content; max-width: 170px; text-align: center; font-family: var(--body); font-weight: 600; font-size: 14px; line-height: 1.3;
  padding: 3px 10px; border-radius: 12px; background: rgb(0 0 0 / .55);
  text-shadow: 0 1px 10px #000, 0 0 18px #000; transition: color .2s ease; }
.o-company .orb-label { top: auto; bottom: calc(var(--d, 58px) / 2 + 10px); }
.orb:focus-visible .orb-label { color: var(--star); }
@media (hover: hover) and (pointer: fine) {
  .orb:hover .orb-label { color: var(--star); }
}
.orb:focus-visible { outline: none; }
.orb:focus-visible .orb-label { text-decoration: underline; text-underline-offset: 4px; }
.o-news { --c1: #9fd0ff; --c2: #2a62c9; --glow: rgb(111 216 255 / .5); }
.o-partners { --c1: #8fa5ff; --c2: #2437b8; --glow: rgb(156 128 247 / .55); }
.o-invest { --c1: #ffe1c0; --c2: #c8864f; --glow: rgb(255 194 122 / .45); }
.o-company { --c1: #fff0c0; --c2: #c9a76a; --glow: rgb(255 227 160 / .45); }
.o-casting { --c1: #ff9a6b; --c2: #8a321a; --glow: rgb(255 138 92 / .45); }
.o-schools { --c1: #fff3cf; --c2: #b98a45; --glow: rgb(255 217 147 / .45); }

/* Без JS: разделы остаются доступными рядом под солнцем. */
html:not(.js) .orbs { position: absolute; inset: auto 0 6vh; display: flex; flex-wrap: wrap; justify-content: center; gap: 24px 32px; padding: 0 20px; }
html:not(.js) .orb { position: relative; width: 120px; height: 110px; }
html:not(.js) .orb-ball { left: 50%; top: 30px; }
html:not(.js) .orb-label { left: 50%; top: 64px; bottom: auto; }
html:not(.js) .orbits path { opacity: 0; }
html:not(.js) .painting { opacity: .45; }
html:not(.js) .core, html:not(.js) .entry-hint { display: none; }
/* С JS закрытая система скрыта и недоступна с клавиатуры (inert). */
.js .scene:not(.open) .orb { visibility: hidden; }

@media (max-width: 600px) {
  .emblem-stage { width: clamp(200px, 62vw, 270px); }
  .orb-label { font-size: 12px; max-width: 132px; padding: 3px 8px; }
}
@media (max-height: 480px) and (orientation: landscape) {
  .emblem-stage { width: min(29vw, 50svh); }
  .entry-hint { top: auto; bottom: 8px; font-size: 11px; padding: 5px 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .sun-corona, .sun-surface { animation: none; }
  .core, .orbits path { transition: none !important; }
  .painting, .emblem-stage, .entry-hint, #gl { transition: opacity 90ms linear; }
}

/* Ресурс подключается только к главной; оформление остальных страниц сохраняется. */
.creation-entry .orb, .creation-entry .scene.armed:not(.open) .orb { transition: none; }
.creation-entry .orb-ball { transition: none; }
.creation-entry .orb:hover .orb-ball, .creation-entry .orb:focus-visible .orb-ball { transform: translate(-50%, -50%); }
.creation-entry .orb.ready .orb-ball { box-shadow: none; }
.creation-entry .hub-foot { position: relative; inset: auto; z-index: 1; padding: 32px var(--pad); background: #08080b; font-size: 14px; border-top: 1px solid var(--line); }
.creation-entry .credits { line-height: 1.7; }
.creation-entry .credits span, .creation-entry .credits.small { font-size: 13px; text-transform: none; letter-spacing: 0; }
.creation-entry .structure-sitemap { position: relative; z-index: 1; }
